lines 0.1.25 → 0.1.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTI4MDczNmE2NTQ0NzYxNjk4MWI0ZDI1OTNjNzYxMDJmMDc2YTNhYg==
4
+ YTY4ODEyZDBhZjRkNTgxY2JkOGI4NGY4ZDQ3Y2U5ZWQ0YmE5YTkyMg==
5
5
  data.tar.gz: !binary |-
6
- NDc0YmRiNWU2ZDczNDIzZTg4NDlmZjE3NjVkZmU0ZGQ0MzA5MjJjOA==
6
+ NDc1NTBjMjY0ZTExNjJiNzIxNmI0YTgwZGJiZTRhNWFlODBhMTAzNg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NzhmMjY0NGVjOWYyZWEzNzM4NjMyMzYxZDVlOTExNTVlZjkyYjBmNGZkNjky
10
- OWYzZmVmOWJjNTcxNGI3NDg3NWJkYTk5MDk1ZTEyNjlkMWRjMGYzODA4MWI5
11
- Y2UwM2NmOGY1Mzk4Y2UwNzBiNWNlMWFlNDAwY2QwNmM3OGM3Mzg=
9
+ MThiZTY3ZTM4NDViYjFlNTQ5MmIyM2UwMjdiYTA2ZWVkMDMwYTA5NDk4MmM3
10
+ OGU5N2FjYWYzYzAyMWJlZGZlNDM5NzA2NjA4N2YyNDNiYjk0MTg0ZGJhOWU2
11
+ YWMzMzcxNjA5MmI1NjRlMGFiYjI2YTJlZWQwZWVhM2JmMGE2MzE=
12
12
  data.tar.gz: !binary |-
13
- NzdiM2Y1NjJmZGMwY2YzNzNmNTkxMWYwZTNkNWU0NDVmNzJmY2Y4ODViNjNj
14
- MWUwZjU2NGY0ZmY3MjY4OGU1M2ViNGMwODk3NzQ0YmRkZWFjMjk3MWUyYTk1
15
- N2ZjYTJhMDIwZGQ3ZmNkZDU1OWNhMzNkYzM0OWQ0Zjk5NjY0OWY=
13
+ NWVjNjgzZTE4MWNlNmEwNTA0NWM2NzQxN2E2ZGIwMDYwNzVkMGZkNDZiNWE5
14
+ ZDE3YmM4OTBhMzI0ZmFjOTM0ODVhMmUwZDJkNWY3OWRlYmJkZjUwMzczMzg0
15
+ YjZiZTViM2ZmNDc2ZGEyY2NmMmQ1ZTQyMmU4M2NhZjAyMmRhN2Y=
@@ -1,4 +1,9 @@
1
1
 
2
+ 0.1.26 / 2013-07-10
3
+ ===================
4
+
5
+ * Fixes double outputs from ActiveRecord
6
+
2
7
  0.1.25 / 2013-07-10 : the "hopefully all syslog issues are fixes" edition
3
8
  ===================
4
9
 
@@ -33,5 +33,20 @@ module Lines
33
33
  end
34
34
  end
35
35
 
36
+ # Remove the default ActiveRecord::LogSubscriber to avoid double outputs
37
+ ActiveSupport::LogSubscriber.log_subscribers.each do |subscriber|
38
+ if subscriber.is_a?(ActiveRecord::LogSubscriber)
39
+ component = :active_record
40
+ events = subscriber.public_methods(false).reject{ |method| method.to_s == 'call' }
41
+ events.each do |event|
42
+ ActiveSupport::Notifications.notifier.listeners_for("#{event}.#{component}").each do |listener|
43
+ if listener.instance_variable_get('@delegate') == subscriber
44
+ ActiveSupport::Notifications.unsubscribe listener
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
36
50
  ActiveRecord::Base.logger = Lines.logger
37
51
  Lines::ActiveRecordSubscriber.attach_to :active_record
52
+
@@ -1,3 +1,3 @@
1
1
  module Lines
2
- VERSION = "0.1.25"
2
+ VERSION = "0.1.26"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lines
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.25
4
+ version: 0.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Pfenniger