From 52bd40f1c97495a4cb2a7c3528d5532936339247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20B=C3=B6hme?= Date: Mon, 15 May 2023 10:33:22 +0200 Subject: [PATCH 1/2] Remove usage of Forwardable Extending Ruby's Forwardable module adds a `delegate` method to each form which overrides the often used `delegate` method of Rails. To prevent this we just use the `delegate` method of Rails instead. Fixes #99 --- lib/reform/form/active_model.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/reform/form/active_model.rb b/lib/reform/form/active_model.rb index cea7352..4bc6fb2 100644 --- a/lib/reform/form/active_model.rb +++ b/lib/reform/form/active_model.rb @@ -4,8 +4,7 @@ def self.included(base) extend ClassMethods register_feature ActiveModel - extend Forwardable - def_delegators :model, :persisted?, :to_key, :to_param, :id + delegate :persisted?, :to_key, :to_param, :id, to: :model def to_model # this is called somewhere in FormBuilder and ActionController. self From 271574cc378c85ca7969815d1f4e2cc7ca627c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20B=C3=B6hme?= Date: Mon, 15 May 2023 10:36:46 +0200 Subject: [PATCH 2/2] Release 0.2.5 --- CHANGES.md | 4 ++++ lib/reform/rails/version.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 700212c..f9473a9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +# 0.2.5 + +* Fix: Delegating from form object causes ArgumentError with 0.2.4 (https://github.com/trailblazer/reform-rails/issues/99) + # 0.2.4 * Fix keyword argument warning in `method_missing` (https://github.com/trailblazer/reform-rails/pull/97) diff --git a/lib/reform/rails/version.rb b/lib/reform/rails/version.rb index 4955259..8ca420b 100644 --- a/lib/reform/rails/version.rb +++ b/lib/reform/rails/version.rb @@ -1,5 +1,5 @@ module Reform module Rails - VERSION = "0.2.4" + VERSION = "0.2.5" end end