Sha256: b11ad5f09ad682765bff8bfd2731955e3ad1c30dc631d2093107aa6c49b3de50

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; class Abstract; module Attachment;
# Set: Abstract (Attachment, Coded)
#
module Coded;
extend Card::Set
def self.source_location; "/Users/ethan/dev/decko/gem/card-mod-carrierwave/set/abstract/attachment/coded.rb"; end
event :lose_coded_status_on_update, :initialize, on: :update, when: :coded? do
  # unless explicit
  return if @new_mod

  @new_storage_type ||= storage_type_from_config
end

event :validate_coded_storage_type, :validate, on: :save, when: :will_become_coded? do
  storage_type_error :mod_argument_needed_to_save unless mod || @new_mod
  storage_type_error :codename_needed_for_storage if codename.blank?
end

def storage_type_error error_name
  errors.add :storage_type, t("carrierwave_#{error_name}")
end

def will_become_coded?
  will_be_stored_as == :coded
end

def mod= value
  if @action == :update && mod != value
    @new_mod = value.to_s
  else
    @mod = value.to_s
  end
end
end;end;end;end;end;
# ~~ generated from /Users/ethan/dev/decko/gem/card-mod-carrierwave/set/abstract/attachment/coded.rb ~~

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
card-1.101.7 tmpsets/set/mod013-card-mod-carrierwave/abstract/attachment/coded.rb
card-1.101.6 tmpsets/set/mod013-card-mod-carrierwave/abstract/attachment/coded.rb