seed_box 0.2.0 → 0.2.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: ce1b363c61981b2b40c309072ecea7ae2d92253a
4
- data.tar.gz: bf8775ffe2309960178702ac503846537f1639ed
3
+ metadata.gz: 23a4cdd8500a5332e14538ddb37400b8df71f71d
4
+ data.tar.gz: 54f472c757a084b882449e86d8a259c2f6f11ed5
5
5
  SHA512:
6
- metadata.gz: 2620e365664ff0e0f5224105f5c49e5506cce47da051696e0c826d45933dae2f0408bbedf7e8b49936122c16376901072c54d4a185d823bccbf251d8a82a55ec
7
- data.tar.gz: 733a11e734bedd04917bbbc568a4916f0ffc7fc685bfb3bd8be4990037272af5630ae972481b5c2f11ea9a2200db6da1fc82f83e80cf0e059349d82834da202b
6
+ metadata.gz: aa9f610dc4a2a11c95fbe2487b396643256552b45f8f6136dde674ec2bdd12351b639545ac5d9053b01421fa0ccde5080b602986dacbc0498f7d6a84bca9a56e
7
+ data.tar.gz: 17ff10ddba0346dd06dc78afd409e58c295f9bfa76f8a3dc91e0bfb762f198c62aa3eddaaac4cc7f2bc45412a16076f0d68bc7e6481142b73ea07d261552dd63
@@ -1,3 +1,3 @@
1
1
  module SeedBox
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/seed_box.rb CHANGED
@@ -14,11 +14,9 @@ module SeedBox
14
14
  end
15
15
 
16
16
  def seed_once(model, find_or_create_by, create_with = {})
17
- record = model.where(find_or_create_by).first_or_initialize(create_with)
17
+ return if model.where(find_or_create_by).exists?
18
18
 
19
- record.save
20
-
21
- handle_errors(record, find_or_create_by, create_with)
19
+ seed(model, find_or_create_by, create_with)
22
20
  end
23
21
 
24
22
  def seed_file(name)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seed_box
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Reigel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-23 00:00:00.000000000 Z
11
+ date: 2018-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  version: '0'
139
139
  requirements: []
140
140
  rubyforge_project:
141
- rubygems_version: 2.5.2
141
+ rubygems_version: 2.6.14.1
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: Provides omnipotent seeds for rails.