Greg Willits wrote:
> Lots of code below, since it's usually the details that matter. Bit of a
> long one, but I think it's generic enough to be a good one for the
OK, nevermind -- got it sorted out.
required this change:
base_module.before_create do |model|
model.attributes.each do |key,value|
model.scrub_value(value) if !value.nil?
In case you're curious why, that;s because blocks are closures - in
particular they remember self, so you were trying to call scrub_value
on the module, read that variable form the module etc.