This project is archived and is in readonly mode.

#5288 ✓committed
Subba

removing unnecessary code in Errors of active model

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

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

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages