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 +4 -4
- data/CHANGELOG +3 -0
- data/README.md +1 -1
- data/lib/active_hash/base.rb +8 -2
- data/lib/active_hash/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff4a2c49ee06315378c81b2a3a0f384154e678fb
|
4
|
+
data.tar.gz: 7d0a067022cf6a783781038eb579e128683a2dfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
367
|
+
use_multiple_files
|
368
368
|
set_filenames "europe", "america", "asia", "africa"
|
369
369
|
end
|
370
370
|
```
|
data/lib/active_hash/base.rb
CHANGED
@@ -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.
|
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
|
data/lib/active_hash/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|