Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task :my_task => :environment do #30

Closed
ak47 opened this issue Mar 9, 2010 · 2 comments
Closed

task :my_task => :environment do #30

ak47 opened this issue Mar 9, 2010 · 2 comments

Comments

@ak47
Copy link

ak47 commented Mar 9, 2010

this isn't a bug, more a usage question - but I can't find any google group for this...

is there a way to include the Rails environment into Thor tasks, classes, etc similar to the rake method (in title)

@josevalim
Copy link
Contributor

You just need to call it as first in your method:

class App
def foo
environment
# do something
end
end

@ak47
Copy link
Author

ak47 commented May 11, 2010

no such luck for me

lib/tasks/ocm_import.thor:4:in parts': undefined local variable or methodenvironment' for #Thor::Sandbox::OcmImport:0x10189c9c8 (NameError)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants