Permalink
Browse files

Records retrieved by find_by_xx now have writable attributes. closes #27

  • Loading branch information...
1 parent c1d1c0f commit f802f1927704556f4c802d65fcd5eed87aa97609 @hukl hukl committed Apr 22, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/globalize/active_record.rb
@@ -125,7 +125,12 @@ def method_missing(method, *args)
def find_first_by_translated_attr_and_locales(name, value)
query = "#{translated_attr_name(name)} = ? AND #{translated_attr_name('locale')} IN (?)"
locales = Globalize.fallbacks(locale || I18n.locale).map(&:to_s)
- find(:first, :joins => :translations, :conditions => [query, value, locales])
+ find(
+ :first,
+ :joins => :translations,
+ :conditions => [query, value, locales],
+ :readonly => false
+ )
end
def translated_attr_accessor(name)

0 comments on commit f802f19

Please sign in to comment.