Sean’s Obsessions


  • I'm a happy Linode customer. This is a Linode 540 VPS.
  • Archives

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.

One Response to “Using Rails Models from within an external script”

  1. 1
    klaus Says:

    thank you for pointing that out, i could not imagine that this was just as easy

Leave a Reply

© 2010 Sean’s Obsessions | Entries (RSS) and Comments (RSS)

Powered by Wordpress, design by Web4Sudoku, based on Pinkline byGPS Gazette