Skip to content

Commit 2176f8a

Browse files
Split, rather than slicing. Also use a variable for clarity.
1 parent e83898d commit 2176f8a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/chatops/controller/test_case_helpers.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ def chatop(method, params = {})
1717
:user => user
1818
}
1919

20-
if Rails.version.slice(0).to_i >= 5
20+
major_version = Rails.version.split('.')[0].to_i
21+
if major_version >= 5
2122
post :execute_chatop, params: params.merge(chatop: method)
2223
else
2324
post :execute_chatop, params.merge(chatop: method)

0 commit comments

Comments
 (0)