Skip to content

Commit

Permalink
Convert array/JSON attributes back to array after inserting or updati…
Browse files Browse the repository at this point in the history
…ng record (so the state basically always is an array)
  • Loading branch information
winternet-studio committed Feb 3, 2022
1 parent dcc1cc1 commit 55562c6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions behaviors/ArrayAttributesBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public function events() {
ActiveRecord::EVENT_AFTER_REFRESH => 'toArrays',
ActiveRecord::EVENT_BEFORE_VALIDATE => 'toArrays',
ActiveRecord::EVENT_BEFORE_INSERT => 'toStrings',
ActiveRecord::EVENT_AFTER_INSERT => 'toArrays',
ActiveRecord::EVENT_BEFORE_UPDATE => 'toStrings',
ActiveRecord::EVENT_AFTER_UPDATE => 'toArrays',
];
}

Expand Down

0 comments on commit 55562c6

Please sign in to comment.