Module: Undestroyable::Orm::ActiveRecord::Table
- Defined in:
- lib/undestroyable/orm/active_record/table.rb
Overview
:table strategy will save any deleted record within separate table. By default, it will use same naming as a actual table. In order to change the table name, following options can be specified within configuration:
[:table_name]
Keep alternative to table name. By default it will equivalent to one used by Model backend.
[:table_prefix]
Keep table prefix. If it is set not nil, it will be ignored for table creation. Default is nil.
[:table_suffix]
Keep table suffix. If it is set not nil, it will be ignored for table creation. Default is nil.
[:full_table_name]
Keep full table name. If this field is not specified it will be generated from
table_name + table_prefix + table_suffix.
Example
class ConceptCat < ActiveRecord::Base
undstroyable do
startegy :database
connection { adapter: "sqlite3", dbfile: ":memory:"}
table_name :scrap
table_suffix :metalic
end
end
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
30 31 32 33 |
# File 'lib/undestroyable/orm/active_record/table.rb', line 30 def self.included(base) base.send :include, InstanceMethods base.extend ClassMethods end |