Permalink
Browse files

corrected lambda

  • Loading branch information...
1 parent 6f4399c commit 4edd6f93ed8eeff625505f0586c4d4b74bf76073 @moskyt committed Jan 9, 2010
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/globalize/active_record.rb
@@ -75,10 +75,9 @@ def translates(*attr_names)
end
self.translated_attribute_names.each do |key|
- join = :"#{self.name.underscore}_translations_#{I18n.locale}"
field = "#{self.name.underscore}_translations.#{key}"
- self.named_scope :"ascend_by_#{key}", lambda{ { :order => "#{field} ASC", :joins => join } }
- self.named_scope :"descend_by_#{key}", lambda{ { :order => "#{field} DESC", :joins => join } }
+ self.named_scope :"ascend_by_#{key}", lambda{ { :order => "#{field} ASC", :joins => :"#{self.name.underscore}_translations_#{I18n.locale}" } }
+ self.named_scope :"descend_by_#{key}", lambda{ { :order => "#{field} DESC", :joins => :"#{self.name.underscore}_translations_#{I18n.locale}" } }
end
end

0 comments on commit 4edd6f9

Please sign in to comment.