229 lines
7.1 KiB
Ruby
Generated
229 lines
7.1 KiB
Ruby
Generated
# typed: true
|
|
|
|
# DO NOT EDIT MANUALLY
|
|
# This is an autogenerated file for types exported from the `discard` gem.
|
|
# Please instead update this file by running `bin/tapioca gem discard`.
|
|
|
|
|
|
# source://discard//lib/discard/version.rb#3
|
|
module Discard; end
|
|
|
|
# = Discard Errors
|
|
#
|
|
# Generic exception class.
|
|
#
|
|
# source://discard//lib/discard/errors.rb#7
|
|
class Discard::DiscardError < ::StandardError; end
|
|
|
|
# Handles soft deletes of records.
|
|
#
|
|
# Options:
|
|
#
|
|
# - :discard_column - The columns used to track soft delete, defaults to `:discarded_at`.
|
|
#
|
|
# source://discard//lib/discard/model.rb#9
|
|
module Discard::Model
|
|
extend ::ActiveSupport::Concern
|
|
include GeneratedInstanceMethods
|
|
|
|
mixes_in_class_methods GeneratedClassMethods
|
|
mixes_in_class_methods ::Discard::Model::ClassMethods
|
|
|
|
# Discard the record in the database
|
|
#
|
|
# @return [Boolean] true if successful, otherwise false
|
|
#
|
|
# source://discard//lib/discard/model.rb#118
|
|
def discard; end
|
|
|
|
# Discard the record in the database
|
|
#
|
|
# There's a series of callbacks associated with #discard!. If the
|
|
# <tt>before_discard</tt> callback throws +:abort+ the action is cancelled
|
|
# and #discard! raises {Discard::RecordNotDiscarded}.
|
|
#
|
|
# @raise [Discard::RecordNotDiscarded]
|
|
# @return [Boolean] true if successful
|
|
#
|
|
# source://discard//lib/discard/model.rb#133
|
|
def discard!; end
|
|
|
|
# @return [Boolean] true if this record has been discarded, otherwise false
|
|
#
|
|
# source://discard//lib/discard/model.rb#105
|
|
def discarded?; end
|
|
|
|
# @return [Boolean] false if this record has been discarded, otherwise true
|
|
#
|
|
# source://discard//lib/discard/model.rb#110
|
|
def kept?; end
|
|
|
|
# Undiscard the record in the database
|
|
#
|
|
# @return [Boolean] true if successful, otherwise false
|
|
#
|
|
# source://discard//lib/discard/model.rb#140
|
|
def undiscard; end
|
|
|
|
# Undiscard the record in the database
|
|
#
|
|
# There's a series of callbacks associated with #undiscard!. If the
|
|
# <tt>before_undiscard</tt> callback throws +:abort+ the action is cancelled
|
|
# and #undiscard! raises {Discard::RecordNotUndiscarded}.
|
|
#
|
|
# @raise [Discard::RecordNotUndiscarded]
|
|
# @return [Boolean] true if successful
|
|
#
|
|
# source://discard//lib/discard/model.rb#155
|
|
def undiscard!; end
|
|
|
|
# @return [Boolean] false if this record has been discarded, otherwise true
|
|
#
|
|
# source://discard//lib/discard/model.rb#110
|
|
def undiscarded?; end
|
|
|
|
private
|
|
|
|
# @raise [::Discard::RecordNotDiscarded]
|
|
#
|
|
# source://discard//lib/discard/model.rb#161
|
|
def _raise_record_not_discarded; end
|
|
|
|
# @raise [::Discard::RecordNotUndiscarded]
|
|
#
|
|
# source://discard//lib/discard/model.rb#165
|
|
def _raise_record_not_undiscarded; end
|
|
|
|
# source://discard//lib/discard/model.rb#169
|
|
def discarded_fail_message; end
|
|
|
|
# source://discard//lib/discard/model.rb#175
|
|
def undiscarded_fail_message; end
|
|
|
|
module GeneratedClassMethods
|
|
def discard_column; end
|
|
def discard_column=(value); end
|
|
def discard_column?; end
|
|
end
|
|
|
|
module GeneratedInstanceMethods
|
|
def discard_column; end
|
|
def discard_column=(value); end
|
|
def discard_column?; end
|
|
end
|
|
end
|
|
|
|
# source://discard//lib/discard/model.rb#26
|
|
module Discard::Model::ClassMethods
|
|
# Discards the records by instantiating each
|
|
# record and calling its {#discard} method.
|
|
# Each object's callbacks are executed.
|
|
# Returns the collection of objects that were discarded.
|
|
#
|
|
# Note: Instantiation, callback execution, and update of each
|
|
# record can be time consuming when you're discarding many records at
|
|
# once. It generates at least one SQL +UPDATE+ query per record (or
|
|
# possibly more, to enforce your callbacks). If you want to discard many
|
|
# rows quickly, without concern for their associations or callbacks, use
|
|
# #update_all(discarded_at: Time.current) instead.
|
|
#
|
|
# ==== Examples
|
|
#
|
|
# Person.where(age: 0..18).discard_all
|
|
#
|
|
# source://discard//lib/discard/model.rb#42
|
|
def discard_all; end
|
|
|
|
# Discards the records by instantiating each
|
|
# record and calling its {#discard!} method.
|
|
# Each object's callbacks are executed.
|
|
# Returns the collection of objects that were discarded.
|
|
#
|
|
# Note: Instantiation, callback execution, and update of each
|
|
# record can be time consuming when you're discarding many records at
|
|
# once. It generates at least one SQL +UPDATE+ query per record (or
|
|
# possibly more, to enforce your callbacks). If you want to discard many
|
|
# rows quickly, without concern for their associations or callbacks, use
|
|
# #update_all!(discarded_at: Time.current) instead.
|
|
#
|
|
# ==== Examples
|
|
#
|
|
# Person.where(age: 0..18).discard_all!
|
|
#
|
|
# source://discard//lib/discard/model.rb#61
|
|
def discard_all!; end
|
|
|
|
# Undiscards the records by instantiating each
|
|
# record and calling its {#undiscard} method.
|
|
# Each object's callbacks are executed.
|
|
# Returns the collection of objects that were undiscarded.
|
|
#
|
|
# Note: Instantiation, callback execution, and update of each
|
|
# record can be time consuming when you're undiscarding many records at
|
|
# once. It generates at least one SQL +UPDATE+ query per record (or
|
|
# possibly more, to enforce your callbacks). If you want to undiscard many
|
|
# rows quickly, without concern for their associations or callbacks, use
|
|
# #update_all(discarded_at: nil) instead.
|
|
#
|
|
# ==== Examples
|
|
#
|
|
# Person.where(age: 0..18).undiscard_all
|
|
#
|
|
# source://discard//lib/discard/model.rb#80
|
|
def undiscard_all; end
|
|
|
|
# Undiscards the records by instantiating each
|
|
# record and calling its {#undiscard!} method.
|
|
# Each object's callbacks are executed.
|
|
# Returns the collection of objects that were undiscarded.
|
|
#
|
|
# Note: Instantiation, callback execution, and update of each
|
|
# record can be time consuming when you're undiscarding many records at
|
|
# once. It generates at least one SQL +UPDATE+ query per record (or
|
|
# possibly more, to enforce your callbacks). If you want to undiscard many
|
|
# rows quickly, without concern for their associations or callbacks, use
|
|
# #update_all!(discarded_at: nil) instead.
|
|
#
|
|
# ==== Examples
|
|
#
|
|
# Person.where(age: 0..18).undiscard_all!
|
|
#
|
|
# source://discard//lib/discard/model.rb#99
|
|
def undiscard_all!; end
|
|
end
|
|
|
|
# Raised by {Discard::Model#discard!}
|
|
#
|
|
# source://discard//lib/discard/errors.rb#11
|
|
class Discard::RecordNotDiscarded < ::Discard::DiscardError
|
|
# @return [RecordNotDiscarded] a new instance of RecordNotDiscarded
|
|
#
|
|
# source://discard//lib/discard/errors.rb#14
|
|
def initialize(message = T.unsafe(nil), record = T.unsafe(nil)); end
|
|
|
|
# Returns the value of attribute record.
|
|
#
|
|
# source://discard//lib/discard/errors.rb#12
|
|
def record; end
|
|
end
|
|
|
|
# Raised by {Discard::Model#undiscard!}
|
|
#
|
|
# source://discard//lib/discard/errors.rb#21
|
|
class Discard::RecordNotUndiscarded < ::Discard::DiscardError
|
|
# @return [RecordNotUndiscarded] a new instance of RecordNotUndiscarded
|
|
#
|
|
# source://discard//lib/discard/errors.rb#24
|
|
def initialize(message = T.unsafe(nil), record = T.unsafe(nil)); end
|
|
|
|
# Returns the value of attribute record.
|
|
#
|
|
# source://discard//lib/discard/errors.rb#22
|
|
def record; end
|
|
end
|
|
|
|
# Discard version
|
|
#
|
|
# source://discard//lib/discard/version.rb#5
|
|
Discard::VERSION = T.let(T.unsafe(nil), String)
|