Sha256: 99cc7d4add343812f7284b0180ff134c5710dccd37811a55433a90cbea3c1451

Contents?: true

Size: 563 Bytes

Versions: 15

Compression:

Stored size: 563 Bytes

Contents

def card
  self
end

event :reject_empty_subcards, :prepare_to_validate do
  subcards.each_with_key do |subcard, key|
    next unless subcard.new? && subcard.unfilled? && !trigger.present?

    drop_subcard(key)
    director.subdirectors.delete(subcard)
  end
end

# check when deleting field that left has not also been deleted
def trashed_left?
  l = left
  !l || l.trash
end

# check when renaming field that it is not actually the same field
# (eg on a renamed trunk)
def same_field?
  (left_id == left_id_before_act) && (right_id == right_id_before_act)
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
card-1.108.1 mod/core/set/all/subcards.rb
card-1.108.0 mod/core/set/all/subcards.rb
card-1.107.0 mod/core/set/all/subcards.rb
card-1.106.0 mod/core/set/all/subcards.rb
card-1.105.6 mod/core/set/all/subcards.rb
card-1.105.5 mod/core/set/all/subcards.rb
card-1.105.4 mod/core/set/all/subcards.rb
card-1.105.3 mod/core/set/all/subcards.rb
card-1.105.2.pre1 mod/core/set/all/subcards.rb
card-1.105.2 mod/core/set/all/subcards.rb
card-1.105.1 mod/core/set/all/subcards.rb
card-1.105.0 mod/core/set/all/subcards.rb
card-1.104.2 mod/core/set/all/subcards.rb
card-1.104.1 mod/core/set/all/subcards.rb
card-1.104.0 mod/core/set/all/subcards.rb