Module: Graphiform::ActiveRecordHelpers::ClassMethods

Defined in:
lib/graphiform/active_record_helpers.rb

Instance Method Summary collapse

Instance Method Details

#preferred_name(name_to_prefer = nil) ⇒ Object



10
11
12
13
14
15
# File 'lib/graphiform/active_record_helpers.rb', line 10

def preferred_name(name_to_prefer = nil)
  @preferred_name ||= nil # Define to avoid instance variable not initialized warnings
  @preferred_name = name_to_prefer if name_to_prefer.present?

  @preferred_name || name
end