Reza,

You're right, typical apps obviously store this kind of (connection)
information in configuration files. A typical scenario would be to
have a database.yml config and pass that hash as the second parameter
to DataMapper.setup. We could definitely mention that on the docs site
too.

Would you be willing to provide a doc patch? The site is hosted at
http://github.com/datamapper/datamapper.github.com so you could just
fork it and then send a pull request. I'll make sure to apply it fast,
and if you want, give you commit access to the doc site.

cheers
snusnu

On Wed, Dec 1, 2010 at 01:52, Reza <[email protected]> wrote:
> Examples given in the Quick Start by DM suggest this:
>
>>> You need make sure this is set before you define your models.
>
> and as an example, comes:
>
>>> DataMapper.setup(:default, 'mysql://localhost/the_database_name')
>
> The problem is WHY we should DECLARE the name/URL of the database in
> the CODE? And if we wanted to change the DB? After all DM is an
> abstraction layer to the low-level DB concerns.
>
> The best practice tells that all these should go in the CONFIGURATION
> files.
>
> Or I might be mistaken and the example given in the Quick Start
> article is about the CONFIG files.
>
> Am I missing something on this?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups 
> "DataMapper" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/datamapper?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to