weighable 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/weighable/model.rb +3 -1
- data/lib/weighable/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8771f8bc5700d552175e0e692dad7a1279abdee
|
4
|
+
data.tar.gz: 6d39188a5ef3d7a1748378e43db3faa734534927
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2af1a29ab674a088bf01e3e571e1154e7cc11ef6e6b604722b4a8d5cd0f5fab04602108c03ba1a731465f122e92d0db5b86a4376daff0e0e267215fa8e5b6e61
|
7
|
+
data.tar.gz: cecefe233f6b0eec510d0c371dde2f55ae2e2dcd768926427eea919295727db8d3d464e262d2355a38d36d667966c02c52fffa2d27d6a1c9eea0e6a091c1be55
|
data/lib/weighable/model.rb
CHANGED
@@ -13,7 +13,9 @@ module Weighable
|
|
13
13
|
|
14
14
|
def define_setter(column, store_as: :gram, precision: nil)
|
15
15
|
define_method "#{column}=" do |weight|
|
16
|
-
weight
|
16
|
+
if weight.respond_to?(:key?) && weight.key?('value') && weight.key?('unit')
|
17
|
+
weight = Weight.new(weight['value'], weight['unit'])
|
18
|
+
end
|
17
19
|
original_unit = weight.try(:unit)
|
18
20
|
|
19
21
|
if original_unit && original_unit != Weight::UNIT[:unit]
|
data/lib/weighable/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weighable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trae Robrock
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|