This repository has been archived by the owner. It is now read-only.

Backward-compatible Rails 4 route mapper compatibility #54

Merged
merged 1 commit into from Jan 28, 2014
Jump to file or symbol
Failed to load files and symbols.
+3 −1
Diff settings

Always

Just for now

Backward-compatible Rails 4 route mapper compatibility

There has been discussion in #42 of moving to a rack-based routing
solution, but that has not been resolved, and Rails 4 is out now.
This change would also require a major version bump, thus leaving
1.x incompatible with Rails 4.

This patch adds the required :via option for Rails >= version 4,
but not for Rails 3, which does not support (nor need) :via.
  • Loading branch information...
nilbus committed Dec 20, 2013
commit abf31511442cdb3ecdfb2a9cbc98bf4014b5e9d0
@@ -28,7 +28,9 @@ def faye_server(mount_path, options={}, &block)
adapter = FayeRails::RackAdapter.new(options)
adapter.instance_eval(&block) if block.respond_to? :call
match options[:mount] => adapter
match_options = {options[:mount] => adapter}
match_options.merge!(:via => :all) if Rails.version.to_i >= 4
match match_options
end
ProTip! Use n and p to navigate between commits in a pull request.