Skip to content

Commit

Permalink
Убираем костыль, который не работает на 7 рельсах
Browse files Browse the repository at this point in the history
  • Loading branch information
liplenka authored and hbda committed Aug 18, 2023
1 parent 0a426f0 commit 7acf7ac
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions lib/insales_api/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,5 @@

module InsalesApi
class Order < Base
extend Resource::WithUpdatedSince

def order_lines_attributes
@order_lines_attributes = order_lines.map do |order_line|
ol = order_line.as_json
# при смене версии рельсов (видимо) изменилась сериализация
ol = ol['order_line'] if ol['order_line']
ol
end
end

def to_xml(options = {})
serialized_options = options.dup
if respond_to? :order_lines_attributes
serialized_options[:methods] = :order_lines_attributes
end
super(serialized_options)
end

def paid?
financial_status == 'paid'
end
end
extend Resource::WithUpdatedSince; end
end

0 comments on commit 7acf7ac

Please sign in to comment.