module AR::Check::CommandRecorder
Public Instance Methods
add_check(table, constraint_name, expression)
click to toggle source
Usage:
add_check :users, :check_user_age, "age > 18"
# File lib/ar/check/command_recorder.rb, line 10 def add_check(table, constraint_name, expression) record(__method__, [table, constraint_name, expression]) end
invert_add_check(args)
click to toggle source
# File lib/ar/check/command_recorder.rb, line 22 def invert_add_check(args) table, constraint_name, _ = args [:remove_check, [table, constraint_name]] end
remove_check(table, constraint_name)
click to toggle source
Usage:
remove_check :users, :check_user_age
# File lib/ar/check/command_recorder.rb, line 18 def remove_check(table, constraint_name) record(__method__, [table, constraint_name]) end