Created
February 12, 2011 07:46
-
-
Save mwawrusch/823588 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StoreFront | |
# Indexes | |
# StoreFront.ensure_index(:import_source) | |
include MongoMapper::Document | |
plugin MongoMapper::Plugins::Sluggable | |
STORE_OPERATOR_NAMES = %w[apple] | |
timestamps! | |
key :_id, String | |
key :name, String, :required => true, :length => 1..1000 | |
key :description , String, :default => "" | |
key :store_operator_name, String, :length => 1..100 | |
key :country_code, String, :length => 3, :required => true | |
key :import_source, Array | |
#slug_key :name, :unique => true #, :min_length =>3, :max_length => 100 | |
sluggable :name, :method => :slug_method | |
def slug_method | |
"#{store_operator_name}-#{name}".parameterize | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment