Change Rails Environment when running scripts

Posted by Andrew Premdas Tue, 26 Aug 2008 01:04:46 GMT

Always seem to forget this and take ages finding it again

RAILS_ENV=production script/...

AASM gotchas

Posted by Andrew Premdas Fri, 15 Aug 2008 13:40:10 GMT

This one really got me!!

Whats wrong with the following

class Order < ActiveRecord::Base
  include AASM  
  aasm_initial_state :customer     
  aasm_column :state
  aasm_state :address      

  aasm_event :set_user do
    transitions :from => :customer, :to => :address
  end

end

Turn of Tabs in Textmate

Posted by Andrew Premdas Wed, 13 Aug 2008 21:03:39 GMT

God it took me a long time to find this again ...

If you want to you can disable tabs from the command line. Make sure TextMate isn't running, and then type:

defaults write com.macromates.textmate OakProjectWindowShowTabBarEnabled false

into the terminal. To bring tabs back, you'll have to:

defaults delete com.macromates.textmate OakProjectWindowShowTabBarEnabled

Winmerge for OSX

Posted by Andrew Premdas Wed, 13 Aug 2008 19:12:09 GMT

Slightly spurious title as there is absolutely no need for a winmerge for OSX. Included with the Developer Tools for OSX is filemerge, which is an excellent diff tool. There is also a tool to call it from a terminal called opendiff so you can do

opendiff  dir1 dir2
opendiff  file1  file2

You can also find filemerge using spotlight.