Sha256: 825852b579eba74f96a775e4ddefd9cce14a83e976e96bc5c1d302a07dcd0530

Contents?: true

Size: 436 Bytes

Versions: 23

Compression:

Stored size: 436 Bytes

Contents

event :set_autoname, :prepare_to_store, on: :create, when: :autoname? do
  self.name = autoname rule(:autoname)
  autoname_card = rule_card :autoname
  autoname_card.update_column :db_content, name
  autoname_card.expire
  pull_from_trash!
  Card.write_to_soft_cache self
end

def no_autoname?
  !autoname?
end

def autoname?
  name.blank? &&
    (@autoname_rule.nil? ? (@autoname_rule = rule(:autoname).present?) : @autoname_rule)
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
card-1.107.0 mod/core/set/all/autoname.rb
card-1.106.0 mod/core/set/all/autoname.rb
card-1.105.6 mod/core/set/all/autoname.rb
card-1.105.5 mod/core/set/all/autoname.rb
card-1.105.4 mod/core/set/all/autoname.rb
card-1.105.3 mod/core/set/all/autoname.rb
card-1.105.2.pre1 mod/core/set/all/autoname.rb
card-1.105.2 mod/core/set/all/autoname.rb
card-1.105.1 mod/core/set/all/autoname.rb
card-1.105.0 mod/core/set/all/autoname.rb
card-1.104.2 mod/core/set/all/autoname.rb
card-1.104.1 mod/core/set/all/autoname.rb
card-1.104.0 mod/core/set/all/autoname.rb
card-1.103.4 mod/core/set/all/autoname.rb
card-1.103.3 mod/core/set/all/autoname.rb
card-1.103.2 mod/core/set/all/autoname.rb
card-1.103.1 mod/core/set/all/autoname.rb
card-1.103.0 mod/core/set/all/autoname.rb
card-1.101.7 mod/core/set/all/autoname.rb
card-1.102.0 mod/core/set/all/autoname.rb