toastyapps-migratory 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/generators/model/model_generator.rb +7 -7
- metadata +2 -2
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.3'
|
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'
|
@@ -11,9 +11,9 @@ module Rails
|
|
11
11
|
if details =~ /,/
|
12
12
|
@precision, @scale = details.split(/,/).map(&:to_i)
|
13
13
|
else
|
14
|
-
case type.gsub(/\[.*?\]/, '').
|
15
|
-
when
|
16
|
-
when
|
14
|
+
case type.gsub(/\[.*?\]/, '').to_sym
|
15
|
+
when :string, :text, :binary, :integer then @limit = details.to_i
|
16
|
+
when :decimal, :float then @precision = details.to_i
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -21,17 +21,17 @@ module Rails
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def options
|
24
|
-
options =
|
24
|
+
options = ''
|
25
25
|
options << ", :limit => #{@limit}" if @limit
|
26
26
|
options << ", :precision => #{@precision}" if @precision
|
27
27
|
options << ", :scale => #{@scale}" if @scale
|
28
28
|
if @default
|
29
|
-
options << case @type
|
30
|
-
when
|
29
|
+
options << case @type
|
30
|
+
when :string, :text, :date, :datetime, :time, :timestamp then ', :default => "'+@default+'"'
|
31
31
|
else ", :default => #{@default}"
|
32
32
|
end
|
33
33
|
end
|
34
|
-
options
|
34
|
+
options
|
35
35
|
end
|
36
36
|
|
37
37
|
alias_method_chain :initialize, :migratory
|
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.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Mongeau
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-02 21:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|