projectblacklight / blacklight

Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr) index.
http://projectblacklight.org/
Other
757 stars 255 forks source link

Use the new method for getting secret_key_base #3124

Closed jcoyne closed 5 months ago

jcoyne commented 5 months ago

See https://blog.saeloun.com/2023/08/11/rails-7-1-store-secret-key-base-in-rails-config/

jrochkind commented 5 months ago

The gemfile for blacklight main branch allows Rails down to 6.1

https://github.com/projectblacklight/blacklight/blob/a36d8fbcd3ae533294ead7d0af564861b17ae192/blacklight.gemspec#L28

I don't believe this method is available down that far? You may want to leave the conditional in, but add a branch for Rails.application.respond_to?(:secret_key_base), and maybe drop the one for Rails <= 5.1?

jcoyne commented 5 months ago

@jrochkind it looks like it's present to me: https://github.com/rails/rails/blob/v6.1.7.6/railties/lib/rails/application.rb#L424-L441

jrochkind commented 5 months ago

Oh wacky, thanks for verifying! Why haven't we all been using this API all along, it was clearly right all along, and people were giving bad advice to use other things! Approved