front and back-end web development, Leeds, UK

Richard's Blog - Design, coding and life in Japan


Blog Archive: January 2010

Get an array of associations for a rails model

This one got me stuck as I couldn't see any such methods in the ActiveRecord API, but with a little help from Google Ruby on Rails: Talk group I managed to work it out.

ClassName.reflect_on_all_associations.collect {|assoc|}

Easy as that


Recent Blog Posts