Sha256: 4c2075d5885681aeb4ec79fef7361874f6a86e91955ffd2a5d0374f6dac63510
Contents?: true
Size: 783 Bytes
Versions: 5
Compression:
Stored size: 783 Bytes
Contents
module Permalink module Orm module MongoMapper def self.included(base) base.extend(Permalink::Orm::Base::ClassMethods) base.extend(ClassMethods) class << base; attr_accessor :permalink_options; end end module ClassMethods # permalink :title # permalink :title, :to => :custom_permalink_field # permalink :title, :to => :permalink, :to_param => [:id, :permalink] # permalink :title, :unique => true def permalink(from, options={}) include Permalink::Orm::Base::InstanceMethods setup_permalink( {:to_param => :permalink}, from, options ) key options[:to], String, :index => true end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems