Class OrWhereBuilder
In: lib/or_where_builder.rb
Parent: WhereBuilder

Methods

to_sql  

Public Instance methods

Returns a string by collecting all the conditions and joins them with ’ and ’.

   OrWhereBuilder.new [] do
     equal :column1, 10
     equal :column2, 'book'
   end.to_sql         #=> " or (column1 = 10 and column2 = 'book')"

[Source]

    # File lib/or_where_builder.rb, line 11
11:   def to_sql
12:     " or (#{sql_parts.join(' and ')})"
13:   end

[Validate]