Skip to content

Instantly share code, notes, and snippets.

View blahutka's full-sized avatar

blahutka blahutka

View GitHub Profile
@blahutka
blahutka / validations_for.rb
Created September 24, 2024 08:11 — forked from ismasan/validations_for.rb
Declarative AM validations depending on arbitrary attributes
# class Page
# include ValidationsFor
#
# validations_for page_type: 'offer' do
# validates :amount, presence: true
# end
#
# validations_for page_type: 'page' do
# validates :title, presence: true
# end