module LinkedRails::Policy::AttributeConditions

Private Instance Methods

check_has_properties(properties) click to toggle source
# File lib/linked_rails/policy/attribute_conditions.rb, line 10
def check_has_properties(properties)
  properties.all? { |k, v| @record.send(k).nil? != v }
end
check_has_values(values) click to toggle source
# File lib/linked_rails/policy/attribute_conditions.rb, line 14
def check_has_values(values)
  values.all? { |k, v| @record.send(k) == v }
end
check_new_record(boolean) click to toggle source
# File lib/linked_rails/policy/attribute_conditions.rb, line 18
def check_new_record(boolean)
  @record.new_record? == boolean
end