Fixed redundant scope condition

Redundant scope condition found in Proposal.created_by scope. It has
been removed.
This commit is contained in:
Juan Salvador Pérez García
2018-06-22 17:44:46 +02:00
parent 3ee9f9b059
commit 3eaf8dbe9f

View File

@@ -75,7 +75,7 @@ class Proposal < ActiveRecord::Base
scope :not_supported_by_user, ->(user) { where.not(id: user.find_voted_items(votable_type: "Proposal").compact.map(&:id)) } scope :not_supported_by_user, ->(user) { where.not(id: user.find_voted_items(votable_type: "Proposal").compact.map(&:id)) }
scope :published, -> { where.not(published_at: nil) } scope :published, -> { where.not(published_at: nil) }
scope :draft, -> { where(published_at: nil) } scope :draft, -> { where(published_at: nil) }
scope :created_by, ->(author) { unscoped.where(hidden_at: nil, author: author) } scope :created_by, ->(author) { where(author: author) }
def url def url
proposal_path(self) proposal_path(self)