Skip to content

Commit

Permalink
Don't attempt to overwrite readonly attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
rubendinho committed Sep 7, 2024
1 parent f88ae39 commit 5752cda
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/sprig/seed/record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def existing?

def populate_attributes
attributes.each do |attribute|
next if existing? && attribute.name.in?(klass.readonly_attributes)

orm_record.send(:"#{attribute.name}=", attribute.value)
end
end
Expand Down

0 comments on commit 5752cda

Please sign in to comment.