Sha256: 2e7253e8198c22a521fd01903e914ff3b7e044944576e06fc9ee9115c0f3f83e

Contents?: true

Size: 424 Bytes

Versions: 1

Compression:

Stored size: 424 Bytes

Contents

module Rails
  module Generators
    class SeedGenerator < Rails::Generators::NamedBase
      desc <<DESC
Description:
  Create a seed file

DESC

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

      def create_seed
        empty_directory 'db/seeds'
        template "template_seed.rb", "db/seeds/#{file_name}.rb"
      end
    end 
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ambitious_seeder-0.1.0 lib/generators/rails/seed/seed_generator.rb