mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #12491 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.25.0
chore(deps-dev): bump rubocop-rails from 2.24.1 to 2.28.0
This commit is contained in:
@@ -683,10 +683,10 @@ GEM
|
||||
rubocop (~> 1.41)
|
||||
rubocop-factory_bot (2.25.1)
|
||||
rubocop (~> 1.41)
|
||||
rubocop-rails (2.24.1)
|
||||
rubocop-rails (2.28.0)
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.33.0, < 2.0)
|
||||
rubocop (>= 1.52.0, < 2.0)
|
||||
rubocop-ast (>= 1.31.1, < 2.0)
|
||||
rubocop-rspec (2.29.2)
|
||||
rubocop (~> 1.40)
|
||||
|
||||
@@ -32,6 +32,6 @@ class Invoice < ApplicationRecord
|
||||
end
|
||||
|
||||
def previous_invoice
|
||||
order.invoices.where("id < ?", id).first
|
||||
order.invoices.where(id: ...id).first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -53,7 +53,7 @@ class OrderCycle < ApplicationRecord
|
||||
Time.zone.now,
|
||||
Time.zone.now)
|
||||
}
|
||||
scope :active_or_complete, lambda { where('order_cycles.orders_open_at <= ?', Time.zone.now) }
|
||||
scope :active_or_complete, lambda { where(order_cycles: { orders_open_at: ..Time.zone.now }) }
|
||||
scope :inactive, lambda {
|
||||
where('order_cycles.orders_open_at > ? OR order_cycles.orders_close_at < ?',
|
||||
Time.zone.now,
|
||||
@@ -64,8 +64,8 @@ class OrderCycle < ApplicationRecord
|
||||
where('order_cycles.orders_close_at > ? OR order_cycles.orders_close_at IS NULL', Time.zone.now)
|
||||
}
|
||||
scope :closed, lambda {
|
||||
where('order_cycles.orders_close_at < ?',
|
||||
Time.zone.now).order("order_cycles.orders_close_at DESC")
|
||||
where(order_cycles: { orders_close_at: ...Time.zone.now })
|
||||
.order("order_cycles.orders_close_at DESC")
|
||||
}
|
||||
scope :unprocessed, -> { where(processed_at: nil) }
|
||||
scope :undated, -> { where('order_cycles.orders_open_at IS NULL OR orders_close_at IS NULL') }
|
||||
|
||||
@@ -126,7 +126,7 @@ module Spree
|
||||
end
|
||||
|
||||
def address_and_city
|
||||
[address1, address2, city].select(&:present?).join(' ')
|
||||
[address1, address2, city].compact_blank.join(' ')
|
||||
end
|
||||
|
||||
private
|
||||
@@ -176,7 +176,7 @@ module Spree
|
||||
end
|
||||
|
||||
def render_address(parts)
|
||||
parts.select(&:present?).join(', ')
|
||||
parts.compact_blank.join(', ')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,7 +18,7 @@ class AddressGeocoder
|
||||
attr_reader :address
|
||||
|
||||
def geocode_address
|
||||
address_parts.select(&:present?).join(', ')
|
||||
address_parts.compact_blank.join(', ')
|
||||
end
|
||||
|
||||
def address_parts
|
||||
|
||||
@@ -90,9 +90,7 @@ module OrderManagement
|
||||
end
|
||||
|
||||
def in_range_order_cycles
|
||||
order_cycles.where("orders_close_at >= ? AND orders_close_at <= ?",
|
||||
begins_at,
|
||||
ends_at || 100.years.from_now)
|
||||
order_cycles.where(orders_close_at: begins_at..ends_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,9 +18,9 @@ class RemoveTransientData
|
||||
def call
|
||||
Rails.logger.info("#{self.class.name}: processing")
|
||||
|
||||
Spree::StateChange.where("created_at < ?", expiration_date).delete_all
|
||||
Spree::LogEntry.where("created_at < ?", expiration_date).delete_all
|
||||
Session.where("updated_at < ?", expiration_date).delete_all
|
||||
Spree::StateChange.where(created_at: ...expiration_date).delete_all
|
||||
Spree::LogEntry.where(created_at: ...expiration_date).delete_all
|
||||
Session.where(updated_at: ...expiration_date).delete_all
|
||||
|
||||
clear_old_cart_data!
|
||||
end
|
||||
|
||||
@@ -44,7 +44,7 @@ WebMock.disable_net_connect!(
|
||||
|
||||
# Requires supporting ruby files with custom matchers and macros, etc,
|
||||
# in spec/support/ and its subdirectories.
|
||||
Dir[Rails.root.join("spec/support/**/*.rb")].sort.each { |f| require f }
|
||||
Rails.root.glob("spec/support/**/*.rb").sort.each { |f| require f }
|
||||
|
||||
Capybara.server = :puma
|
||||
Capybara.disable_animation = true
|
||||
|
||||
@@ -37,7 +37,7 @@ module Reporting
|
||||
order.line_items[0].variant.product.update(name: "Cucumber")
|
||||
order.line_items[1].variant.product.update(name: "Apple")
|
||||
order.line_items[2].variant.product.update(name: "Banane")
|
||||
product_names = report.rows.map(&:product).filter(&:present?)
|
||||
product_names = report.rows.map(&:product).compact_blank
|
||||
expect(product_names).to eq(["Apple", "Banane", "Cucumber"])
|
||||
end
|
||||
end
|
||||
@@ -84,7 +84,7 @@ module Reporting
|
||||
order.line_items[0].variant.product.update(name: "Cucumber")
|
||||
order.line_items[1].variant.product.update(name: "Apple")
|
||||
order.line_items[2].variant.product.update(name: "Banane")
|
||||
product_names = report.rows.map(&:product).filter(&:present?)
|
||||
product_names = report.rows.map(&:product).compact_blank
|
||||
# only the supplier's variant is displayed
|
||||
expect(product_names).to include("Cucumber")
|
||||
expect(product_names).not_to include("Apple", "Banane")
|
||||
|
||||
Reference in New Issue
Block a user