Sha256: b2e1c568ab9775293112fd0c36f4d033c93064113c2cea73af26a9c60f73bb9c
Contents?: true
Size: 836 Bytes
Versions: 30
Compression:
Stored size: 836 Bytes
Contents
module ClassMethods def exists? mark card = quick_fetch mark card.present? end alias :exist? :exists? def known? mark card = fetch mark, skip_modules: true card.present? end end def state case when !known? then :unknown when !ok?(:read) then :unknown # anti-fishing when real? then :real when virtual? then :virtual else :wtf end end def new_card? new_record? || # not yet in db (from ActiveRecord) !@from_trash.nil? # in process of restoration from trash end alias_method :new?, :new_card? def known? real? || virtual? end def real? !new_card? end def unknown? !known? end def pristine? # has not been edited directly by human users. bleep blorp. new_card? || !actions.joins(:act).where( "card_acts.actor_id != ?", Card::WagnBotID ).exists? end
Version data entries
30 entries across 30 versions & 1 rubygems