Skip to content

Support for find with a block is missing #73

@bbraschi

Description

@bbraschi

FrozenRecord.Scope#find, in frozen_record/scope.rb, does not support that a block is passed to it

    def find(id)
      raise RecordNotFound, "Can't lookup record without ID" unless id

      scope = self
      if @limit || @offset
        scope = limit(nil).offset(nil)
      end
      scope.find_by_id(id) or raise RecordNotFound, "Couldn't find a record with ID = #{id.inspect}"
    end

It seems it should, as ActiveRecord.FinderMethods#find in active_record/relation/finder_methods.rb

    def find(*args)
     return super if block_given?
     find_with_ids(*args)
   end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions