Skip to content

Instantly share code, notes, and snippets.

adamonduty

Block or report user

Report or block adamonduty

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Arel Multi-join example.rb
# The problem: In your Rails 3 project, you have a model Request that models a
# user's request for content related to a specific problem or topic. The user
# can tag her request with any number of words. These are modeled by a Tag class
# backed by a tags DB table. Since you want unique records per tag, you have a
# Tagging class backed by a taggings table. Taggings is a a many-to-many table
# with some additional information. Also, other models in the application
# besides requests can be tagged: The Tagging class defines a polymorphic
# relationship "taggable" with those models.
#
# So pretty soon you want to look up all the requests that are tagged with
You can’t perform that action at this time.