You could add this somewhere, for instance in environment.rb:
class ActiveRecord::Base def self.map_column(legacy, nice) class_eval <<-EOS def #{nice} #{legacy} end
def #{nice}=(val) self.#{legacy} = val end EOS end end
The usage is
class Model < ActiveRecord::Base map_column :_job, :job_id map_column :_change, :change_id ... end
You see the technique in case you prefer another kind of macro. BTW, that cannot be based on alias_method because AR accessors are not defined by then.
-- fxn