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 data property dup #248

Merged
merged 3 commits into from
Dec 4, 2024
Merged

Conversation

Vagab
Copy link
Contributor

@Vagab Vagab commented Dec 4, 2024

When duping a property we can lose some attributes. So e.g.:

class Ex < Literal::Data
  prop :record, Book
end

record = Book.find(1)
ex = Ex.new(record:)
ex.record # => <Book id: nil>

because rails's dup does not preserve ids(and some other things)

cc @joeldrapper

@joeldrapper joeldrapper merged commit 8da5d29 into joeldrapper:main Dec 4, 2024
10 checks passed
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