diff --git a/lib/valkyrie/change_set.rb b/lib/valkyrie/change_set.rb index 0ca79db6..45936f88 100644 --- a/lib/valkyrie/change_set.rb +++ b/lib/valkyrie/change_set.rb @@ -77,9 +77,11 @@ def [](key) send(key) if respond_to?(key) end - delegate :attributes, to: :resource - - delegate :internal_resource, :created_at, :updated_at, :model_name, :optimistic_locking_enabled?, to: :resource + [:internal_resource, :created_at, :updated_at, :model_name, :optimistic_locking_enabled?, :attributes].each do |method_name| + define_method(method_name) do |*args| + resource.public_send(method_name, *args) + end + end # Prepopulates all fields with defaults defined in the changeset. This is an # override of Reform::Form's method to allow for single-valued fields to