#1067 ✓resolved
Mauricio Eduardo Szabo

dm-rest-adapter doesn't permit to customize URLs

Reported by Mauricio Eduardo Szabo | September 30th, 2009 @ 06:46 PM

The dm-rest-adapter doesn't seems to obey the storage_names property. So, if I create a class like:

class StudentRest
  include DataMapper::Resource

  property :id, Serial
  property :name, String

  storage_names[:default] = 'students'
end

a StudentRest.all tries to find a resource on http://localhost/student_rests.xml, because it tries to pluralize the class name (it seems to me that overriding the default storage_names, the adapter should be able to find http://localhost/students.xml)

I ended up solving this problem just by adding:

class DataMapperRest::Adapter
  def resource_name(model)

model.storage_name



end end

After I setup connections.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Referenced by

Pages