app/models/decidim/proposals/proposal.rb in decidim-proposals-0.4.0 vs app/models/decidim/proposals/proposal.rb in decidim-proposals-0.4.1

- old
+ new

@@ -21,10 +21,11 @@ geocoded_by :address, http_headers: ->(proposal) { { "Referer" => proposal.feature.organization.host } } scope :accepted, -> { where(state: "accepted") } scope :rejected, -> { where(state: "rejected") } + scope :evaluating, -> { where(state: "evaluating") } def self.order_randomly(seed) transaction do connection.execute("SELECT setseed(#{connection.quote(seed)})") order("RANDOM()").load @@ -63,9 +64,16 @@ # Public: Checks if the organization has rejected a proposal. # # Returns Boolean. def rejected? state == "rejected" + end + + # Public: Checks if the organization has marked the proposal as evaluating it. + # + # Returns Boolean. + def evaluating? + state == "evaluating" end # Public: Overrides the `commentable?` Commentable concern method. def commentable? feature.settings.comments_enabled?