Skip to content

Rails Plugin: Observer behaviour for ActiveRecord models to denormalize information off of other models

Notifications You must be signed in to change notification settings

duncanbeevers/denormalizes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Rails Plugin: Observer behaviour for ActiveRecord models to denormalize information off of other models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published