Skip to content

Commit 7da40aa

Browse files
committed
Style updates
1 parent 9f8d268 commit 7da40aa

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

app/models/user.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ def has_active_repos?
3939

4040
def token=(value)
4141
encrypted_token = crypt.encrypt_and_sign(value)
42-
write_attribute(:token, encrypted_token)
42+
self[:token] = encrypted_token
4343
end
4444

4545
def token
46-
encrypted_token = read_attribute(:token)
46+
encrypted_token = self[:token]
4747
unless encrypted_token.nil?
4848
crypt.decrypt_and_verify(encrypted_token)
4949
end

app/models/violation.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ def messages
1717

1818
def source=(value)
1919
encrypted_source = crypt.encrypt_and_sign(value)
20-
write_attribute(:source, encrypted_source)
20+
self[:source] = encrypted_source
2121
end
2222

2323
def source
24-
encrypted_source = read_attribute(:source)
24+
encrypted_source = self[:source]
2525
unless encrypted_source.nil?
2626
crypt.decrypt_and_verify(encrypted_source)
2727
end

app/services/complete_file_review.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def build_file_review_violations
3131
file_review.build_violation(
3232
line,
3333
violation.fetch(:message),
34-
violation.fetch(:source)
34+
violation.fetch(:source),
3535
)
3636
end
3737
end

spec/models/file_review_spec.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,16 @@
4141
line = build_line
4242
file_review = FileReview.new
4343

44-
file_review.build_violation(line, first_violation_message, "foo = bar(1, 2)")
45-
file_review.build_violation(line, other_violation_message, "foo = bar(1, 2)")
44+
file_review.build_violation(
45+
line,
46+
first_violation_message,
47+
"foo = bar(1, 2)"
48+
)
49+
file_review.build_violation(
50+
line,
51+
other_violation_message,
52+
"foo = bar(1, 2)"
53+
)
4654
violation = file_review.violations.first
4755

4856
expect(file_review.violations.size).to eq 1

spec/services/suggest_changes_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
violation = instance_double(
1010
"Violation",
1111
messages: [
12-
"Put a comma after the last parameter of a multiline method call."
12+
"Put a comma after the last parameter of a multiline method call.",
1313
],
14-
source: " violation.fetch(:source)"
14+
source: " violation.fetch(:source)",
1515
)
1616
suggest_changes = described_class.new(violation)
1717

@@ -31,7 +31,7 @@
3131
"Missing semicolon semi",
3232
"Something else",
3333
],
34-
source: " console.log('wat')"
34+
source: " console.log('wat')",
3535
)
3636
suggest_changes = described_class.new(violation)
3737

@@ -72,7 +72,7 @@
7272
"Layout/TrailingWhitespace: Trailing whitespace detected.",
7373
"Put a comma after the last parameter of a multiline method call.",
7474
],
75-
source: " violation.fetch(:source) "
75+
source: " violation.fetch(:source) ",
7676
)
7777
suggest_changes = described_class.new(violation)
7878

0 commit comments

Comments
 (0)