Method: Filemaker::Model::Selectable#or

Defined in:
lib/filemaker/model/selectable.rb

#or(criterion) {|options| ... } ⇒ Filemaker::Model::Criteria

Used with where to specify how the queries are combined. Default is ‘and’, so you won’t find any and method.

Examples:

Mix with where to ‘or’ query

Model.where(name: 'Bob').or(age: '50')

Parameters:

  • criterion (Hash)

    Hash criterion

Yields:

  • (options)

Returns:



129
130
131
132
133
134
135
136
137
# File 'lib/filemaker/model/selectable.rb', line 129

def or(criterion)
  fail Filemaker::Error::MixedClauseError,
       "Can't mix 'or' with 'in'." if chains.include?(:in)
  @selector ||= {}
  selector.merge!(klass.with_model_fields(criterion))
  options[:lop] = 'or'
  yield options if block_given?
  self
end