Class: Puret::Generators::AttributeGenerator
- Inherits:
-
Base
- Object
- Rails::Generators::NamedBase
- Base
- Puret::Generators::AttributeGenerator
- Defined in:
- lib/generators/puret/attribute/attribute_generator.rb
Instance Method Summary collapse
-
#copy_attribute_migration_template ⇒ Object
create migration.
-
#inject_puret_config_into_model ⇒ Object
configure puret attributes in model.
Methods inherited from Base
#invoke_model, next_migration_number, source_root
Instance Method Details
#copy_attribute_migration_template ⇒ Object
create migration
18 19 20 |
# File 'lib/generators/puret/attribute/attribute_generator.rb', line 18 def copy_attribute_migration_template migration_template "migration.rb", "db/migrate/add_#{translations_table_name}" end |
#inject_puret_config_into_model ⇒ Object
configure puret attributes in model
11 12 13 14 15 |
# File 'lib/generators/puret/attribute/attribute_generator.rb', line 11 def inject_puret_config_into_model inject_into_class model_path, class_name, <<-CONTENT puret #{attributes.map { |a| ":%s" % a.name }.join(", ")} CONTENT end |