Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 5 compatibility #20

Merged
merged 1 commit into from
Nov 2, 2015
Merged

Rails 5 compatibility #20

merged 1 commit into from
Nov 2, 2015

Conversation

ekampp
Copy link
Contributor

@ekampp ekampp commented Oct 31, 2015

This is more a request for comments and a general discussion than an actual pull-request.

This is the patch that I'm using for Rails 5 compatability, but there might be better ways. So let's explore.

Rails 5 has changed method signature for ActionDispatch::FileHandler to take a hash of headers and not a single string.

module ActionDispatch
  class FileHandler
    def initialize(root, index: 'index', headers: {})
      # ... 
    end
end

@romanbsd
Copy link
Owner

romanbsd commented Nov 1, 2015

Hi! First of all, thanks for your PR.
I think that what's missing is to add a Rails version check here, and either provide the second parameter as string (for Rails::VERSION::MAJOR < 5) or as {headers: ...} for >= 5.

@ekampp
Copy link
Contributor Author

ekampp commented Nov 1, 2015

Added a Rails' major version check, and reimplemented backwards compatability.

romanbsd pushed a commit that referenced this pull request Nov 2, 2015
Rails 5 compatibility
@romanbsd romanbsd merged commit e08ebdc into romanbsd:master Nov 2, 2015
@romanbsd
Copy link
Owner

romanbsd commented Nov 2, 2015

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants