How to access Rails model in a rake file outside of rake tasks? -


in order access rails models in rake task give :environment dependency. if want have dynamic descriptions of task , depend on database date. example:

end_date = foo.end_date # model foo provides end date  desc "do after #{end_date}" task bar: :environment   ... end 

i tried rake::task[:environment].invoke, don't know how build task 'environment'.


Comments