Class: ActiveRecord::ConnectionAdapters::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/ar-audit-tracer.rb

Instance Method Summary collapse

Instance Method Details

#authorstamps(type = :string, *args) ⇒ Object

Adds author (created_by and updated_by) columns to the table

Example
t.authors

Parameters:

  • Symbol

    type The desired type for the columns, defaults to :string

See Also:

  • SchemaStatements#add_authors


51
52
53
54
# File 'lib/ar-audit-tracer.rb', line 51

def authorstamps(type=:string, *args)
  options = {:null => false}.merge(args.extract_options!)
  @base.add_authorstamps(@table_name, type, options)
end

#remove_authorstampsObject

Removes the author columns (created_by and updated_by) from the table.

Example
t.remove_authors


59
60
61
# File 'lib/ar-audit-tracer.rb', line 59

def remove_authorstamps
  @base.remove_authorstamps(@table_name)
end