Class: Refinery::LocationExplorerGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/refinery/location_explorer_generator.rb

Instance Method Summary collapse

Instance Method Details

#append_load_seed_dataObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/generators/refinery/location_explorer_generator.rb', line 12

def append_load_seed_data
  create_file 'db/seeds.rb' unless File.exists?(File.join(destination_root, 'db', 'seeds.rb'))
  append_file 'db/seeds.rb', :verbose => true do
    <<-EOH

# Added by Refinery CMS Location Explorer extension
Refinery::LocationExplorer::Engine.load_seed
    EOH
  end
end

#generate_locations_initializerObject



8
9
10
# File 'lib/generators/refinery/location_explorer_generator.rb', line 8

def generate_locations_initializer
  template "config/initializers/refinery/location_explorer.rb.erb", File.join(destination_root, "config", "initializers", "refinery", "location_explorer.rb")
end

#rake_dbObject



4
5
6
# File 'lib/generators/refinery/location_explorer_generator.rb', line 4

def rake_db
  rake("refinery_location_explorer:install:migrations")
end