Skip to content

Instantly share code, notes, and snippets.

@charly
Created August 19, 2009 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charly/170539 to your computer and use it in GitHub Desktop.
Save charly/170539 to your computer and use it in GitHub Desktop.
class Asset < ActiveRecord::Base
acts_as_taggable_on :tags, :people
# FIRST ATTEMPT
def tag_list=(new_tags)
set_tag_list_on('tags',new_tags.downcase)
end
def person_list=(new_tags)
set_tag_list_on('people',new_tags.downcase)
end
# SECOND and successful ATTEMPT
module HackTag
def set_tag_list_on(context, new_tags, tagger=nil)
super(context, new_tags.downcase, tagger=nil)
end
end
include HackTag
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment