Sha256: 941859693f69fc72851aa296e7bc9c453fbe3bef6cf07e0d6d42bee78cc1e019

Contents?: true

Size: 525 Bytes

Versions: 3

Compression:

Stored size: 525 Bytes

Contents

module ActsAsTaggableOnDynamic
  module Utils

    def self.included(base)
      base.send :include, ActsAsTaggableOnDynamic::Utils::InstanceMethods
    end

    module InstanceMethods

      ##
      # Return an array of context names which are valid for the given model type
      #
      # Example:
      #   self.tag_context_list => ['tags']
      #
      def tag_context_list
        ActsAsTaggableOn::Tagging.where("taggable_type = '#{self.class.name}'").select(:context).uniq.map(&:context)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
acts-as-taggable-on-dynamic-0.0.3 lib/acts_as_taggable_on_dynamic/utils.rb
acts-as-taggable-on-dynamic-0.0.2 lib/acts_as_taggable_on_dynamic/utils.rb
acts-as-taggable-on-dynamic-0.0.1 lib/acts_as_taggable_on_dynamic/utils.rb