Hi
Ok what i want to do is work with MongoDB using standard ActiveRecord
methods like Model.all Model.find and so on but whithout ActiveRecord
itself.
First to notice Ror using database.yml where we create connection config
like
define:
adapter
database
login
password
socket
ok for mongodb we have no adapter and then we cann''t use database.yml
at
all.
We can create own mongodb.yml where we can define:
server
port
database
how ror knows wich config to use(database.yml or mongodb.yml) i don''t
know.
and then define that in mongo_config.rb in initialize folder. Like
MongoMapper.connection MongoMapper.database
at railscasts.com Ryan suggest only adding MongoMapper.database =
"base"
in mmongo_config.rb ( gem ''mongo_mapper'' required in Gemfile).
After all you make model like this
class Person
include MongoMapper::Document
key:name
key:lname
it should use mongo_mapper but it fails.
It doesn''t work. At least with Rails 3beta and 1.9.1. Because it still
using ActiveRecord some how and database.yml accordingly. And server
doesn''t work and console.
So i didn''t find a method to switch off ActiveRecord easily ( earlier
it
can be done by config.frameworks -= {:active_record} and it doesn''t
work
for rails 3.)
Ok what to do with this ? Tell me your experience.
And for Ror core team it would be wise to implement switching on off
gems like ActiveRecord for application and (or) make adapter for
document-based DB''s because popularity for this kind of DB''s
now is
growing pretty fast. And it will be easy to use mongodb adapter instead
of making custom implementations.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.