Class: Post
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Post
- Extended by:
- FriendlyId
- Defined in:
- app/models/post.rb
Instance Method Summary collapse
Instance Method Details
#helpers ⇒ Object
20 21 22 |
# File 'app/models/post.rb', line 20 def helpers ActionController::Base.helpers end |
#publish ⇒ Object
24 25 26 27 28 |
# File 'app/models/post.rb', line 24 def publish self.published = true self.published_at = Time.now save end |
#unpublish ⇒ Object
30 31 32 33 34 |
# File 'app/models/post.rb', line 30 def unpublish self.published = false self.published_at = nil save end |