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

include Her::Model not working #289

Open
annacruz opened this issue Oct 5, 2014 · 4 comments
Open

include Her::Model not working #289

annacruz opened this issue Oct 5, 2014 · 4 comments

Comments

@annacruz
Copy link

annacruz commented Oct 5, 2014

Maybe I'm making a stupid mistake, but I can't figure out yet.

I'm trying to connect with an api, my config/initializers/her.rb looks like:

Her::API.setup url: "http://localhost:3000/myapi/" do |c|

Request

c.use Faraday::Request::UrlEncoded

Response

c.use Her::Middleware::DefaultParseJSON

Adapter

c.use Faraday::Adapter::NetHttp
end

and my model looks like

class Set
include Her::Model

end

But when I try inside rails console to use Set.find I receive "NoMethodError: undefined method `find' for Set:Class"

any clue?

@kindrowboat
Copy link
Contributor

It looks like everything is setup properly. Is your code open source somewhere to look at?

@moofish32
Copy link

Any chance Set is having some sort of collision with Ruby's Set? http://www.ruby-doc.org/stdlib-1.9.3/libdoc/set/rdoc/Set.html

@tippenein
Copy link
Contributor

@annacruz I think @moofish32 is right about this. You should namespace it differently. Could you close the issue if this is the case?

@giedriusr
Copy link
Contributor

True

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

5 participants