ãªãã¨ãªãæè¿ããã¤ãã®Webãµã¼ãã¹ã触ã£ã¦ãããããããä½ããã¡ããã¨ããã©ããã ãªã»ã»ã»ãã¨ããã®ãå°ãã ãåãã£ã¦ããã®ã§ãã»ãã¨ã«ãªãã¨ãªãã¡ã¢ã£ã¦ããã ãä¸æ¸ãããå
¬éããstatus=draft/publishedã¨ãpublished=true/falseã§è¡¨ç¾ãã¦ã¯ãããªã class Article < ApplicationRecord belongs_to :user scope :draft, ->{ where(published: false) } scope :published, -> { where(published: true) } def publish! update!(published: true) end ããããã¢ãã«ãä½ã£ã¦ãã¾ã㨠ä¸æ¸ãã¨å
¬éå¾ã§ãè¦ããã¨ãã§ãã人ããç°ãªãã¹ããªãã ãã©ããµã¨ããæåã« Article.find
{{#tags}}- {{label}}
{{/tags}}