Class AndWhereBuilder
In: lib/and_where_builder.rb
Parent: WhereBuilder

Methods

to_sql  

Public Instance methods

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

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

[Source]

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

[Validate]