devise-active_node 0.0.1.alpha → 0.0.1.beta

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: 74a1cabda42e11e0c77a6fbdf3a12856a07e6288
4
- data.tar.gz: 51f194c4e6a4e0f06dff905968414fa40c11cbff
3
+ metadata.gz: 0a3cec0fb7ca42e3b70a219fc61e31ca60d18aaf
4
+ data.tar.gz: 619858cc6bcee732f5352c47fa1e8ad37e94647d
5
5
  SHA512:
6
- metadata.gz: f74338d8b22b54c8824a5eb6ed6f673a65bb2d80de5b4f084aa0a45885c209fd77b169f8f0f5a11f8b9a9ff9f1c791d4b38f8afa0692acdb3899f9bdb5d4786c
7
- data.tar.gz: accfa476762d9fcaeaa588066d4776dfff00d7330a213e7e953a79986528f7560ba6b7bedab982cf982072989e85fa18afcd250ddad87b93133ed72abb81b5f2
6
+ metadata.gz: e24adf41ffa8b23c4a9f277a6df6a7bcd6f2f22da2408e90f3f1ea85a1dbfd1b91ae2d778b8cc187d161122f1a6ef07dc466043a482d8af14048d10503c609eb
7
+ data.tar.gz: e87d70e6354e796105b474ce824bba6592ae28091913744443fcd9584df618a7f6203971792126cafa71e186facf4f470dad92590d2d5c94699c7081f014a776
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "active_node", ">= 2.2.0"
21
+ spec.add_dependency "active_node", ">= 2.2.4"
22
22
  spec.add_dependency "devise"
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.6"
@@ -1,5 +1,5 @@
1
1
  module Devise
2
2
  module ActiveNode
3
- VERSION = "0.0.1.alpha"
3
+ VERSION = "0.0.1.beta"
4
4
  end
5
5
  end
@@ -24,12 +24,7 @@ module OrmAdapter
24
24
 
25
25
  # @see OrmAdapter::Base#find_all
26
26
  def find_all(options = {})
27
- klass
28
- .order(options.delete :order)
29
- .where(options.delete :conditions)
30
- .limit(options.delete :limit)
31
- .offset(options.delete :offset)
32
- .where(options)
27
+ construct_graph(klass, options)
33
28
  end
34
29
 
35
30
  # @see OrmAdapter::Base#create!
@@ -41,6 +36,22 @@ module OrmAdapter
41
36
  def destroy(object)
42
37
  object.destroy && true if valid_object?(object)
43
38
  end
39
+
40
+ protected
41
+ def construct_graph(graph, options)
42
+ conditions, order, limit, offset = extract_conditions!(options)
43
+
44
+ graph = graph.where(conditions || {})
45
+ graph = graph.order(order_clause(order)) if order.any?
46
+ graph = graph.limit(limit) if limit
47
+ graph = graph.offset(offset) if offset
48
+
49
+ graph
50
+ end
51
+
52
+ def order_clause(order)
53
+ order.map {|pair| "#{pair[0]} #{pair[1]}"}.join(",")
54
+ end
44
55
  end
45
56
  end
46
57
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise-active_node
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha
4
+ version: 0.0.1.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heinrich Klobuczek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-05 00:00:00.000000000 Z
11
+ date: 2014-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_node
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 2.2.0
19
+ version: 2.2.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 2.2.0
26
+ version: 2.2.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: devise
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -130,3 +130,4 @@ test_files:
130
130
  - spec/orm_adapter/adapters/active_node_spec.rb
131
131
  - spec/orm_adapter/example_app_shared.rb
132
132
  - spec/spec_helper.rb
133
+ has_rdoc: