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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmYzMWQ2NTkwOWRkMWJhNTRhNDVjM2U5ODYzNTgwY2ZhZWU4YzkyMQ==
4
+ MGRkZjA3NjA3YzdmY2IzZTkwODg3ZTcyNzczZDVkYmE4MzRlZjk4MA==
5
5
  data.tar.gz: !binary |-
6
- Mzg2NmQzNmJjYmI0Y2ZhOGY1ODM1YTBhMmE3NjUzNjU5ZjBmZWU4Mw==
6
+ MGM1NjBkMDM2ZjRiMThiYTQ5NzAxNzIyN2NhM2IwM2QxZTY2OTlkOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MGRjNjBmNmQ5ZTJkNTVmMjUxMDk3MDM4ZTdlYWQ3MTY0YmY4OGI0Mzk3Y2Ix
10
- MmZmY2MyYTI1ZTc0Mjc4MmQ2YjA3NWZhNmRiNTFlOGU2ZDk0NDk5NDJmYjA1
11
- NmY5YmQwYTczNWM3MGY2MTI2ZTg4MzBiYTk4MDZmNDQ4NGVlZWY=
9
+ OTNiYTViM2I0YjU5MjAyOWI1ZGFmYjU2MDMwMDhjMjRkYzcyYWVhNGJhNGE2
10
+ NTk2ZDkyYmE5YmExNDFmNGMwMWM0M2Q0OWZkMGU2MTQzZDQ3ZmNiNDdlZjQ4
11
+ NTc1NDRkNDFjNGRlZjA0NWM2MjUyYjU4YTM5N2UxMGYxYTkxNzg=
12
12
  data.tar.gz: !binary |-
13
- NDRjNjg0NmJhZjhkYmY0OTZmOTg1YjA3MjQ1YmQ5MDAzY2E0OTQ1OGZlYjRl
14
- NzQzMDQ0MGVmNTRiNDE0NzIwNGRkYjUwMzljYjA4YTFkOWEyNjAxMWIyODhk
15
- Mzc5YWY0MjBiMmVhYzVhNzMzMGVkMWMyYTVhY2JlZmJmMjk2MzI=
13
+ NGZjNTFmMTg3ZmFkN2Q0ZjE4MjY2OWMxYmMzNzVkMzk5YjA3NGFkYjdjMzAw
14
+ ZjdmYjgyOTMxY2UxMTMxNDJkZjM2MGVkMDJiMzA4ZGViNTJhZGIxNjNlNGQz
15
+ NDljNWEwZDllYzU3MjNkNWM3NWMxODJkYjZhZjBhZjc5MTNmMjM=
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,9 @@
1
1
  = DirectiveRecord CHANGELOG
2
2
 
3
+ == Version 0.1.22 (April 8, 2015)
4
+
5
+ * Corrected deriving qry_options from habtm associations
6
+
3
7
  == Version 0.1.21 (April 3, 2015)
4
8
 
5
9
  * Storing original sql alias of a calculated column when numerizing aliases
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.21
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
@@ -1,7 +1,7 @@
1
1
  module DirectiveRecord
2
2
  MAJOR = 0
3
3
  MINOR = 1
4
- TINY = 21
4
+ TINY = 22
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].join(".")
7
7
  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.21
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-03 00:00:00.000000000 Z
11
+ date: 2015-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord