toastyapps-migratory 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/generators/migration/templates/migration.rb +3 -3
- metadata +1 -1
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ require 'rake/testtask'
|
|
3
3
|
|
4
4
|
gem_spec = Gem::Specification.new do |gem_spec|
|
5
5
|
gem_spec.name = 'migratory'
|
6
|
-
gem_spec.version = '0.0.
|
6
|
+
gem_spec.version = '0.0.8'
|
7
7
|
gem_spec.summary = 'Rails migration extender for default values and adding indexes'
|
8
8
|
gem_spec.description = 'Rails migration extender for default values and adding indexes'
|
9
9
|
gem_spec.email = 'matt@toastyapps.com'
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class <%= class_name.underscore.camelize %> < ActiveRecord::Migration
|
2
2
|
def self.up<% attributes.each do |attribute| %>
|
3
3
|
<%= migration_action %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'add' %>, :<%= attribute.type %><%= attribute.options %><% end -%>
|
4
|
-
<% for attribute in attributes
|
5
|
-
|
6
|
-
|
4
|
+
<% for attribute in attributes -%>
|
5
|
+
<% if attribute.is_indexed %>
|
6
|
+
add_index :<%= attribute.name %><% end -%><% end -%>
|
7
7
|
<%- end %>
|
8
8
|
end
|
9
9
|
|