You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def find(*args)
args = args[0] if args[0].is_a? Array
return args.collect { |id| find(id) } if args.count > 1
find_by(primary_key => args[0])
end
Seems to work. In Hyperstack ActiveRecord#find returns a nil if record is not found. In Rails it raises a ActiveRecord::RecordNotFound exception. I'm OK with this behavior, but we could also filter out the nil values when returning an array?
Still have to write a testcase, hope to push a pull request for this in the coming days.
Currently ActiveRecord::Base.find([1,2,3]) returns a single record.
Should be an array of multiple records.
https://api.rubyonrails.org/classes/ActiveRecord/FinderMethods.html#method-i-find
The text was updated successfully, but these errors were encountered: