weighable 0.1.0 → 0.1.1

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: 075f2df68dabd18abf769e897b901c6d1481fa48
4
- data.tar.gz: 0968b3a9d07bd772ade4cc17e82f425e5a61a81f
3
+ metadata.gz: 17e7bee879cdfb4aca37dd69d5677c39c6a6a221
4
+ data.tar.gz: 756192d72542ae5bcb60e457e9ee8fa8f22fcf02
5
5
  SHA512:
6
- metadata.gz: b1c3daa50fb95b1d86b66da11e37d2795328d2ad5cd89dc89342b49b1c87fb5a3a69152448c32bbbf64b1d8b7051d8c43d2aa63dde6f368b55756174592fc32c
7
- data.tar.gz: 84877638d4ab602cd99d5d6b85ce5d89d3329a9763dd5fe1f57cdab706286b62189f9831b32e422d16575354097cbb3a1deeed9a990d6db952b65fe717c3def1
6
+ metadata.gz: f66202def0fab1ca40c610dc71bfb34ecad05922e471975e1747706dba87209dbf89a69ff26e260f08acfb4d1e92748d643d935344ccadd88edc9ef1aab22d12
7
+ data.tar.gz: 929f67f8295a99423b0f7d914b60cb5b70635a523e25be2d28b7157a7d2900a9cb6fae788debcc6049bb2032f17ec3ea8b5e3bee6db416ab6f3e49bd24c015e9
@@ -1,4 +1,4 @@
1
- require 'weighable/inflections'
1
+ require 'active_support/inflector/methods'
2
2
 
3
3
  class Numeric
4
4
  Weighable::Weight::UNIT.each do |unit, _|
@@ -1,4 +1,4 @@
1
- require 'weighable/inflections'
1
+ require 'active_support/inflector/methods'
2
2
 
3
3
  class String
4
4
  Weighable::Weight::UNIT.each do |unit, _|
@@ -9,7 +9,7 @@ module Weighable
9
9
  define_method "#{column}=" do |weight|
10
10
  weight = Weight.new(weight['value'], weight['unit']) if weight.is_a?(Hash)
11
11
  original_unit = weight.try(:unit)
12
- weight = weight.try(:to, store_as) if original_unit && original_unit != :each
12
+ weight = weight.try(:to, store_as) if original_unit && original_unit != :unit
13
13
 
14
14
  public_send("#{column}_value=", weight.try(:value))
15
15
  public_send("#{column}_unit=", weight.try(:unit))
@@ -1,3 +1,3 @@
1
1
  module Weighable
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
@@ -1,4 +1,4 @@
1
- require 'weighable/inflections'
1
+ require 'active_support/inflector/methods'
2
2
 
3
3
  module Weighable
4
4
  class Weight
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: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trae Robrock
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-25 00:00:00.000000000 Z
11
+ date: 2016-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -136,7 +136,6 @@ files:
136
136
  - lib/weighable/core_ext/numeric.rb
137
137
  - lib/weighable/core_ext/string.rb
138
138
  - lib/weighable/errors.rb
139
- - lib/weighable/inflections.rb
140
139
  - lib/weighable/model.rb
141
140
  - lib/weighable/railtie.rb
142
141
  - lib/weighable/version.rb
@@ -1,4 +0,0 @@
1
- require 'active_support/inflector/methods'
2
- ActiveSupport::Inflector.inflections(:en) do |i|
3
- i.uncountable 'each'
4
- end