diff options
author | Robin Houston <robin@lenny.robin> | 2011-06-17 05:52:31 +0100 |
---|---|---|
committer | Robin Houston <robin@lenny.robin> | 2011-06-17 05:52:31 +0100 |
commit | eb23e5d7af94e15eb73a1f559daea7e99bc3d7e5 (patch) | |
tree | 63bf1d2e95c9ab5ac06330f159ae5092b49a80bc | |
parent | baf30707a91c2a569f55219487c93a84e0928ff0 (diff) |
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
-rw-r--r-- | vendor/plugins/globalize2/lib/globalize/active_record.rb | 14 |
1 files changed, 10 insertions, 4 deletions
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| |