Class: Refinery::BookingsGenerator

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

Instance Method Summary collapse

Instance Method Details

#append_load_seed_dataObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/generators/refinery/bookings/bookings_generator.rb', line 14

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 Bookings extension
Refinery::Bookings::Engine.load_seed
    EOH
  end
end

#rake_dbObject

def generate_bookings_initializer

template "config/initializers/refinery/bookings.rb.erb", File.join(destination_root, "config", "initializers", "refinery", "bookings.rb")

end



10
11
12
# File 'lib/generators/refinery/bookings/bookings_generator.rb', line 10

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