Method: Thredded::PrivatePost.find!

Defined in:
app/models/thredded/private_post.rb

.find!(id) ⇒ Thredded::PrivatePost

Finds the post by its ID, or raises Errors::PrivatePostNotFound.

Parameters:

  • id (String, Number)

Returns:

Raises:



28
29
30
# File 'app/models/thredded/private_post.rb', line 28

def self.find!(id)
  find_by(id: id) || fail(Thredded::Errors::PrivatePostNotFound)
end