Sha256: 8c2ae874ecc5a904c94c828f19c471f72a568800510483e91045809ff205ba47

Contents?: true

Size: 384 Bytes

Versions: 13

Compression:

Stored size: 384 Bytes

Contents

Sequel::Model.db = Sequel.connect(Taps::Config.taps_database_url)

class DbSession < Sequel::Model
	plugin :schema
	set_schema do
		primary_key :id
		text :key
		text :database_url
		timestamp :started_at
		timestamp :last_access
	end

	def conn
		Sequel.connect(database_url) do |db|
			yield db if block_given?
		end
	end
end

DbSession.create_table! unless DbSession.table_exists?

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
taps-0.3.11 lib/taps/db_session.rb
dkastner-taps-0.3.11 lib/taps/db_session.rb
taps-0.3.10 lib/taps/db_session.rb
taps-0.3.9 lib/taps/db_session.rb
taps-0.3.8 lib/taps/db_session.rb
taps-0.3.7 lib/taps/db_session.rb
taps-0.3.6 lib/taps/db_session.rb
taps-0.3.5 lib/taps/db_session.rb
taps-0.3.4 lib/taps/db_session.rb
taps-0.3.3 lib/taps/db_session.rb
taps-0.3.2 lib/taps/db_session.rb
taps-0.3.1 lib/taps/db_session.rb
taps-0.3.0 lib/taps/db_session.rb