toastyapps-migratory 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.textile CHANGED
@@ -6,18 +6,24 @@ Migratory overrides the default rails model migration and gives you the ability
6
6
 
7
7
  h3. Specify Default Values
8
8
 
9
+ script/generate migration AddAdminToUsers _**admin:boolean:false**_
10
+
9
11
  script/generate model User username:string password_encrypted:string email:string _**is_admin:boolean:false**_ _**rating:integer:0**_ _**role:string:"member"**_
10
12
 
11
13
  script/generate resource User username:string password_encrypted:string email:string _**is_admin:boolean:false**_ _**rating:integer:0**_ _**role:string:"member"**_
12
14
 
13
15
  h3. Specify Indexes
14
16
 
17
+ script/generate migration AddAdminToUsers _***admin:boolean:false**_
18
+
15
19
  script/generate model User _***username:string**_ password_encrypted:string _***email:string**_ is_admin:boolean:false
16
20
 
17
21
  script/generate resource User _***username:string**_ password_encrypted:string _***email:string**_ is_admin:boolean:false
18
22
 
19
23
  h3. Specify Limit, Precision, and Scale
20
24
 
25
+ script/generate migration AddRoleToUsers _***role:string<notextile>[10]</notextile>:"member"**_
26
+
21
27
  script/generate model Product _**name:string<notextile>[30]</notextile>**_ _**cost:decimal<notextile>[10,2]</notextile>:0.00**_
22
28
 
23
29
  script/generate resource Product _**name:string<notextile>[30]</notextile>**_ _**cost:decimal<notextile>[10,2]</notextile>:0.00**_
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'
6
+ gem_spec.version = '0.0.7'
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'
@@ -7,11 +7,10 @@ class <%= migration_name %> < ActiveRecord::Migration
7
7
  <% unless options[:skip_timestamps] %>
8
8
  t.timestamps
9
9
  <% end -%>
10
-
10
+ end
11
11
  <% for attribute in attributes -%><% if attribute.is_indexed -%>
12
- add_index :<%= attribute.name %>
12
+ add_index :<%= table_name %>, :<%= attribute.name %>
13
13
  <% end -%><% end -%>
14
- end
15
14
  end
16
15
 
17
16
  def self.down
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toastyapps-migratory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Mongeau