Class: Blogg::Post

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
FriendlyId
Defined in:
app/models/blogg/post.rb

Instance Method Summary collapse

Instance Method Details

#article?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'app/models/blogg/post.rb', line 21

def article?
  !static
end

#nextObject



25
26
27
# File 'app/models/blogg/post.rb', line 25

def next
  self.class.articles.where('id > ?', id).first
end

#prevObject



29
30
31
# File 'app/models/blogg/post.rb', line 29

def prev
  self.class.articles.where('id < ?', id).last
end

#static?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'app/models/blogg/post.rb', line 17

def static?
  static
end