devise_couch icon indicating copy to clipboard operation
devise_couch copied to clipboard

undefined method `to_adapter' for User:Class

Open stefl opened this issue 13 years ago • 1 comments

If a user attempts to edit their profile they will get this error.

To fix this I had to do something like this, which feels like a cludge:

class Adapter
  def get! identifier
    User.get(identifier)
  end
end

in my User class:

def self.to_adapter
  Adapter.new
end

Is there a better way / something I am missing?

stefl avatar Apr 28 '11 15:04 stefl

hey,

you probably need to add the shenoudab/orm_adapter to your project. the original orm_adapter (via gem install) is missing the couchrest_model adapter.

you also need to fix the couchrest_model adapter in some places, giving it the right receiver (sometimes, klass. is missing) and really return only one result in def find_first (using, i.e., the find_by ... methods of couchrest_model which gives you only the first view result)

greets, jochen

freetwix avatar May 04 '11 19:05 freetwix