Skip to content
fuchsto edited this page Sep 13, 2010 · 1 revision

Class methods

table
Parameters:

  • Table name as Symbol
  • Schema name as Symbol

primary_key
Parameters:

  • Primary key field name as Symbol
  • Sequence name as Symbol, in case primary key is to be auto-incremented (optional). If no sequence name is given, primary key value has to be given at .create().

Example:



class Poll < Lore::Model
    table :poll, :public
    primary_key :poll_id, :poll_id_seq
end


Hooks

  • self.before_create(attribute_hash)
  • self.after_create(created_model_instance)

Clone this wiki locally