Sha256: d5df78590e1a02820c94097ffcb06c137be97f7c9349558ff9d00c50a1719bd5
Contents?: true
Size: 590 Bytes
Versions: 59
Compression:
Stored size: 590 Bytes
Contents
module Para module ModelFieldParsers class Globalize < Para::ModelFieldParsers::Base register :globalize, self def parse! fields_hash.delete(:translations) model.translated_attribute_names.each do |attribute_name| column = model.translation_class.columns_hash[attribute_name.to_s] fields_hash[column.name] = AttributeField::Translation.new( model, name: column.name, type: column.type ) end end def applicable? defined?(::Globalize) && model.translates? end end end end
Version data entries
59 entries across 59 versions & 1 rubygems