backframe 0.0.26 → 0.0.27

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: cfcf5e14728ebdb5a5e975a9965e9760777c5a2c
4
- data.tar.gz: 48f5456543ca36ef8e959f0a0686320326b7d697
3
+ metadata.gz: d2e1d68313054692fd5e4a0178cbca7e3fab5d51
4
+ data.tar.gz: 96d8a7dd3c7b631b5850da80c863ab9b8b334294
5
5
  SHA512:
6
- metadata.gz: 1e51424f4614b555cb2e26479b39915954db466294892d199cf8edccac048b4642262f920f85c179cd481991d89f7602bd824ab3ccf2df2bf8a1ee3a9da010c1
7
- data.tar.gz: c1e301e15b94d9306dcde58017895dcf43736a1c0373f9095770eb44288a0a53d60be7356a9590fa327e15aedc53237c9191c0c622657371a5fda9be6f09815a
6
+ metadata.gz: 09af97fd6f9da753452b9d38339a6d71e40ea8362b9cbaa04960872196231cc0cd837412e069dc827a117f7c9bdada47689acb1d548f714ca27e8f2127f4966f
7
+ data.tar.gz: 77ea7a04fedbe0fa178c19b51bed8751bc73d4f0a552276b5871e677fc89b943c96e9adbbd7263249001c4c6e592f324e8c2173ca0679759e2678c1cfe410ba8
@@ -56,15 +56,16 @@ module Backframe
56
56
  model_table = self.table_name
57
57
  associations = self.reflect_on_all_associations(:belongs_to)
58
58
  associations.each do |association|
59
- association_name = association.name
60
- association_table = association.class_name.constantize.table_name
61
- association_foreign_key = association.foreign_key
62
- sortjoins["#{association.name}"] = "LEFT OUTER JOIN \"#{association_table}\" #{association_name} ON (\"#{association_name}\".\"id\" = \"#{model_table}\".\"#{association_foreign_key}\")"
63
- association.class_name.constantize.columns.each do |column|
64
- sortfields["#{association_name}.#{column.name}"] = "\"#{association_name}\".\"#{column.name}\""
59
+ if !(association.options.key?(:polymorphic) && association.options[:polymorphic])
60
+ association_name = association.name
61
+ association_table = association.class_name.constantize.table_name
62
+ association_foreign_key = association.foreign_key
63
+ sortjoins["#{association.name}"] = "LEFT OUTER JOIN \"#{association_table}\" #{association_name} ON (\"#{association_name}\".\"id\" = \"#{model_table}\".\"#{association_foreign_key}\")"
64
+ association.class_name.constantize.columns.each do |column|
65
+ sortfields["#{association_name}.#{column.name}"] = "\"#{association_name}\".\"#{column.name}\""
66
+ end
65
67
  end
66
68
  end
67
-
68
69
  key = (key.present? && sortfields.has_key?(key)) ? key : default_key
69
70
  order = (order.present?) ? order : default_order
70
71
  if parts = key.match(/(\w*)\.(\w*)/)
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Backframe
4
- VERSION = '0.0.26'
4
+ VERSION = '0.0.27'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backframe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Kops