Sha256: b324ee925be757c065d5a23dfad77ae29a287099888023c5b8f9e4f787dc9168

Contents?: true

Size: 571 Bytes

Versions: 2

Compression:

Stored size: 571 Bytes

Contents

module RailsVoter
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path("../templates", __FILE__)

    def add_routes
      route "mount RailsVoter::Engine, at: \"/rails_voter\""
    end

    def add_migrations
      rake("rails_voter:install:migrations")
      rake("db:migrate")
    end

    def add_sample_data
      copy_file "sample_data.rb", "lib/tasks/rails_voter.rake"
      rake("rails_voter:add_sample_data")
    end

    def add_helpers
      copy_file "helpers.rb", "config/initializers/rails_voter_helpers.rb"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_voter-0.2.1 lib/generators/rails_voter/install/install_generator.rb
rails_voter-0.2.0 lib/generators/rails_voter/install/install_generator.rb