Code Monkey home page Code Monkey logo

dm-devise's Introduction

dm-devise

dm-devise lets you use devise (github.com/plataformatec/devise) with DataMapper. The gem gives you the options of 2 ORM setups depending on what library you wish to use for validations:

:data_mapper

Uses dm-validations. This involves a bit of monkey-patching, but you need to use this if you want auto-validations in any of your models.

:data_mapper_active_model

Uses ActiveModel::Validations. Do not use if you require ‘dm-validations’ anywhere in your app (or include it in your Gemfile). Things will break. The advantage to this is ActiveModel’s I18n support for error messages, and it uses the same validations lib as devise does by default.

dm-devise is intended for use with Rails 3 and devise 1.1. It may work with earlier versions, but it’s not been tested (if you try, please let Jared Morgan (github.com/jm81) know how it goes.)

This README only covers dm-devise specifics. Make sure to read the devise README github.com/plataformatec/devise/blob/master/README.rdoc

Last tested against devise release: v1.1.1

Last tested against devise master: 2010-09-24, commit d02ea3153b1b350a99b78ec54543d951552a08d2

Installation

Add dm-devise and dm gems to your Gemfile. The following gems are required:

gem 'dm-core',           '~> 1.0.2'
gem 'dm-sqlite-adapter', '~> 1.0.2' # or your preferred adapter
gem 'dm-serializer',     '~> 1.0.2'
gem 'dm-timestamps',     '~> 1.0.2'
gem 'dm-rails',          '~> 1.0.3'
gem 'dm-validations',    '~> 1.0.2' # Do not include if using data_mapper_active_model
gem 'dm-devise',         '~> 1.1.0'

If you’re using data_mapper_active_model do not include dm-validations in your Gemfile.

Run the generator:

rails generate devise:install

The generator will install an initializer which describes ALL Devise’s configuration options and you MUST take a look at it. Make sure to specify either data_mapper (for using dm-validations) or data_mapper_active_model (ActiveModel::Validations) as the orm in the configuration file.

To add Devise to any of your models using the generator:

rails generate data_mapper:devise MODEL

Read the README for devise at github.com/plataformatec/devise/blob/master/README.rdoc

TODO

  • Example app

  • Rails templates

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Maintainers

Contributors

github.com/jm81/dm-devise/contributors

Bugs and Feedback

For dm-devise specific issues, please create an issue on GitHub at:

github.com/jm81/dm-devise/issues

Copyright © 2010 Jared Morgan. See LICENSE for details.

dm-devise's People

Contributors

jm81 avatar reactormonk avatar solnic avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.