Address some Rubocop violations

This commit is contained in:
Pau Perez
2020-04-17 17:00:11 +02:00
parent 04c962432a
commit 6dd4a866e5
2 changed files with 2 additions and 4 deletions

View File

@@ -173,7 +173,6 @@ Naming/MethodParameterName:
Naming/PredicateName:
Exclude:
- 'spec/**/*'
- 'app/mailers/producer_mailer.rb'
- 'app/models/enterprise.rb'
- 'app/models/enterprise_relationship.rb'
- 'app/models/order_cycle.rb'
@@ -630,7 +629,6 @@ Style/FrozenStringLiteralComment:
- 'app/jobs/subscription_placement_job.rb'
- 'app/jobs/welcome_enterprise_job.rb'
- 'app/mailers/enterprise_mailer.rb'
- 'app/mailers/producer_mailer.rb'
- 'app/mailers/spree/base_mailer_decorator.rb'
- 'app/mailers/spree/order_mailer_decorator.rb'
- 'app/mailers/spree/user_mailer.rb'

View File

@@ -17,7 +17,7 @@ class ProducerMailer < Spree::BaseMailer
order_cycle_subject = I18n.t('producer_mailer.order_cycle.subject', producer: producer.name)
subject = "[#{Spree::Config.site_name}] #{order_cycle_subject}"
return unless has_orders?(order_cycle, producer)
return unless orders?(order_cycle, producer)
mail(
to: @producer.contact.email,
@@ -32,7 +32,7 @@ class ProducerMailer < Spree::BaseMailer
private
def has_orders?(order_cycle, producer)
def orders?(order_cycle, producer)
line_items_from(order_cycle, producer).any?
end