You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method #<FactoryGirl::Declaration::Implicit:0x007fe0488292b0>
#file called at [...]/spec/factories/releases_factory.rb:5:in `block (2 levels) in <top (required)>'
And using the factory fails with:
Trait not registered: class
I'm using this with Rails, and I have a Paperclip attachment called file.
I think this is Rake's DSL conflicting with FactoryGirl's. Clearly Rake's is deprecated, but I don't want to use an old version of rake just to get this to work. Is there a workaround? Or am I missing something?
Yeah, it sounds like you're dealing with Rake here, which is a shame. We try to remove as many methods as possible so there are no clashes, but some of the Rake code sneaks in. In instances like this, you'll have to use add_attribute directly:
There's not, sadly; it adds methods to Object; we try as best we can to remove them, but some still slip through. Hooray for monkey-patching core libraries!
Given the following factory:
Running
rspec
generates the following warnings:And using the factory fails with:
Trait not registered: class
I'm using this with Rails, and I have a Paperclip attachment called
file
.I think this is Rake's DSL conflicting with FactoryGirl's. Clearly Rake's is deprecated, but I don't want to use an old version of rake just to get this to work. Is there a workaround? Or am I missing something?
Someone's reported a similar situation at rubyist/guard-rake#17
The text was updated successfully, but these errors were encountered: