From ec36ac619fe6eb9ef6f785b65ffd43e98b5566b0 Mon Sep 17 00:00:00 2001 From: benji Date: Sat, 4 Apr 2015 03:38:29 +0200 Subject: [PATCH] use english locale --- app/models/order.rb | 2 +- app/models/order_item.rb | 2 +- app/views/users/show.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/order.rb b/app/models/order.rb index a73aba2..cf6a450 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -48,7 +48,7 @@ class Order < ActiveRecord::Base def to_sentence self.order_items.map { - |oi| oi.count.to_s + " " + oi.product.name.pluralize(oi.count, :nl) + |oi| pluralize(oi.count, oi.product.name) }.to_sentence end diff --git a/app/models/order_item.rb b/app/models/order_item.rb index 66322be..534e3da 100644 --- a/app/models/order_item.rb +++ b/app/models/order_item.rb @@ -13,7 +13,7 @@ class OrderItem < ActiveRecord::Base belongs_to :product validates :product, presence: true - validates :count, numericality: { only_integer: true, greater_than_or_equal_to: 0, smaller_than_or_equal_to: 10000 } + validates :count, numericality: { only_integer: true, greater_than_or_equal_to: 0 } after_create :remove_from_stock diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 631bca0..b869e1f 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -19,7 +19,7 @@
Specifics:

All orders (<%= @user.orders_count %>)