Callbacks
require "granite/adapter/pg"
class Post < Granite::Base
connection pg
before_save :upcase_title
column id : Int64, primary: true
column title : String
column content : String
timestamps
def upcase_title
if title = @title
@title = title.upcase
end
end
endCreate
Update
Destroy
Last updated