mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-18 21:56:55 -04:00
Rubocop
This commit is contained in:
@@ -546,13 +546,6 @@ Style/GlobalStdStream:
|
||||
- 'config/environments/production.rb'
|
||||
- 'lib/tasks/openfarm.rake'
|
||||
|
||||
# Offense count: 1
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
|
||||
Style/GuardClause:
|
||||
Exclude:
|
||||
- 'app/models/photo_association.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Style/IfUnlessModifier:
|
||||
@@ -623,12 +616,6 @@ Style/RedundantFetchBlock:
|
||||
Exclude:
|
||||
- 'config/puma.rb'
|
||||
|
||||
# Offense count: 4
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Style/RedundantFreeze:
|
||||
Exclude:
|
||||
- 'lib/haml/filters/growstuff_markdown.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowModifier.
|
||||
|
||||
@@ -33,8 +33,8 @@ class PhotoAssociation < ApplicationRecord
|
||||
end
|
||||
|
||||
def crop_present
|
||||
if %w(Planting Seed Harvest).include?(photographable_type)
|
||||
errors.add(:crop_id, "failed to calculate crop") if crop_id.blank?
|
||||
end
|
||||
return unless %w(Planting Seed Harvest).include?(photographable_type)
|
||||
|
||||
errors.add(:crop_id, "failed to calculate crop") if crop_id.blank?
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,10 +15,10 @@ module Haml::Filters
|
||||
|
||||
private
|
||||
|
||||
CROP_REGEX = /(?<!\\)\[([^\[\]]+?)\]\(crop\)/.freeze
|
||||
MEMBER_REGEX = /(?<!\\)\[([^\[\]]+?)\]\(member\)/.freeze
|
||||
MEMBER_AT_REGEX = /(?<!\\)(@\w+)/.freeze
|
||||
MEMBER_ESCAPE_AT_REGEX = /(?<!\\)\\(?=@\w+)/.freeze
|
||||
CROP_REGEX = /(?<!\\)\[([^\[\]]+?)\]\(crop\)/
|
||||
MEMBER_REGEX = /(?<!\\)\[([^\[\]]+?)\]\(member\)/
|
||||
MEMBER_AT_REGEX = /(?<!\\)(@\w+)/
|
||||
MEMBER_ESCAPE_AT_REGEX = /(?<!\\)\\(?=@\w+)/
|
||||
HOST = Rails.application.config.host
|
||||
|
||||
def expand_crops!
|
||||
|
||||
Reference in New Issue
Block a user