Hi Peter—

On Jul 27, 2011, at 6:29 AM, Peter Sanford wrote:
> Ah yes. I am connecting to multiple databases and thus relying on
> Datamapper.repository(:repo_name) { ... } to specify which one. Is
> there another way to do this that doesn't hit the IdentityMap?

There are multiple ways to accomplish this. Probably the easiest is to 
designate the default repository for each of your models. To do so use 
Model.default_repository:

class MyModel
  include DataMapper::Resource

  def self.default_repository
    :alternate_repo
  end
end

Also, queries accept a :repository option, ex:

JournalIssue.all(:repository => :medline, :created_on.gte => Date.today - 7)

There are probably other ways to slice this, but hopefully that gets you 
started in the right direction,
Emmanuel

-- 
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