search for: conditions_by_like

Displaying 2 results from an estimated 2 matches for "conditions_by_like".

2008 Aug 24
3
tricky include question
...e tables that are associated to other tables in the actual include statement but not to the original table call. In this case the furnii table. this is my original query @furnii_from_furnii = Furni.find :all, :include =>[:raider, {:imageasset => :skin}], :conditions => ""+Furni.conditions_by_like(@search)+" OR " +Raider.conditions_by_like(@search) + "OR" +Skin.conditions_by_like(@search) + "" now I need to include 2 more tables skintype and skinstyle. these 2 tables are not associated to either furnii or imageassets but have an association to the skin table, w...
2008 Jun 26
6
ActiveRecord search Query Question
...tting it and trying to do a loop for the newly splitted string. Here is when I get the error "can''t convert Array into String". I''m sure that I''m doing some logical mistakes but I''m new to ruby on rails so please forgive me. hope some one can help def conditions_by_like(value, *columns) myArray = value.gsub(/[^\A-Za-z0-9\s]/, "").split(/ /) myArray.each do |itemz| columns = self.user_columns if columns.size==0 columns = columns[0] if columns[0].kind_of?(Array) conditions = columns.map { |c| c = c.name if c.kind_of? Active...