Option 1
You can create a method such as:
def ok_to_run_test_method? street_changed? || something_changed? || something_else_changed? end
and then use:
before_save :run_test_method, :if => :ok_to_run_test_method?
Please note that :ok_to_run_test_method? is a symbol. Not sure if it was a typo or not, but in your question are you actually calling the class street_changed? method street_changed? .
Second option
Modify your callbacks a bit and use the block style syntax:
before_save do if street_changed? || something_changed? || something_else_changed?
source share