mongoid_logger 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mongoid_logger/base.rb +9 -1
- data/lib/mongoid_logger/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: dbd7da2558e8d7d5c4cc1e23c6d57e914ff62450
|
4
|
+
data.tar.gz: e192096b29e378eb6eb16e9169bf79c87ff01e73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 166c750b4c380b93c72a24ecd238fb615c829576199862fa25ecbed5a2fef78fa67952a3de73b2723494872d5071a3ff5f3b21249a860c212ed2e728b9310664
|
7
|
+
data.tar.gz: be7646cd2161653c409cf33c842b937ca2df4196e476f749e88bc212582bd697a37a10fdcaf5c7fcd8a340861013a832455d49bc85ad086b54167f5bcb34e248
|
data/lib/mongoid_logger/base.rb
CHANGED
@@ -102,7 +102,7 @@ module MongoidLogger
|
|
102
102
|
@mongo_collection_names.default = base_name
|
103
103
|
|
104
104
|
@application_name = @db_configuration["application_name"]
|
105
|
-
@session =
|
105
|
+
@session = mongoid_session
|
106
106
|
confirm_collection
|
107
107
|
|
108
108
|
@mongo_collections = @mongo_collection_names.each_with_object({}){|(k, col_name), d| d[k] = @session[col_name] }
|
@@ -115,6 +115,14 @@ module MongoidLogger
|
|
115
115
|
{}
|
116
116
|
end
|
117
117
|
|
118
|
+
def mongoid_session
|
119
|
+
if session_name = @db_configuration["session"]
|
120
|
+
Mongoid.session(session_name)
|
121
|
+
else
|
122
|
+
Mongoid.default_session
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
118
126
|
def insert_document(doc)
|
119
127
|
doc[:level] = doc[:messages].map(&:first).min || 0
|
120
128
|
return if @ignore_block && @ignore_block.call(doc)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- akima
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-12-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|