ruby-grape / grape-rabl

Use rabl with grape
MIT License
136 stars 29 forks source link

NoMethodError on partials when upgrading to rabl 0.11.2 and above #31

Closed ronenm closed 9 years ago

ronenm commented 9 years ago

Hi,

I'm using the following (and other) partial in my rabl views for grape:

  node :images do |partner|
      partial("images", :object => partner.gallery.attachments)
 end

When upgrading to the latest rabl (0.11.4) I noticed that I'm starting to get the following error message:

NoMethodError (undefined method views' for #<Grape::Util::HashStack:0x007ffb4d9d08a0>): app/views/api/partner.rabl:7:inblock in eval_source'

Going backward I saw that this error message started to appear at rabl 0.11.2 (it works fine in 0.11.1).

Thanks, Ronen

dblock commented 9 years ago

Looks like a legit problem. Maybe you can PR an update to rabl in this project that reproduces the problem, to start?

ronenm commented 9 years ago

Sure. I'll prepare a spec for this case if the current specs do not catch the issue. Probably will be ready on Friday.

On Mon, Nov 24, 2014 at 3:28 PM, Daniel Doubrovkine (dB.) @dblockdotorg < notifications@github.com> wrote:

Looks like a legit problem. Maybe you can PR an update to rabl in this project that reproduces the problem, to start?

— Reply to this email directly or view it on GitHub https://github.com/LTe/grape-rabl/issues/31#issuecomment-64193241.

רונן מולדובן

מנחה סדנאות, מטפל בתטא-הילינג, מאמן אישי ועסקי מייסד ומנהל בית גשרים נייד 054-4818159 טלפון 04-6620199 פקס 153-4-6620199 אימייל ronen@beit-gsharim.com www.beit-gsharim.com http://www.beit-gsharim.com צ'ט Skype: ronen.moldovan MSN: moldovan@hotmail.com צרו עימי קשר [image: Linkedin] http://www.linkedin.com/profile?viewProfile=&key=399337&locale=en_US&trk=tab_pro[image: Facebook] http://www.facebook.com/#%21/ronen.moldovan[image: Twitter] https://twitter.com/gsharim

--- @ WiseStamp Signature http://my.wisestamp.com/link?u=4mmzgsymmkn8mh7d&site=www.wisestamp.com/email-install. Get it now http://my.wisestamp.com/link?u=4mmzgsymmkn8mh7d&site=www.wisestamp.com/email-install

phallstrom commented 9 years ago

Same error. Reverting to 0.11.1 resolves it.

LTe commented 9 years ago

@phallstrom @ronenm do you use grape-rabl and sinatra in the same time?

Related: https://github.com/nesquena/rabl/issues/597

phallstrom commented 9 years ago

@LTe Yes to grape-rabl, No to sinatra.

ronenm commented 9 years ago

No not using it with Sinatra. בתאריך 5 בדצמ 2014 18:14, ‏"Philip Hallstrom" notifications@github.com כתב:

@LTe https://github.com/LTe Yes to grape-rabl, No to sinatra.

— Reply to this email directly or view it on GitHub https://github.com/LTe/grape-rabl/issues/31#issuecomment-65812067.

LTe commented 9 years ago

@ronenm @phallstrom @dblock I created pull request to rabl. This should fix problem.

Related: https://github.com/nesquena/rabl/pull/602

ronenm commented 9 years ago

@LTe, I fetched your pull request to a local path and can confirm that the issue has been solved with it.

Waiting for the release of rabl that will include this fix.

Many thanks for the help.

DouweM commented 9 years ago

The PR has been merged into rabl! A new release will be issued soon.

dblock commented 9 years ago

Are we saying this can be closed once that is released?

LTe commented 9 years ago

@dblock already released https://github.com/nesquena/rabl/commit/34cd122abdeb7c08e08ce3bb2773e1e0555db5fc

Do you think that we should bump dependency for rabl to >= 0.11.5?

ronenm commented 9 years ago

Sure. I will close once I check it with the official release.

On Sat, Dec 6, 2014 at 2:02 AM, Daniel Doubrovkine (dB.) @dblockdotorg < notifications@github.com> wrote:

Are we saying this can be closed once that is released?

— Reply to this email directly or view it on GitHub https://github.com/LTe/grape-rabl/issues/31#issuecomment-65874163.

רונן מולדובן

מנחה סדנאות, מטפל בתטא-הילינג, מאמן אישי ועסקי מייסד ומנהל בית גשרים נייד 054-4818159 טלפון 04-6620199 פקס 153-4-6620199 אימייל ronen@beit-gsharim.com www.beit-gsharim.com http://www.beit-gsharim.com צ'ט Skype: ronen.moldovan MSN: moldovan@hotmail.com צרו עימי קשר [image: Linkedin] http://www.linkedin.com/profile?viewProfile=&key=399337&locale=en_US&trk=tab_pro[image: Facebook] http://www.facebook.com/#%21/ronen.moldovan[image: Twitter] https://twitter.com/gsharim

--- @ WiseStamp Signature http://my.wisestamp.com/link?u=4mmzgsymmkn8mh7d&site=www.wisestamp.com/email-install. Get it now http://my.wisestamp.com/link?u=4mmzgsymmkn8mh7d&site=www.wisestamp.com/email-install

ronenm commented 9 years ago

Everything's working fine with Rabl 0.11.5