I'm trying to pass in conditions to a find command in a rake task.  I'm
still a little new to this, but what is the best practices for this?
Should I be passing in a hash or..    Any suggestions welcome!

command line: rake mytask conditions='condition = 1'

#mytask.rake
def conditions
  ENV['conditions'] || ENV['conditions'] || nil
end

task :metadata => :environment do
  klass.find_each(:start => start, :conditions => conditions) do
|record|
  #do stuff
  end
end

thanks!
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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