19 lines
333 B
Ruby
19 lines
333 B
Ruby
class ApplicationRecord < ActiveRecord::Base
|
|
self.abstract_class = true
|
|
self.inheritance_column = :sti_type
|
|
|
|
if Rails::VERSION::MAJOR < 5
|
|
def saved_changes
|
|
changes
|
|
end
|
|
end
|
|
|
|
class << self
|
|
def truncate
|
|
#connection_pool.with_connection { |c| c.truncate table_name }
|
|
delete_all
|
|
end
|
|
end
|
|
end
|
|
|