Skip to content

Instantly share code, notes, and snippets.

@bloopletech
Created November 13, 2009 12:53
Show Gist options
  • Save bloopletech/233801 to your computer and use it in GitHub Desktop.
Save bloopletech/233801 to your computer and use it in GitHub Desktop.
class ActiveRecord::Base
def self.fake_model(*columns_arr)
alias_method :save, :valid?
def columns
@columns ||= []
end
@columns ||= []
columns_arr.each do |name|
columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, '', 'string', true)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment