Class: Post

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.per_pageObject



2
3
4
# File 'app/models/post.rb', line 2

def self.per_page
  25
end

Instance Method Details

#editable_by?(user) ⇒ Boolean

Returns:

  • (Boolean)


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

def editable_by?(user)
  user && (user.id == user_id)
end