active_hash 1.5.2 → 1.5.3

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: c8acc3676775043861b3c4c658566c9517381793
4
- data.tar.gz: 998aeda1de90bcd1a6a08c4ae3c3895336adab98
3
+ metadata.gz: ff4a2c49ee06315378c81b2a3a0f384154e678fb
4
+ data.tar.gz: 7d0a067022cf6a783781038eb579e128683a2dfd
5
5
  SHA512:
6
- metadata.gz: 409dc56e3320ff815b2349c3fcf0e68fd83b7db7ed632c3a14a97f05342eb95f4763d02b79c0b9bd59a6d5a6186d26428ab9aa39bf0de145a19df16a26e4c3fe
7
- data.tar.gz: 2089dee0d560192d62ab2aa583a3526b1920c716c4da960a2c5152d6fb19672a1cb033d361892d31093d323cb1610c66df3b86d440f9bc56defa49578e2e8add
6
+ metadata.gz: 9f25c8480482cf4c58fcdf30efc210b838a44157c2c816a56471040d6e90b607f999e3e677972765db25a9e1afc980ab75e548e1b511d9cc57a02bf4cf06ac73
7
+ data.tar.gz: e819bb567be614fbd26451b5e5a6c09f0149d7f966002d6ccb6b49325472d193d393b245aba170d69a3b97760cafa089f66c5bb7a0e76e90992d981686fb8c6d
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ 2017-06-14 (v1.5.3)
2
+ - Support symbol values in where and find_by [#156](https://github.com/zilkey/active_hash/pull/156) Thanks, @south37
3
+
1
4
  2017-06-14 (v1.5.2)
2
5
  - Fix find_by when passed an invalid id [#152](https://github.com/zilkey/active_hash/pull/152) Thanks, @davidstosik
3
6
 
data/README.md CHANGED
@@ -364,7 +364,7 @@ mexico:
364
364
  You can use multiple files to store your data. You will have to choose between hash or array style as you cannot use both for one model.
365
365
  ```ruby
366
366
  class Country < ActiveYaml::Base
367
- use_mutliple_files
367
+ use_multiple_files
368
368
  set_filenames "europe", "america", "asia", "africa"
369
369
  end
370
370
  ```
@@ -180,15 +180,21 @@ module ActiveHash
180
180
  def match_options?(record, options)
181
181
  options.all? do |col, match|
182
182
  if match.kind_of?(Array)
183
- match.include?(record[col])
183
+ match.any? { |v| normalize(v) == normalize(record[col]) }
184
184
  else
185
- record[col] == match
185
+ normalize(record[col]) == normalize(match)
186
186
  end
187
187
  end
188
188
  end
189
189
 
190
190
  private :match_options?
191
191
 
192
+ def normalize(v)
193
+ v.respond_to?(:to_sym) ? v.to_sym : v
194
+ end
195
+
196
+ private :normalize
197
+
192
198
  def count
193
199
  all.length
194
200
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveHash
2
2
  module Gem
3
- VERSION = "1.5.2"
3
+ VERSION = "1.5.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_hash
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Dean
@@ -29,7 +29,7 @@ authors:
29
29
  autorequire:
30
30
  bindir: bin
31
31
  cert_chain: []
32
- date: 2017-06-14 00:00:00.000000000 Z
32
+ date: 2017-12-26 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: activesupport
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubyforge_project:
90
- rubygems_version: 2.6.11
90
+ rubygems_version: 2.5.2
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: An ActiveRecord-like model that uses a hash or file as a datasource