feat(announces): anyone can read announces
This commit is contained in:
parent
ff8ed6016e
commit
e4c37758d4
11 changed files with 189 additions and 0 deletions
|
@ -11,4 +11,7 @@ class ReleaseNote < ApplicationRecord
|
|||
|
||||
validates :categories, presence: true, inclusion: { in: CATEGORIES }
|
||||
validates :body, presence: true
|
||||
|
||||
scope :published, -> { where(published: true, released_on: ..Date.current) }
|
||||
scope :for_categories, -> (categories) { where("categories && ARRAY[?]::varchar[]", categories) }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue