octoshark 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/lib/octoshark/active_record_extensions.rb +9 -3
- data/lib/octoshark/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d633a471d22eac63cd9221ccc6d05446f0dd374f
|
4
|
+
data.tar.gz: 17bbd7dd09f26461f283520e1a7dd2eec5224817
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e44c905b0c564be6446d7e9adde9d69cf6013da491da760194eeafc86c50b43322b1de1b036d1d1f18b6ba4a88f17a7740b399540f2f67d21a024f3152cf36f
|
7
|
+
data.tar.gz: ee16b4532fd1efc1709c3a401ae084de11e3bf62c53a657f5fab86bfa1fed022d2263c4a17d7d62b623362d1e432df5be2abdc3a8adcd64a43f381788a19937c
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-

|
2
2
|
|
3
|
-
|
3
|
+

|
4
4
|
|
5
5
|
Octoshark is a simple ActiveRecord connection switcher. It provides a general purpose connection switching mechanism that can be used in sharding and master-slave multi-database environments. It's up to you to specify how ActiveRecord models will use the Octoshark connections, see below for example scenarios.
|
6
6
|
|
@@ -155,6 +155,10 @@ def clean_database_with
|
|
155
155
|
end
|
156
156
|
```
|
157
157
|
|
158
|
+
## Logo
|
159
|
+
|
160
|
+
Thanks to [@saschamt](https://github.com/saschamt) for Octoshark logo design. :)
|
161
|
+
|
158
162
|
## Contributing
|
159
163
|
|
160
164
|
1. Fork it ( http://github.com/dalibor/octoshark/fork )
|
@@ -17,17 +17,23 @@ module Octoshark
|
|
17
17
|
end
|
18
18
|
|
19
19
|
module ActiveRecordAbstractAdapter
|
20
|
+
extend ActiveSupport::Concern
|
21
|
+
|
20
22
|
attr_accessor :connection_name
|
21
23
|
|
22
|
-
|
24
|
+
included do
|
25
|
+
alias_method_chain :log, :octoshark
|
26
|
+
end
|
27
|
+
|
28
|
+
def log_with_octoshark(sql, name = "SQL", *other_args, &block)
|
23
29
|
if connection_name
|
24
30
|
name = "[Octoshark: #{connection_name}] #{name}"
|
25
31
|
end
|
26
32
|
|
27
|
-
|
33
|
+
log_without_octoshark(sql, name, *other_args, &block)
|
28
34
|
end
|
29
35
|
end
|
30
36
|
end
|
31
37
|
|
32
38
|
ActiveRecord::Base.send(:include, Octoshark::ActiveRecordBase)
|
33
|
-
ActiveRecord::ConnectionAdapters::AbstractAdapter.send(:
|
39
|
+
ActiveRecord::ConnectionAdapters::AbstractAdapter.send(:include, Octoshark::ActiveRecordAbstractAdapter)
|
data/lib/octoshark/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octoshark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dalibor Nasevic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|