Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
|Failed to load latest commit information.|
Denormalizes provides a clean syntax for specifying observation and denormalization rules between ActiveRecord models. class UserScore < ActiveRecord::Base belongs_to :user named_scope_for :user_id denormalizes :score, :from => :user end There are a number of common-sense conventions in use here. First, the denormalization model must have reflection onto the observed model in the form of a has_one or belongs_to. Second, denormalized values can only be activerecord attributes of the observed model, (must be columns in the database) and the observer model's columns must match those of the observed model.