aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/object/itself.rb
blob: df613c4e4f4f2066b194b1e2b8ba6483347a133b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
class Object
  # 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