Passing a parameter or two to a Rake task

I have a rake task that I want to pass parameters to. For example, I want to issue a command like

<prompt> rake db:do_something 1

and inside the rake task:

...
cust = Customer.find( the_id_passed_in )
# do something with this customer record, etc...
...

Pretty straightforward, right?

20
задан NJ. 5 March 2011 в 23:13
поделиться