Genshin/spree_warehouse — pull request #44 by doktorj (2012-02-10 09:06:47+00:00)
Title: getting closer saving nested visual code data within variant form partial

----
spent a while figuring out where this error was coming from:
ActionView::Template::Error (/Users/phong/.rvm/gems/ruby-1.9.3-p0@rails3.1.3/gems/spree_core-1.0.0.rc4/app/views/spree/admin/variants/_form.html.erb:25: syntax error, unexpected ')', expecting keyword_end
...visual_codes, t(:visual_codes)) );@output_buffer.safe_concat('...
... ^): whenever i'd try to load the edit variant page
and it turns out that in the visual_code/_form partial someone had views/<%= f.label :code, t("visual_codes.data") %>
when which is apparently invalid and causes that weird error. i changed it to just be "visual_codes" for now which lets me load the variants page again. --then i realized it was because you had had it wrapped in quotes, so now it's using t(visual_codes.data) - havn't pushed that up yet tho

---
changed t(:visual_codes.data) to t(:singular, :scope => :visual_code)
---
added has_many: variants to VisualCode model
---
reading up on various spree edge guides including: http://edgeguides.spreecommerce.com/products_and_variants.html

---
added <% vct = Spree::VisualCodeType.find_by_id(vc) %> to visual_codes/index.erb and changed <%= vc.type_id.name %> to vct.name to temporarily fix the broken visual codes index page

---
downgraded spree_warehouse both Gemfile and spree_warehouse.gemspec to use gem 'spree', '~> 1.0.0.rc4' from beta specifically for now (looks like this may have been put thru with Vassils most recent merged pull request, that i merged but didn't noticed the version bump - Rei says we should stay at 1.0.0rc4 for now to save time - i agree for now)

---
combined visual_code and visual_code type overrides, into a single override/partial, so now both are showing up (but not yet saving) on create new product variant form.