Class: IosPushNotificationsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- IosPushNotificationsGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/ios_push_notifications_generator.rb
Overview
:nodoc:
Class Method Summary collapse
-
.next_migration_number(dirname) ⇒ Object
FIXME: Should be proxied to ActiveRecord::Generators::Base Implement the required interface for Rails::Generators::Migration.
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
FIXME: Should be proxied to ActiveRecord::Generators::Base Implement the required interface for Rails::Generators::Migration.
22 23 24 25 26 27 28 |
# File 'lib/generators/ios_push_notifications_generator.rb', line 22 def self.next_migration_number(dirname) #:nodoc: if ActiveRecord::Base. Time.now.utc.strftime("%Y%m%d%H%M#{rand 60}") else "%.3d" % (current_migration_number(dirname) + 1) end end |
Instance Method Details
#create_initializer ⇒ Object
9 10 11 |
# File 'lib/generators/ios_push_notifications_generator.rb', line 9 def create_initializer template 'initializer.rb', "config/initializers/ios_push_notification.rb" end |
#create_migration ⇒ Object
13 14 15 16 |
# File 'lib/generators/ios_push_notifications_generator.rb', line 13 def create_migration migration_template 'device_migration.rb', "db/migrate/create_iospn_devices.rb" migration_template 'notification_migration.rb', "db/migrate/create_iospn_notifications.rb" end |