Skip to content

Commit 3e46a25

Browse files
committed
Fix CHANGELOG
Delegate to_s to base in instance
1 parent 2dd0bd9 commit 3e46a25

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
* [#2573](https://github.com/ruby-grape/grape/pull/2573): Clean up deprecated code - [@ericproulx](https://github.com/ericproulx).
77
* [#2575](https://github.com/ruby-grape/grape/pull/2575): Refactor Api description class - [@ericproulx](https://github.com/ericproulx).
88
* [#2577](https://github.com/ruby-grape/grape/pull/2577): Deprecate `return` in endpoint execution - [@ericproulx](https://github.com/ericproulx).
9-
* [#13](https://github.com/ericproulx/grape/pull/13): Refactor endpoint helpers and error middleware integration - [@ericproulx](https://github.com/ericproulx).
9+
* [#2580](https://github.com/ruby-grape/grape/pull/2580): Refactor endpoint helpers and error middleware integration - [@ericproulx](https://github.com/ericproulx).
10+
* [#2581](https://github.com/ruby-grape/grape/pull/2581): Delegate `to_s` in Grape::API::Instance - [@ericproulx](https://github.com/ericproulx).
1011
* Your contribution here.
1112

1213
#### Fixes

lib/grape/api/instance.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,16 @@ class Instance
1919
Boolean = Grape::API::Boolean
2020

2121
class << self
22+
extend Forwardable
2223
attr_reader :instance, :base
2324
attr_accessor :configuration
2425

26+
def_delegators :base, :to_s
27+
2528
def given(conditional_option, &block)
26-
evaluate_as_instance_with_configuration(block, lazy: true) if conditional_option && block
29+
return unless conditional_option
30+
31+
mounted(&block)
2732
end
2833

2934
def mounted(&block)
@@ -35,10 +40,6 @@ def base=(grape_api)
3540
grape_api.instances << self
3641
end
3742

38-
def to_s
39-
base&.to_s || super
40-
end
41-
4243
def base_instance?
4344
self == base.base_instance
4445
end

0 commit comments

Comments
 (0)