Blame SOURCES/rubygem-i18n-0.7.0-Ignore-metadata-for-frozen-classes.patch

69c0aa
From bbbdedc0c78ec941a84d161d5c610a358310cf99 Mon Sep 17 00:00:00 2001
69c0aa
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
69c0aa
Date: Tue, 20 Jan 2015 14:34:44 +0100
69c0aa
Subject: [PATCH] Ignore metadata for frozen classes.
69c0aa
69c0aa
---
69c0aa
 lib/i18n/backend/metadata.rb | 8 ++++++--
69c0aa
 1 file changed, 6 insertions(+), 2 deletions(-)
69c0aa
69c0aa
diff --git a/lib/i18n/backend/metadata.rb b/lib/i18n/backend/metadata.rb
69c0aa
index 52c0a29..a8d922a 100644
69c0aa
--- a/lib/i18n/backend/metadata.rb
69c0aa
+++ b/lib/i18n/backend/metadata.rb
69c0aa
@@ -21,11 +21,15 @@ module I18n
69c0aa
         def included(base)
69c0aa
           Object.class_eval do
69c0aa
             def translation_metadata
69c0aa
-              @translation_metadata ||= {}
69c0aa
+              unless self.frozen?
69c0aa
+                @translation_metadata ||= {}
69c0aa
+              else
69c0aa
+                {}
69c0aa
+              end
69c0aa
             end
69c0aa
 
69c0aa
             def translation_metadata=(translation_metadata)
69c0aa
-              @translation_metadata = translation_metadata
69c0aa
+              @translation_metadata = translation_metadata unless self.frozen?
69c0aa
             end
69c0aa
           end unless Object.method_defined?(:translation_metadata)
69c0aa
         end
69c0aa
-- 
69c0aa
2.1.0
69c0aa