Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 4th, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.   searchable do
  2.     text :name
  3.     boolean :online_search
  4.     boolean :offline_search
  5.   end
  6.  
  7.   def online_search
  8.     store.online_store == true
  9.   end
  10.  
  11.   def offline_search
  12.     store.online_store == false
  13.   end
  14.  
  15.   def search_type=(boolean)
  16.     case (boolean)
  17.     when 'online'
  18.       @online_search = true
  19.       @offline_search = false
  20.     when 'offline'
  21.       @online_search = false
  22.       @offline_search = true
  23.     when 'all'
  24.       @online_search = true
  25.       @offline_search = true
  26.     else
  27.     @online_search = true
  28.     @offline_search = true
  29.     end
  30.   end