aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/deprecated_associations.rb
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2006-10-24 17:25:30 +0000
committerJamis Buck <jamis@37signals.com>2006-10-24 17:25:30 +0000
commite5684a28777c8bbfe472ac33fdbfddc7bdc1f9a7 (patch)
treef1db21efc9512f14af7f0d136d2dd863dabcda3a /activerecord/lib/active_record/deprecated_associations.rb
parent897ffd63d2ee33808eb68173409bcf1047930535 (diff)
downloadrails-e5684a28777c8bbfe472ac33fdbfddc7bdc1f9a7.tar.gz
rails-e5684a28777c8bbfe472ac33fdbfddc7bdc1f9a7.tar.bz2
rails-e5684a28777c8bbfe472ac33fdbfddc7bdc1f9a7.zip
update deprecations to include alternative methods (where available)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5359 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/deprecated_associations.rb')
-rw-r--r--activerecord/lib/active_record/deprecated_associations.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/deprecated_associations.rb b/activerecord/lib/active_record/deprecated_associations.rb
index 4a0918c824..01410c4a7b 100644
--- a/activerecord/lib/active_record/deprecated_associations.rb
+++ b/activerecord/lib/active_record/deprecated_associations.rb
@@ -18,7 +18,7 @@ module ActiveRecord
def add_#{association_name}(*items)
#{association_name}.concat(items)
end
- deprecate :add_#{association_name}
+ deprecate :add_#{association_name} => "use #{association_name}.concat instead"
end_eval
end
@@ -27,7 +27,7 @@ module ActiveRecord
def remove_#{association_name}(*items)
#{association_name}.delete(items)
end
- deprecate :remove_#{association_name}
+ deprecate :remove_#{association_name} => "use #{association_name}.delete instead"
end_eval
end
@@ -36,7 +36,7 @@ module ActiveRecord
def has_#{collection_name}?(force_reload = false)
!#{collection_name}(force_reload).empty?
end
- deprecate :has_#{collection_name}?
+ deprecate :has_#{collection_name}? => "use !#{collection_name}.empty? instead"
end_eval
end
@@ -45,7 +45,7 @@ module ActiveRecord
def find_in_#{collection_name}(association_id)
#{collection_name}.find(association_id)
end
- deprecate :find_in_#{collection_name}
+ deprecate :find_in_#{collection_name} => "use #{collection_name}.find instead"
end_eval
end
@@ -56,7 +56,7 @@ module ActiveRecord
#{collection_name}.find_all(runtime_conditions, orderings, limit, joins)
end
end
- deprecate :find_all_in_#{collection_name}
+ deprecate :find_all_in_#{collection_name} => "use #{collection_name}.find(:all, ...) instead"
end_eval
end
@@ -65,7 +65,7 @@ module ActiveRecord
def create_in_#{collection_name}(attributes = {})
#{collection_name}.create(attributes)
end
- deprecate :create_in_#{collection_name}
+ deprecate :create_in_#{collection_name} => "use #{collection_name}.create instead"
end_eval
end
@@ -74,7 +74,7 @@ module ActiveRecord
def build_to_#{collection_name}(attributes = {})
#{collection_name}.build(attributes)
end
- deprecate :build_to_#{collection_name}
+ deprecate :build_to_#{collection_name} => "use #{collection_name}.build instead"
end_eval
end
@@ -87,7 +87,7 @@ module ActiveRecord
raise "Comparison object is a #{association_class_name}, should have been \#{comparison_object.class.name}"
end
end
- deprecate :#{association_name}?
+ deprecate :#{association_name}? => :==
end_eval
end
@@ -96,7 +96,7 @@ module ActiveRecord
def has_#{association_name}?(force_reload = false)
!#{association_name}(force_reload).nil?
end
- deprecate :has_#{association_name}?
+ deprecate :has_#{association_name}? => "use !#{association_name} insead"
end_eval
end
end