calculated_attributes 0.0.20 → 0.0.21
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 21a523e5d620f5382b3af08ded6fff13f5e94ade
|
|
4
|
+
data.tar.gz: d70290a340d2e4f41cf4d84b5127d7a2142e9530
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9046121ecb68b88f866bf4a0ac14241a4ab56bb84d6d446d2f6b983cb7be600932d69ac3b33964651d3bfc0a019fe1a9bccd51f46fb6c3219b682bf8f68f3fec
|
|
7
|
+
data.tar.gz: dc58094ebf3bcba65020b595102696b8c495efaa2a6226d7fafa9cc7ea563c3d6cd9fb13221e557bd0a7c6d44956d0fbac1ad561cc6d9688ca843f8cacf5bbe0
|
|
@@ -193,12 +193,16 @@ module ActiveRecord
|
|
|
193
193
|
# Updates the attribute identified by <tt>attr_name</tt> with the specified +value+. Empty strings
|
|
194
194
|
# for fixnum and float columns are turned into +nil+.
|
|
195
195
|
def write_attribute(attr_name, value)
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
if ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR == 2
|
|
197
|
+
write_attribute_with_type_cast(attr_name, value, true)
|
|
198
|
+
else
|
|
199
|
+
attr_name = attr_name.to_s
|
|
200
|
+
attr_name = self.class.primary_key if attr_name == 'id' && self.class.primary_key
|
|
201
|
+
@attributes_cache.delete(attr_name)
|
|
202
|
+
column = column_for_attribute(attr_name)
|
|
200
203
|
|
|
201
|
-
|
|
204
|
+
@attributes[attr_name] = type_cast_attribute_for_write(column, value)
|
|
205
|
+
end
|
|
202
206
|
end
|
|
203
207
|
end
|
|
204
208
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: calculated_attributes
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.21
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Zach Schneider
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-07-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: appraisal
|