Method: ActiveRecord::Base.acts_as_answerer
- Defined in:
- lib/ask/acts_as_answerer.rb
.acts_as_answerer ⇒ Object
101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/ask/acts_as_answerer.rb', line 101 def self.acts_as_answerer include Ask::ActiveRecord::InstanceMethods has_many :answers, :as => :answerer, :dependent=>:destroy has_many :questions, :through=>:answers if respond_to? :attr_accessible # Rails 3.2 backwards compatibility attr_accessible :answers_attributes end accepts_nested_attributes_for :answers, :allow_destroy=>true validate :validate_required_questions end |