Sha256: 407aa6aabb2e544758a108028a2cb6197175702ec756e6b989d1100b84f7c3e0

Contents?: true

Size: 503 Bytes

Versions: 2

Compression:

Stored size: 503 Bytes

Contents

require "active_record"

class User < ActiveRecord::Base
  has_one :profile
  has_many :projects
  validates :email, length: { minimum: 1, maximum: 120 }
end

class Profile < ActiveRecord::Base
  belongs_to :user
end

class Project < ActiveRecord::Base
  belongs_to :user
end

Dir::mkdir("db") unless File.exists?("db")

ActiveRecord::Base.establish_connection \
  :adapter => "sqlite3",
  :database => "db/test.db",
  :pool => 5,
  :timeout => 5000

ActiveRecord::Migrator.migrate("./spec/db/migrate")

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ar2gostruct-0.2.2 spec/support/models.rb
ar2gostruct-0.2.1 spec/support/models.rb