Skip to content

Commit f0ff5f2

Browse files
committed
🚨 Linting
1 parent 94b6cec commit f0ff5f2

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

.rubocop_gradual.lock

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"README.md:2478083419": [
2+
"README.md:4226975945": [
33
[277, 3, 100, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 3592044714]
44
],
55
"bin/bundle:247448467": [
@@ -31,12 +31,17 @@
3131
[57, 13, 125, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 3604044426],
3232
[69, 13, 83, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 902334745]
3333
],
34-
"lib/omniauth/identity/models/rom.rb:1077115502": [
35-
[23, 9, 814, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 2641680277],
36-
[34, 33, 14, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 3392992668],
37-
[56, 13, 15, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 1768297560],
38-
[72, 18, 20, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 2230320645],
39-
[73, 54, 20, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 2230320645]
34+
"lib/omniauth/identity/models/rom.rb:1006067066": [
35+
[28, 9, 866, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 3432708653],
36+
[39, 33, 14, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 3392992668],
37+
[60, 13, 14, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 2710654061],
38+
[61, 25, 14, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 2710654061],
39+
[66, 13, 18, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 3343971124],
40+
[67, 13, 18, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 3343971124],
41+
[71, 13, 20, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 2230320645],
42+
[72, 13, 20, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 2230320645],
43+
[76, 13, 15, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 3094507655],
44+
[77, 14, 15, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 3094507655]
4045
],
4146
"lib/omniauth/identity/models/sequel.rb:101522047": [
4247
[44, 9, 3379, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 3595458005]
@@ -102,7 +107,7 @@
102107
[14, 1, 61, "RSpec/SpecFilePathFormat: Spec path should end with `omni_auth/identity/models/mongoid*_spec.rb`.", 2184534986],
103108
[32, 9, 71, "RSpec/SubjectStub: Do not stub methods of the object under test.", 399334056]
104109
],
105-
"spec_orms/rom_spec.rb:1364234352": [
110+
"spec_orms/rom_spec.rb:2272636079": [
106111
[5, 1, 57, "RSpec/SpecFilePathFormat: Spec path should end with `omni_auth/identity/models/rom*_spec.rb`.", 18469108],
107112
[6, 3, 12, "RSpec/BeforeAfterAll: Beware of using `before(:all)` as it may cause state to leak between tests. If you are using `rspec-rails`, and `use_transactional_fixtures` is enabled, then records created in `before(:all)` are not automatically rolled back.", 86334566]
108113
],

lib/omniauth/identity/models/rom.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ def locate(conditions)
9292
else
9393
conditions
9494
end
95-
return nil if key_value.nil?
95+
return if key_value.nil?
9696

9797
relation = rom_container.relations[rom_relation_name]
9898
identity_data = relation.where(auth_key_symbol => key_value).one
99-
return nil unless identity_data
99+
return unless identity_data
100100

101101
if owner_relation_name && identity_data[:owner_id]
102102
owner_data = rom_container.relations[owner_relation_name].where(id: identity_data[:owner_id]).one

spec_orms/rom_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
it "finds a record by custom auth key (login) when auth_key is set to :login" do
4646
# Temporarily switch the auth key to :login using the public Model.auth_key API
4747
original = model_klass.auth_key
48-
model_klass.auth_key :login
48+
model_klass.auth_key(:login)
4949

5050
begin
5151
# Insert test data using the login field
@@ -57,7 +57,7 @@
5757
expect(located.login).to(eq("bob"))
5858
ensure
5959
# Restore original auth_key to avoid leaking state between tests
60-
model_klass.auth_key original
60+
model_klass.auth_key(original)
6161
end
6262
end
6363

@@ -81,7 +81,7 @@
8181

8282
it "authenticates with custom auth_key (login) when auth_key is set to :login" do
8383
original = model_klass.auth_key
84-
model_klass.auth_key :login
84+
model_klass.auth_key(:login)
8585

8686
begin
8787
# Insert test data using login field
@@ -93,7 +93,7 @@
9393
expect(authenticated).to(be_a(RomTestIdentity))
9494
expect(authenticated.login).to(eq("bob"))
9595
ensure
96-
model_klass.auth_key original
96+
model_klass.auth_key(original)
9797
end
9898
end
9999

@@ -116,7 +116,7 @@
116116
describe "owner_relation_name" do
117117
it "loads associated owner data when owner_relation_name is configured" do
118118
# Set up owner_relation_name
119-
model_klass.owner_relation_name :rom_test_owners
119+
model_klass.owner_relation_name(:rom_test_owners)
120120

121121
# Insert owner data
122122
owner_data = {name: "John Doe"}

0 commit comments

Comments
 (0)