Skip to content

Commit

Permalink
Alias untranslated_attributes to ActiveRecord::Base#attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
shioyama committed Sep 26, 2017
1 parent 062e6c6 commit 4b1214d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/mobility/plugins/active_record/attribute_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@ def initialize(*attribute_names)
define_method :translated_attributes do
super().merge(attribute_names.inject({}) { |attributes, name| attributes.merge(name.to_s => send(name)) })
end
end

def included(model_class)
untranslated_attributes = model_class.superclass.instance_method(:attributes)
model_class.class_eval do
define_method :untranslated_attributes, untranslated_attributes
end
define_method :untranslated_attributes, ::ActiveRecord::Base.instance_method(:attributes)
end
end
end
Expand Down

0 comments on commit 4b1214d

Please sign in to comment.