module Concerns::Event::Names::InstanceMethods

Public Instance Methods

default_name() click to toggle source
# File app/models/concerns/event/names.rb, line 13
def default_name
  "New Event #{self.date.strftime("%m-%d-%Y")}"
end
friendly_class_name() click to toggle source
# File app/models/concerns/event/names.rb, line 47
def friendly_class_name
  self.class.friendly_class_name
end
full_name() click to toggle source

Try to intelligently combined parent name and child name for schedule pages

# File app/models/concerns/event/names.rb, line 35
def full_name
  if parent.nil?
    name
  elsif parent.full_name == name
    name
  elsif name[ parent.full_name ]
    name
  else
    "#{parent.full_name}: #{name}"
  end
end
full_name_with_date() click to toggle source
# File app/models/concerns/event/names.rb, line 30
def full_name_with_date
  "#{full_name} (#{short_date.try :strip})"
end
name_with_date() click to toggle source
# File app/models/concerns/event/names.rb, line 26
def name_with_date
  "#{name} (#{short_date})"
end
parent_name() click to toggle source

Parent’s name. Own name if no parent

# File app/models/concerns/event/names.rb, line 18
def parent_name
  if parent.nil?
    name
  else
    parent.name
  end
end