Sha256: 05dd89bf9fe8842d942cd4e2337206adf6c63d5d16501382c49e18ca1a488fe0

Contents?: true

Size: 1.15 KB

Versions: 5

Compression:

Stored size: 1.15 KB

Contents

### START Tag Subclasses ###
module Tagtical
  class Tag
    class Language < Tagtical::Tag
    end
    class PartTag < Tagtical::Tag
      
      def dump_value(value)
        value && value.downcase
      end

    end
  end
end
module Tag
  class Skill < Tagtical::Tag

    def load_value(value)
      value.gsub("ball", "baller") if value
    end
    
  end
  class FooCraft < Skill # Multiple levels of inheritance
  end
end
class NeedTag < Tagtical::Tag # Tag subclass ending in "Tag"
end
class Offering < Tagtical::Tag # Top level
end

### END Tag Subclasses ###

class TaggableModel < ActiveRecord::Base
  acts_as_taggable(:languages, :skills, {:crafts => Tag::FooCraft}, :needs, :offerings)
  has_many :untaggable_models
end

class CachedModel < ActiveRecord::Base
  acts_as_taggable
end

class OtherTaggableModel < ActiveRecord::Base
  acts_as_taggable(:languages, :needs, :offerings)
end

class InheritingTaggableModel < TaggableModel
end

class AlteredInheritingTaggableModel < TaggableModel
  acts_as_taggable(:parts)
end

class TaggableUser < ActiveRecord::Base
  acts_as_tagger
end

class UntaggableModel < ActiveRecord::Base
  belongs_to :taggable_model
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tagtical-1.5.5 spec/models.rb
tagtical-1.5.4 spec/models.rb
tagtical-1.5.3 spec/models.rb
tagtical-1.5.2 spec/models.rb
tagtical-1.5.1 spec/models.rb