rivendell-db 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,9 +19,9 @@ module Rivendell
19
19
  def self.default_url
20
20
  if mysql_conf
21
21
  # If we can, pull the config from Rivendell's own configuration.
22
- "mysql://#{mysql_conf['Loginname']}:#{mysql_conf['Password']}@#{mysql_conf['Hostname']}/#{mysql_conf['Database']}"
22
+ "mysql://#{mysql_conf['Loginname']}:#{mysql_conf['Password']}@#{mysql_conf['Hostname']}/#{mysql_conf['Database']}?reconnect=true"
23
23
  else
24
- 'mysql://rduser:letmein@localhost/Rivendell'
24
+ 'mysql://rduser:letmein@localhost/Rivendell?reconnect=true'
25
25
  end
26
26
  end
27
27
 
@@ -44,6 +44,7 @@ require 'rivendell/db/cut'
44
44
  require 'rivendell/db/cart'
45
45
  require 'rivendell/db/dropbox'
46
46
  require 'rivendell/db/group'
47
+ require 'rivendell/db/scheduler_code'
47
48
  # require 'rivendell/task'
48
49
  # require 'rivendell/tools'
49
50
 
@@ -50,4 +50,9 @@ class Rivendell::DB::Cart
50
50
  ""
51
51
  end
52
52
  end
53
+
54
+ def self.scheduler_code(scheduler_code)
55
+ all('sched_codes.like' => "%#{scheduler_code.ljust(11)}%")
56
+ end
57
+
53
58
  end
@@ -0,0 +1,11 @@
1
+ class Rivendell::DB::SchedulerCode
2
+ include DataMapper::Resource
3
+ storage_names[:default] = 'SCHED_CODES'
4
+
5
+ property :code, String, :key => true
6
+ property :description, String
7
+
8
+ def carts
9
+ Rivendell::DB::Cart.scheduler_code(code)
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  module Rivendell
2
2
  module DB
3
- VERSION = "0.3"
3
+ VERSION = "0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rivendell-db
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-09-29 00:00:00.000000000 Z
13
+ date: 2015-01-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: dm-core
@@ -225,6 +225,7 @@ files:
225
225
  - lib/rivendell/db/cut.rb
226
226
  - lib/rivendell/db/dropbox.rb
227
227
  - lib/rivendell/db/group.rb
228
+ - lib/rivendell/db/scheduler_code.rb
228
229
  - lib/rivendell/db/version.rb
229
230
  - rivendell-db.gemspec
230
231
  - spec/rivendell/db/cart_spec.rb
@@ -249,7 +250,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
249
250
  version: '0'
250
251
  segments:
251
252
  - 0
252
- hash: -4448408842086997654
253
+ hash: 522510053322483927
253
254
  required_rubygems_version: !ruby/object:Gem::Requirement
254
255
  none: false
255
256
  requirements:
@@ -258,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
259
  version: '0'
259
260
  segments:
260
261
  - 0
261
- hash: -4448408842086997654
262
+ hash: 522510053322483927
262
263
  requirements: []
263
264
  rubyforge_project:
264
265
  rubygems_version: 1.8.23