NoMethodError (undefined method `[]' for nil:NilClass)
Experienced
When running this Rails application in development mode without providing the master.key
to credentials.yml.enc
, the application throws:
NoMethodError (undefined method `[]' for nil:NilClass):
app/models/concerns/encryptable.rb:31:in `crypt'
app/models/concerns/encryptable.rb:19:in `block (2 levels) in encrypted_attributes'
app/models/user.rb:55:in `restrict!'
app/lib/incommon/current_user.rb:29:in `new'
app/lib/incommon/api/controller.rb:31:in `active_user'
app/lib/incommon/api/controller.rb:26:in `current_user'
Expected
The application picks up the auto-generated credentials
for development
and test
environments and does not rely on production settings for these cases.
Resolution
Edited by jon r