Closed jonallured closed 7 years ago
Fabrication's task definition is perfectly compatible with both rake 0.9.*
and 10.*
. What was really deprecated was something like below, and I believe we can safely remove the include
call.
#!/usr/bin/env rake
module Namespace
desc 'description'
task :run do
sh 'say "Running this task shows deprecation warnings"'
end
end
And if you run the rake task, it shows the following:
$ rake run
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 Module#desc called at /Users/yuki/GitHub/tmp/rake-922/Rakefile:4:in `<module:Namespace>'
WARNING: DSL method Module#task called at /Users/yuki/GitHub/tmp/rake-922/Rakefile:5:in `<module:Namespace>'
WARNING: DSL method Module#sh called at /Users/yuki/GitHub/tmp/rake-922/Rakefile:6:in `block in <module:Namespace>'
say "Running this task shows deprecation warnings"
Make sure to use rake 0.9.2.2
otherwise it raises an NoMethodError
With fd0424bf472823d9b71371a867385be48e8917c5, the Rake DSL is now included when the fabrication gem is required. I tried to follow that commit message, but wasn't able to figure out what the reason for that change was. If you could help enlighten me, I would really appreciate it!
In any event, we're having an issue where we have a model that has an attribute named
link
- the exception is:Which is super weird! With some help from my friends (@ashkan18 and @yuki24), we figured out that fabrication 2.14.0 was the version that broke things for us.
Check this out:
I think that's pretty unexpected, no? I don't know what the way forward is here, but I wanted to raise the issue and see if anyone had any good ideas about what to do.