Class: CarrierWave::Storage::PostgresqlTable::CarrierWaveFile
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- CarrierWave::Storage::PostgresqlTable::CarrierWaveFile
- Defined in:
- lib/carrierwave/storage/postgresql_table.rb
Class Method Summary collapse
Class Method Details
.delete_all_files(conditions) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/carrierwave/storage/postgresql_table.rb', line 42 def self.delete_all_files(conditions) self.transaction do self.connection.execute("SELECT lo_unlink(pg_largeobject_oid) FROM (SELECT DISTINCT pg_largeobject_oid FROM #{self.table_name} WHERE #{conditions}) AS oids") self.where(conditions).delete_all end end |