Skip to content

Commit 23a40f2

Browse files
committed
docs: update Atom example in README
1 parent 188491b commit 23a40f2

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,15 @@ puts posts.first.inspect
138138

139139
### With [Atom](https://github.com/atomframework/atom)
140140

141-
Define your models as above, but with `Model` as an alias of `Atom::Model` and [`Validations`](https://github.com/vladfaust/validations.cr) included by default. You also don't need to initialize repository explicitly when using Atom:
141+
Define your models just as above, but with [`Validations`](https://github.com/vladfaust/validations.cr) included by default. You also don't need to initialize repository explicitly when using Atom:
142142

143143
```crystal
144+
require "pg"
144145
require "atom"
145-
146-
Atom.model(PG)
146+
require "atom/model"
147147
148148
class User
149-
include Model
149+
include Atom::Model
150150
151151
schema do
152152
type name : String
@@ -155,8 +155,8 @@ class User
155155
validate name, size: (3..50)
156156
end
157157
158-
users = query(User.all) # Top-level `query`, `exec` and `scalar` methods
159-
User.new("Jo").valid? # Validations
158+
users = Atom.query(User.all) # Atom-level `query`, `exec` and `scalar` methods
159+
User.new("Jo").valid? # Validations
160160
```
161161

162162
## Testing

0 commit comments

Comments
 (0)