Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `to_adapter' for User:Class #10

Open
stefl opened this issue Apr 28, 2011 · 1 comment
Open

undefined method `to_adapter' for User:Class #10

stefl opened this issue Apr 28, 2011 · 1 comment

Comments

@stefl
Copy link

stefl commented Apr 28, 2011

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?

@freetwix
Copy link

freetwix commented May 4, 2011

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants