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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53e985ab2b9d5543a4ff59616696ed9d17d246af
4
- data.tar.gz: fd26deee9c54db16d7c583281c2f9eecaaa2da95
3
+ metadata.gz: dbd7da2558e8d7d5c4cc1e23c6d57e914ff62450
4
+ data.tar.gz: e192096b29e378eb6eb16e9169bf79c87ff01e73
5
5
  SHA512:
6
- metadata.gz: 4b1cb3c5b734214492e77f915c1dc7c89fde634af00c20db2e5fe2a13a3c5b04e897f9c29bf70d79e4eae1489f01339dec1904f9ef40e87fda00bf9dcf7ea880
7
- data.tar.gz: 0dcf2bf161432d41147a19f86db211e03d2cec2c48ac989cbda6043cc3b6ebf65ceadbcab09316f98a6a5aed445017a3578d574cff661bf96dc5e5f84822ff3f
6
+ metadata.gz: 166c750b4c380b93c72a24ecd238fb615c829576199862fa25ecbed5a2fef78fa67952a3de73b2723494872d5071a3ff5f3b21249a860c212ed2e728b9310664
7
+ data.tar.gz: be7646cd2161653c409cf33c842b937ca2df4196e476f749e88bc212582bd697a37a10fdcaf5c7fcd8a340861013a832455d49bc85ad086b54167f5bcb34e248
@@ -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 = Mongoid.default_session.with(safe: true)
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)
@@ -1,3 +1,3 @@
1
1
  module MongoidLogger
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
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.1
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-11-13 00:00:00.000000000 Z
12
+ date: 2013-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport