method

presence_in

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: Object
presence_in(another_object) public

Returns the receiver if it’s included in the argument otherwise returns nil. Argument must be any object which responds to #include?. Usage:

params[:bucket_type].presence_in %w( project calendar )

This will throw an ArgumentError if the argument doesn’t respond to #include?.

@return [Object]

Show source
Register or log in to add new notes.