Skip to content

Commit

Permalink
Merge pull request #1 from quiltt/fix-readonly-attrs-support
Browse files Browse the repository at this point in the history
Don't attempt to overwrite readonly attributes
  • Loading branch information
rubendinho authored Sep 7, 2024
2 parents f88ae39 + 5752cda commit 80ccf5d
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 80ccf5d

Please sign in to comment.