uploadcare / uploadcare-rails

Rails API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
https://uploadcare.com
MIT License
58 stars 70 forks source link

Error upgrading Rails 7.2 #149

Closed jjf21 closed 1 week ago

jjf21 commented 1 week ago

Describe the bug

During my Rails upgrade from 7.1.4.1 to 7.2.1.2, I got an error:

     NoMethodError:
       undefined method `assign_attributes' for #<Uploadcare::Rails::Group:0x000000016c9338a8>

After some research, it looks like Uploadcare::Rails::Group rely on the method assign_attributes which is defined in ActiveModel::AttributesAssignment.

Uploadcare::Rails::Group includes Objects::Loadable which includes ActiveRecord::AttributeAssignment.

Method assign_attributes is not ActiveRecord's responsability therefore it has been remove from ActiveRecord::AttributeAssignment

Since ActiveModel::AttributesAssignment is no more included in ActiveRecord::AttributeAssignment the method assign_attributes is undefined.

EDIT

It looks like it has been fix for you main branch https://github.com/uploadcare/uploadcare-rails/commit/cbf92458e21539b3fcbd8b3b09fc68d27a72c221 but hasn't been released.

vipulnsward commented 1 week ago

Will publish a new release soon.

vipulnsward commented 1 week ago

@jjf21 can you upgrade and see if all okay on 3.4.4 version?

jjf21 commented 1 week ago

It works, thanks for reactivity !