Class OnWhereBuilder
In: lib/on_where_builder.rb
Parent: WhereBuilder

Methods

to_sql  

Public Instance methods

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

   OnWhereBuilder.new [] do
     equal :column1, 10
     equal :column2, 'book'
   end.to_sql         #=> " on column1 = 10 and column2 = 'book'"

[Source]

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

[Validate]