Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@j-mcnally
Created April 29, 2014 00:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j-mcnally/11387860 to your computer and use it in GitHub Desktop.
Save j-mcnally/11387860 to your computer and use it in GitHub Desktop.
require_dependency 'spree/address'
module AddressExtension
def self.included(base)
base.extend(ClassMethods)
base.send(:include, InstanceMethods)
base.class_eval do
unloadable
attr_accessible :residential
def full_name
"#{firstname} #{lastname}"
end
def full_address
[address1, address2, city, state.name, zipcode, country.name].join(" ") rescue ""
end
end
end
module ClassMethods
end
module InstanceMethods
end
end
Spree::Address.send(:include, AddressExtension)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment