samvera / questioning_authority

Question your authorities
Other
54 stars 30 forks source link

don't limit `TableBasedAuthority#all` #319

Open no-reply opened 4 years ago

no-reply commented 4 years ago

authorities with more than 1000 entries have erratic behavior due to

https://github.com/samvera/questioning_authority/blob/2271be61d1a80abb324e835178f9d54acceee501/lib/qa/authorities/local/table_based_authority.rb#L47

it seems like it would be good enough to just remove the limit.

elrayle commented 3 years ago

Rather than remove the limit, I would be inclined to make it configurable. If the configured limit is nil, that can be used to effectively remove the limit.

Change to something like...

    def all
      Qa.config.tablebased_all_limit&.positive? ? output_set(base_relation.limit(1000)) : output_set(base_relation)
    end

The config would default to 1000 to maintain backward compatibility.