My favorites
▼
|
Sign in
substruct
Open-source Ruby on Rails E-Commerce
Project Home
Downloads
Wiki
Issues
Source
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
39
attachment: orders_by_country_counter.patch
(898 bytes)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Index: /home/edmundo/workspace_aptana/substruct_trunk/vendor/plugins/substruct/app/models/country.rb
===================================================================
--- /home/edmundo/workspace_aptana/substruct_trunk/vendor/plugins/substruct/app/models/country.rb (revision 43)
+++ /home/edmundo/workspace_aptana/substruct_trunk/vendor/plugins/substruct/app/models/country.rb (working copy)
@@ -6,9 +6,8 @@
def number_of_orders
sql = "SELECT COUNT(*) as count "
sql << "FROM orders "
- sql << "INNER JOIN order_users ON order_users.id = orders.order_user_id "
sql << "INNER JOIN order_addresses ON ( "
- sql << " order_addresses.country_id = #{self.id} AND order_addresses.order_user_id = order_users.id "
+ sql << " order_addresses.country_id = #{self.id} AND order_addresses.id = orders.shipping_address_id "
sql << ");"
Order.count_by_sql(sql)
end
Powered by
Google Project Hosting