lib/magento/order_item.rb in magentor-0.2.0 vs lib/magento/order_item.rb in magentor-0.2.1
- old
+ new
@@ -1,10 +1,10 @@
module Magento
class OrderItem < Base
class << self
def find_by_id(id)
Order.list.each do |order|
- Order.find_by_increment_id(order.increment_id).order_items.select{ |i| i.id == id }
+ Order.find_by_increment_id(order.increment_id).order_items.select{ |i| i.id == id }.first
end
end
def find_by_order_and_id(order_id, id)
Order.find_by_id(order_id).order_items.select{ |i| i.id == id }
\ No newline at end of file