Sha256: 01ba9d092ec0e5a3b53680ff72a26c037deecef7585badc1de1024195b73ddeb

Contents?: true

Size: 325 Bytes

Versions: 1

Compression:

Stored size: 325 Bytes

Contents

module MakeFlaggable
  module Flaggable
    extend ActiveSupport::Concern

    included do
      has_many :flaggings, :class_name => "MakeFlaggable::Flagging", :as => :flaggable
    end

    module ClassMethods
      def flaggable?
        true
      end
    end

    def flagged?
      flaggings.count > 0
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
make_flaggable-0.0.2 lib/make_flaggable/flaggable.rb