Created
June 30, 2011 23:13
-
-
Save Odaeus/1057518 to your computer and use it in GitHub Desktop.
Fix for acts_as_reportable associations with the same name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/ruport/acts_as_reportable.rb b/lib/ruport/acts_as_reportable.rb | |
index cdcafe9..30db614 100644 | |
--- a/lib/ruport/acts_as_reportable.rb | |
+++ b/lib/ruport/acts_as_reportable.rb | |
@@ -344,13 +344,8 @@ module Ruport | |
new_columns = [] | |
associations.each do |association| | |
- if include_has_options | |
- assoc_options = includes[association].merge({ | |
- :qualify_attribute_names => association | |
- }) | |
- else | |
- assoc_options = {:qualify_attribute_names => association} | |
- end | |
+ assoc_options = {:qualify_attribute_names => association} | |
+ assoc_options.merge!(includes[association]) if include_has_options | |
assoc_objects = [*send(association)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment