Created
March 26, 2011 06:55
-
-
Save bradylove/888086 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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