NoMethodError in HousesController#show

undefined method `charge' for nil:NilClass

Extracted source (around line #25):
23
24
25
26
27
28
              
@house = CatHouse.find_by(key: key)
if @house.charge.has_key?('plans')
render 'show_multi_plan'
else
render 'show'

Rails.root: /app

Application Trace | Framework Trace | Full Trace

Request

Parameters:

{"key"=>"setagaya", "format"=>"html"}

Response

Headers:

None