superstore 1.0.9 → 1.0.10

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: 14e6e854d00b71d3adc4c90c9a22a2ad037804f7
4
- data.tar.gz: b93c4c751c9878bf0ffd5f9ad820318c7a4b516e
3
+ metadata.gz: c19b1ea6b25bd38b5dd4a2a64c8b12002015b750
4
+ data.tar.gz: b6ae687fdf28f34c3f0ec5577d8c0abce2044cfb
5
5
  SHA512:
6
- metadata.gz: ffcc9039341bf692f33ace4bb30da758a24dc39c3f41037a794ae7a3ebe289a7136b7bcb604377bd99b74aa9f50e000c154166d574b784b33d68ad48d26631b3
7
- data.tar.gz: a697096203de501f04f73fa73194ccf8c2e0b09f03e139dfd4a9152c1cfab47be90fd265cc064c45ae7b61430631ab3cf64b77a9c2ed4746ece148607ba84ee5
6
+ metadata.gz: f6bdbbfde5df3bad14ea2cf542fb3eda7f888fecb6c9ae516055164300e3f74ca62b466c837286baaf5a270a1f32ccdbc310a1d4e456bf5cf9b00c4a1a2ff7c5
7
+ data.tar.gz: 8bb6ba4bddcd5cf5887397223da51e52b9c607e754ec365ef1219a0857e9b8c408ee4c43b89b00abcad184ddafe3272e8c49e4b24215cddff9c1e71aac28381a
@@ -65,27 +65,21 @@ module Superstore
65
65
  end
66
66
 
67
67
  def typecast_persisted_attributes(attributes)
68
- typecast_persisted_attributes! attributes.dup
69
- end
70
-
71
- def typecast_persisted_attributes!(attributes)
72
- attributes = attributes.dup
68
+ result = {}
73
69
 
74
70
  attributes.each do |key, value|
75
71
  if definition = attribute_definitions[key]
76
- attributes[key] = definition.instantiate(value)
77
- elsif key != primary_key
78
- attributes.delete(key)
72
+ result[key] = definition.instantiate(value)
79
73
  end
80
74
  end
81
75
 
82
76
  attribute_definitions.each_value do |definition|
83
- unless definition.default.nil? || attributes.has_key?(definition.name)
84
- attributes[definition.name] = definition.default
77
+ unless definition.default.nil? || result.has_key?(definition.name)
78
+ result[definition.name] = definition.default
85
79
  end
86
80
  end
87
81
 
88
- attributes
82
+ result
89
83
  end
90
84
  end
91
85
 
data/superstore.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'superstore'
5
- s.version = '1.0.9'
5
+ s.version = '1.0.10'
6
6
  s.description = 'ActiveModel for many attributes'
7
7
  s.summary = 'Cassandra ActiveModel'
8
8
  s.authors = ["Michael Koziarski", "gotime"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Koziarski