diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-11-30 02:42:43 -0800 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-11-30 02:42:43 -0800 |
commit | 61ad8d5c32422c523293428d25277be1759b597c (patch) | |
tree | febfdcc97db26bbfc5cef3cc887957b5c4eb89ab /activerecord/lib/active_record | |
parent | 31c20a244b7e9a284d45d7aaa56f6e5277810418 (diff) | |
parent | 35fd2d401938df1afc595de9b87dadd4421f44a5 (diff) | |
download | rails-61ad8d5c32422c523293428d25277be1759b597c.tar.gz rails-61ad8d5c32422c523293428d25277be1759b597c.tar.bz2 rails-61ad8d5c32422c523293428d25277be1759b597c.zip |
Merge pull request #13107 from chancancode/has_one_counter_cache_should_raise
Raise `ArgumentError` when `has_one` is used with `counter_cache`
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations/builder/belongs_to.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/builder/singular_association.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/builder/belongs_to.rb b/activerecord/lib/active_record/associations/builder/belongs_to.rb index aa43c34d86..ac387d377d 100644 --- a/activerecord/lib/active_record/associations/builder/belongs_to.rb +++ b/activerecord/lib/active_record/associations/builder/belongs_to.rb @@ -5,7 +5,7 @@ module ActiveRecord::Associations::Builder end def self.valid_options(options) - super + [:foreign_type, :polymorphic, :touch] + super + [:foreign_type, :polymorphic, :touch, :counter_cache] end def self.valid_dependent_options diff --git a/activerecord/lib/active_record/associations/builder/singular_association.rb b/activerecord/lib/active_record/associations/builder/singular_association.rb index 66b03c0301..a6e8300642 100644 --- a/activerecord/lib/active_record/associations/builder/singular_association.rb +++ b/activerecord/lib/active_record/associations/builder/singular_association.rb @@ -3,7 +3,7 @@ module ActiveRecord::Associations::Builder class SingularAssociation < Association #:nodoc: def self.valid_options(options) - super + [:remote, :dependent, :counter_cache, :primary_key, :inverse_of] + super + [:remote, :dependent, :primary_key, :inverse_of] end def self.define_accessors(model, reflection) |