calculated_attributes 0.0.19 → 0.0.20

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: 2b2dd0e9f52299a368d2b049c1db8ba7d42c1c7d
4
- data.tar.gz: ec77da383307dfd1cf345a32bddcc5639f9deeaf
3
+ metadata.gz: 7da323e196847b4f15e503b0d19ac25d9ecb784a
4
+ data.tar.gz: 807ad2214677049d809d2d72df5187ceffc1c6e3
5
5
  SHA512:
6
- metadata.gz: 5dd5735365b4d0f7ecc94ae7667c918ec3fe452f5eb537ab1613905aa20ee0d954f820c800f42ce5df42221ea52e621479308a2fc9733c195761504993f116a0
7
- data.tar.gz: 1f05b7e90a8a33e2c021f12ac9fe77d67aa042cb56b145e7f94d2d1ad620f9cca77c5a7e26e37beee1df008888fab863a217a05838d439670a406fde5ed679b2
6
+ metadata.gz: e730af38ee04e9bd4b68d268406d4d119e23b4d81a177a5e9ab01a425e74fbc3116a8d476e19e0dbcba03a1344abfeb65838a2962ef1c81482395fab934faadf
7
+ data.tar.gz: 7ee138eb56996b3d602c49ac7dcaabc6619974eea11d6166cb48c9f567f71c3311fa7938bf90df9f5718cc090af06241b4ae11a9439607d87ce490a61db3d202
@@ -187,6 +187,24 @@ module ActiveRecord
187
187
  end
188
188
  end
189
189
 
190
+ module ActiveRecord
191
+ module AttributeMethods
192
+ module Write
193
+ # Updates the attribute identified by <tt>attr_name</tt> with the specified +value+. Empty strings
194
+ # for fixnum and float columns are turned into +nil+.
195
+ def write_attribute(attr_name, value)
196
+ attr_name = attr_name.to_s
197
+ attr_name = self.class.primary_key if attr_name == 'id' && self.class.primary_key
198
+ @attributes_cache.delete(attr_name)
199
+ column = column_for_attribute(attr_name)
200
+
201
+ @attributes[attr_name] = type_cast_attribute_for_write(column, value)
202
+ end
203
+ end
204
+ end
205
+ end
206
+
207
+
190
208
  module Arel
191
209
  module Nodes
192
210
  class Node
@@ -1,3 +1,3 @@
1
1
  module CalculatedAttributes
2
- VERSION = '0.0.19'
2
+ VERSION = '0.0.20'
3
3
  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.19
4
+ version: 0.0.20
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-06-24 00:00:00.000000000 Z
11
+ date: 2015-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal