spree/spree — Issue #1142: Undefined method 'states' for nil:NilClass
Author: uspatriot
Created: 2012-02-10 20:23:03+00:00
State: open

I have a fresh Spree app with the sample data loaded (spree_sample:load).

Any time I add a sample product to the cart and then click the checkout button I get the undefined method 'states' error.

Ruby: 1.9.2p290
Rails 3.2.1
Spree: 1.0.0.rc3

Showing `/Users/chris/.rvm/gems/ruby-1.9.2-p290/bundler/gems/spree-5d49b19e7114/core/app/views/spree/checkout/_address.html.erb` where line #43 raised:

`undefined method `states' for nil:NilClass`

Extracted source (around line #43):

`40:
41: <% if Spree::Config[:address_requires_state] %>
42:

43: <% have_states = !@order.bill_address.country.states.empty? %>
44: <%= bill_form.label :state, t(:state) %>*

45: