Sha256: d03c20fb8361938070e798094efaed76b084e3af454f352f56276afa08eee54d
Contents?: true
Size: 538 Bytes
Versions: 10
Compression:
Stored size: 538 Bytes
Contents
class CarterGenerator < Rails::Generator::Base default_options :skip_migration => false def manifest record do |m| if !options[:skip_migration] && defined?(ActiveRecord) m.migration_template "migration.rb", 'db/migrate', :migration_file_name => "create_carter" end end end protected def add_options!(opt) opt.separator '' opt.separator 'Options:' opt.on("--skip-migration", "Don't generate a migration") { |v| options[:skip_migration] = v } end end
Version data entries
10 entries across 10 versions & 1 rubygems