Sha256: d68903cb7270ed78f832bb9f8f83e264a51e47e43c80e832034373c7cc2e3ca1
Contents?: true
Size: 865 Bytes
Versions: 1
Compression:
Stored size: 865 Bytes
Contents
module ActiveRecord::Associations::Builder class HasManyForActiveModel < HasMany p ActiveRecord.version p ActiveRecord.version >= Gem::Version.new("5.0.0.beta") if ActiveRecord.version >= Gem::Version.new("5.0.0.beta") AR_CALLBACK_METHODS = %i(define_callback before_validation after_validation before_save after_save before_update after_update) def self.valid_options(_options) super + [:active_model, :target_ids] - [:through, :dependent, :source, :source_type, :counter_cache, :as] end def self.define_callbacks(model, reflection) if AR_CALLBACK_METHODS.all? { |meth| self.respond_to?(meth) } super end end else def valid_options super + [:active_model, :target_ids] - [:through, :dependent, :source, :source_type, :counter_cache, :as] end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
activemodel-associations-0.2.0.beta1 | lib/active_record/associations/builder/has_many_for_active_model.rb |