Hey. I would like ActiveRecord to et some DB field automatically using callbacks.
class Product < ActiveRecord::Base
after_create :set_locale
def set_locale
self.locale = I18n.locale
end
end
In ./script/console I do
p = Product.create
p
Field p.locale is not set. What did I do wrong? Thx for help!