app/controllers/api/base_controller/logger.rb
Use caller(1..1).first
instead of caller.first
. Open
Open
method = api_get_method_name(caller.first, __method__)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop identifies places where caller[n]
can be replaced by caller(n..n).first
.
Example:
# bad
caller[1]
caller.first
caller_locations[1]
caller_locations.first
# good
caller(2..2).first
caller(1..1).first
caller_locations(2..2).first
caller_locations(1..1).first
Use caller(1..1).first
instead of caller.first
. Open
Open
method = api_get_method_name(caller.first, __method__)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop identifies places where caller[n]
can be replaced by caller(n..n).first
.
Example:
# bad
caller[1]
caller.first
caller_locations[1]
caller_locations.first
# good
caller(2..2).first
caller(1..1).first
caller_locations(2..2).first
caller_locations(1..1).first
Use caller(1..1).first
instead of caller.first
. Open
Open
method = api_get_method_name(caller.first, __method__)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop identifies places where caller[n]
can be replaced by caller(n..n).first
.
Example:
# bad
caller[1]
caller.first
caller_locations[1]
caller_locations.first
# good
caller(2..2).first
caller(1..1).first
caller_locations(2..2).first
caller_locations(1..1).first
Use caller(1..1).first
instead of caller.first
. Open
Open
method = api_get_method_name(caller.first, __method__)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop identifies places where caller[n]
can be replaced by caller(n..n).first
.
Example:
# bad
caller[1]
caller.first
caller_locations[1]
caller_locations.first
# good
caller(2..2).first
caller(1..1).first
caller_locations(2..2).first
caller_locations(1..1).first