Tags
webcam vindaloo version vegan unix unicef trojan todo thinkpad textmate testing tagging syntax svn subversion sphinx spaces solaris sitemap sinatra sheet security search schema_info SchemaInfo ruby rinari relationships refresh rdiff-backup ramaze railsconf08 railsconf07 rails protools production power placeboeffect pink floyd PIC perl overheat outbreak osx os x NYHS NYC netbeans nanophotonics mysql music MPEG-4 model migration microvolunteer macbook mac log linux less leopard keynote JAX javascript java imunizator highlighting Handbrake haml hacks google geocoding genghistron gem gaming gabrielle's funny functional fun friends food fixes fixed firefox FF3 ferret fantasy' emacs DV donate datarecovery database D&D converter conference computing cheat capistrano business bribesThe Decider said on Mon Jul 30 14:18:50 +0000 2007 | permalink
Tagged: migration version schema_info SchemaInfo
Getting at schema_info or SchemaInfo
I’m writing a utility that will be executed using script/runner and needed to get at the table schema_info where the migration version is held. This worked:
class SchemaInfo < ActiveRecord::Base
set_table_name :schema_info
set_primary_key :version
attr_accessor :version
def version_before_type_cast
end
def self.version
self.find(:first).id
end
end
[1514][chadb@Jokerman:~/Sites/surveil/trunk]$ script/console Loading development environment. >> SchemaInfo.version => 149 >> quit