From eb23e5d7af94e15eb73a1f559daea7e99bc3d7e5 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Fri, 17 Jun 2011 05:52:31 +0100 Subject: Silence another deprecation warning, this time just by muting it (since there is no obvious fix). See also https://github.com/joshmh/globalize2/issues/42 --- vendor/plugins/globalize2/lib/globalize/active_record.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'vendor/plugins/globalize2/lib/globalize') diff --git a/vendor/plugins/globalize2/lib/globalize/active_record.rb b/vendor/plugins/globalize2/lib/globalize/active_record.rb index ce1c50d23..3095bfe28 100644 --- a/vendor/plugins/globalize2/lib/globalize/active_record.rb +++ b/vendor/plugins/globalize2/lib/globalize/active_record.rb @@ -53,10 +53,16 @@ module Globalize extend ClassMethods, Migration after_save :save_translations! - has_many :translations, :class_name => translation_class.name, - :foreign_key => class_name.foreign_key, - :dependent => :delete_all, - :extend => HasManyExtensions + ActiveSupport::Deprecation.silence do + # Silence the warning that :class_name is deprecated and will be + # removed in Rails 3, since it clutters up e.g. test output, and + # there is nothing obvious that we can replace it with in Rails 2. + + has_many :translations, :class_name => translation_class.name, + :foreign_key => class_name.foreign_key, + :dependent => :delete_all, + :extend => HasManyExtensions + end named_scope :with_translations, lambda { |locale| conditions = required_attributes.map do |attribute| -- cgit v1.2.3