# Rails saving on LDAP (or directly on a mailserver)

**URL:** <https://www.ruby-forum.com/t/rails-saving-on-ldap-or-directly-on-a-mailserver/181686>\
**Category:** Rails\
**Created:** [January 16, 2010, 2:02am UTC](https://www.ruby-forum.com/t/rails-saving-on-ldap-or-directly-on-a-mailserver/181686 "2010-01-16T02:02:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ialuronico](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/c4cdca/32.png) [@ialuronico](https://www.ruby-forum.com/u/ialuronico)\
**Post date:** [January 16, 2010, 2:02am UTC](https://www.ruby-forum.com/t/rails-saving-on-ldap-or-directly-on-a-mailserver/181686/1 "2010-01-16T02:02:56Z")

</div>

Hi everybody,

I’m a newbie in the Rails world but I like it so much …

One of my friend is rebuildiding a gym+swimminpool and starting from the  
next summer there will be a lot of people working in the gym ( like  
Barman , swimming teacher , personal trainer … )

My idea (i’m helping my frined on the computer and web parts) is to have  
all this people registering themself on the gym website and have theyr  
account saved on an LDAP server ( the badge & access system will run on  
LDAP)

there is some way to use LDAP as rails database ?

thanks

---

<div class="post-metadata">

**Author:** ![ialuronico](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/c4cdca/32.png) [@ialuronico](https://www.ruby-forum.com/u/ialuronico)\
**Post date:** [January 19, 2010, 3:30am UTC](https://www.ruby-forum.com/t/rails-saving-on-ldap-or-directly-on-a-mailserver/181686/2 "2010-01-19T03:30:44Z")

</div>

Simone R. wrote:

> Hi everybody,

[snip]

> My idea (i’m helping my frined on the computer and web parts) is to have  
> all this people registering themself on the gym website and have theyr  
> account saved on an LDAP server ( the badge & access system will run on  
> LDAP)
> 
> there is some way to use LDAP as rails database ?

Not that I’m aware of. Rails is sql-oriented and LDAP is a totally  
different animal.

Having said that, OpenLDAP can use a sql database as the store for the  
information that it serves up. This requires you to turn your problem  
around, using mysql/postgresql for your ldap database and then using  
rails to interact with the mysql/postgresql database that happens to  
have ldap data in it. It also assumes that you can use OpenLDAP, e.g.  
you aren’t already using ActiveDirectory.

[http://www.openldap.org/doc/admin24/backends.html#SQL](http://www.openldap.org/doc/admin24/backends.html#SQL)  
[http://serverfault.com/questions/53608/how-do-i-configure-openldap-to-use-mysql-ubuntu-9-04](http://serverfault.com/questions/53608/how-do-i-configure-openldap-to-use-mysql-ubuntu-9-04)

Good luck,  
gvb

---

<div class="post-metadata">

**Author:** ![ialuronico](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/c4cdca/32.png) [@ialuronico](https://www.ruby-forum.com/u/ialuronico)\
**Post date:** [January 19, 2010, 2:18pm UTC](https://www.ruby-forum.com/t/rails-saving-on-ldap-or-directly-on-a-mailserver/181686/3 "2010-01-19T14:18:08Z")

</div>

On Mon, 2010-01-18 at 21:28 -0500, Jerry Van Baren wrote:

> > there is some way to use LDAP as rails database ?
> 
> Not that I’m aware of. Rails is sql-oriented and LDAP is a totally  
> different animal.

* * *

wrong

OP might want to check [rubyforge.org](http://rubyforge.org) for ldap but I have used activeldap  
which uses LDAP as an activerecord store. There are probably quite a few  
and it has been a long time since I used activeldap.

LDAP is of course a database albeit one that is intended to be ‘read  
often, written not so often’ so some judgment should be given to what is  
stored in LDAP and what would be better off in some SQL db.

Craig
