cyrax 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGE1NTkyYjQyY2U4ZDc5YTVmMWNmMWVlZGRlZDY0ZWY1ZGE3ZmI3MQ==
4
+ ZjUxOTdlY2I2N2FkZmE0MDVhZWNlNjQwY2IxNTE5OTc4NGQ4MzYxMQ==
5
5
  data.tar.gz: !binary |-
6
- NTFjM2QwOWQ4YTE0MDAwYTFkM2U5YTQxMzBkN2U5YTczYjgyMDJhZQ==
6
+ MDkyNWFmZDk2Y2NhYTQ3ZTYwZWE2MDAzYzM3NmIwZGI2YTE4ZjAxYg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZWQ5OTc5ZGMyMmE4ODA3ZGFhMjg2YWVjM2U1MjY4ZjZkNjlhZTMwYWRjMWI1
10
- NWE3NmM3NTdkMDY0NmZkMTcwY2Y2MzVhYWMwMjE0MTJkZTAyNjY5MTI5MjMx
11
- YTRiODM3ZGRkZWY4NmZkMmQ2ZWUwODBiYzlkNTliNjcxODBlZmU=
9
+ ZThmZDE0ODA2MTc1YjRkZjRlMTQ5YTU1ODNjZmRiNDAxODc1MjhjYjA0ZDJj
10
+ YjgwNmNjZjI0MTdiMGM2N2IwY2JkMjg5YWU3NGQ3ZDQ4MDE4ZWUwOTA5Njhi
11
+ MWM5ODQwZGVjODU2ZThlMWZmZDMwMzZmOGI1NmI5M2JkMjZkYzQ=
12
12
  data.tar.gz: !binary |-
13
- MTI3ODE4MTEyNGUzM2ViYjQ2OTU0ZWUyY2MyNzVjOTU4OGRmNzI2YTFhZTY1
14
- NDg5OWEwZDgyMWU0MzczODU1ZDZlYWY0ODI5YzliNjY4ZWFlODQ3MDZkZTY3
15
- NzQ5ZmQyNmQ5ZDczNmQzMzI3MDhmMjRhMGI1ZTkxNjM3ODc2ZDM=
13
+ MmEzYTFhYzAwZWZlM2E2MzZjM2Q1YjM0MWRlY2YyMmQ5NmJjYzM5MTE4ODhl
14
+ ZjRmYzA0MDFmZDRiNzhlOWJiOGIwN2ZlM2Y5YmM4NWU4NDgxODE3MzIwN2Qy
15
+ MjdmZWUzMTY0ODU1ODc3NGZkNjMxYjllZTgxMDJlNWM2ZThhMWE=
@@ -30,7 +30,13 @@ class Cyrax::Decorator
30
30
 
31
31
  class << self
32
32
  def fetch(resource)
33
- resource.respond_to?(:all) ? resource.all : resource
33
+ if resource.is_a?(ActiveRecord::Relation)
34
+ resource.to_a
35
+ elsif resource.respond_to?(:all)
36
+ resource.all
37
+ else
38
+ resource
39
+ end
34
40
  end
35
41
 
36
42
  def decorate(resource)
@@ -5,6 +5,7 @@ module Cyrax::Extensions
5
5
  def collection
6
6
  respond_with wrapped_collection, name: collection_name
7
7
  end
8
+ alias_method :read_all, :collection
8
9
 
9
10
  def build
10
11
  respond_with build_resource(nil)
data/lib/cyrax/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cyrax
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyrax
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Droidlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-15 00:00:00.000000000 Z
11
+ date: 2013-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport