Exception: RailsNoDatabaseInView::DatabaseAccessFromViewError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rails_no_database_in_view/database_access_from_view_error.rb

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ DatabaseAccessFromViewError

Returns a new instance of DatabaseAccessFromViewError.



4
5
6
# File 'lib/rails_no_database_in_view/database_access_from_view_error.rb', line 4

def initialize error
  @error = error
end

Instance Method Details

#messageObject



8
9
10
11
12
13
# File 'lib/rails_no_database_in_view/database_access_from_view_error.rb', line 8

def message
  "A database call was made from the view.\n" \
  "The database had been temporarily disable while rendering the view so we could catch situations like this.\n" \
  "\nOriginal error:\n" \
  "#{@error.message} (#{@error.class})"
end