Module: ClockworkDatabaseEvents

Defined in:
lib/clockwork_database_events.rb,
lib/clockwork_database_events/models.rb,
lib/clockwork_database_events/version.rb

Overview

version

Constant Summary collapse

VERSION =
'0.2.0'

Class Method Summary collapse

Class Method Details

.migrate(db) ⇒ Object



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

def migrate(db)
  require 'sequel'
  Sequel.extension :migration
  migrations = File.expand_path('../../db/migrations', __FILE__)
  return if Sequel::Migrator.is_current?(db, migrations)
  Sequel::Migrator.run(db, migrations)
end

.seedObject



10
11
12
13
14
# File 'lib/clockwork_database_events/models.rb', line 10

def seed
  %w(second minute hour day week month).each do |period|
    FrequencyPeriod.find_or_create(name: period)
  end
end