Method: LucidWorks::Schema#initialize
- Defined in:
- lib/lucid_works/schema.rb
#initialize(model) ⇒ Schema
Initializes the schema, taking a block of schema declarations. Typically it is called from LucidWorks::Base, e.g.:
class MyModel < LucidWorks::Base
schema do
attribute :string1, :string
attribute :bool1, :boolean
attribute :integer1, :integer
attributes :string2, :string3, :string4
attributes :bool2, :bool3, :type => :boolean
attributes :int2, :int3, :type => :integer
attribute :string_with_values, :values => ['one', 'two']
attribute :dontsendme, :omit_during_update => true
attribute :sendnull, :string, :nil_when_blank => true
end
end
26 27 28 29 30 |
# File 'lib/lucid_works/schema.rb', line 26 def initialize(model) @model = model @primary_key = :id @dynamic_attributes = true end |