This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
named_scope :with_keywords, lambda {|q| | |
fields = %w(title information items.sku) | |
tokens = q.split.collect {|c| "%#{c.downcase}%"} | |
clause = (["(" + fields.map {|f| "#{f} LIKE ?" }.join(" OR ") + ")"] * tokens.size).join(" AND ") | |
{ :include => [:items], :conditions => [clause, *(tokens * fields.size).sort] } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################# | |
# Application | |
############################################################# | |
set :application, "" #your app's name here | |
set :server_ip, "" #your server's ip here | |
set :deploy_to, "/home/rails/#{application}" #the path to your rails app here | |
############################################################# | |
# Servers |
NewerOlder