directiverecord 0.1.21 → 0.1.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.rdoc +4 -0
- data/VERSION +1 -1
- data/lib/directive_record/relation.rb +7 -0
- data/lib/directive_record/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGRkZjA3NjA3YzdmY2IzZTkwODg3ZTcyNzczZDVkYmE4MzRlZjk4MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGM1NjBkMDM2ZjRiMThiYTQ5NzAxNzIyN2NhM2IwM2QxZTY2OTlkOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTNiYTViM2I0YjU5MjAyOWI1ZGFmYjU2MDMwMDhjMjRkYzcyYWVhNGJhNGE2
|
10
|
+
NTk2ZDkyYmE5YmExNDFmNGMwMWM0M2Q0OWZkMGU2MTQzZDQ3ZmNiNDdlZjQ4
|
11
|
+
NTc1NDRkNDFjNGRlZjA0NWM2MjUyYjU4YTM5N2UxMGYxYTkxNzg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGZjNTFmMTg3ZmFkN2Q0ZjE4MjY2OWMxYmMzNzVkMzk5YjA3NGFkYjdjMzAw
|
14
|
+
ZjdmYjgyOTMxY2UxMTMxNDJkZjM2MGVkMDJiMzA4ZGViNTJhZGIxNjNlNGQz
|
15
|
+
NDljNWEwZDllYzU3MjNkNWM3NWMxODJkYjZhZjBhZjc5MTNmMjM=
|
data/CHANGELOG.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.22
|
@@ -27,7 +27,14 @@ module DirectiveRecord
|
|
27
27
|
def sql_aliases_to_paths(arg)
|
28
28
|
visit_sql(arg).gsub(/(`([^`]+)`\.`([^`]+)`)/) do
|
29
29
|
sql_alias, column = $2, $3
|
30
|
+
|
30
31
|
path = sql_alias_to_path sql_alias
|
32
|
+
reflection = klass.reflections[sql_alias_to_association(sql_alias, klass).to_sym]
|
33
|
+
|
34
|
+
if reflection && (reflection.macro == :has_and_belongs_to_many) && (reflection.join_table == sql_alias) && (reflection.association_foreign_key == column)
|
35
|
+
column = "id"
|
36
|
+
end
|
37
|
+
|
31
38
|
path.empty? ? column : "#{path}.#{column}"
|
32
39
|
end
|
33
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: directiverecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Engel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|