-
Notifications
You must be signed in to change notification settings - Fork 241
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
spree 4.7 #201
base: master
Are you sure you want to change the base?
spree 4.7 #201
Conversation
end | ||
end | ||
|
||
::Spree::Admin::ProductsController.prepend(::SpreeRelatedProducts::Spree::Admin::ProductsControllerDecorator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [109/80]
module SpreeRelatedProducts | ||
module Spree | ||
module Admin | ||
module ProductsControllerDecorator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/Documentation: Missing top-level module documentation comment.
@@ -0,0 +1,14 @@ | |||
module SpreeRelatedProducts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
@@ -1,3 +1,5 @@ | |||
require_dependency 'spree/calculator' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
# Merge in the relation_filter if it's available | ||
result = result.merge(self.class.relation_filter) if relation_filter | ||
|
||
# make sure results are in same order as related_ids array (position order) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [83/80]
base.extend ClassMethods | ||
end | ||
|
||
module ClassMethods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/Documentation: Missing top-level module documentation comment.
module ProductDecorator | ||
def self.prepended(base) | ||
base.has_many :relations, -> { order(:position) }, class_name: 'Spree::Relation', as: :relatable | ||
base.has_many :relation_types, -> { distinct }, class_name: 'Spree::RelationType', through: :relations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [110/80]
module Spree | ||
module ProductDecorator | ||
def self.prepended(base) | ||
base.has_many :relations, -> { order(:position) }, class_name: 'Spree::Relation', as: :relatable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [104/80]
# frozen_string_literal: true | ||
module SpreeRelatedProducts | ||
module Spree | ||
module ProductDecorator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/Documentation: Missing top-level module documentation comment.
@@ -0,0 +1,119 @@ | |||
# frozen_string_literal: true | |||
module SpreeRelatedProducts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/EmptyLineAfterMagicComment: Add an empty line after magic comments.
No description provided.