openwferu-extras 0.9.14 → 0.9.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,7 +38,10 @@
38
38
  #
39
39
 
40
40
  require 'rubygems'
41
- require_gem 'activerecord'
41
+
42
+ #require_gem 'activerecord'
43
+ gem 'activerecord'
44
+ require 'active_record'
42
45
 
43
46
 
44
47
  require 'openwfe/workitem'
@@ -66,7 +69,9 @@ module Extras
66
69
  # among you to sort that out for a Rails based usage.
67
70
  #
68
71
  class OwfeTables < ActiveRecord::Migration
72
+
69
73
  def self.up
74
+
70
75
  create_table :workitems do |t|
71
76
  t.column :fei, :string
72
77
  t.column :wfid, :string
@@ -77,17 +82,25 @@ module Extras
77
82
  t.column :dispatch_time, :timestamp
78
83
  t.column :last_modified, :timestamp
79
84
  end
85
+ add_index :workitems, :wfid
86
+ add_index :workitems, :wf_name
87
+ add_index :workitems, :wf_revision
88
+ add_index :workitems, :participant_name
89
+ add_index :workitems, :store_name
90
+
80
91
  create_table :fields do |t|
81
- t.column :key, :string, :null => false
92
+ t.column :fkey, :string, :null => false
82
93
  t.column :svalue, :string
83
94
  t.column :yvalue, :text
84
95
  t.column :workitem_id, :integer, :null => false
85
96
  end
86
- add_index :fields, [ :workitem_id, :key ], :unique => true
87
- add_index :fields, :key
97
+ add_index :fields, [ :workitem_id, :fkey ], :unique => true
98
+ add_index :fields, :fkey
88
99
  add_index :fields, :svalue
89
100
  end
101
+
90
102
  def self.down
103
+
91
104
  drop_table :workitems
92
105
  drop_table :fields
93
106
  end
@@ -142,7 +155,7 @@ module Extras
142
155
  #
143
156
  # awi = OpenWFE::Extras::Workitem.from_owfe_workitem(wi)
144
157
  #
145
- # (This method will not save the 'ActiveWorkitem').
158
+ # (This method saves the 'ActiveWorkitem').
146
159
  #
147
160
  def Workitem.from_owfe_workitem (wi, store_name=nil)
148
161
 
@@ -194,7 +207,7 @@ module Extras
194
207
 
195
208
  h = {}
196
209
  fields.each do |f|
197
- h[f.key] = f.value
210
+ h[f.fkey] = f.value
198
211
  end
199
212
  h
200
213
  end
@@ -228,7 +241,7 @@ module Extras
228
241
  #
229
242
  def field (key)
230
243
 
231
- fields.find_by_key(key.to_s)
244
+ fields.find_by_fkey(key.to_s)
232
245
  end
233
246
 
234
247
  #
@@ -315,7 +328,7 @@ module Extras
315
328
  def self.new_field (key, value)
316
329
 
317
330
  f = Field.new
318
- f.key = key
331
+ f.fkey = key
319
332
  f.value = value
320
333
  f
321
334
  end
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.0
2
+ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: openwferu-extras
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.9.14
7
- date: 2007-09-18 00:00:00 +09:00
6
+ version: 0.9.15
7
+ date: 2007-09-24 00:00:00 +09:00
8
8
  summary: OpenWFEru extras (sqs, csv, ...)
9
9
  require_paths:
10
10
  - lib