class Repository
- Repository
- Reference
- Object
Included Modules
- Clear::Model
Extended Modules
- Clear::Model::HasHooks::ClassMethods
Defined in:
models/repository.crConstant Summary
-
COLUMNS =
{"id" => {type: Int64, primary: true, converter: "Int64", db_column_name: "id", crystal_variable_name: id, presence: false, mass_assign: true}, "provider" => {type: String, primary: false, converter: "String", db_column_name: "provider", crystal_variable_name: provider, presence: true, mass_assign: true}, "provider_id" => {type: Int32, primary: false, converter: "Int32", db_column_name: "provider_id", crystal_variable_name: provider_id, presence: true, mass_assign: true}, "name" => {type: String, primary: false, converter: "String", db_column_name: "name", crystal_variable_name: name, presence: true, mass_assign: true}, "description" => {type: String | ::Nil, primary: false, converter: "String", db_column_name: "description", crystal_variable_name: description, presence: true, mass_assign: true}, "default_branch" => {type: String, primary: false, converter: "String", db_column_name: "default_branch", crystal_variable_name: default_branch, presence: true, mass_assign: true}, "shard_yml" => {type: String | ::Nil, primary: false, converter: "String", db_column_name: "shard_yml", crystal_variable_name: shard_yml, presence: true, mass_assign: true}, "readme" => {type: String | ::Nil, primary: false, converter: "String", db_column_name: "readme", crystal_variable_name: readme, presence: true, mass_assign: true}, "changelog" => {type: String | ::Nil, primary: false, converter: "String", db_column_name: "changelog", crystal_variable_name: changelog, presence: true, mass_assign: true}, "license" => {type: String | ::Nil, primary: false, converter: "String", db_column_name: "license", crystal_variable_name: license, presence: true, mass_assign: true}, "last_activity_at" => {type: Time, primary: false, converter: "Time", db_column_name: "last_activity_at", crystal_variable_name: last_activity_at, presence: true, mass_assign: true}, "stars_count" => {type: Int32, primary: false, converter: "Int32", db_column_name: "stars_count", crystal_variable_name: stars_count, presence: true, mass_assign: true}, "forks_count" => {type: Int32, primary: false, converter: "Int32", db_column_name: "forks_count", crystal_variable_name: forks_count, presence: true, mass_assign: true}, "open_issues_count" => {type: Int32 | ::Nil, primary: false, converter: "Int32", db_column_name: "open_issues_count", crystal_variable_name: open_issues_count, presence: true, mass_assign: true}, "archived" => {type: Bool, primary: false, converter: "Bool", db_column_name: "archived", crystal_variable_name: archived, presence: true, mass_assign: true}, "ignore" => {type: Bool, primary: false, converter: "Bool", db_column_name: "ignore", crystal_variable_name: ignore, presence: true, mass_assign: true}, "fork" => {type: Bool, primary: false, converter: "Bool", db_column_name: "fork", crystal_variable_name: fork, presence: true, mass_assign: true}, "synced_at" => {type: Time, primary: false, converter: "Time", db_column_name: "synced_at", crystal_variable_name: synced_at, presence: true, mass_assign: true}, "created_at" => {type: Time | ::Nil, primary: false, converter: "Time", db_column_name: "created_at", crystal_variable_name: created_at, presence: true, mass_assign: true}, "updated_on" => {type: Time | ::Nil, primary: false, converter: "Time", db_column_name: "updated_on", crystal_variable_name: updated_on, presence: true, mass_assign: true}, "tsv" => {type: Clear::TSVector, primary: false, converter: "Clear::TSVector", db_column_name: "tsv", crystal_variable_name: tsv, presence: false, mass_assign: true}, "user_id" => {type: Int64, primary: false, converter: "Int64", db_column_name: "user_id", crystal_variable_name: user_id, presence: false, mass_assign: true}} of Nil => Nil -
POLYMORPHISM_SETTINGS =
{} of Nil => Nil
Constructors
-
.build(x : NamedTuple) : self
Build a new empty model and fill the columns using the NamedTuple in argument.
-
.build(x : NamedTuple, &block : self -> Nil) : self
Build a new empty model and fill the columns using the NamedTuple in argument.
-
.create(x : NamedTuple, &block : self -> Nil) : self
Build and new model and save it.
-
.create(**tuple, &block : self -> Nil) : self
Build and new model and save it.
-
.create(x : NamedTuple) : self
Build and new model and save it.
-
.create(**tuple) : self
Build and new model and save it.
-
.create!(x : NamedTuple, &block : self -> Nil) : self
Build and new model and save it.
-
.create!(**tuple, &block : self -> Nil) : self
Build and new model and save it.
-
.create!(x : NamedTuple) : self
Build and new model and save it.
-
.create!(**tuple) : self
Build and new model and save it.
- .new(h : Hash(String, _), cache : Clear::Model::QueryCache | Nil = nil, persisted = false, fetch_columns = false)
- .new(json : JSON::Any, cache : Clear::Model::QueryCache | Nil = nil, persisted = false)
- .new(t : NamedTuple, persisted = false)
- .new
Class Method Summary
-
.build(**tuple : **T) forall T
Build a new empty model and fill the columns using the NamedTuple in argument.
-
.build(**tuple)
Build a new empty model and fill the columns using the NamedTuple in argument.
-
.build(**tuple, &)
Build a new empty model and fill the columns using the NamedTuple in argument.
- .columns
-
.connection : String
Define on which connection the model is living.
-
.connection=(connection : String)
Define on which connection the model is living.
-
.create_from_json(string_or_io : String | IO, trusted : Bool = false)
Create a new model from json and save it.
-
.create_from_json!(string_or_io : String | IO, trusted : Bool = false)
Create a new model from json and save it.
-
.find(x)
Returns a model using primary key equality Returns
nilif not found. -
.find!(x)
Returns a model using primary key equality.
- .find_repository(user_login : String, repository_name : String, provider : String) : Repository | Nil
-
.from_json(string_or_io : String | IO, trusted : Bool = false)
Create a new empty model and fill the columns from json.
-
.full_table_name
returns the fully qualified and escaped name for this table.
-
.import(array : Enumerable(self), on_conflict : Clear::SQL::InsertQuery -> | Nil = nil)
Import a bulk of models in one SQL insert query.
- .polymorphic? : Bool
- .published
-
.query
Return a new empty query
SELECT * FROM [my_model_table]. - .read_only=(read_only : Bool)
- .read_only? : Bool
-
.schema : Clear::SQL::Symbolic | Nil
Define the current schema used in PostgreSQL.
-
.schema=(schema : Clear::SQL::Symbolic | Nil)
Define the current schema used in PostgreSQL.
- .search(str)
-
.table : Clear::SQL::Symbolic
Return the table name setup for this model.
-
.table=(table : Clear::SQL::Symbolic)
Return the table name setup for this model.
-
.with_counts
- .without_releases
Instance Method Summary
- #_cached_user : User | Nil
-
#archived : Bool
Returns the value of
#archivedcolumn or throw an exception if the column is not defined. -
#archived=(x : Bool)
Setter for
#archivedcolumn. -
#archived_column : Clear::Model::Column(Bool, Clear::Model::Converter::BoolConverter)
Returns the column object used to manage
#archivedfield -
#attributes : Hash(String, Clear::SQL::Any)
Attributes, used when fetch_columns is true
- #cache : Clear::Model::QueryCache | Nil
-
#changed?
Return
trueif the model is dirty (e.g. -
#changelog : String | Nil
Returns the value of
#changelogcolumn or throw an exception if the column is not defined. -
#changelog=(x : String | Nil)
Setter for
#changelogcolumn. -
#changelog_column : Clear::Model::Column(String | Nil, Clear::Model::Converter::StringConverter)
Returns the column object used to manage
#changelogfield -
#clear_change_flags
Reset the
#changed?flag on all columns -
#created_at : Time | Nil
Returns the value of
#created_atcolumn or throw an exception if the column is not defined. -
#created_at=(x : Time | Nil)
Setter for
#created_atcolumn. -
#created_at_column : Clear::Model::Column(Time | Nil, Clear::Model::Converter::TimeConverter)
Returns the column object used to manage
#created_atfield - #decorate
-
#default_branch : String
Returns the value of
#default_branchcolumn or throw an exception if the column is not defined. -
#default_branch=(x : String)
Setter for
#default_branchcolumn. -
#default_branch_column : Clear::Model::Column(String, Clear::Model::Converter::StringConverter)
Returns the column object used to manage
#default_branchfield - #dependencies : Repository::Collection
- #dependents : Repository::Collection
-
#description : String | Nil
Returns the value of
#descriptioncolumn or throw an exception if the column is not defined. -
#description=(x : String | Nil)
Setter for
#descriptioncolumn. -
#description_column : Clear::Model::Column(String | Nil, Clear::Model::Converter::StringConverter)
Returns the column object used to manage
#descriptionfield -
#fork : Bool
Returns the value of
#forkcolumn or throw an exception if the column is not defined. -
#fork=(x : Bool)
Setter for
#forkcolumn. -
#fork_column : Clear::Model::Column(Bool, Clear::Model::Converter::BoolConverter)
Returns the column object used to manage
#forkfield - #forks : Repository::Collection
-
#forks_count : Int32
Returns the value of
#forks_countcolumn or throw an exception if the column is not defined. -
#forks_count=(x : Int32)
Setter for
#forks_countcolumn. -
#forks_count_column : Clear::Model::Column(Int32, Clear::Model::Converter::Int32Converter)
Returns the column object used to manage
#forks_countfield -
#id : Int64
Returns the value of
#idcolumn or throw an exception if the column is not defined. -
#id=(x : Int64)
Setter for
#idcolumn. -
#id_column : Clear::Model::Column(Int64, Clear::Model::Converter::Int64Converter)
Returns the column object used to manage
#idfield -
#ignore : Bool
Returns the value of
#ignorecolumn or throw an exception if the column is not defined. -
#ignore=(x : Bool)
Setter for
#ignorecolumn. -
#ignore_column : Clear::Model::Column(Bool, Clear::Model::Converter::BoolConverter)
Returns the column object used to manage
#ignorefield - #language_names
- #languages : Language::Collection
-
#last_activity_at : Time
Returns the value of
#last_activity_atcolumn or throw an exception if the column is not defined. -
#last_activity_at=(x : Time)
Setter for
#last_activity_atcolumn. -
#last_activity_at_column : Clear::Model::Column(Time, Clear::Model::Converter::TimeConverter)
Returns the column object used to manage
#last_activity_atfield -
#license : String | Nil
Returns the value of
#licensecolumn or throw an exception if the column is not defined. -
#license=(x : String | Nil)
Setter for
#licensecolumn. -
#license_column : Clear::Model::Column(String | Nil, Clear::Model::Converter::StringConverter)
Returns the column object used to manage
#licensefield -
#name : String
Returns the value of
#namecolumn or throw an exception if the column is not defined. -
#name=(x : String)
Setter for
#namecolumn. -
#name_column : Clear::Model::Column(String, Clear::Model::Converter::StringConverter)
Returns the column object used to manage
#namefield -
#open_issues_count : Int32 | Nil
Returns the value of
#open_issues_countcolumn or throw an exception if the column is not defined. -
#open_issues_count=(x : Int32 | Nil)
Setter for
#open_issues_countcolumn. -
#open_issues_count_column : Clear::Model::Column(Int32 | Nil, Clear::Model::Converter::Int32Converter)
Returns the column object used to manage
#open_issues_countfield - #postinstall_script : String | Nil
-
#provider : String
Returns the value of
#providercolumn or throw an exception if the column is not defined. -
#provider=(x : String)
Setter for
#providercolumn. -
#provider_column : Clear::Model::Column(String, Clear::Model::Converter::StringConverter)
Returns the column object used to manage
#providerfield -
#provider_id : Int32
Returns the value of
#provider_idcolumn or throw an exception if the column is not defined. -
#provider_id=(x : Int32)
Setter for
#provider_idcolumn. -
#provider_id_column : Clear::Model::Column(Int32, Clear::Model::Converter::Int32Converter)
Returns the column object used to manage
#provider_idfield -
#readme : String | Nil
Returns the value of
#readmecolumn or throw an exception if the column is not defined. -
#readme=(x : String | Nil)
Setter for
#readmecolumn. -
#readme_column : Clear::Model::Column(String | Nil, Clear::Model::Converter::StringConverter)
Returns the column object used to manage
#readmefield -
#relationships : Relationship::Collection
The method relationships is a
has_manyrelation to Relationship -
#releases : Release::Collection
The method releases is a
has_manyrelation to Release -
#repository_forks : RepositoryFork::Collection
The method repository_forks is a
has_manyrelation to RepositoryFork -
#repository_languages : RepositoryLanguage::Collection
The method repository_languages is a
has_manyrelation to RepositoryLanguage -
#repository_parent : RepositoryFork | Nil
Return the related model
#repository_parent. -
#repository_parent! : RepositoryFork
Return the related model
#repository_parent, but throw an error if the model is not found. -
#reset(h : Hash(Symbol, _))
Set the columns from hash
-
#reset(h : Hash(String, _))
Set the model fields from hash
- #reset(t : NamedTuple)
- #reset(from_json : JSON::Any)
-
#reset(**t : **T) forall T
reset flavors
-
#set(h : Hash(Symbol, _))
Set the columns from hash
-
#set(h : Hash(String, _))
Set the model fields from hash
- #set(t : NamedTuple)
- #set(from_json : JSON::Any)
-
#set(**t : **T) forall T
Set one or multiple columns to a specific value This two are equivalents:
-
#set_from_json(string_or_io : String | IO, trusted : Bool = false)
Set the fields from json passed as argument Trusted flag set to true will allow mass assignment without protection, FALSE by default
-
#shard_yml : String | Nil
Returns the value of
#shard_ymlcolumn or throw an exception if the column is not defined. -
#shard_yml=(x : String | Nil)
Setter for
#shard_ymlcolumn. -
#shard_yml_column : Clear::Model::Column(String | Nil, Clear::Model::Converter::StringConverter)
Returns the column object used to manage
#shard_ymlfield -
#stars_count : Int32
Returns the value of
#stars_countcolumn or throw an exception if the column is not defined. -
#stars_count=(x : Int32)
Setter for
#stars_countcolumn. -
#stars_count_column : Clear::Model::Column(Int32, Clear::Model::Converter::Int32Converter)
Returns the column object used to manage
#stars_countfield -
#synced_at : Time
Returns the value of
#synced_atcolumn or throw an exception if the column is not defined. -
#synced_at=(x : Time)
Setter for
#synced_atcolumn. -
#synced_at_column : Clear::Model::Column(Time, Clear::Model::Converter::TimeConverter)
Returns the column object used to manage
#synced_atfield - #tag_names
- #tags : Tag::Collection
- #tags=(names : Array(String))
-
#to_h(full = false) : Hash(String, Clear::SQL::Any)
Return a hash version of the columns of this model.
- #to_json(emit_nulls : Bool = false)
- #to_json(json, emit_nulls = false)
- #touch : Repository
-
#tsv : Clear::TSVector
Returns the value of
#tsvcolumn or throw an exception if the column is not defined. -
#tsv=(x : Clear::TSVector)
Setter for
#tsvcolumn. -
#tsv_column : Clear::Model::Column(Clear::TSVector, Clear::TSVector::Converter)
Returns the column object used to manage
#tsvfield -
#update_from_json(string_or_io : String | IO, trusted : Bool = false)
Set the fields from json passed as argument and call
saveon the object Trusted flag set to true will allow mass assignment without protection, FALSE by default -
#update_from_json!(string_or_io : String | IO, trusted : Bool = false)
Set the fields from json passed as argument and call
save!on the object Trusted flag set to true will allow mass assignment without protection, FALSE by default -
#update_h : Hash(String, Clear::SQL::Any)
Generate the hash for update request (like during save)
-
#updated_on : Time | Nil
Returns the value of
#updated_oncolumn or throw an exception if the column is not defined. -
#updated_on=(x : Time | Nil)
Setter for
#updated_oncolumn. -
#updated_on_column : Clear::Model::Column(Time | Nil, Clear::Model::Converter::TimeConverter)
Returns the column object used to manage
#updated_onfield -
#user : User
The method user is a
belongs_torelation to User - #user=(model : User)
-
#user_id : Int64
Returns the value of
#user_idcolumn or throw an exception if the column is not defined. -
#user_id=(x : Int64)
Setter for
#user_idcolumn. -
#user_id_column : Clear::Model::Column(Int64, Clear::Model::Converter::Int64Converter)
Returns the column object used to manage
#user_idfield -
#validate_fields_presence
For each column, ensure than when needed the column has present information into it.
Constructor Detail
Build a new empty model and fill the columns using the NamedTuple in argument.
Returns the new model
Build a new empty model and fill the columns using the NamedTuple in argument.
Returns the new model
Build and new model and save it. Returns the model.
The model may not be saved due to validation failure;
check the returned model errors? and persisted? flags.
Build and new model and save it. Returns the model.
The model may not be saved due to validation failure;
check the returned model errors? and persisted? flags.
Build and new model and save it. Returns the model.
The model may not be saved due to validation failure;
check the returned model errors? and persisted? flags.
Build and new model and save it. Returns the model.
The model may not be saved due to validation failure;
check the returned model errors? and persisted? flags.
Build and new model and save it. Returns the model.
Returns the newly inserted model Raises an exception if validation failed during the saving process.
Build and new model and save it. Returns the model.
Returns the newly inserted model Raises an exception if validation failed during the saving process.
Build and new model and save it. Returns the model.
Returns the newly inserted model Raises an exception if validation failed during the saving process.
Build and new model and save it. Returns the model.
Returns the newly inserted model Raises an exception if validation failed during the saving process.
Class Method Detail
Build a new empty model and fill the columns using the NamedTuple in argument.
Returns the new model
Build a new empty model and fill the columns using the NamedTuple in argument.
Returns the new model
Build a new empty model and fill the columns using the NamedTuple in argument.
Returns the new model
Define on which connection the model is living. Useful in case of models living in different databases.
Is set to "default" by default.
See Clear::SQL#init(URI, *opts) for more information about multi-connections.
Example:
Clear::SQL.init("postgres://postgres@localhost/database_1")
Clear::SQL.init("secondary", "postgres://postgres@localhost/database_2")
class ModelA
include Clear::Model
# Performs all the queries on `database_1`
# self.connection = "default"
column id : Int32, primary: true, presence: false
column title : String
end
class ModelB
include Clear::Model
# Performs all the queries on `database_2`
self.connection = "secondary"
column id : Int32, primary: true, presence: false
end
Define on which connection the model is living. Useful in case of models living in different databases.
Is set to "default" by default.
See Clear::SQL#init(URI, *opts) for more information about multi-connections.
Example:
Clear::SQL.init("postgres://postgres@localhost/database_1")
Clear::SQL.init("secondary", "postgres://postgres@localhost/database_2")
class ModelA
include Clear::Model
# Performs all the queries on `database_1`
# self.connection = "default"
column id : Int32, primary: true, presence: false
column title : String
end
class ModelB
include Clear::Model
# Performs all the queries on `database_2`
self.connection = "secondary"
column id : Int32, primary: true, presence: false
end
Create a new model from json and save it. Returns the model.
The model may not be saved due to validation failure;
check the returned model errors? and persisted? flags.
Trusted flag set to true will allow mass assignment without protection, FALSE by default
Create a new model from json and save it. Returns the model.
Returns the newly inserted model Raises an exception if validation failed during the saving process. Trusted flag set to true will allow mass assignment without protection, FALSE by default
Returns a model using primary key equality. Raises error if the model is not found.
Create a new empty model and fill the columns from json. Returns the new model
Trusted flag set to true will allow mass assignment without protection, FALSE by default
returns the fully qualified and escaped name for this table. add schema if schema is different from 'public' (default schema)
ex: "schema"."table"
Import a bulk of models in one SQL insert query. Each model must be non-persisted.
on_conflict callback can be optionnaly turned on
to manage constraints of the database.
Note: Old models are not modified. This method return a copy of the models as saved in the database.
Example:
users = [User.new(id: 1), User.new(id: 2), User.new(id: 3)]
users = User.import(users)
Return a new empty query SELECT * FROM [my_model_table]. Can be refined after that.
Define the current schema used in PostgreSQL. The value is nil by default, which lead to non-specified
schema during the querying, and usage of "public" by PostgreSQL.
This property can be redefined on initialization. Example:
class MyModel
include Clear::Model
self.schema = "my_schema"
end
MyModel.query.to_sql # SELECT * FROM "my_schema"."my_models"
Define the current schema used in PostgreSQL. The value is nil by default, which lead to non-specified
schema during the querying, and usage of "public" by PostgreSQL.
This property can be redefined on initialization. Example:
class MyModel
include Clear::Model
self.schema = "my_schema"
end
MyModel.query.to_sql # SELECT * FROM "my_schema"."my_models"
Return the table name setup for this model. By convention, the class name is by default equals to the pluralized underscored string form of the model name. Example:
MyModel => "my_models"
Person => "people"
Project::Info => "project_infos"
The property can be updated at initialization to a custom table name:
class MyModel
include Clear::Model
self.table = "another_table_name"
end
MyModel.query.to_sql # SELECT * FROM "another_table_name"
Return the table name setup for this model. By convention, the class name is by default equals to the pluralized underscored string form of the model name. Example:
MyModel => "my_models"
Person => "people"
Project::Info => "project_infos"
The property can be updated at initialization to a custom table name:
class MyModel
include Clear::Model
self.table = "another_table_name"
end
MyModel.query.to_sql # SELECT * FROM "another_table_name"
repositories = Repository.query.with_counts
repositories.each(fetch_columns: true) do |repository|
repository.name
repository.attributes["dependents_count"]
end
Instance Method Detail
Returns the value of #archived column or throw an exception if the column is not defined.
Returns the column object used to manage #archived field
See Clear::Model::Column
Return true if the model is dirty (e.g. one or more fields
have been changed.). Return false otherwise.
Returns the value of #changelog column or throw an exception if the column is not defined.
Returns the column object used to manage #changelog field
See Clear::Model::Column
Reset the #changed? flag on all columns
The model behave like its not dirty anymore and call to save would apply no changes.
Returns self
Returns the value of #created_at column or throw an exception if the column is not defined.
Returns the column object used to manage #created_at field
See Clear::Model::Column
Returns the value of #default_branch column or throw an exception if the column is not defined.
Returns the column object used to manage #default_branch field
See Clear::Model::Column
Returns the value of #description column or throw an exception if the column is not defined.
Returns the column object used to manage #description field
See Clear::Model::Column
Returns the value of #fork column or throw an exception if the column is not defined.
Returns the column object used to manage #fork field
See Clear::Model::Column
Returns the value of #forks_count column or throw an exception if the column is not defined.
Returns the column object used to manage #forks_count field
See Clear::Model::Column
Returns the value of #id column or throw an exception if the column is not defined.
Returns the column object used to manage #id field
See Clear::Model::Column
Returns the value of #ignore column or throw an exception if the column is not defined.
Returns the column object used to manage #ignore field
See Clear::Model::Column
Returns the value of #last_activity_at column or throw an exception if the column is not defined.
Returns the column object used to manage #last_activity_at field
See Clear::Model::Column
Returns the value of #license column or throw an exception if the column is not defined.
Returns the column object used to manage #license field
See Clear::Model::Column
Returns the value of #name column or throw an exception if the column is not defined.
Returns the column object used to manage #name field
See Clear::Model::Column
Returns the value of #open_issues_count column or throw an exception if the column is not defined.
Returns the column object used to manage #open_issues_count field
See Clear::Model::Column
Returns the value of #provider column or throw an exception if the column is not defined.
Returns the column object used to manage #provider field
See Clear::Model::Column
Returns the value of #provider_id column or throw an exception if the column is not defined.
Returns the column object used to manage #provider_id field
See Clear::Model::Column
Returns the value of #readme column or throw an exception if the column is not defined.
Returns the column object used to manage #readme field
See Clear::Model::Column
The method relationships is a has_many relation to Relationship
The method repository_forks is a has_many relation to RepositoryFork
The method repository_languages is a has_many relation to RepositoryLanguage
Return the related model #repository_parent.
This relation is of type one to zero or one [1, 0..1] between RepositoryFork and Repository
If the relation hasn't been cached, will call a select SQL operation.
Otherwise, will try to find in the cache.
Return the related model #repository_parent,
but throw an error if the model is not found.
Set one or multiple columns to a specific value This two are equivalents:
model.set(a: 1)
model.a = 1
Set the fields from json passed as argument Trusted flag set to true will allow mass assignment without protection, FALSE by default
Returns the value of #shard_yml column or throw an exception if the column is not defined.
Returns the column object used to manage #shard_yml field
See Clear::Model::Column
Returns the value of #stars_count column or throw an exception if the column is not defined.
Returns the column object used to manage #stars_count field
See Clear::Model::Column
Returns the value of #synced_at column or throw an exception if the column is not defined.
Returns the column object used to manage #synced_at field
See Clear::Model::Column
Return a hash version of the columns of this model.
Returns the value of #tsv column or throw an exception if the column is not defined.
Returns the column object used to manage #tsv field
See Clear::Model::Column
Set the fields from json passed as argument and call save on the object
Trusted flag set to true will allow mass assignment without protection, FALSE by default
Set the fields from json passed as argument and call save! on the object
Trusted flag set to true will allow mass assignment without protection, FALSE by default
Generate the hash for update request (like during save)
Returns the value of #updated_on column or throw an exception if the column is not defined.
Returns the column object used to manage #updated_on field
See Clear::Model::Column
Returns the value of #user_id column or throw an exception if the column is not defined.
Returns the column object used to manage #user_id field
See Clear::Model::Column
For each column, ensure than when needed the column has present information into it.
This method is called on validation.