Class: WorldDb::Model::Continent

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/worlddb/models/continent_comp.rb,
lib/worlddb/models/forward.rb,
lib/worlddb/models/continent.rb

Overview

collect depreciated or methods for future removal here

- keep for now for commpatibility (for old code)

Instance Method Summary collapse

Instance Method Details

#on_createObject



16
17
18
19
20
21
# File 'lib/worlddb/models/continent.rb', line 16

def on_create
  place_rec = Place.create!( name: name, kind: place_kind )
  self.place_id = place_rec.id 

  self.slug = TextUtils.slugify( name )  if slug.blank?
end

#on_updateObject



23
24
25
26
27
28
29
# File 'lib/worlddb/models/continent.rb', line 23

def on_update
  ## fix/todo: check - if name or kind changed - only update if changed ?? why? why not??
  place.update_attributes!( name: name, kind: place_kind )
  
  ## check if name changed -- possible?
  ## update slug too??
end

#place_kindObject

use place_kind_of_code ??



31
32
33
# File 'lib/worlddb/models/continent.rb', line 31

def place_kind   # use place_kind_of_code ??
  'CONT'
end

#synonymsObject



17
# File 'lib/worlddb/models/continent_comp.rb', line 17

def synonyms()       alt_names;      end

#synonyms=(value) ⇒ Object



18
# File 'lib/worlddb/models/continent_comp.rb', line 18

def synonyms=(value) self.alt_names = value; end

#titleObject



12
# File 'lib/worlddb/models/continent_comp.rb', line 12

def title()       name;              end

#title=(value) ⇒ Object



13
# File 'lib/worlddb/models/continent_comp.rb', line 13

def title=(value) self.name = value; end