| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Ruport
Revision: 1307
Author: sandal
Date: 09 Jun 2008 21:55:59
Changes:Fixed get_attributes_with_options method to work with rails 2.1
Files:| ... | ...@@ -369,11 +369,9 @@ | |
| 369 | 369 | # name to the attribute name as association.attribute |
| 370 | 370 | # |
| 371 | 371 | def get_attributes_with_options(options = {}) |
| 372 | only_or_except = | |
| 373 | if options[:only] or options[:except] | |
| 374 | { :only => options[:only], :except => options[:except] } | |
| 375 | end | |
| 376 | attrs = attributes(only_or_except) | |
| 372 | attrs = attributes | |
| 373 | attrs.slice!(*options[:only].map(&:to_s)) if options[:only] | |
| 374 | attrs.except!(*options[:except].map(&:to_s)) if options[:except] | |
| 377 | 375 | attrs = attrs.inject({}) {|h,(k,v)| |
| 378 | 376 | h["#{options[:qualify_attribute_names]}.#{k}"] = v; h |
| 379 | 377 | } if options[:qualify_attribute_names] |