On Aug 14, 3:02 am, Aryk Grosz <[EMAIL PROTECTED]>
wrote:
> I have a method where I would like output to occur via "puts" only if
> its currently in the middle of a rake task or if its in the middle of a
> migration.
>
> How can I detect if the program execution is in the context of a
> migration or a rake task?
> --
> Posted viahttp://www.ruby-forum.com/.

Not sure about this, but I think calling self.class or self.parent
inside a migration task (self.up and self.down) should return
ActiveRecord::Migration.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to