Sha256: aabdca1faef81ec75b69d7629b63e6e61cb01e3eb849e108410e02b0b8d66cc9

Contents?: true

Size: 880 Bytes

Versions: 4

Compression:

Stored size: 880 Bytes

Contents

module Refinery
  class ContactsGenerator < Rails::Generators::Base
    source_root File.expand_path('../templates', __FILE__)

    def generate_recaptcha_template
      template 'config/initializers/recaptcha.rb.erb', File.join(destination_root, 'config', 'initializers', 'recaptcha.rb')
    end

    def generate_contacts_template
      template 'config/initializers/refinery/contacts.rb.erb', File.join(destination_root, 'config', 'initializers', 'refinery', 'contacts.rb')
    end

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

    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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
refinerycms-contacts-0.2.0 lib/generators/refinery/contacts_generator.rb
refinerycms-contacts-0.1.2 lib/generators/refinery/contacts_generator.rb
refinerycms-contacts-0.1.1 lib/generators/refinery/contacts_generator.rb
refinerycms-contacts-0.1.0 lib/generators/refinery/contacts_generator.rb