:full is the default; I set it on anyway and tried to search where my field
named "entity" != _ART.
It didn't work, and the log says this:
"entity"=>{"from"=>"_ART", "to"=>"", "opt"=>"!="},
When I try the same search with "CONTAINS" instead of "!=", it does what I
expect and the log says this:
"entity"=>{"from"=>"_ART", "to"=>"", "opt"=>"%?%"},
I used Volker's advice, changing finder.rb
StringComparators = {
:doesnt_contain => '!%?%', #<-- added this line
:contains => '%?%',
:begins_with => '?%',
:ends_with => '%?'
}
and also around line 94:
elsif
ActiveScaffold::Finder::StringComparators.values.include?(value[:opt])
if value[:opt].match(/\!/)
value[:opt].delete! "!"
["#{column.search_sql} NOT LIKE ?", value[:opt].sub('?',
value[:from])]
else
["#{column.search_sql} LIKE ?", value[:opt].sub('?',
value[:from])]
end
Seems to be working.
Thanks all!
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/activescaffold/-/TXNUaEF3VTRnMFVK.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.