class WithModel::Model::DSL
Public Class Methods
Public Instance Methods
model(&block)
click to toggle source
Provide a class body for the ActiveRecord model.
# File lib/with_model/model/dsl.rb, line 21 def model(&block) @model.model_block = block end
table(options = {}, &block)
click to toggle source
Provide a schema definition for the table, passed to ActiveRecord's `create_table`. The table name will be auto-generated.
# File lib/with_model/model/dsl.rb, line 15 def table(options = {}, &block) @model.table_options = options @model.table_block = block end