lines 0.1.25 → 0.1.26
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 +8 -8
 - data/CHANGELOG.md +5 -0
 - data/lib/lines/active_record.rb +15 -0
 - data/lib/lines/version.rb +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            !binary "U0hBMQ==":
         
     | 
| 
       3 
3 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
      
 4 
     | 
    
         
            +
                YTY4ODEyZDBhZjRkNTgxY2JkOGI4NGY4ZDQ3Y2U5ZWQ0YmE5YTkyMg==
         
     | 
| 
       5 
5 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                NDc1NTBjMjY0ZTExNjJiNzIxNmI0YTgwZGJiZTRhNWFlODBhMTAzNg==
         
     | 
| 
       7 
7 
     | 
    
         
             
            !binary "U0hBNTEy":
         
     | 
| 
       8 
8 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
      
 9 
     | 
    
         
            +
                MThiZTY3ZTM4NDViYjFlNTQ5MmIyM2UwMjdiYTA2ZWVkMDMwYTA5NDk4MmM3
         
     | 
| 
      
 10 
     | 
    
         
            +
                OGU5N2FjYWYzYzAyMWJlZGZlNDM5NzA2NjA4N2YyNDNiYjk0MTg0ZGJhOWU2
         
     | 
| 
      
 11 
     | 
    
         
            +
                YWMzMzcxNjA5MmI1NjRlMGFiYjI2YTJlZWQwZWVhM2JmMGE2MzE=
         
     | 
| 
       12 
12 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                 
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 13 
     | 
    
         
            +
                NWVjNjgzZTE4MWNlNmEwNTA0NWM2NzQxN2E2ZGIwMDYwNzVkMGZkNDZiNWE5
         
     | 
| 
      
 14 
     | 
    
         
            +
                ZDE3YmM4OTBhMzI0ZmFjOTM0ODVhMmUwZDJkNWY3OWRlYmJkZjUwMzczMzg0
         
     | 
| 
      
 15 
     | 
    
         
            +
                YjZiZTViM2ZmNDc2ZGEyY2NmMmQ1ZTQyMmU4M2NhZjAyMmRhN2Y=
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/lib/lines/active_record.rb
    CHANGED
    
    | 
         @@ -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 
     | 
    
         
            +
             
     | 
    
        data/lib/lines/version.rb
    CHANGED