Skip to content

Instantly share code, notes, and snippets.

@seivan
Created March 13, 2009 03:15
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 seivan/78413 to your computer and use it in GitHub Desktop.
Save seivan/78413 to your computer and use it in GitHub Desktop.
class BlogPost < ActiveRecord::Base
has_many :comments
acts_as_taggable_on :tag_cat, :tag_date
validates_presence_of :subject, :content, :tag_cat_list
after_create :create_date
def create_date
self.tag_date_list = self.created_at.strftime('%Y %m')
self.save
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment