Class: PrivateMail::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- PrivateMail::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/private_mail/install/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(path) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/generators/private_mail/install/install_generator.rb', line 12 def self.next_migration_number(path) unless @prev_migration_nr @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i else @prev_migration_nr += 1 end @prev_migration_nr.to_s end |
Instance Method Details
#copy_migrations ⇒ Object
21 22 23 24 25 26 |
# File 'lib/generators/private_mail/install/install_generator.rb', line 21 def copy_migrations migration_template "create_conversations.rb", "db/migrate/create_conversations.rb" migration_template "create_messages.rb", "db/migrate/create_messages.rb" migration_template "create_messages_recipients.rb", "db/migrate/create_messages_recipients.rb" migration_template "create_mail_items.rb", "db/migrate/create_mail_items.rb" end |
#copy_models ⇒ Object
28 29 30 31 32 |
# File 'lib/generators/private_mail/install/install_generator.rb', line 28 def copy_models copy_file "../models/mail_item.rb", "app/models/mail_item.rb" copy_file "../models/message.rb", "app/models/message.rb" copy_file "../models/conversation.rb", "app/models/conversation.rb" end |