Module: Census::User::Associations
- Defined in:
- lib/census/user.rb
Class Method Summary collapse
-
.included(model) ⇒ Object
Hook for defining associations.
Class Method Details
.included(model) ⇒ Object
Hook for defining associations.
28 29 30 31 32 33 |
# File 'lib/census/user.rb', line 28 def self.included(model) model.class_eval do has_many :answers, :dependent => :destroy, :inverse_of => :user accepts_nested_attributes_for :answers, :reject_if => lambda { |a| a[:data].blank? } end end |