You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,15 +138,15 @@ puts posts.first.inspect
138
138
139
139
### With [Atom](https://github.com/atomframework/atom)
140
140
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:
142
142
143
143
```crystal
144
+
require "pg"
144
145
require "atom"
145
-
146
-
Atom.model(PG)
146
+
require "atom/model"
147
147
148
148
class User
149
-
include Model
149
+
include Atom::Model
150
150
151
151
schema do
152
152
type name : String
@@ -155,8 +155,8 @@ class User
155
155
validate name, size: (3..50)
156
156
end
157
157
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
0 commit comments