Skip to content

An adapter which allows you to use FriendlyId with DataMapper

License

Notifications You must be signed in to change notification settings

malagant/friendly_id_mongoid

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FriendlyId Mongoid Adapter

This is an pre-release (beta) adapter for FriendlyId using Mongoid.

FriendlyId Features

It currently supports all of FriendlyId's features except:

  • Rails Generator
  • Support for multiple finders

Currently, only finds using get is supported.

@post = Post.get("this-is-a-title")
@post.friendly_id # this-is-a-title

Compatibility

The FriendlyId Mongoid Adapter keeps in lock-step with major and minor versions of the FriendlyId gem, i.e. friendly_id_datamapper 3.1.x is compatible with friendly_id 3.1.x series. Patch and build versions are not kept in lock-step.

Usage

gem install friendly_id friendly_id_datamapper

require "friendly_id"
require "friendly_id/mongoid"

class Post
  include Mongoid::Document

  field :id,    Serial
  field :title, String

  has_friendly_id :title, :use_slug => true
end

For more information on the available features, please see the FriendlyId Guide.

Bugs

Please report them on the Github issue tracker for this project.

If you have a bug to report, please include the following information:

  • Version information for FriendlyId, friendly_id_mongoid, Rails and Ruby.
  • Stack trace and error message.
  • Any snippets of relevant model, view or controller code that shows how your are using FriendlyId.

If you are able to, it helps even more if you can fork FriendlyId on Github, and add a test that reproduces the error you are experiencing.

Credits

Copyright (c) 2010, released under the MIT license.

About

An adapter which allows you to use FriendlyId with DataMapper

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%