In rails 1.2.6 the following works fine:
class Promotion < ActiveRecord::Base
def self.find_by_name(name) super(name.upcase.strip) end
end
so if the db contains a promotion with name 'PROMO1' then Promotion.find_by_name('pRoMo1') > a valid promotion
in rails 2.0.1 Promotion.find_by_name('pRoMo1') > nil
I guess I can't override the default find_by_xxx methods in rails 2 - but why? Should I not be doing this? I haven't spotted anything in the release notes.
Any insight appreciated.