Sha256: df9226d255af2cfd515122ca81cf3efd4e00037aad5d6a8c916452eda44ad795
Contents?: true
Size: 630 Bytes
Versions: 99
Compression:
Stored size: 630 Bytes
Contents
require 'rails/generators/active_record' module ActiveRecord module Generators class MigrationGenerator < Base argument :attributes, :type => :array, :default => [], :banner => "field:type field:type" def create_migration_file set_local_assigns! migration_template "migration.rb", "db/migrate/#{file_name}.rb" end protected attr_reader :migration_action def set_local_assigns! if file_name =~ /^(add|remove)_.*_(?:to|from)_(.*)/ @migration_action = $1 @table_name = $2.pluralize end end end end end
Version data entries
99 entries across 99 versions & 3 rubygems