Module: MrEko::Core

Included in:
Playlist, Song
Defined in:
lib/mr_eko/core.rb

Defined Under Namespace

Modules: GlobalHelpers

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/mr_eko/core.rb', line 4

def self.included(base)
  base.send(:include, GlobalHelpers)
  base.extend GlobalHelpers

  # The Sequel timestamps plugin doesn't seem to work, so...
  def before_create; self.created_on = Time.now.utc; end
  def before_update; self.updated_on = Time.now.utc; end
end

Instance Method Details

#before_createObject

The Sequel timestamps plugin doesn’t seem to work, so…



9
# File 'lib/mr_eko/core.rb', line 9

def before_create; self.created_on = Time.now.utc; end

#before_updateObject



10
# File 'lib/mr_eko/core.rb', line 10

def before_update; self.updated_on = Time.now.utc; end