Replace defined? in views with local_assigns
Created by: cirosantilli
local_assigns
is the right way to do it: http://stackoverflow.com/questions/2060561/optional-local-variables-in-rails-partial-templates-how-do-i-get-out-of-the-de
One occurrence, defined?(snippet[:start_line])
, is a bug, since a = {}; defined? a[:b]
returns "method"
, not nil
.
Merge request reports
Activity
Created by: TeatroIO
I've prepared a stage. Click to open.
Created by: dblessing
@cirosantilli I don't see any documentation references to
local_assign
anymore. Further, I see http://stackoverflow.com/questions/851258/should-the-extensive-use-of-local-assigns-has-key-in-partial-be-considered-a-co that suggests it's a poorly documented feature at best and questions its use. Is usingdefined?
currently causing issues? If not, I'm not sure there's compelling reasons to change at this time.