Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User < ActiveRecord::Base
- attr_readonly :properties_count
- has_many :properties, :as => :owner
- ...
- end
- class Property < ActiveRecord::Base
- ...
- belongs_to :owner, :polymorphic => true, :counter_cache => true
- ...
- end
Add Comment
Please, Sign In to add comment