Class: Essay::AttributeFeatures::HumanID

Inherits:
Base
  • Object
show all
Defined in:
lib/humanid/essay.rb

Instance Method Summary collapse

Instance Method Details

#optionsObject



35
36
37
# File 'lib/humanid/essay.rb', line 35

def options
  active_record.human_id_options.fetch(attribute.name)
end

#persists?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/humanid/essay.rb', line 19

def persists?
  !!options[:persist]
end

#updates_automatically?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/humanid/essay.rb', line 27

def updates_automatically?
  !updates_manually?
end

#updates_if_blank?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/humanid/essay.rb', line 31

def updates_if_blank?
  options[:update] == :if_blank
end

#updates_manually?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/humanid/essay.rb', line 23

def updates_manually?
  options[:update] == :manual
end