Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.