问题
I´m using rails 3.0.7 with the globalize3 gem.
I have the model "Country" with traslated field "title".
In the rails console, try to find the record by its translated title like this:
gr = Country.find_by_title 'Greece'
This returns the correct record. But it is set to readonly, so I cannot save it.
Is this expected behaviour? What is causing it? I suspect it has something to to with some join generated by globalize3, but this is just an educated guess.
Is there a way around it, except just use the id to find the record?
来源:https://stackoverflow.com/questions/9496816/ruby-on-rails-with-globalize3-find-by-translated-field-makes-record-readonly