I got it to work like this:
class Foo
extend ActiveModel::Callbacks
include ActiveModel::Validations
include ActiveModel::Validations::Callbacks
before_validation :bar
def bar
# callback logic here
end
end
It's important that you have everything in that order.