Skip to content

Commit

Permalink
update select method
Browse files Browse the repository at this point in the history
  • Loading branch information
jflack-bf committed Sep 11, 2024
1 parent b36f268 commit 9bce773
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/active_force/active_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,17 @@ def where args=nil, *rest
super build_condition args, rest
end

def select *selected_fields
selected_fields.map! { |field| mappings[field] }
super *selected_fields
def select *selected_fields, &block
if block
result = []
self.each do |record|
result << record if block.call(record)
end
result
else
selected_fields.map! { |field| mappings[field] }
super *selected_fields
end
end

def ids
Expand Down

0 comments on commit 9bce773

Please sign in to comment.