instance method
select
Ruby on Rails 3.0.20
Since v3.0.20Signature
select(value = Proc.new)
No documentation comment.
Parameters
-
valueopt = Proc.new
Source
# File activerecord/lib/active_record/relation/query_methods.rb, line 34
def select(value = Proc.new)
if block_given?
to_a.select {|*block_args| value.call(*block_args) }
else
relation = clone
relation.select_values += Array.wrap(value)
relation
end
end
Defined in activerecord/lib/active_record/relation/query_methods.rb line 34
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::QueryMethods