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 +4 -4
- data/README.md +1 -1
- data/lib/ancestry_joins.rb +4 -1
- data/lib/ancestry_joins/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 618fee191850e6a341ec7adcb26e008f86145b3d
|
4
|
+
data.tar.gz: 2a79102dc7635980c68fe8c5b7834687c24df68f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
|
data/lib/ancestry_joins.rb
CHANGED
@@ -8,7 +8,10 @@ module AncestryJoins
|
|
8
8
|
extend ActiveSupport::Concern
|
9
9
|
|
10
10
|
included do
|
11
|
-
|
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.
|
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.
|
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:
|
11
|
+
date: 2017-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|