Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

removing unnecessary code in Errors of active model

#5288

this is small patch fixes Errors class in active_model

def [](attribute)
 if errors = get(attribute.to_sym)
   errors
  else
   set(attribute.to_sym, [])
  end
end

with below code

def [](attribute)
 get(attribute.to_sym) || set(attribute.to_sym, [])
end

Reported by Subba · August 3rd, 2010 @ 05:47 PM

State: committed
Milestone: none
Assigned to: José Valim José Valim
Importance: none