Sha256: ce41bdb1be28fd3369df655ffb8e6509f0cb55e8783094efc0cb4baee16477b4

Contents?: true

Size: 737 Bytes

Versions: 14

Compression:

Stored size: 737 Bytes

Contents

### Connection

DB = if RUBY_PLATFORM == 'java'
  Jdbc::SQLite3.load_driver
  Sequel.connect('jdbc:sqlite::memory:')
else
  Sequel.sqlite
end

Sequel::Model.instance_eval do
  def none
    where('1 = 0')
  end
end

### Tables

[:dummies, :fluffies, :bobbies].each do |m|
  DB.create_table m do
    primary_key :id
    String :string
    Integer :number
    Text :text
    Integer :dummy_id
  end
end

DB.create_table :loonies do
  Integer :fluffy_id
  String :string
end

### Classes

class Dummy < Sequel::Model
  one_to_many :fluffies
  one_to_many :bobbies
end

class Fluffy < Sequel::Model
  many_to_one :dummy
  one_to_one :loony
end

class Bobby < Sequel::Model
end

class Loony < Sequel::Model
end

class Rumba < Sequel::Model
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
protector-0.7.7 migrations/sequel.rb
protector-0.7.6 migrations/sequel.rb
protector-0.7.4 migrations/sequel.rb
protector-0.7.3 migrations/sequel.rb
protector-0.7.2 migrations/sequel.rb
protector-0.7.1 migrations/sequel.rb
protector-0.7.0 migrations/sequel.rb
protector-0.6.4 migrations/sequel.rb
protector-0.6.3 migrations/sequel.rb
protector-0.6.2 migrations/sequel.rb
protector-0.6.1 migrations/sequel.rb
protector-0.6.0 migrations/sequel.rb
protector-0.6.0.beta.1 migrations/sequel.rb
protector-0.5.5 migrations/sequel.rb