Sha256: caadfeabb278e1fb006cf1fcd9391b6f58eb9e5c48cdb00229a285a864b99fe0
Contents?: true
Size: 458 Bytes
Versions: 14
Compression:
Stored size: 458 Bytes
Contents
module ActiveMocker module ActiveRecord # @api private class Table attr_reader :name, :fields def initialize(name, id=true, fields=[]) @name = name @fields = fields fields.unshift Field.new('id', :integer, [{primary_key: true}]) if id.nil? end def to_h {name: name, fields: fields.to_h} end alias_method :to_hash, :to_h def column_names fields.map { |f| f.name } end end end end
Version data entries
14 entries across 14 versions & 1 rubygems