Class: NotifyOn::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- NotifyOn::InstallGenerator
- Defined in:
- lib/generators/notify_on/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_bulk_config ⇒ Object
24 25 26 |
# File 'lib/generators/notify_on/install_generator.rb', line 24 def copy_bulk_config template "notifications.yml", "config/notifications.yml" end |
#copy_initializer ⇒ Object
20 21 22 |
# File 'lib/generators/notify_on/install_generator.rb', line 20 def copy_initializer template "notify_on.rb", "config/initializers/notify_on.rb" end |
#generate_migration ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/generators/notify_on/install_generator.rb', line 6 def generate_migration attrs = "recipient_id:integer recipient_type:string sender_id:integer " attrs += "sender_type:string unread:boolean trigger_id:integer " attrs += "trigger_type:string description_raw:text " attrs += "description_cached:text link_raw:string link_cached:string " attrs += "options:text" generate "migration create_notify_on_notifications #{attrs}" gsub_file Dir.glob('db/migrate/*.rb').last, /t\.boolean\ \:unread/, 't.boolean :unread, :default => true' gsub_file Dir.glob('db/migrate/*.rb').last, /t\.text\ \:options/, "t.text :options\n t.timestamps" end |