| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Potion Store
Revision: 75
Author: andykim78
Date: 30 Jun 2008 05:22:55
Changes:PostgreSQL 8.3 compatibility and case insensitive search in lost license page
Files:| ... | ...@@ -11,11 +11,14 @@ | |
| 11 | 11 | conditions = "status != 'P'" |
| 12 | 12 | if q |
| 13 | 13 | q = q.strip().downcase() |
| 14 | conditions = conditions + " AND (LOWER(email) LIKE '#{q}%' OR | |
| 15 | LOWER(first_name) LIKE '#{q}%' OR | |
| 16 | LOWER(last_name) LIKE '#{q}%' OR | |
| 17 | LOWER(licensee_name) LIKE '%#{q}%' OR | |
| 18 | id LIKE '#{q}')" | |
| 14 | if q.to_i != 0 | |
| 15 | conditions = [conditions + "AND id=?", q.to_i] | |
| 16 | else | |
| 17 | conditions = [conditions + " AND (LOWER(email) LIKE ? OR | |
| 18 | LOWER(first_name) LIKE ? OR | |
| 19 | LOWER(last_name) LIKE ? OR | |
| 20 | LOWER(licensee_name) LIKE ?)", "#{q}%", "#{q}%", "#{q}%", "%#{q}%"] | |
| 21 | end | |
| 19 | 22 | end |
| 20 | 23 | @orders = Order.paginate :page => (params[:page] || 1), :per_page => 100, :conditions => conditions, :order => 'order_time DESC' |
| 21 | 24 |
| ... | ...@@ -1,3 +1,7 @@ | |
| 1 | 2008-06-30 Andy Kim <andy@potionfactory.com> | |
| 2 | * Case insensitive match of email in lost license controller | |
| 3 | * Order searching in admin interface broke with PostgreSQL 8.3. Fixed. | |
| 4 | ||
| 1 | 5 | 2008-06-27 Andy Kim <andy@potionfactory.com> |
| 2 | 6 | * Admin order edit form wasn't setting a license key to a product added to the order |
| 3 | 7 | * Don't show inactive products in order edit form if the order doesn't have said product already |
| ... | ...@@ -10,8 +10,8 @@ | |
| 10 | 10 | render :action => 'index' and return |
| 11 | 11 | end |
| 12 | 12 | |
| 13 | email = params[:email].strip() | |
| 14 | orders = Order.find(:all, :conditions => ['status=\'C\' AND email=?', email]) | |
| 13 | email = params[:email].strip().downcase() | |
| 14 | orders = Order.find(:all, :conditions => ["status='C' AND LOWER(email)=?", email]) | |
| 15 | 15 | if orders.empty? |
| 16 | 16 | flash[:notice] = "Could not find any orders for " + email |
| 17 | 17 | @email = email |