Methods
Public Class methods
wraps around an Array in ActiveRecord format [‘column = ?’, 2]
[ show source ]
# File lib/og/ez/clause.rb, line 118
118: def initialize(cond_array)
119: @test = :array
120: @cond_array = cond_array
121: end
Public Instance methods
[ show source ]
# File lib/og/ez/clause.rb, line 123
123: def to_sql
124: return nil if @cond_array.first.to_s.empty?
125: query = (@cond_array.first =~ /^\([^\(\)]+\)$/) ? "#{@cond_array.first}" : "(#{@cond_array.first})"
126: [query, @cond_array[1..@cond_array.length] ]
127: end