Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: call #dup would raise MissingAttributeError while putting :mount_on in options #2691

Merged
merged 1 commit into from
Aug 27, 2023

Conversation

marsz
Copy link
Contributor

@marsz marsz commented Aug 23, 2023

If use :mount_on option and call #dup, it would raise ActiveModel::MissingAttributeError

class Attachment < ::ApplicationRecord
  mount_uploader(:file, FileUploader, mount_on: :stored_filename)
end

attachment.dup

Got error:

ActiveModel::MissingAttributeError:
       can't write unknown attribute `file`

@marsz marsz changed the title fix: call #dup would raise MissingAttributeError while use :mount_on in options fix: call #dup would raise MissingAttributeError while putting :mount_on in options Aug 23, 2023
@mshibuya mshibuya merged commit 9216dfc into carrierwaveuploader:master Aug 27, 2023
13 checks passed
@mshibuya
Copy link
Member

Looks good, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants