config_scripts 0.4.5 → 0.4.6

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: f313f0ac8e15d395c540613a5cab1030cb104d22
4
- data.tar.gz: 464fe91acad8305f8a7672601832bb74c382d5e6
3
+ metadata.gz: 47e36d187f881d51081e4264d4b744b4349cbd1e
4
+ data.tar.gz: b7758b32f51e15b1f5b70c779714113e48e513a7
5
5
  SHA512:
6
- metadata.gz: ae90a8fa1e6d34b9454b24817d6971dd905eef6af44e40870bbc82a851e2e35a25e6b52b3f1b864dd67e776e1054e16fec68047d6729a9ff2229a867fed03925
7
- data.tar.gz: 62c70bca40f3ea8507490fb28f43958486685857a04561608c953fe3d0d248fa1fb05a1ff9e3840f474c6a171185ed47ad8b09c78c129151c0bcd87f08c81082
6
+ metadata.gz: 91db88c121aff5140b627770f806068c9e90f73b6e26d5d545fabedcb94287258df64e05fca3143648591b80b23e538f6503fe0d74e2bfacfe2cbd7152ce6e34
7
+ data.tar.gz: 50a9fda8901d06c93eaf42a1134244c55c2dd09dc8b28d5f6927ba78ad6ca48d2d97594ee4556649a0384609199124243357440a607d88420cbaf9f5f9af2db7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # Version 0.4.6 - 28 October 2014
2
+ * Serializes boolean values as 1 and 0 to make sure they get fetched properly
3
+ when used in identifiers
4
+
1
5
  # Version 0.4.5 - 22 May 2014
2
6
  * Removes the ability to apply scopes when loading records from seed
3
7
  identifiers. This caused more trouble than it was worth, and unscoping the
@@ -242,6 +242,10 @@ module ConfigScripts
242
242
  identifier = "#{value.class.name}::#{identifier}"
243
243
  end
244
244
  value = identifier
245
+ elsif value.is_a?(TrueClass)
246
+ value = '1'
247
+ elsif value.is_a?(FalseClass)
248
+ value = '0'
245
249
  end
246
250
  value
247
251
  end
@@ -1,4 +1,4 @@
1
1
  module ConfigScripts
2
2
  # The current version of the library.
3
- VERSION = "0.4.5"
3
+ VERSION = "0.4.6"
4
4
  end
@@ -260,6 +260,24 @@ describe ConfigScripts::Seeds::SeedType do
260
260
  end
261
261
  end
262
262
 
263
+ context "with a boolean value" do
264
+ let(:attribute) { :archived }
265
+
266
+ context "with a true value" do
267
+ before { person.archived = true }
268
+ it "gets the string 1" do
269
+ expect(subject).to eq "1"
270
+ end
271
+ end
272
+
273
+ context "with a false value" do
274
+ before { person.archived = false }
275
+ it "gets the string 0" do
276
+ expect(subject).to eq "0"
277
+ end
278
+ end
279
+ end
280
+
263
281
  context "with a normal value" do
264
282
  let(:attribute) { :name }
265
283
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_scripts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Brownlee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-22 00:00:00.000000000 Z
11
+ date: 2014-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails