polyblock 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9abb384bd840e0c3f33149a5b159b76f110b06da
4
- data.tar.gz: 1da9c949cf2faa80a13d36294ae941f6bd4be800
3
+ metadata.gz: 21a692470d1350ca6dd6b68ce45313f43d753c66
4
+ data.tar.gz: 4e4fa9f06f01c46bf8f3ad98de430fcf1974caa2
5
5
  SHA512:
6
- metadata.gz: 0fbd0b8fa7c04ec4f7c005cc9ddfe2721a3c6733b17db3d44c96c8a09d404d6ea231165a62e6f86b7f42a8e02f12101dbfda7054efba98dea0939a61823bd8e1
7
- data.tar.gz: 8080560803d3e843d3f7c12cf222daa226cc6361e8b74f626381f7fb0041c56a9ac294c22a2ffdc43408509e4a612f81c9155fce4583756ebaa69bf9bff0e879
6
+ metadata.gz: b8b4994a2488cd7e7d7d193fa0c9c8ab8beee99b667603e10736f427f41af96a815b2d0b3063ce9b78d518c20d83bd008693285571cb5a62a55c6dbb7bc9dd3c
7
+ data.tar.gz: de796291fa0eafbad3c7d0dcd689c4b0d09aa560b3a9f2181e08015df2c5467d8222ffdc73d40b9b3fb5bf5d6852e93e2d0e28924c7f9f5b5e85b0f56a312d89
@@ -20,7 +20,12 @@ module Polyblock
20
20
  matches = Polyblock::Block.where :name => name
21
21
  pb_exists = matches.any?
22
22
  pb = pb_exists ? matches.first : Polyblock::Block.new({:name => name})
23
- pb_id = pb_exists ? pb.id : Polyblock::Block.count + 1
23
+ pb_id = if pb_exists
24
+ pb.id
25
+ else
26
+ nextId = Polyblock::Block.count + 1
27
+ nextId += 1 while Polyblock::Block.where(:id => nextId).any?
28
+ end
24
29
  end
25
30
 
26
31
  # Build output tag
@@ -1,3 +1,3 @@
1
1
  module Polyblock
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyblock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - MacKinley Smith
@@ -1493,7 +1493,6 @@ files:
1493
1493
  - test/dummy/tmp/cache/assets/development/sprockets/ff61dbc17d234bd987651f689838d26a
1494
1494
  - test/dummy/tmp/cache/assets/development/sprockets/ffdb359321552b05439e0337844f817d
1495
1495
  - test/dummy/tmp/cache/assets/development/sprockets/fffa8f692e900a66d630702707280ecc
1496
- - test/dummy/tmp/pids/server.pid
1497
1496
  - test/fixtures/polyblock/blocks.yml
1498
1497
  - test/helpers/polyblock/polyblocks_helper_test.rb
1499
1498
  - test/integration/navigation_test.rb
@@ -2814,7 +2813,6 @@ test_files:
2814
2813
  - test/dummy/tmp/cache/assets/development/sprockets/ff61dbc17d234bd987651f689838d26a
2815
2814
  - test/dummy/tmp/cache/assets/development/sprockets/ffdb359321552b05439e0337844f817d
2816
2815
  - test/dummy/tmp/cache/assets/development/sprockets/fffa8f692e900a66d630702707280ecc
2817
- - test/dummy/tmp/pids/server.pid
2818
2816
  - test/fixtures/polyblock/blocks.yml
2819
2817
  - test/helpers/polyblock/polyblocks_helper_test.rb
2820
2818
  - test/integration/navigation_test.rb
@@ -1 +0,0 @@
1
- 48499