Sha256: a2b00c77ff5d0de481415fd915d576d9448c4a9a2b6a5261d3b3b7b0ddb7bccf

Contents?: true

Size: 1.28 KB

Versions: 12

Compression:

Stored size: 1.28 KB

Contents

require_relative "../sequel_warning"

$:.unshift(File.join(File.dirname(File.expand_path(__FILE__)), "../../lib/"))
require_relative "../../lib/sequel"

Sequel::Deprecation.backtrace_filter = lambda{|line, lineno| lineno < 4 || line =~ /_spec\.rb/}

gem 'minitest'
require 'minitest/autorun'
require 'minitest/hooks/default'

require_relative '../deprecation_helper'

class << Sequel::Model
  attr_writer :db_schema
  alias orig_columns columns
  def columns(*cols)
    return super if cols.empty?
    define_method(:columns){cols}
    @dataset.send(:columns=, cols) if @dataset
    def_column_accessor(*cols)
    @columns = cols
    @db_schema = {}
    cols.each{|c| @db_schema[c] = {}}
  end
end

Sequel::Model.use_transactions = false
Sequel::Model.cache_anonymous_models = false

db = Sequel.mock(:fetch=>{:id => 1, :x => 1}, :numrows=>1, :autoid=>proc{|sql| 10})
def db.schema(*) [[:id, {:primary_key=>true}]] end
def db.reset() sqls end
def db.supports_schema_parsing?() true end
Sequel::Model.db = DB = db

if ENV['SEQUEL_COLUMNS_INTROSPECTION']
  Sequel.extension :columns_introspection
  Sequel::Database.extension :columns_introspection
  Sequel::Mock::Dataset.send(:include, Sequel::ColumnsIntrospection)
end
if ENV['SEQUEL_NO_CACHE_ASSOCIATIONS']
  Sequel::Model.cache_associations = false
end

Version data entries

12 entries across 10 versions & 2 rubygems

Version Path
tdiary-5.0.8 vendor/bundle/gems/sequel-5.6.0/spec/model/spec_helper.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/sequel-5.6.0/spec/model/spec_helper.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/sequel-5.3.0/spec/model/spec_helper.rb
sequel-5.6.0 spec/model/spec_helper.rb
sequel-5.5.0 spec/model/spec_helper.rb
sequel-5.4.0 spec/model/spec_helper.rb
tdiary-5.0.7 vendor/bundle/gems/sequel-5.3.0/spec/model/spec_helper.rb
sequel-5.3.0 spec/model/spec_helper.rb
sequel-5.2.0 spec/model/spec_helper.rb
sequel-5.1.0 spec/model/spec_helper.rb
tdiary-5.0.6 vendor/bundle/gems/sequel-5.0.0/spec/model/spec_helper.rb
sequel-5.0.0 spec/model/spec_helper.rb