diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-05-05 10:14:28 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-05-05 10:14:28 -0300 |
commit | a83a1ccebaaae5e05741ebd5d9db408c450df098 (patch) | |
tree | 79dc5924ce11481674180e1d216ec6551e634011 /activerecord/lib/active_record/associations.rb | |
parent | d19d4d2f20d87289eaeaa8df807d635ce72f3799 (diff) | |
parent | d4402c5554a0d3202fc22eb38c5c1a8c4b9afd93 (diff) | |
download | rails-a83a1ccebaaae5e05741ebd5d9db408c450df098.tar.gz rails-a83a1ccebaaae5e05741ebd5d9db408c450df098.tar.bz2 rails-a83a1ccebaaae5e05741ebd5d9db408c450df098.zip |
Merge commit 'rails/master'
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 2dd1197192..b23cb14c1b 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1,4 +1,10 @@ module ActiveRecord + class InverseOfAssociationNotFoundError < ActiveRecordError #:nodoc: + def initialize(reflection) + super("Could not find the inverse association for #{reflection.name} (#{reflection.options[:inverse_of].inspect} in #{reflection.class_name})") + end + end + class HasManyThroughAssociationNotFoundError < ActiveRecordError #:nodoc: def initialize(owner_class_name, reflection) super("Could not find the association #{reflection.options[:through].inspect} in model #{owner_class_name}") @@ -1488,7 +1494,7 @@ module ActiveRecord :finder_sql, :counter_sql, :before_add, :after_add, :before_remove, :after_remove, :extend, :readonly, - :validate + :validate, :inverse_of ] def create_has_many_reflection(association_id, options, &extension) @@ -1502,7 +1508,7 @@ module ActiveRecord @@valid_keys_for_has_one_association = [ :class_name, :foreign_key, :remote, :select, :conditions, :order, :include, :dependent, :counter_cache, :extend, :as, :readonly, - :validate, :primary_key + :validate, :primary_key, :inverse_of ] def create_has_one_reflection(association_id, options) @@ -1521,7 +1527,7 @@ module ActiveRecord @@valid_keys_for_belongs_to_association = [ :class_name, :foreign_key, :foreign_type, :remote, :select, :conditions, :include, :dependent, :counter_cache, :extend, :polymorphic, :readonly, - :validate, :touch + :validate, :touch, :inverse_of ] def create_belongs_to_reflection(association_id, options) |