Apply Layout/RedundantLineBreak rule to short lines
We're not adding the rule because it would apply the current line length rule of 110 characters per line. We still haven't decided whether we'll keep that rule or make lines shorter so they're easier to read, particularly when vertically splitting the editor window. So, for now, I'm applying the rule to lines which are about 90 characters long.
This commit is contained in:
@@ -292,8 +292,7 @@ class Budget
|
||||
end
|
||||
|
||||
def valid_heading?(user)
|
||||
voted_in?(heading, user) ||
|
||||
can_vote_in_another_heading?(user)
|
||||
voted_in?(heading, user) || can_vote_in_another_heading?(user)
|
||||
end
|
||||
|
||||
def can_vote_in_another_heading?(user)
|
||||
|
||||
@@ -31,9 +31,7 @@ class Budget
|
||||
|
||||
def store_reclassified_votes(reason)
|
||||
ballot_lines_for_investment.order(:id).each do |line|
|
||||
attrs = { user: line.ballot.user,
|
||||
investment: self,
|
||||
reason: reason }
|
||||
attrs = { user: line.ballot.user, investment: self, reason: reason }
|
||||
Budget::ReclassifiedVote.create!(attrs)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,10 +11,7 @@ class Dashboard::Action < ApplicationRecord
|
||||
|
||||
enum action_type: [:proposed_action, :resource]
|
||||
|
||||
validates :title,
|
||||
presence: true,
|
||||
allow_blank: false,
|
||||
length: { in: 4..80 }
|
||||
validates :title, presence: true, allow_blank: false, length: { in: 4..80 }
|
||||
|
||||
validates :action_type, presence: true
|
||||
|
||||
|
||||
@@ -24,13 +24,11 @@ class Organization < ApplicationRecord
|
||||
end
|
||||
|
||||
def verified?
|
||||
verified_at.present? &&
|
||||
(rejected_at.blank? || rejected_at < verified_at)
|
||||
verified_at.present? && (rejected_at.blank? || rejected_at < verified_at)
|
||||
end
|
||||
|
||||
def rejected?
|
||||
rejected_at.present? &&
|
||||
(verified_at.blank? || verified_at < rejected_at)
|
||||
rejected_at.present? && (verified_at.blank? || verified_at < rejected_at)
|
||||
end
|
||||
|
||||
def self.search(text)
|
||||
|
||||
@@ -106,15 +106,13 @@ class Poll < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.votable_by(user)
|
||||
answerable_by(user).
|
||||
not_voted_by(user)
|
||||
answerable_by(user).not_voted_by(user)
|
||||
end
|
||||
|
||||
def votable_by?(user)
|
||||
return false if user_has_an_online_ballot?(user)
|
||||
|
||||
answerable_by?(user) &&
|
||||
not_voted_by?(user)
|
||||
answerable_by?(user) && not_voted_by?(user)
|
||||
end
|
||||
|
||||
def user_has_an_online_ballot?(user)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
class RelatedContentScore < ApplicationRecord
|
||||
SCORES = {
|
||||
POSITIVE: 1,
|
||||
NEGATIVE: -1
|
||||
}.freeze
|
||||
SCORES = { POSITIVE: 1, NEGATIVE: -1 }.freeze
|
||||
|
||||
belongs_to :related_content, touch: true, counter_cache: :related_content_scores_count
|
||||
belongs_to :user
|
||||
|
||||
@@ -12,8 +12,7 @@ class Verification::Letter
|
||||
validate :validate_correct_code, if: :verify?
|
||||
|
||||
def save
|
||||
valid? &&
|
||||
letter_requested!
|
||||
valid? && letter_requested!
|
||||
end
|
||||
|
||||
def save!
|
||||
|
||||
Reference in New Issue
Block a user