Comments (15)
How does your spec and spec helper look around the lines given in the backtrace?
from draper.
I've updated the gist to show the two extra files.
from draper.
Any news on this?
from draper.
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:in
require'`) and line number 1 is require "spec_helper"
So it's something to do with the way it loads.
from draper.
bump?
from draper.
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.
... 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.
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.
No worries. That'd be great. Trying to keep issues current. :)
from draper.
Got anything reproducible?
from draper.
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.
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.
@anlek could you push a simple app to github that reproduces this issue?
from draper.
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.
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)
- Create unique context for each item in a collection?
- Draper is incompatible with Ruby 3 HOT 5
- Draper changes the behaviour of url_for when using STI models
- Sending problematic method names (open, format) to decorated rails objects sends to Kernel (conflicts with ransack)
- undefined method `auto_link' for spec with type :decorator
- Generators don't work. HOT 3
- Draper::UninferrableDecoratorError (Could not infer a decorator for Document.) HOT 3
- CI: A test MAY fail with NameError: uninitialized constant ActionMailer::Base
- Release new version HOT 7
- Breaks respond_with in Rails API apps HOT 2
- ArgumentError using helpers with Ruby 3 HOT 4
- Mongo error -> Uninitialized constant ActiveRecord Did you mean? ActiveModel HOT 1
- Usage with `Turbo::Broadcastable` HOT 1
- undefined method `attributes' for nil:NilClass
- Automatically use decorated associations in delegate methods HOT 1
- Unexpected behavior when `frozen?` method is defined in model HOT 1
- Scaffold generator: Invalid path when using --model-name=Record
- Draper still actively maintained? HOT 10
- Rails - STI bug for ActiveRecord_Relation, works fine for a single record
- issue with using draper outside of controller/view context within a rake task or (active)job
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from draper.