Skip to content

Instantly share code, notes, and snippets.

@bradylove
Created March 26, 2011 06:55
Show Gist options
  • Save bradylove/888086 to your computer and use it in GitHub Desktop.
Save bradylove/888086 to your computer and use it in GitHub Desktop.
class Post < ActiveRecord::Base
def update_published(published, published_at)
if published == true and published_at.nil? == true
Time.now
elsif published == false
nil
elsif published == true and published_at.nil? == false
published_at
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment