Sha256: 703ba7897f543996de8985f919ca019ade679c9152a17583e52b191ce2ace55a

Contents?: true

Size: 730 Bytes

Versions: 6

Compression:

Stored size: 730 Bytes

Contents

module ActiveRecord
  class BaseWithoutTable < Base
    self.abstract_class = true
    
    def create_or_update
      errors.empty?
    end
    
    class << self
      def columns()
        @columns ||= []
      end
      
      def column(name, sql_type = nil, default = nil, null = true)
        columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)
        reset_column_information
      end
      
      # Do not reset @columns
      def reset_column_information
        generated_methods.each { |name| undef_method(name) }
        @column_names = @columns_hash = @content_columns = @dynamic_methods_hash = @read_methods = nil
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jcnetdev-active_record_without_table-1.0.20070427 lib/active_record/base_without_table.rb
jcnetdev-active_record_without_table-1.0.200807032 lib/active_record/base_without_table.rb
jcnetdev-active_record_without_table-1.0.200807033 lib/active_record/base_without_table.rb
jcnetdev-active_record_without_table-1.0.20080704 lib/active_record/base_without_table.rb
jcnetdev-active_record_without_table-1.0.20080705 lib/active_record/base_without_table.rb
jcnetdev-active_record_without_table-1.1 lib/active_record/base_without_table.rb