Sha256: 938e9597b3edba2307257d9ed779bc1baa60b609c2941a37182b509ef32145d3
Contents?: true
Size: 598 Bytes
Versions: 9
Compression:
Stored size: 598 Bytes
Contents
require 'active_support/concern' module Georgia module Concerns module Publishable extend ActiveSupport::Concern included do scope :published, where(public: true) def publish self.update_attribute(:public, true) end def unpublish self.update_attribute(:public, false) end def public? self.public end alias_method :published?, :public? def publish_state public? ? 'public' : 'private' end end module ClassMethods end end end end
Version data entries
9 entries across 9 versions & 1 rubygems