Returns criterion for the resource primary field.
Is generated by .mapping
macro.
User.primary.inspect # => #<Jennifer::QueryBuilder::Criteria:0x0 @field="id", @table="users">
Returns table column counts grepped from the database.
Returns Jennifer::QueryBuilder::ModelQuery(T)
.
Returns all non virtual field names
Returns named tuple of column metadata
Returns field count.
Returns array of field names
Accepts symbol hash or named tuple, stringifies it and calls constructor with string-based keys hash.
Creates object based on given string hash.
Returns criterion for the resource primary field.
Returns primary field name.
Returns relation instance by given name.
Returns superclass for the current class.
Returns table prefix.
Returns Jennifer::QueryBuilder::ModelQuery(T)
.
This method is an entry point for writing query to your resource.
Address.all
.where { _street.like("%St. Paul%") }
.union(
Profile.all
.where { _login.in(["login1", "login2"]) }
.select(:contact_id)
)
.select(:contact_id)
.results
Returns all non virtual field names
Is generated by .mapping
macro.
Returns array of field names
Is generated by .mapping
macro.
Accepts symbol hash or named tuple, stringifies it and calls constructor with string-based keys hash.
It calls after_initialize
callbacks.
User.new({:name => "John Smith"})
User.new({name: "John Smith"})
Creates object based on given string hash.
It calls after_initialize
callbacks.
User.new({"name" => "John Smith"})
Returns criterion for the resource primary field.
Is generated by .mapping
macro.
User.primary.inspect # => #<Jennifer::QueryBuilder::Criteria:0x0 @field="id", @table="users">
Returns superclass for the current class.
class A < Jennifer::Model::Base
# ...
end
class B < A
end
B.superclass # => A