annotation Gravity::Column

Overview

This is akin to the JSON::Field annotation for the JSON::Serializable module. It annotates a getter, setter, or property and allows you to change how that item is seen (or not seen) by the model. The available params are:

Example:

class User
  include Gravity::Model

  getter name : String

  @[Gravity::Column(ignore: true)]
  getter hidden_field : String
end

Defined in:

gravity/annotations.cr