I have the following code:
condition_clause = "%#{@phrase}%"
logger.info "condition is #{condition_clause}"
unless @phrase.nil?
condition = Caboose::EZ::Condition.new :affiliates do
affiliate_name =~ "%#{@phrase}%" # <<< here's the problem
end
options[:conditions] = condition.to_sql
logger.info "ajax param is #{@phrase}"
logger.info "ez condition is #{condition.to_sql}"
end
The output from the logs is:
ajax param is map
ez condition is
In other words, the the where clause is not being constructed. However,
if I
change the line marked above to:
affiliate_name =~ condition_clause # <<< here’s the fix
Everything works. I’ve ascertained that by the time I’m in operator=~,
all
that’s left is ‘%%’.
Is there something obvious I’ve missed about this straightforward
variable
interpolation?
TIA
–
View this message in context:
http://www.nabble.com/ez_where-%3A-i'm-puzzled-t1455038.html#a3932303
Sent from the RubyOnRails Users forum at Nabble.com.