Skip to content

Fix builds #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
inherit_from: .rubocop_todo.yml

require:
- solidus_dev_support/rubocop

AllCops:
TargetRubyVersion: 3.0
NewCops: disable

SuggestExtensions: false
154 changes: 0 additions & 154 deletions .rubocop_todo.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parallel: true # default: false
format: progress # default: Standard::Formatter
ignore:
- "dummy-app/**/*"
- "sandbox/**/*"
28 changes: 13 additions & 15 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
# frozen_string_literal: true

source 'https://rubygems.org'
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

branch = ENV.fetch('SOLIDUS_BRANCH', 'main')
gem 'solidus', github: 'solidusio/solidus', branch: branch
branch = ENV.fetch("SOLIDUS_BRANCH", "main")
gem "solidus", github: "solidusio/solidus", branch: branch

# Needed to help Bundler figure out how to resolve dependencies,
# otherwise it takes forever to resolve them.
# See https://github.com/bundler/bundler/issues/6677
gem 'rails', '>0.a'

gem 'rubocop-rails-omakase'
gem "rails", ">0.a"

# Provides basic authentication functionality for testing parts of your engine
gem 'solidus_auth_devise'
gem "solidus_auth_devise"

case ENV['DB']
when 'mysql'
gem 'mysql2'
when 'postgresql'
gem 'pg'
case ENV["DB"]
when "mysql"
gem "mysql2"
when "postgresql"
gem "pg"
else
gem 'sqlite3'
gem "sqlite3"
end

group :test do
gem 'rails-controller-testing'
gem "rails-controller-testing"
end

gemspec

# Use a local Gemfile to include development dependencies that might not be
# relevant for the project or for other contributors, e.g.: `gem 'pry-debug'`.
send :eval_gemfile, 'Gemfile-local' if File.exist? 'Gemfile-local'
send :eval_gemfile, "Gemfile-local" if File.exist? "Gemfile-local"
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# frozen_string_literal: true

require "bundler/gem_tasks"
require 'solidus_dev_support/rake_tasks'
require "solidus_dev_support/rake_tasks"
SolidusDevSupport::RakeTasks.install

task :default do
require 'bundler'
require "bundler"
Bundler.with_unbundled_env do
sh 'bin/rspec'
sh "bin/rspec"
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module InstanceMethods
private

def product_does_not_belong_to_store
render json: { message: I18n.t('spree.errors.products_from_different_stores_may_not_be_added_to_this_order') },
render json: {message: I18n.t("spree.errors.products_from_different_stores_may_not_be_added_to_this_order")},
status: :unprocessable_entity
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/spree/admin/stores_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class StoresController < Spree::Admin::ResourceController

def index
@stores = @stores.ransack(name_or_domains_or_code_cont: params[:q]).result if params[:q]
@stores = @stores.where(id: params[:ids].split(',')) if params[:ids]
@stores = @stores.where(id: params[:ids].split(",")) if params[:ids]

respond_with(@stores) do |format|
format.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def tree(root_taxon:, item_classes:, current_item_classes:, max_level:)
classes = item_classes
if current_item_classes && current_taxon&.self_and_ancestors&.include?(taxon)
classes = [classes,
current_item_classes].join(' ')
current_item_classes].join(" ")
end

content_tag :li, class: classes do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ def self.prepended(base)
end

def show
@variants = @product.
variants_including_master.
display_includes.
with_prices(current_pricing_options).
includes([:option_values, :images])
@variants = @product
.variants_including_master
.display_includes
.with_prices(current_pricing_options)
.includes([:option_values, :images])
@taxonomies = get_taxonomies
@product_properties = @product.product_properties.includes(:property)
@taxon = Spree::Taxon.find(params[:taxon_id]) if params[:taxon_id]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def self.prepended(base)

def mine
super
@shipments = @shipments.where(spree_orders: { store_id: current_store.id }) if @shipments
@shipments = @shipments.where(spree_orders: {store_id: current_store.id}) if @shipments
end

::Spree::Api::ShipmentsController.prepend(self) if SolidusMultiDomain::Engine.api_available?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module SolidusMultiDomain
module UsersControllerDecorator
def show
load_object
@orders = @user.orders.complete.by_store(current_store).order('completed_at desc')
@orders = @user.orders.complete.by_store(current_store).order("completed_at desc")
end

::UsersController.prepend(self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ def self.prepended(base)
base.module_eval do
def get_taxonomies
@taxonomies ||= if current_store.present?
::Spree::Taxonomy.where(["store_id = ?",
current_store.id])
else
::Spree::Taxonomy
end
::Spree::Taxonomy.where(["store_id = ?",
current_store.id])
else
::Spree::Taxonomy
end
@taxonomies = @taxonomies.includes(root: :children)
@taxonomies
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ def taxon_preview(taxon, max = 4)
price_scope = ::Spree::Price.where(current_pricing_options.search_arguments)

products = taxon.active_products
.joins(:stores)
.where("spree_products_stores.store_id = ?", current_store.id)
.joins(:prices)
.merge(price_scope)
.select("DISTINCT spree_products.*, spree_products_taxons.position")
.limit(max)
.joins(:stores)
.where("spree_products_stores.store_id = ?", current_store.id)
.joins(:prices)
.merge(price_scope)
.select("DISTINCT spree_products.*, spree_products_taxons.position")
.limit(max)

if products.size < max
products_arel = ::Spree::Product.arel_table
taxon.descendants.each do |descendent_taxon|
to_get = max - products.length
products += descendent_taxon.active_products
.joins(:stores)
.where("spree_products_stores.store_id = ?", current_store.id)
.joins(:prices)
.merge(price_scope)
.select("DISTINCT spree_products.*, spree_products_taxons.position")
.where(products_arel[:id].not_in(products.map(&:id)))
.limit(to_get)
.joins(:stores)
.where("spree_products_stores.store_id = ?", current_store.id)
.joins(:prices)
.merge(price_scope)
.select("DISTINCT spree_products.*, spree_products_taxons.position")
.where(products_arel[:id].not_in(products.map(&:id)))
.limit(to_get)
break if products.size >= max
end
end
Expand Down
Loading