activerecord-collections 0.0.10 → 0.0.11

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: 22ce528f513350381a68417cd1b739ddca67c5c4
4
- data.tar.gz: ec7a642f1a23c4dfc41cf1ae7f059c263be993c1
3
+ metadata.gz: a6e07d4f6473993e7c2b8c9aed6d5fc735de4d39
4
+ data.tar.gz: ab291ee2e1fa9beabb2ac03e30ea6cd43ecdbbd9
5
5
  SHA512:
6
- metadata.gz: e3965879d213c235ddc447ec1a9d723736af7509aebf7fe4d4749e96a951a4213e1cedadf9dec7acc82035d7ec80b30088db75cc924f95eb91c14519d6d46b1b
7
- data.tar.gz: 32445dbdd55347fe201dca00bc1effe2618356e6f3d616f15197d364c925414a34433b42e5d2bdb48934801e4350f52a6693f0423ee9226cc9d6673c486eaca3
6
+ metadata.gz: b27eaf11f36645b7a1c30279c46f16ac92135a7c38fd19a788d9a0ed072f17aa840f49d732223e1b38ac5c6abd71c90eec240a82e3e73454f2058e9ce9d5daff
7
+ data.tar.gz: 9dca6c8e1b4b32480bb7b51b7506c686852d22a2bf456a97e395df397da8a20f717bb9f389cdfb8ee4bfbab0b526c448357c5e42429d8ac09e2800f42098614d
@@ -11,8 +11,8 @@ module ActiveRecord
11
11
  end
12
12
 
13
13
  def from_hash(hash)
14
- hash.symbolize_keys!
15
- collection = new(hash[:klass])
14
+ hash.symbolize_keys! unless hash.is_a?(HashWithIndifferentAccess)
15
+ collection = hash.has_key?(:klass) ? new(hash[:klass]) : new
16
16
  collection.select!(*hash[:select]) unless hash[:select].empty?
17
17
  collection.distinct! if hash[:distinct] == true
18
18
  collection.joins!(*hash[:joins]) unless hash[:joins].empty?
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Collections
3
- VERSION = '0.0.10'
3
+ VERSION = '0.0.11'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-collections
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rebec
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-01 00:00:00.000000000 Z
11
+ date: 2015-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord