Sha256: b7e3523952750aa4d55471020f92a3fe518efa68af0b95f8c5c0390808f7ff04
Contents?: true
Size: 558 Bytes
Versions: 7
Compression:
Stored size: 558 Bytes
Contents
class SecondbaseMigrationGenerator < Rails::Generator::NamedBase def manifest record do |m| m.migration_template 'migration.rb', "db/migrate/#{SecondBase::CONNECTION_PREFIX}", :assigns => get_local_assigns end end private def get_local_assigns returning(assigns = {}) do if class_name.underscore =~ /^(add|remove)_.*_(?:to|from)_(.*)/ assigns[:migration_action] = $1 assigns[:table_name] = $2.pluralize else assigns[:attributes] = [] end end end end
Version data entries
7 entries across 7 versions & 1 rubygems