forgeplus/app/models/concerns/publicable.rb

9 lines
185 B
Ruby
Raw Normal View History

2020-03-09 00:40:16 +08:00
module Publicable
extend ActiveSupport::Concern
included do
scope :visible, -> { where(is_public: true) }
scope :is_private, -> {where(is_public: false)}
2020-03-09 00:40:16 +08:00
end
end