@@ -36,9 +36,9 @@ class Article
3636 # This sets the published date and permalink when an article is published
3737 def set_published_permalink
3838 # Check to see if we are publishing
39- if self . is_published ?
39+ if self . published ?
4040 # Set the date, only if we haven't already
41- self . published_at = Time . now if self . published_at . nil?
41+ self . published_at || = Time . now
4242
4343 # Set the permalink, only if we haven't already
4444 self . permalink = create_permalink
@@ -68,7 +68,7 @@ def fire_before_update_event
6868
6969 def fire_before_save_event
7070 Hooks ::Events . before_save_article ( self )
71- Hooks ::Events . before_publish_article ( self ) if self . is_published ?
71+ Hooks ::Events . before_publish_article ( self ) if self . published ?
7272 end
7373
7474 def fire_after_create_event
@@ -81,12 +81,12 @@ def fire_after_update_event
8181
8282 def fire_after_save_event
8383 Hooks ::Events . after_save_article ( self )
84- Hooks ::Events . after_publish_article ( self ) if self . is_published ?
84+ Hooks ::Events . after_publish_article ( self ) if self . published ?
8585 end
8686
87- def is_published?
87+ def published = ( binary_string )
8888 # We need this beacuse the values get populated from the params
89- self . published == "1" || self . published
89+ attribute_set ( : published, binary_string == "1" )
9090 end
9191
9292 def create_permalink
0 commit comments