fabrication 2.20.0 → 2.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fabrication/schematic/definition.rb +10 -10
- data/lib/fabrication/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64e503b6bd8387aba620486cb389b3b3a2694473
|
4
|
+
data.tar.gz: 434881b49d868391b548c364361526884ebc9e66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31dd79d6add115b0688035eec9cff3df7219fca66f88f92ab352d8cbc7214e1c83b2fefd5e70c6fdcaa567f076f12901881fc9cd60c3e084cbecca65e60792aa
|
7
|
+
data.tar.gz: bda40d311f7701e30f3c04e34a94f60a4ddf001c1510155fb5131d9bb680fc1dc25a42959d2d0b39252c3d60ab156d4c9099e0a47218d3de6a2978262f876977
|
@@ -113,7 +113,7 @@ class Fabrication::Schematic::Definition
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def generate_value(name, params)
|
116
|
-
if params[:count]
|
116
|
+
if params[:count] || params[:rand]
|
117
117
|
name = Fabrication::Support.singularize(name.to_s)
|
118
118
|
proc { Fabricate.build(params[:fabricator] || name) }
|
119
119
|
else
|
@@ -130,6 +130,15 @@ class Fabrication::Schematic::Definition
|
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
133
|
+
def klass
|
134
|
+
@klass ||= Fabrication::Support.class_for(
|
135
|
+
options[:class_name] ||
|
136
|
+
(parent && parent.klass) ||
|
137
|
+
options[:from] ||
|
138
|
+
name
|
139
|
+
)
|
140
|
+
end
|
141
|
+
|
133
142
|
protected
|
134
143
|
|
135
144
|
def loaded?
|
@@ -152,13 +161,4 @@ class Fabrication::Schematic::Definition
|
|
152
161
|
def parent
|
153
162
|
@parent ||= Fabrication.manager[options[:from].to_s] if options[:from]
|
154
163
|
end
|
155
|
-
|
156
|
-
def klass
|
157
|
-
@klass ||= Fabrication::Support.class_for(
|
158
|
-
options[:class_name] ||
|
159
|
-
(parent && parent.klass) ||
|
160
|
-
options[:from] ||
|
161
|
-
name
|
162
|
-
)
|
163
|
-
end
|
164
164
|
end
|
data/lib/fabrication/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fabrication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.20.
|
4
|
+
version: 2.20.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Elliott
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Fabrication is an object generation framework for ActiveRecord, Mongoid,
|
14
14
|
DataMapper, Sequel, or any other Ruby object.
|