Sha256: bbddc240474c999db30acca66063997524a3d9d07446aa628c45d1d23ae2ecf9

Contents?: true

Size: 407 Bytes

Versions: 3

Compression:

Stored size: 407 Bytes

Contents

#
# See http://railscasts.com/episodes/193-tableless-model
#
class TablelessModel < 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 initialize(attributes = nil)
    super(attributes)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
auxiliary_addons-0.5.6 lib/auxiliary_addons/tableless_model.rb
auxiliary_addons-0.5.5 lib/auxiliary_addons/tableless_model.rb
auxiliary_addons-0.5.4 lib/auxiliary_addons/tableless_model.rb