ancestry_joins 0.1.0 → 0.1.1

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: 202ddb44a51c5d2f85b2301f8ffdd308b8d9c275
4
- data.tar.gz: 40957c6db4e124df74a9df71c0071345143a3461
3
+ metadata.gz: 618fee191850e6a341ec7adcb26e008f86145b3d
4
+ data.tar.gz: 2a79102dc7635980c68fe8c5b7834687c24df68f
5
5
  SHA512:
6
- metadata.gz: c6b9d34c587a6c8f84fcaa31fecf3b83d4d527954b441a4a85ced4762abeafd47806b4ab9052e87b89d8b3f9716ff9a49abe4fa59ec3d91296f850d04cf9aec3
7
- data.tar.gz: 47bd49c3c65251ad4b1134032bc3f30b82a8a14c2498359ea9ace055a53fa4c55b5c38616c037721a8f8f0ff361918154f00c9d89559e3983c495808b84a0b0f
6
+ metadata.gz: 8823a3d66f695efdf487e23ced533351f900a5e1498034a5b535e1332bb02c6c17e95e3cef2d0043ca4e94494c841e02f5a15d177c16083627fca8dfb68ad60c
7
+ data.tar.gz: f4c49c68e569e2791759e2a16fd917eb13aa18d3729def784a8d555e011c4006d085ac56b923c0e7812661ab7eb62f804724602238da26a5bb698abcdbb0b85c
data/README.md CHANGED
@@ -23,7 +23,7 @@ Item.where(interesting: true).with_ancestors_only
23
23
 
24
24
  ## Caveats
25
25
 
26
- Do to the querying method, only Postgres is supported at the moment.
26
+ Due to the custom SQL select, only Postgres is supported at the moment.
27
27
  More databases can be supported in the future. Look at `lib/ancestry_joins.rb`
28
28
  to implement scopes for another database.
29
29
 
@@ -8,7 +8,10 @@ module AncestryJoins
8
8
  extend ActiveSupport::Concern
9
9
 
10
10
  included do
11
- case connection.adapter_name.downcase.to_sym
11
+ rails_env = ENV['RAILS_ENV'] || (Rails.env if defined?(Rails))
12
+ raise 'Could not detect Rails env' unless rails_env
13
+
14
+ case configurations[rails_env]['adapter'].downcase.to_sym
12
15
  when :postgresql
13
16
  # Helper to add all selection fields. This is the default behavior until
14
17
  # you add your own selections.
@@ -1,3 +1,3 @@
1
1
  module AncestryJoins
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ancestry_joins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Pierce
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-16 00:00:00.000000000 Z
11
+ date: 2017-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler