Class: PodioCrm::PodioCrmGenerator
- Inherits:
-
ActiveRecord::Generators::Base
- Object
- ActiveRecord::Generators::Base
- PodioCrm::PodioCrmGenerator
- Defined in:
- lib/generators/podio_crm/podio_crm_generator.rb
Instance Method Summary collapse
- #app_id ⇒ Object
- #generate_migration ⇒ Object
- #migration_class_name ⇒ Object
- #migration_file_name ⇒ Object
- #migration_name ⇒ Object
- #set_app_id ⇒ Object
Instance Method Details
#app_id ⇒ Object
17 18 19 |
# File 'lib/generators/podio_crm/podio_crm_generator.rb', line 17 def app_id @app_id end |
#generate_migration ⇒ Object
13 14 15 |
# File 'lib/generators/podio_crm/podio_crm_generator.rb', line 13 def generate_migration migration_template "podio_crm_migration.rb.erb", "db/migrate/#{migration_file_name}" end |
#migration_class_name ⇒ Object
29 30 31 |
# File 'lib/generators/podio_crm/podio_crm_generator.rb', line 29 def migration_class_name migration_name.camelize end |
#migration_file_name ⇒ Object
25 26 27 |
# File 'lib/generators/podio_crm/podio_crm_generator.rb', line 25 def migration_file_name "#{migration_name}.rb" end |
#migration_name ⇒ Object
21 22 23 |
# File 'lib/generators/podio_crm/podio_crm_generator.rb', line 21 def migration_name "add_podio_crm_#{app_id.human_name}_to_#{name.underscore.pluralize}" end |
#set_app_id ⇒ Object
9 10 11 |
# File 'lib/generators/podio_crm/podio_crm_generator.rb', line 9 def set_app_id @app_id ||= attributes.shift end |