spree/spree — pull request #5821 by wuboy0307 (2014-12-23 01:45:30+00:00)
Title: argument out of range in state change index

The process order on line 29 seems to be wrong.
Localize first and to_time will cause "argument out of range" error.
I believe it should to_time first then localize.

ActionView::Template::Error (argument out of range):
26: <%= link_to state_change.user.login, spree.admin_user_path(state_change.user) if state_change.user %>
27:
28:
29: <%= l(state_change.created_at).to_time %>
30: <% if state_change.created_at != state_change.updated_at %>
31: <%= Spree::StateChange.human_attribute_name(:updated)%>: <%= l(state_change.updated_at).to_time %>
32: <% end %>
activesupport (4.1.8) lib/active_support/core_ext/string/conversions.rb:24:in `initialize'
activesupport (4.1.8) lib/active_support/core_ext/string/conversions.rb:24:in `new'
activesupport (4.1.8) lib/active_support/core_ext/string/conversions.rb:24:in `to_time'
/Users/wuboy/.rvm/gems/ruby-2.1.5/bundler/gems/spree-76c64275db82/backend/app/views/spree/admin/state_changes/index.html.erb:29:in `block in _d334132c461d9fd4244541dc3c29b10d'
activerecord (4.1.8) lib/active_record/relation/delegation.rb:46:in `each'
activerecord (4.1.8) lib/active_record/relation/delegation.rb:46:in `each'
/Users/wuboy/.rvm/gems/ruby-2.1.5/bundler/gems/spree-76c64275db82/backend/app/views/spree/admin/state_changes/index.html.erb:20:in `_d334132c461d9fd4244541dc3c29b10d'