Sha256: 01342b3b6e26f52a2bdd4e2b2fbefc8d584f39dcfabe9bde9d33b76309bf1e84

Contents?: true

Size: 548 Bytes

Versions: 1

Compression:

Stored size: 548 Bytes

Contents

require 'rails/generators/active_record'

module MyFeeds
  module Generators
    class MyFeedsGenerator < ActiveRecord::Generators::Base

      argument :name, :type => :string, :default => 'my_feeds'

      def self.source_root
        @source_root ||= File.join(File.dirname(__FILE__), 'templates')
      end

      def create_migration
        migration_template 'feeds_migration.rb', 'db/migrate/my_feeds_migration.rb'
      end

      def create_model
        template "feed.rb", File.join('app/models', "feed.rb")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
my_feeds-1.0.0 lib/generators/my_feeds_generator.rb