lib/traco/attributes.rb in traco-3.1.4 vs lib/traco/attributes.rb in traco-3.1.5

- old
+ new

@@ -12,12 +12,10 @@ def included(base) self.class.ensure_translatable_attributes(base) base.translatable_attributes |= @attributes - self.class.warm_up_activerecord_methods(base) - base.extend ClassMethods end private @@ -55,17 +53,8 @@ def self.ensure_translatable_attributes(base) return if base.respond_to?(:translatable_attributes) base.class_attribute :translatable_attributes base.translatable_attributes = [] - end - - # Force AR to create methods `title_en` etc, which are lazily evaluated, - # otherwise we can't safely check `.instance_methods`. - def self.warm_up_activerecord_methods(base) - random_attribute = base.translatable_attributes.first - - instance = base.new - instance.send(Traco.column(random_attribute, I18n.default_locale)) end end end