Skip to content
This repository has been archived by the owner on Apr 17, 2020. It is now read-only.

Move ADDRESS_FIELDS global constant to Spree Preference #49

Closed
felixbuenemann opened this issue Feb 21, 2013 · 2 comments
Closed

Move ADDRESS_FIELDS global constant to Spree Preference #49

felixbuenemann opened this issue Feb 21, 2013 · 2 comments

Comments

@felixbuenemann
Copy link
Contributor

I think it's a really bad idea to have a global constant ADDRESS_FIELDS. Not only willy it raise constant redefined warning if you need to change it, it also could override another constant, because it isn't namespaced into a class.

I think it would be a much better idea to store this as a spree addressbook preference:

class Spree::AddressBookConfiguration
  # ...
  preference :address_fields, :string, :default => "firstname lastname company address1 address2 city state zipcode country phone"
end

Then in the form code:

Spree::AddressBook::Config.address_fields.split.each do |field|

If you agree, I'd be happy to make a PR.

@felixbuenemann
Copy link
Contributor Author

@romul No response on this, are you flooded atm?

@iloveitaly
Copy link
Member

This is a great idea. Closing this issue out… I'll look for a PR!

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants