cond = EZ::Where::Condition.new do
category_id === [category_id] # these are integers coming in
state_id === [state_id] # same
term_id === [term_id] # same
city =~ ‘%city’ # this would be a string
title =~ ‘%title’ # string as well
I don’t know this plugin at all, but normally you need to give a
|thingie| in a block, so my guess would be:
cond = EZ::Where::Condition.new do |ez|
ez.category_id === [category_id] # these are integers coming in
ez.state_id === [state_id] # same
ez.term_id === [term_id] # same
ez.city =~ ‘%city’ # this would be a string
ez.title =~ ‘%title’ # string as well
RAILS_ROOT: ./script/…/config/…
term_id === [term_id] # same
Or something similar.
Cheers
No, ‘=~’ maps to a LIKE SQL action, so the format specified is correct.
He is missing a table name for the block… It should be something
like this…
cond = EZ::Where::Condition.new :some_table_name do
category_id === [category_id] # these are integers coming in
state_id === [state_id] # same
term_id === [term_id] # same
city =~ ‘%city’ # this would be a string
title =~ ‘%title’ # string as well
end
_Kevin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.