| Class | AndWhereBuilder |
| In: |
lib/and_where_builder.rb
|
| Parent: | WhereBuilder |
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')"
# File lib/and_where_builder.rb, line 10
10: def to_sql
11: " and (#{sql_parts.join(' and ')})"
12: end