Skip to content

Instantly share code, notes, and snippets.

@seivan
Created March 12, 2009 21:52
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/78311 to your computer and use it in GitHub Desktop.
Save seivan/78311 to your computer and use it in GitHub Desktop.
class BlogPost < ActiveRecord::Base
has_many :comments
acts_as_taggable_on :tag, :tag_date
validates_presence_of :subject, :content, :tag_list
after_create :create_date
def create_date
self.tag_date_list = self.created_at.split("-")[0..1].join(" ").to_s
self.save
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment