Flowdock

Notes posted by MGPalmer

RSS feed
December 12, 2011
2 thanks

Need to extend class when using this

I had to dig around to find this out - if you want to use memoize somewhere, like an ActiveRecord model, you need to add

extend ActiveSupport::Memoizable

to the class. This doesn’t seem to be explained anywhere (the only docs are 3 year old blog posts anyway).

September 14, 2011
2 thanks

More on add_to_base

Actually, use

model_instance.errors.add :base, :invalid

to have I18n working.