Sha256: b76a0ed7b4474f9b0179bc4e5cb92c46515a1a75e6e2d18ab4d4d99a7a4cbd15

Contents?: true

Size: 970 Bytes

Versions: 3

Compression:

Stored size: 970 Bytes

Contents

# frozen_string_literal: true
require 'active_record'

class DbRecord < ActiveRecord::Base
  def self.columns
    [
      # adhering to the ActiveRecord::ConnectionAdapters::Column contract
      OpenStruct.new(name: 'id', sql_type: 'integer', type: :integer),
      OpenStruct.new(name: 'string_attribute', sql_type: 'character varying(255)', type: :string),
      OpenStruct.new(name: 'uuid_attribute', sql_type: 'uuid', type: :uuid),
      OpenStruct.new(name: 'integer_attribute', sql_type: 'integer', type: :integer),
      OpenStruct.new(name: 'text_attribute', sql_type: 'text', type: :text),
      OpenStruct.new(name: 'datetime_attribute', sql_type: 'timestamp without time zone', type: :datetime),
      OpenStruct.new(name: 'date_attribute', sql_type: 'date', type: :date),
      OpenStruct.new(name: 'boolean_attribute', sql_type: 'boolean', type: :boolean),
      OpenStruct.new(name: 'array_attribute', sql_type: 'integer[]', type: :array)
    ]
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
grape-jsonapi-1.0.1 spec/support/models/db_record.rb
grape-jsonapi-1.0.0 spec/support/models/db_record.rb
grape_fast_jsonapi-0.2.6 spec/support/models/db_record.rb