sciencehistory / scihist_digicoll

Science History Institute Digital Collections
Other
11 stars 0 forks source link

take non-ransack key out of ransack hash key (was: Ransack should work identically in production and dev.) #2359

Open eddierubeiz opened 1 year ago

eddierubeiz commented 1 year ago

In config/initializers/ransack.rb the line c.ignore_unknown_conditions = Rails.env.production? has caused confusion several times. The setting also prevents developers from testing the filter for review_requested and ocr_requested.

c.ignore_unknown_conditions should probably not have different settings in dev and production.

eddierubeiz commented 1 year ago

We've also discussed getting rid of ransack completely, which could be another ticket.

jrochkind commented 1 year ago

So I think the initial thinking (of me or of ransack defaults) was that in production you don't want an error for this, you just want a no-op -- but in development, you want to know you've asked for something ransack will do nothing with.

if they are going to be the same in both... I'd almost want it to be false in both, to raise in both!

But then we'd still have this problem.

The issue, I think, is we're putting a param in the ransack sub-hash, that ransack isn't actually handling.

So other solutions might be:

The first one is probably best? If I understand what's up right and it works?

eddierubeiz commented 1 year ago

Yeah - I'm in favor of option 1.