aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rwxr-xr-xactiverecord/lib/active_record/associations.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 4a637d5dab..2861a3940b 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -66,6 +66,16 @@ module ActiveRecord
end
end
+ class ReadOnlyAssociation < ActiveRecordError #:nodoc:
+ def initialize(reflection)
+ @reflection = reflection
+ end
+
+ def message
+ "Can not add to a has_many :through association. Try adding to #{@reflection.through_reflection.name.inspect}."
+ end
+ end
+
module Associations # :nodoc:
def self.append_features(base)
super