Sha256: 1c74dba3c89ef9421e80cefe8ca769ed4d3ff4902195999d21ecaf858e5e6a9d

Contents?: true

Size: 674 Bytes

Versions: 1

Compression:

Stored size: 674 Bytes

Contents

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

    module InstanceMethods

      ###
      # This method allows to set the owner of the tags which will be set
      # during the next operations
      #
      def tag_owner=(owner)
        @tag_owner = owner
      end

      ###
      # Returns the tag owner which was set
      #
      def tag_owner
        @tag_owner || nil
      end

      ###
      # Validates if the auto tag ownership enabled
      #
      def is_auto_tag_ownership_enabled?
        (self.tag_owner != nil)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts-as-taggable-on-dynamic-0.0.3 lib/acts_as_taggable_on_dynamic/tag_owner.rb