Class: Refinery::ContactsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Refinery::ContactsGenerator
- Defined in:
- lib/generators/refinery/contacts_generator.rb
Instance Method Summary collapse
- #append_load_seed_data ⇒ Object
- #generate_contacts_template ⇒ Object
- #generate_recaptcha_template ⇒ Object
- #rake_db ⇒ Object
Instance Method Details
#append_load_seed_data ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/generators/refinery/contacts_generator.rb', line 17 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 Contacts extension Refinery::Contacts::Engine.load_seed EOH end end |
#generate_contacts_template ⇒ Object
9 10 11 |
# File 'lib/generators/refinery/contacts_generator.rb', line 9 def generate_contacts_template template 'config/initializers/refinery/contacts.rb.erb', File.join(destination_root, 'config', 'initializers', 'refinery', 'contacts.rb') end |
#generate_recaptcha_template ⇒ Object
5 6 7 |
# File 'lib/generators/refinery/contacts_generator.rb', line 5 def generate_recaptcha_template template 'config/initializers/recaptcha.rb.erb', File.join(destination_root, 'config', 'initializers', 'recaptcha.rb') end |
#rake_db ⇒ Object
13 14 15 |
# File 'lib/generators/refinery/contacts_generator.rb', line 13 def rake_db rake("refinery_contacts:install:migrations") end |