Sha256: 14770791ec2a43691dd2b29b6431e54dd191437fe5918c3af891d11ccbdd28ea
Contents?: true
Size: 488 Bytes
Versions: 14
Compression:
Stored size: 488 Bytes
Contents
# frozen_string_literal: true module ActiveRecall module DeckMethods def deck d = ActiveRecall::Deck.find_or_create_by(user_id: id, user_type: self.class.name) d.source_class.module_eval do def stats ActiveRecall::Item.find_by(source_id: id, source_type: self.class.name) end end d end def remove_deck ActiveRecall::Deck .where(user_id: id, user_type: self.class.name) .destroy_all end end end
Version data entries
14 entries across 14 versions & 1 rubygems