Skip to content

Commit c1e0caa

Browse files
committed
squash: active record
1 parent 43112a3 commit c1e0caa

File tree

6 files changed

+31
-31
lines changed

6 files changed

+31
-31
lines changed

instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,91 +29,91 @@ def destroy!
2929
end
3030
end
3131

32-
def becomes(klass)
32+
def becomes(...)
3333
tracer.in_span("#{self.class}#becomes") do
3434
super
3535
end
3636
end
3737

38-
def becomes!(klass)
38+
def becomes!(...)
3939
tracer.in_span("#{self.class}#becomes!") do
4040
super
4141
end
4242
end
4343

44-
def update_attribute(name, value)
44+
def update_attribute(...)
4545
tracer.in_span("#{self.class}#update_attribute") do
4646
super
4747
end
4848
end
4949

50-
def update(attributes)
50+
def update(...)
5151
tracer.in_span("#{self.class}#update") do
5252
super
5353
end
5454
end
5555

56-
def update!(attributes)
56+
def update!(...)
5757
tracer.in_span("#{self.class}#update!") do
5858
super
5959
end
6060
end
6161

62-
def update_column(name, value)
62+
def update_column(...)
6363
tracer.in_span("#{self.class}#update_column") do
6464
super
6565
end
6666
end
6767

68-
def update_columns(attributes)
68+
def update_columns(...)
6969
tracer.in_span("#{self.class}#update_columns") do
7070
super
7171
end
7272
end
7373

74-
def increment(attribute, by = 1)
74+
def increment(...)
7575
tracer.in_span("#{self.class}#increment") do
7676
super
7777
end
7878
end
7979

80-
def increment!(attribute, by = 1, touch: nil)
80+
def increment!(...)
8181
tracer.in_span("#{self.class}#increment!") do
8282
super
8383
end
8484
end
8585

86-
def decrement(attribute, by = 1)
86+
def decrement(...)
8787
tracer.in_span("#{self.class}#decrement") do
8888
super
8989
end
9090
end
9191

92-
def decrement!(attribute, by = 1, touch: nil)
92+
def decrement!(...)
9393
tracer.in_span("#{self.class}#decrement!") do
9494
super
9595
end
9696
end
9797

98-
def toggle(attribute)
98+
def toggle(...)
9999
tracer.in_span("#{self.class}#toggle") do
100100
super
101101
end
102102
end
103103

104-
def toggle!(attribute)
104+
def toggle!(...)
105105
tracer.in_span("#{self.class}#toggle!") do
106106
super
107107
end
108108
end
109109

110-
def reload(options = nil)
110+
def reload(...)
111111
tracer.in_span("#{self.class}#reload") do
112112
super
113113
end
114114
end
115115

116-
def touch(*names, time: nil)
116+
def touch(...)
117117
tracer.in_span("#{self.class}#touch") do
118118
super
119119
end

instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence_class_methods.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,31 @@ class << base
1818

1919
# Contains ActiveRecord::Persistence::ClassMethods to be patched
2020
module ClassMethods
21-
def create(attributes = nil, &block)
21+
def create(...)
2222
tracer.in_span("#{self}.create") do
2323
super
2424
end
2525
end
2626

27-
def create!(attributes = nil, &block)
27+
def create!(...)
2828
tracer.in_span("#{self}.create!") do
2929
super
3030
end
3131
end
3232

33-
def update(id = :all, attributes) # rubocop:disable Style/OptionalArguments
33+
def update(...)
3434
tracer.in_span("#{self}.update") do
3535
super
3636
end
3737
end
3838

39-
def destroy(id)
39+
def destroy(...)
4040
tracer.in_span("#{self}.destroy") do
4141
super
4242
end
4343
end
4444

45-
def delete(id_or_array)
45+
def delete(...)
4646
tracer.in_span("#{self}.delete") do
4747
super
4848
end

instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence_insert_class_methods.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,37 @@ class << base
1818

1919
# Contains ActiveRecord::Persistence::ClassMethods to be patched
2020
module ClassMethods
21-
ruby2_keywords def insert(*args)
21+
def insert(...)
2222
tracer.in_span("#{self}.insert") do
2323
super
2424
end
2525
end
2626

27-
ruby2_keywords def insert_all(*args)
27+
def insert_all(...)
2828
tracer.in_span("#{self}.insert_all") do
2929
super
3030
end
3131
end
3232

33-
ruby2_keywords def insert!(*args)
33+
def insert!(...)
3434
tracer.in_span("#{self}.insert!") do
3535
super
3636
end
3737
end
3838

39-
ruby2_keywords def insert_all!(*args)
39+
def insert_all!(...)
4040
tracer.in_span("#{self}.insert_all!") do
4141
super
4242
end
4343
end
4444

45-
ruby2_keywords def upsert(*args)
45+
def upsert(...)
4646
tracer.in_span("#{self}.upsert") do
4747
super
4848
end
4949
end
5050

51-
ruby2_keywords def upsert_all(*args)
51+
def upsert_all(...)
5252
tracer.in_span("#{self}.upsert_all") do
5353
super
5454
end

instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/relation_persistence.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ module ActiveRecord
1010
module Patches
1111
# Module to prepend to ActiveRecord::Relation for instrumentation
1212
module RelationPersistence
13-
def update_all(*)
13+
def update_all(...)
1414
tracer.in_span("#{model.name}.update_all") do
1515
super
1616
end
1717
end
1818

19-
def delete_all(*)
19+
def delete_all(...)
2020
tracer.in_span("#{model.name}.delete_all") do
2121
super
2222
end

instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/transactions_class_methods.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class << base
1818

1919
# Contains ActiveRecord::Transactions::ClassMethods to be patched
2020
module ClassMethods
21-
def transaction(**options, &block)
21+
def transaction(...)
2222
tracer.in_span('ActiveRecord.transaction', attributes: { 'code.namespace' => name }) do
2323
super
2424
end

instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/validations.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ module Patches
1414
# https://github.com/rails/rails/blob/v5.2.4.5/activerecord/lib/active_record/validations.rb#L42-L53
1515
# Contains the ActiveRecord::Validations methods to be patched
1616
module Validations
17-
def save(**options)
17+
def save(...)
1818
tracer.in_span("#{self.class}#save") do
1919
super
2020
end
2121
end
2222

23-
def save!(**options)
23+
def save!(...)
2424
tracer.in_span("#{self.class}#save!") do
2525
super
2626
end

0 commit comments

Comments
 (0)