Skip to content

Commit

Permalink
Fixing strange method mapping on Class rather than the specific class
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjeffries committed Dec 14, 2015
1 parent 9f14a3f commit 23ab36f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
# Changelog

## 1.2.8

Bugfixes:

- There was a strange problem with Flexirest defining methods on `Class` rather than on the specific class (which only presents itself when another class in the application is making use of `method_missing`).

## 1.2.7

Features:
Expand All @@ -10,13 +16,13 @@ Features:

Bugfixes:

- Fixes case when "Rails" exists but doesn't declare a ".cache" method
- Fixes case when `Rails` exists but doesn't declare a `.cache` method

## 1.2.4 / 1.2.3

Bugfixes:

- Allows setting of base_url, username, password and request_body_type in a project-specific base class, then using that default in subclasses.
- Allows setting of `base_url`, `username`, `password` and `request_body_type` in a project-specific base class, then using that default in subclasses.
- Strings of four digits in the response are no longer treated as (invalid) dates (thanks Tom Hoen)
- 1.2.3 was pushed without a successful Travis build

Expand Down
4 changes: 2 additions & 2 deletions lib/flexirest/mapping.rb
Expand Up @@ -24,10 +24,10 @@ def patch(name, url, options = {})
def _map_call(name, details)
_calls[name] = {name:name}.merge(details)
_calls["lazy_#{name}".to_sym] = {name:name}.merge(details)
self.class.send(:define_method, name) do |options={}|
(class << self; self; end).send(:define_method, name) do |options={}|
_call(name, options)
end
self.class.send(:define_method, "lazy_#{name}".to_sym) do |options={}|
(class << self; self; end).send(:define_method, "lazy_#{name}".to_sym) do |options={}|
_call("lazy_#{name}", options)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/flexirest/version.rb
@@ -1,3 +1,3 @@
module Flexirest
VERSION = "1.2.7"
VERSION = "1.2.8"
end

0 comments on commit 23ab36f

Please sign in to comment.