Class: DatashiftJourney::InstallMongoCollectorGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Extended by:
InitializerCommon
Includes:
InitializerCommon
Defined in:
lib/generators/datashift_journey/collector/install_mongo_collector_generator.rb

Instance Method Summary collapse

Instance Method Details

#install_commonObject

Hmm bit odd but to get thor to work appears we need to wrap calls to our common methods



18
19
20
21
22
23
24
25
26
# File 'lib/generators/datashift_journey/collector/install_mongo_collector_generator.rb', line 18

def install_common
  create_initializer_file(klass)

  notify_about_routes

  journey_decorator(klass)

  model_journey_code(klass)
end

#install_migrationsObject



9
10
11
12
# File 'lib/generators/datashift_journey/collector/install_mongo_collector_generator.rb', line 9

def install_migrations
  say_status :copying, 'migrations'
  `rake railties:install:migrations`
end

#migration_dataObject



28
29
30
31
32
33
34
# File 'lib/generators/datashift_journey/collector/install_mongo_collector_generator.rb', line 28

def migration_data
  <<RUBY
  field :form, type: String
  field :field , type: String
  field :value, type: String
RUBY
end