I’m trying to make something cool with the ActiveRecord, it consists
in adding the feature of warnings to it.
class Person < ActiveRecord::Base
p = Person.new
=> ‘should not be blank’
It makes the warning about an attribute, and the only way to save it
is that you confirm that you accept the warnings.
When I’m trying to overwrite the validation functionality to handle
the warnings and the validations of the model… the overwrite doesn’t
I imagine that this is happening because they use the
“alias_method_chain :save, :validation” on the Validation module,
when I try to do this in a plugin to change the behavior of this
def save_with_validation(perform_validation = true)
# code to handle the warnings
it doesn’t get overwritten.
Maybe some dark magic is going on in the save_with_validation and the
Anyone has an idea?
thanks in advance
PD: if someone wants to see the code, pastie can help