Class: GcmMigrationsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- GcmMigrationsGenerator
- Extended by:
- ActiveRecord::Generators::Migration
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/gcm_migrations_generator.rb
Overview
$ ruby script/generate gcm_migrations
Class Method Summary collapse
-
.base_root ⇒ Object
Set the current directory as base for the inherited generators.
Instance Method Summary collapse
Class Method Details
.base_root ⇒ Object
Set the current directory as base for the inherited generators.
12 13 14 |
# File 'lib/generators/gcm_migrations_generator.rb', line 12 def self.base_root File.dirname(__FILE__) end |
Instance Method Details
#create_migrations ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/generators/gcm_migrations_generator.rb', line 18 def create_migrations templates = { 'create_gcm_devices.rb' => 'db/migrate/create_gcm_devices.rb', 'create_gcm_notifications.rb' => 'db/migrate/create_gcm_notifications.rb' } templates.each_pair do |name, path| begin migration_template(name, path) rescue => err puts "WARNING: #{err.}" end end end |