fabrication 2.19.0 → 2.20.0

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: ec76537ef334cfc100461b49634dcd19b672d7a7
4
- data.tar.gz: 0d37203436e8a6fef226545cd7a5c22e0c208d88
3
+ metadata.gz: 1f1e087b9bc06cf6edd4173c888e238883b3d1d1
4
+ data.tar.gz: 8c9b35320041a28a50f9ddee0a66d948f4786675
5
5
  SHA512:
6
- metadata.gz: a07b2975a2328a16393594aa85fbb0ddcce3f5848af26c23435ea28e539843b393068e152a749dca027d6fe6ee8572dfaad1cebdf1a78eddee4cfa8607782e7b
7
- data.tar.gz: 77b7fcd3038aeca55a2543491c5fce0ae360b3537e95705f348e34b0b3a5183c3b01161993ccfa3683cd117d88ca14f2050722213c06470877b16eeab9f16740
6
+ metadata.gz: bc7c52109293ecf03a510ef7b9428d3a70bb01ef42ef9c7355a89014716c15bc5ca1d6a54a996c8ccec94b96e0e404aedae8eff4b82e87e6d854de3e28fc4a51
7
+ data.tar.gz: c93800178ad1c91901ff6ab22167a73a7b2d12285e7219e57e997035f8c33fdf938a8b0cb49e453065f0be6d02607a016ae8b6f147af3e081e0dc4c89f89c9c0
@@ -50,7 +50,12 @@ class Fabrication::Schematic::Attribute
50
50
  end
51
51
 
52
52
  def rand
53
- Kernel.rand((1..params[:rand])) if params[:rand]
53
+ return unless params[:rand]
54
+
55
+ range = params[:rand]
56
+ range = 1..range unless range.is_a? Range
57
+
58
+ Kernel.rand(range)
54
59
  end
55
60
 
56
61
  def rand_range
@@ -1,3 +1,3 @@
1
1
  module Fabrication
2
- VERSION = '2.19.0'
2
+ VERSION = '2.20.0'
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.19.0
4
+ version: 2.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Elliott
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-30 00:00:00.000000000 Z
11
+ date: 2018-01-21 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.