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

Avoid alias_method_chain #118

Merged
merged 1 commit into from
Jul 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/api_auth/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def with_api_auth(access_id, secret_key, options = {})
self.api_auth_options = options

class << self
alias_method_chain :connection, :auth
alias_method :connection_without_auth, :connection
alias_method :connection, :connection_with_auth
end
end

Expand All @@ -64,7 +65,9 @@ module InstanceMethods

module Connection
def self.included(base)
base.send :alias_method_chain, :request, :auth
base.send :alias_method, :request_without_auth, :request
base.send :alias_method, :request, :request_with_auth

base.class_eval do
attr_accessor :hmac_secret_key, :hmac_access_id, :use_hmac, :api_auth_options
end
Expand Down