Sha256: a55482b21944f1f62815857c2a67f3fea2ec5f77df661a1b2adcc512d6428473
Contents?: true
Size: 608 Bytes
Versions: 13
Compression:
Stored size: 608 Bytes
Contents
require './helper' MongoMapperExt.init class TagsEx include MongoMapper::Document include MongoMapperExt::Tags key :title end TagsEx.delete_all TagsEx.create!(:title => "The title of the blogpost!!!", :tags => ["tag1", "tag2", "tag3"]) TagsEx.create!(:title => "testing tags", :tags => ["tag1", "tag4", "tag2"]) TagsEx.create!(:title => "more tags", :tags => ["tag1", "tag3", "tag5"]) puts ">> Tag Cloud" puts TagsEx.tag_cloud.inspect puts ">> with tag = tag5" puts TagsEx.find_with_tags("tag5").inspect puts ">> all tags that start with t" puts TagsEx.find_tags(/^t/).inspect TagsEx.delete_all
Version data entries
13 entries across 13 versions & 1 rubygems