Skip to content

Commit

Permalink
Documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmacdonald committed Apr 15, 2024
1 parent 0d8dd6b commit acc129f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/toucan2/instance.clj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
```clj
(instance-of? ::bird (instance ::toucan {})) ; -> true
(instance-of? ::toucan (instance ::bird {})) ; -> false
(instance-of? ::toucan (instance ::bird {})) ; -> false
```"
[model x]
(and (instance? x)
Expand Down
5 changes: 3 additions & 2 deletions src/toucan2/protocols.clj
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"Get a map with any changes made to `instance` since it came out of the DB. Only includes keys that have been
added or given different values; keys that were removed are not counted. Returns `nil` if there are no changes."))

;;; `nil` and `IPersistentMap` can implement so of the methods that make sense for them -- `nil` or a plain map doesn't
;;; have any changes, so [[changes]] can return `nil`. I don't know what sort of implementation for stuff like
;;; `nil` and `IPersistentMap` can implement the methods that make sense for them: `nil` or a plain map doesn't have any
;;; changes, so [[changes]] can return `nil`. I don't know what sort of implementation for stuff like
;;; [[with-original]] or [[with-current]] makes sense so I'm not implementing those for now.
(extend-protocol IRecordChanges
nil
Expand Down Expand Up @@ -76,6 +76,7 @@
this)
(with-current [_this new-current]
new-current)

;; treat the entire map as `changes` -- that way if you accidentally do something like
;;
;; (merge plain-map instance)
Expand Down

0 comments on commit acc129f

Please sign in to comment.