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