her icon indicating copy to clipboard operation
her copied to clipboard

include Her::Model not working

Open annacruz opened this issue 10 years ago • 4 comments

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?

annacruz avatar Oct 05 '14 13:10 annacruz

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

kindrowboat avatar Oct 14 '14 15:10 kindrowboat

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

moofish32 avatar Jan 26 '15 23:01 moofish32

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

tippenein avatar Jun 30 '15 00:06 tippenein

True

giedriusr avatar Jun 30 '15 06:06 giedriusr