Answers for "parameterized scope rails code"

0

parameterized scope rails code

scope :by_post_status, -> (post_status) { where('post_status = ?', post_status) }
scope :published, -> { by_post_status("public") }
scope :draft, -> { by_post_status("draft") }
Posted by: Guest on March-17-2021

Browse Popular Code Answers by Language