GithubHelp home page GithubHelp logo

Comments (15)

henrik avatar henrik commented on July 20, 2024

How does your spec and spec helper look around the lines given in the backtrace?

from draper.

anlek avatar anlek commented on July 20, 2024

I've updated the gist to show the two extra files.

from draper.

anlek avatar anlek commented on July 20, 2024

Any news on this?

from draper.

anlek avatar anlek commented on July 20, 2024

Just to let you know, the payment_notifications_controller_spec.rb file has nothing to do with it, I commented out the whole file, and now it picked the next file in the lineup (being: from /Users/andrew/code/rails_apps/example/spec/helpers/application_helper_spec.rb:1:inrequire'`) and line number 1 is require "spec_helper"

So it's something to do with the way it loads.

from draper.

anlek avatar anlek commented on July 20, 2024

bump?

from draper.

steveklabnik avatar steveklabnik commented on July 20, 2024

I have no idea why this is happening, but here's the offending line: https://github.com/jcasimir/draper/blob/ad94f54369deabd11315fc241c66b74a30adec0a/lib/draper/system.rb#L4

from draper.

steveklabnik avatar steveklabnik commented on July 20, 2024

... and if you look at draper.rb, the view_context.rb file is being explicitly loaded before this is called. So it should be working.

from draper.

anlek avatar anlek commented on July 20, 2024

Wow, this was quite a while ago, I'll see if I can recreate the issue again and maybe spend a bit more time trying to debug it a bit more.

from draper.

steveklabnik avatar steveklabnik commented on July 20, 2024

No worries. That'd be great. Trying to keep issues current. :)

from draper.

steveklabnik avatar steveklabnik commented on July 20, 2024

Got anything reproducible?

from draper.

anlek avatar anlek commented on July 20, 2024

I still have the issue. Not sure where to go from here:

/Users/andrew/code/rails_apps/example/vendor/ruby/1.9.1/gems/draper-0.11.1/lib/draper/system.rb:5:in
'setup': uninitialized constant Draper::ViewContextFilter (NameError)

from draper.

anlek avatar anlek commented on July 20, 2024

I've tried doing a bunch of stuff and non of it really worked out for me.
I tried requiring draper/view_context before loading environment.rb but that didn't help.
I did remove draper out of the project and ensured that rspec runs correctly, and it worked fine (after a few fixes in my code). Putting draper back and project is still broken :(
I'm not sure why it's failing.

Also, loaded rails console and tried to see if Draper::ViewContextFilter was present and it was.

Any ideas on your end?

from draper.

nashby avatar nashby commented on July 20, 2024

@anlek could you push a simple app to github that reproduces this issue?

from draper.

anlek avatar anlek commented on July 20, 2024

I tried to do a simple app but didn't raise the issue. I'm looking into what I am missing to create the issue.

from draper.

anlek avatar anlek commented on July 20, 2024

OK, figured it out!
I'm not sure why I had this but I think there was a bug in draper in version 0.9 which caused me to put this in:
(I believe the solution came from issue #46)

#FIXME: Temporary fix for draper cashing the view_context between reuquests (making it look as if unlogged in users were logged in)
module Draper
  module ViewContext
    def set_current_view_context
      Thread.current[:current_view_context] = self.view_context
    end
  end
end

That was under lib/draper/view_context.rb - deleting the file fixed the issue. I'm sorry to have wasted your time.

from draper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.