ORM Model with Adapters for mysql, pg, sqlite in the Crystal Language.
If upgrading from Granite < 0.12.0, please also see release notes for 12.0
Several Breaking Changes:
find_by
syntax has changed from Post.find_by :slug, "example_slug"
to Post.find_by slug: "example_slug"
. This allows support for multiple parameters to find_by
The list of changes and contributors:
64b3e31 Update to crystal 0.25.0 (#228) - @robacarp and @faustinoaq
ba90030 Added uniqueness validator for models (#227) - @Thellior
7661430 bugfix: querybuilder logger (#224) - @robacarp
e5f9b4c Adds model.from_json(JSON::Any) (#221) - @Blacksmoke16
757140b added query macro, tests, and docs (#215) - @noahlh
455d7ca Fix last insert ID race condition (#220) - @charlie-hadden
afdc4d0 Allow find_by
to accept multiple arguments (#211) - @Blacksmoke16
b23155a Validation Helpers (#219) - @Blacksmoke16
8a0cdd0 Update amber repository link (#205) - @faustinoaq
Thanks everyone! 💯
BREAKING CHANGE:
Granite::ORM
is now Granite
. You will need to remove ORM
from all of your models.
Lots of new stuff in 0.10.0:
BREAKING CHANGE:
all()
method now returns a Collection
object instead of an array.Detailed commits:
d0d580c changes syntax for helper methods from ? to ! (#171)
This rolls back a breaking change.
13ccfc0 add belongs_to custom type support (#142) @drujensen
6d160a2 parse timestamp strings for sqlite db adapter (#135) @damianham
48b7da4 primary auto: false
works as a natural key (#166) @maiha
332b9af Fix .create class method (#167) @Adam-Stomski
43fc6fc spec: don't clear database automatically (#165) @maiha
5a4b1f9 add record statuses about persistence: new_record?
, destroyed?
, persisted?
(#153) @maiha
f797799 add spec for callbacks (#154) @maiha
719d2e5 find
,find_by
,first
now ensures T
, call with trailing ?
for T?
(#146) @maiha
fab317b simplify specs by reducing macros (#147) @maiha
c9cfc3d Fields are now required in default. Use foo?
for nilable fields. (#144) @maiha
b93f7b6 allow reserved words as table and column names (#139) @maiha
f8ddc27 Fix documentation for creation of Indexes (#138) @gabrielengel
40b13eb Add #count (#137) @maiha
2efbbbb Dj/validation using blocks and procs (#131) e306360 underscore instead of downcase (#128)
76bb160 check if model is valid before trying to save (#127) 11e635c only rescue DB errors (#126) 72e165e avoid empty case statement (#124) ba9c814 add error if casting fails (#125) 0395229 Validate per instance (#118)
f5dd273 Merge pull request #111 from amberframework/CI-badge-1 d5da241 Merge pull request #109 from robacarp/query_logger