Skip to content

Instantly share code, notes, and snippets.

@chriskk
Created July 10, 2013 03:35
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 chriskk/5963295 to your computer and use it in GitHub Desktop.
Save chriskk/5963295 to your computer and use it in GitHub Desktop.
include Carmen
ISLANDS = Country.named('United States').subregions.coded('HI').subregions.collect { |isle| isle.name }
ActionController::RoutingError (uninitialized constant Refinery::Locations::Location::ISLANDS):
vendor/extensions/locations/app/models/refinery/locations/location.rb:16:in `<class:Location>'
vendor/extensions/locations/app/models/refinery/locations/location.rb:3:in `<module:Locations>'
vendor/extensions/locations/app/models/refinery/locations/location.rb:2:in `<module:Refinery>'
vendor/extensions/locations/app/models/refinery/locations/location.rb:1:in `<top (required)>'
module Refinery
module Locations
class Location < Refinery::Core::BaseModel
self.table_name = 'refinery_locations'
attr_accessible :name, :location_type, :island, :address, :address2, :city, :state, :postal_code, :country, :telephone, :fax, :hours, :notes, :longitude, :latitude, :display, :position
LOCATION_TYPES = [
"Store A",
"Store B",
"Store C"
]
validates :name, :location_type, :island, :address, :address2, :city, :state, :postal_code, :country, :telephone, :presence => true
validates :location_type, inclusion: LOCATION_TYPES
validates :island, inclusion: ISLANDS
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment