Module: I18nAttributes::GeneratorHelpers

Included in:
ModelGenerator, ReviseModelGenerator
Defined in:
lib/i18n_attributes/generator_helpers.rb

Instance Method Summary collapse

Instance Method Details

#generate_yaml_file_data(locale, singular_name, human_name, attributes, orm = "active_record") ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/i18n_attributes/generator_helpers.rb', line 6

def generate_yaml_file_data(locale, singular_name, human_name, attributes, orm="active_record")
  YAML.dump_stream(
    {
      locale.to_s => {
        orm.to_s => {
          "models" => {
            singular_name => human_name.to_s
          },
          "attributes" => {
            singular_name => columns_hash(attributes).merge(enums_hash(attributes))
          }
        }
      }
    }
  )
end