Class: ActiveRecord::Associations::Builder::HasManyForActiveModel
- Inherits:
-
HasMany
- Object
- HasMany
- ActiveRecord::Associations::Builder::HasManyForActiveModel
- Defined in:
- lib/active_record/associations/builder/has_many_for_active_model.rb
Constant Summary collapse
- AR_CALLBACK_METHODS =
%i(define_callback before_validation after_validation before_save after_save before_update after_update)
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.define_callbacks(model, reflection) ⇒ Object
12 13 14 15 16 |
# File 'lib/active_record/associations/builder/has_many_for_active_model.rb', line 12 def self.define_callbacks(model, reflection) if AR_CALLBACK_METHODS.all? { |meth| self.respond_to?(meth) } super end end |
.valid_options(_options) ⇒ Object
7 8 9 10 |
# File 'lib/active_record/associations/builder/has_many_for_active_model.rb', line 7 def self.() super + [:active_model, :target_ids] - [:through, :dependent, :source, :source_type, :counter_cache, :as] end |
Instance Method Details
#valid_options ⇒ Object
18 19 20 21 |
# File 'lib/active_record/associations/builder/has_many_for_active_model.rb', line 18 def super + [:active_model, :target_ids] - [:through, :dependent, :source, :source_type, :counter_cache, :as] end |