03 Nov
Using Rails Models from within an external script
For some one off scripts I wanted to make use of a couple of models I created. I had no idea how simple it would be to load the rails environment from within a script:
require 'config/environment.rb'
p MyModel.find(:first)
Sweet! Rails is so… thoughtful.