rails_model_stacker 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails_model_stacker/factory_stacker.rb +14 -0
- data/rails_model_stacker.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1a6fe6ecdb20cfecc6e873393aadc3bf5a0e9e2
|
4
|
+
data.tar.gz: 30c6e265a2f040b9fe358dadbec669e98d1ee90a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65908a837a525098b68a6c377b43ddf94c47fc7fee3e7877cda4f4dd55cd0cbc2bcb020e3841e92aee00f60e2bb5bfe96647dcef1fae049cc930627712dfc745
|
7
|
+
data.tar.gz: 5a8d6e6156e215c0d7880708d33529c3b3a60e16224a54fc9331aec3ba30d820e4c0881a55b9f9c1cf0fcb5a007f17ca67debfafd63785517ed5983e71639be8
|
@@ -35,6 +35,18 @@ module FactoryGirl
|
|
35
35
|
auto_sequencer columns, :money
|
36
36
|
end
|
37
37
|
|
38
|
+
##
|
39
|
+
#integer sequence
|
40
|
+
def auto_number_sequence column
|
41
|
+
auto_sequence column, :number
|
42
|
+
end
|
43
|
+
|
44
|
+
##
|
45
|
+
#multiple integer sequences
|
46
|
+
def auto_number_sequencer columns
|
47
|
+
auto_sequencer columns, :number
|
48
|
+
end
|
49
|
+
|
38
50
|
private
|
39
51
|
##
|
40
52
|
#makes the text for auto_sequence
|
@@ -45,6 +57,8 @@ module FactoryGirl
|
|
45
57
|
case type
|
46
58
|
when :money
|
47
59
|
"#{index}.#{rand(99)}"
|
60
|
+
when :number
|
61
|
+
index.to_s
|
48
62
|
else
|
49
63
|
"#{template} #{index}"
|
50
64
|
end
|
data/rails_model_stacker.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "rails_model_stacker"
|
6
|
-
s.version = "0.0.
|
6
|
+
s.version = "0.0.7"
|
7
7
|
s.date = "2017-07-13"
|
8
8
|
s.summary = "Rails Model Stacker"
|
9
9
|
s.description = "Shorter Active Record validations and associations with RSpec and shoulda support"
|