active_record_slave 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_record_slave/slave.rb +6 -0
- data/lib/active_record_slave/version.rb +1 -1
- data/test/active_record_slave_test.rb +2 -9
- data/test/test.sqlite3 +0 -0
- data/test/test_helper.rb +14 -0
- data/test/test_slave.sqlite3 +0 -0
- metadata +8 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99bdf4d7588229de3ab130af6ded5d46b2488bed
|
4
|
+
data.tar.gz: 465b4f5a5c037702fe3e1a8ec0f535ceefbd3418
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63618a6ca32f59027db8a2f8b491616561c5566c25122f2e6b0e50cc44494bb0e36d6b862a388b22d8b8962f1fd1e0193864a66198af865925f17ec7a73bca0a
|
7
|
+
data.tar.gz: 6ddc32f2cecd2dc61891930db2c1d532e1d4f7970b24e884faea149eece50d04b8f7646bce8e42e681220d217ee93d9653f53c342c72d5922da68ec479ea56fe
|
@@ -1,6 +1,12 @@
|
|
1
1
|
module ActiveRecordSlave
|
2
2
|
# Class to hold slave connection pool
|
3
3
|
class Slave < ActiveRecord::Base
|
4
|
+
# Prevent Rails from trying to create an instance of this model
|
4
5
|
self.abstract_class = true
|
6
|
+
|
7
|
+
# Since this is an abstract class so it has no columns
|
8
|
+
def self.columns
|
9
|
+
[]
|
10
|
+
end
|
5
11
|
end
|
6
12
|
end
|
@@ -1,13 +1,6 @@
|
|
1
|
-
|
2
|
-
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
|
3
|
-
|
4
|
-
require 'rubygems'
|
1
|
+
require File.join(File.dirname(__FILE__), 'test_helper')
|
5
2
|
require 'logger'
|
6
3
|
require 'erb'
|
7
|
-
require 'test/unit'
|
8
|
-
require 'shoulda'
|
9
|
-
require 'active_record'
|
10
|
-
require 'active_record_slave'
|
11
4
|
|
12
5
|
l = Logger.new('test.log')
|
13
6
|
l.level = ::Logger::DEBUG
|
@@ -48,7 +41,7 @@ ActiveRecordSlave.install!(nil, 'test')
|
|
48
41
|
#
|
49
42
|
# Unit Test for active_record_slave
|
50
43
|
#
|
51
|
-
class ActiveRecordSlaveTest < Test
|
44
|
+
class ActiveRecordSlaveTest < Minitest::Test
|
52
45
|
context 'the active_record_slave gem' do
|
53
46
|
|
54
47
|
setup do
|
data/test/test.sqlite3
CHANGED
Binary file
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# Allow test to be run in-place without requiring a gem install
|
2
|
+
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
|
3
|
+
|
4
|
+
# Configure Rails Environment
|
5
|
+
ENV['RAILS_ENV'] = 'test'
|
6
|
+
|
7
|
+
require 'active_record'
|
8
|
+
require 'minitest/autorun'
|
9
|
+
require 'minitest/reporters'
|
10
|
+
require 'minitest/stub_any_instance'
|
11
|
+
require 'shoulda/context'
|
12
|
+
require 'active_record_slave'
|
13
|
+
|
14
|
+
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
|
data/test/test_slave.sqlite3
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,43 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_slave
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reid Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activerecord
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: thread_safe
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.1.0
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.1.0
|
26
|
+
version: '3.0'
|
41
27
|
description:
|
42
28
|
email:
|
43
29
|
- reidmo@gmail.com
|
@@ -57,6 +43,7 @@ files:
|
|
57
43
|
- test/active_record_slave_test.rb
|
58
44
|
- test/database.yml
|
59
45
|
- test/test.sqlite3
|
46
|
+
- test/test_helper.rb
|
60
47
|
- test/test_slave.sqlite3
|
61
48
|
homepage: https://github.com/reidmorrison/active_record_slave
|
62
49
|
licenses:
|
@@ -78,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
65
|
version: '0'
|
79
66
|
requirements: []
|
80
67
|
rubyforge_project:
|
81
|
-
rubygems_version: 2.
|
68
|
+
rubygems_version: 2.4.5
|
82
69
|
signing_key:
|
83
70
|
specification_version: 4
|
84
71
|
summary: ActiveRecord drop-in solution to efficiently redirect reads to slave databases
|
@@ -86,4 +73,5 @@ test_files:
|
|
86
73
|
- test/active_record_slave_test.rb
|
87
74
|
- test/database.yml
|
88
75
|
- test/test.sqlite3
|
76
|
+
- test/test_helper.rb
|
89
77
|
- test/test_slave.sqlite3
|