Sha256: b2444ff783e3592fe885580f3eb8befd52a5e6c4153bbe47321c02afdb4c8239

Contents?: true

Size: 1.06 KB

Versions: 6

Compression:

Stored size: 1.06 KB

Contents

if ADAPTER=='mongoid'
  require 'mongoid'
  Mongoid.configure do |config|
    name = "lolita3_test"
    host = "localhost"
    config.master = Mongo::Connection.new.db(name)
    config.slaves = [
      Mongo::Connection.new(host, 27017, :slave_ok => true).db(name)
    ]
    #config.use_object_ids = true
    config.persist_in_safe_mode = false
  end
else
  require 'active_record'
  ActiveRecord::Base.establish_connection({ :database => ":memory:", :adapter => 'sqlite3', :timeout => 500 })
  ActiveRecord::Schema.define do
    create_table :posts, :force => true do |t|
      t.string :field_one
    end
    create_table :test_class2, :force => true do |t|
      t.string :field_one
    end
    create_table :pages,:force=>true do |t|
      t.string :name
    end
  end
  
  class Comment < ActiveRecord::Base
    belongs_to :test_class1, :class_name=>"Post"
  end
  class Post < ActiveRecord::Base
    has_many :pages
    include Lolita::Configuration
    lolita 
  end


  class Profile < ActiveRecord::Base
    include Lolita::Configuration
    lolita do
      
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lolita-3.1.0 spec/adapter_helper.rb
lolita-3.0.7 spec/adapter_helper.rb
lolita-3.0.6 spec/adapter_helper.rb
lolita-3.0.5 spec/adapter_helper.rb
lolita-3.0.4 spec/adapter_helper.rb
lolita-3.0.3 spec/adapter_helper.rb