Auto-correct violationso of Rubocop Layout/*

This commit is contained in:
Kristina Lim
2020-05-14 04:44:23 +08:00
committed by Luis Ramos
parent 0fd66f9a55
commit d1725014c4
2 changed files with 12 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
module Spree
class StockItem < ActiveRecord::Base
belongs_to :stock_location, class_name: 'Spree::StockLocation'
@@ -39,15 +40,17 @@ module Spree
end
private
def count_on_hand=(value)
write_attribute(:count_on_hand, value)
end
def process_backorders
backordered_inventory_units.each do |unit|
return unless in_stock?
unit.fill_backorder
end
def count_on_hand=(value)
write_attribute(:count_on_hand, value)
end
def process_backorders
backordered_inventory_units.each do |unit|
return unless in_stock?
unit.fill_backorder
end
end
end
end

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Spree::StockItem do