Sha256: 0a2b7c83267618a6c67fadd0e07dd91ee571231a46054ec9ea562af40a272f66

Contents?: true

Size: 617 Bytes

Versions: 5

Compression:

Stored size: 617 Bytes

Contents

module Permalink
  module Orm
    module Mongoid
      include Permalink::Orm::Base::ClassMethods
      attr_accessor :permalink_options

      # 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
        )

        field options[:to]
        key options[:to]
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
permalink-1.2.1 lib/permalink/orm/mongoid.rb
permalink-1.2.0 lib/permalink/orm/mongoid.rb
permalink-1.1.2 lib/permalink/orm/mongoid.rb
permalink-1.1.1 lib/permalink/orm/mongoid.rb
permalink-1.1.0 lib/permalink/orm/mongoid.rb