Rails Configuration: use Proc's or method overrides?

I came across a ticket by Craig W. at

https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4247-customising-asset-paths#ticket-4247-5

and found it quite interesting.

Quote:
This patch allows you to set the way that asset paths are rewritten. My
own use case was to accommodate a server setup where not all of the
assets have the same mtime even if they’re the same file.

If this is not set then it falls back to the default of using
ENV[‘RAILS_ASSET_ID’] or the file mtime.

config/environments/production.rb

Normally you’d calculate RELEASE_NUMBER at startup.

RELEASE_NUMBER = 12345
config.action_controller.asset_path_template = proc { |asset_path|
“/release-#{RELEASE_NUMBER}#{asset_path}”
}
End Quote.

I feel it goes to the heart of Rails, namely, how should configuring an
application be organized? In this case it seemed to me better to make
use of Ruby method overrides.

At the same time, it would be good to have some uniformity with respect
to configuration. Meaning when developing a patch like this, it would be
good to have a guide.

What do you think?

Stephan

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs