instance method
itself
Ruby on Rails 4.2.11.3
Since v4.2.11.3 Last seen in v4.2.11.3Signature
itself()
Returns the object itself.
Useful for chaining methods, such as Active Record scopes:
Event.public_send(state.presence_in([ :trashed, :drafted ]) || :itself).order(:created_at)
@return Object
Source
# File activesupport/lib/active_support/core_ext/object/itself.rb, line 11
def itself
self
end
Defined in activesupport/lib/active_support/core_ext/object/itself.rb line 11
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Object