activemodel-behavior_validator
Usage
Add to your Gemfile:
gem 'activemodel-behavior_validator'
Run:
bundle install
Then add the following to your model:
validates :my_attribute, behavior: { active?: true }
Validation outside a model
If you need to validate a outside a model, you can do that:
BehaviorValidator.valid?(object, { method_name: expected_result }