blob: 3065e956c610142f38d6a104206be7ad6b207933 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
class Object
unless respond_to?(:itself) # TODO: Remove this file when we drop support for Ruby < 2.2
# Returns the object itself. Useful when dealing with a chaining scenario, like Active Record scopes:
#
# Event.public_send(state.presence_in?([ :trashed, :drafted ]) || :itself).order(:created_at)
#
# @return Object
def itself
self
end
end
end
|