Rails exceptions from reserved keywords
I keep bumping into exception errors that I believe are due to conflicts from reserved keywords.
For example, I have a permit model with the attribute "gross_value." When my view tries to retrieve @permit.gross_value I get the following exception error. However, when I rename the attribute to @permit.value_gross (without changing anything else) the view works fine. I've had similar issues with other attribute names.
Is my diagnosis of the reason for the exception correct? How do I know what keywords to avoid this issue?
fatal (exception reentered):
actionpack (5.0.1) lib/action_controller/metal/rescue.rb:23:in rescue in process_action'
process_action'
actionpack (5.0.1) lib/action_controller/metal/rescue.rb:20:in
actionpack (5.0.1) lib/action_controller/metal/instrumentation.rb:32:in block in process_action'
block in instrument'
activesupport (5.0.1) lib/active_support/notifications.rb:164:in
activesupport (5.0.1) lib/active_support/notifications/instrumenter.rb:21:in instrument'
instrument'
activesupport (5.0.1) lib/active_support/notifications.rb:164:in
actionpack (5.0.1) lib/action_controller/metal/instrumentation.rb:30:in process_action'
process_action'
actionpack (5.0.1) lib/action_controller/metal/params_wrapper.rb:248:in
activerecord (5.0.1) lib/active_record/railties/controller_runtime.rb:18:in process_action'
process'
actionpack (5.0.1) lib/abstract_controller/base.rb:126:in
actionview (5.0.1) lib/action_view/rendering.rb:30:in process'
dispatch'
actionpack (5.0.1) lib/action_controller/metal.rb:190:in
actionpack (5.0.1) lib/action_controller/metal.rb:262:in dispatch'
dispatch'
actionpack (5.0.1) lib/action_dispatch/routing/route_set.rb:50:in
actionpack (5.0.1) lib/action_dispatch/routing/route_set.rb:32:in serve'
block in serve'
actionpack (5.0.1) lib/action_dispatch/journey/router.rb:39:in
actionpack (5.0.1) lib/action_dispatch/journey/router.rb:26:in each'
serve'
actionpack (5.0.1) lib/action_dispatch/journey/router.rb:26:in
actionpack (5.0.1) lib/action_dispatch/routing/route_set.rb:725:in call'
call'
rack (2.0.1) lib/rack/etag.rb:25:in
rack (2.0.1) lib/rack/conditional_get.rb:25:in call'
call'
rack (2.0.1) lib/rack/head.rb:12:in
rack (2.0.1) lib/rack/session/abstract/id.rb:222:in context'
call'
rack (2.0.1) lib/rack/session/abstract/id.rb:216:in
actionpack (5.0.1) lib/action_dispatch/middleware/cookies.rb:613:in call'
call'
activerecord (5.0.1) lib/active_record/migration.rb:553:in
actionpack (5.0.1) lib/action_dispatch/middleware/callbacks.rb:38:in block in call'
run_callbacks'
activesupport (5.0.1) lib/active_support/callbacks.rb:97:in
activesupport (5.0.1) lib/active_support/callbacks.rb:750:in _run_call_callbacks'
run_callbacks'
activesupport (5.0.1) lib/active_support/callbacks.rb:90:in
actionpack (5.0.1) lib/action_dispatch/middleware/callbacks.rb:36:in call'
call'
actionpack (5.0.1) lib/action_dispatch/middleware/executor.rb:12:in
actionpack (5.0.1) lib/action_dispatch/middleware/remote_ip.rb:79:in call'
call'
actionpack (5.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:49:in
web-console (3.1.1) lib/web_console/middleware.rb:131:in call_app'
block in call'
web-console (3.1.1) lib/web_console/middleware.rb:28:in
web-console (3.1.1) lib/web_console/middleware.rb:18:in catch'
call'
web-console (3.1.1) lib/web_console/middleware.rb:18:in
actionpack (5.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in call'
call_app'
railties (5.0.1) lib/rails/rack/logger.rb:36:in
railties (5.0.1) lib/rails/rack/logger.rb:24:in block in call'
block in tagged'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in
activesupport (5.0.1) lib/active_support/tagged_logging.rb:26:in tagged'
tagged'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in
railties (5.0.1) lib/rails/rack/logger.rb:24:in call'
call'
sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in
actionpack (5.0.1) lib/action_dispatch/middleware/request_id.rb:24:in call'
call'
rack (2.0.1) lib/rack/method_override.rb:22:in
rack (2.0.1) lib/rack/runtime.rb:22:in call'
call'
activesupport (5.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in
actionpack (5.0.1) lib/action_dispatch/middleware/executor.rb:12:in call'
call'
actionpack (5.0.1) lib/action_dispatch/middleware/static.rb:136:in
rack (2.0.1) lib/rack/sendfile.rb:111:in call'
call'
railties (5.0.1) lib/rails/engine.rb:522:in
puma (3.4.0) lib/puma/configuration.rb:224:in call'
handle_request'
puma (3.4.0) lib/puma/server.rb:569:in
puma (3.4.0) lib/puma/server.rb:406:in process_client'
block in run'
puma (3.4.0) lib/puma/server.rb:271:in
puma (3.4.0) lib/puma/thread_pool.rb:114:in `block in spawn_thread'
Thanks for your help!
Simon