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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f1e087b9bc06cf6edd4173c888e238883b3d1d1
4
- data.tar.gz: 8c9b35320041a28a50f9ddee0a66d948f4786675
3
+ metadata.gz: 64e503b6bd8387aba620486cb389b3b3a2694473
4
+ data.tar.gz: 434881b49d868391b548c364361526884ebc9e66
5
5
  SHA512:
6
- metadata.gz: bc7c52109293ecf03a510ef7b9428d3a70bb01ef42ef9c7355a89014716c15bc5ca1d6a54a996c8ccec94b96e0e404aedae8eff4b82e87e6d854de3e28fc4a51
7
- data.tar.gz: c93800178ad1c91901ff6ab22167a73a7b2d12285e7219e57e997035f8c33fdf938a8b0cb49e453065f0be6d02607a016ae8b6f147af3e081e0dc4c89f89c9c0
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
@@ -1,3 +1,3 @@
1
1
  module Fabrication
2
- VERSION = '2.20.0'
2
+ VERSION = '2.20.1'
3
3
  end
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.0
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-21 00:00:00.000000000 Z
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.