Skip to content

Instantly share code, notes, and snippets.

@cbeer
Created September 13, 2010 18:32
Show Gist options
  • Save cbeer/577776 to your computer and use it in GitHub Desktop.
Save cbeer/577776 to your computer and use it in GitHub Desktop.
class Surrogate < ActiveRecord::Base
def self.columns()
@columns ||= [];
end
def self.column(name, sql_type = nil, default = nil, null = true)
columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)
end
def save
end
def new_record?
false
end
def update
end
column :id, :string
column :title, :string
acts_as_commentable
acts_as_taggable
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment