editstore 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/README.rdoc +69 -71
- data/app/models/editstore/change.rb +22 -22
- data/app/models/editstore/object_lock.rb +17 -17
- data/db/migrate/20130710234514_create_editstore_projects.rb +4 -4
- data/db/migrate/20130711172833_create_editstore_changes.rb +2 -2
- data/db/migrate/20130711173100_create_editstore_states.rb +3 -3
- data/db/migrate/20130711211606_create_editstore_fields.rb +3 -3
- data/db/migrate/20130814221827_add_error_to_change.rb +1 -1
- data/db/migrate/20131004224346_add_pending_to_change.rb +1 -1
- data/db/migrate/20131015203809_create_object_lock.rb +2 -2
- data/db/migrate/20131015205757_add_indices.rb +1 -1
- data/db/migrate/20131016183057_create_run_log.rb +2 -2
- data/db/migrate/20131017165120_add_locking_version.rb +1 -1
- data/lib/editstore/version.rb +1 -1
- metadata +29 -16
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
YmVhMGJmY2Y2N2E0MDRjMGZhMmEzNjk0ZDY3N2FmMjJiNjc0MDBlNg==
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5ea22f34cc95b4d779097c8693b7965082dc95b8bc94ffd103df8dfe1835a1eb
|
4
|
+
data.tar.gz: 2c2fb739980d0de515fceed160886b041d7617429bbe496faeb9f716800edcfc
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
ODc3M2UwYzQ0Y2IyZTY0NThmMDUzZDdhYjFkZjkxYmJjNjFmNWI3YjVlZGEx
|
11
|
-
ZmRiOTM2ZDU1NDRmZTAwODRmYzlmYzU4YzYwNDliNzI3ODQxMzA=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZTUwMDU5NzExNTc2NDI2MTQwYTAxYjIzNTQ3NzI4YTg5ZWM1OGMyNjdiMzMy
|
14
|
-
ODM1NTNlZmIzMWIxNTJjMmE2ZmExYWU1ZDExMmZlNGE1YzFkNTZjZmE5OWRl
|
15
|
-
MDYwY2YyNDI5ZWIzNzNlYjY4NTRjMjVjMTQxMmUxM2Y2YmE1ZTU=
|
6
|
+
metadata.gz: a01f66c8dcf29de656fbd1ec1c5ee6abbe425620fdc9645372cd8dbc320aea725f91dde38b24bbe489140f79083d98369afbc1a5bd25a599405d9b193b1af6af
|
7
|
+
data.tar.gz: 22c48feec9dccf1874ad2da26e25a3e7fe659bf31f81d1d0cfcc7e7ddfa639d531590d63686b6549af80680c4c3b83abe0e753ef404deafcbb04513858aa1fad
|
data/README.rdoc
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
{<img src="https://travis-ci.org/sul-dlss/editstore.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/sul-dlss/editstore]
|
2
|
+
{<img src="https://coveralls.io/repos/github/sul-dlss/editstore/badge.svg?branch=master" alt="Coverage Status" />}[https://coveralls.io/github/sul-dlss/editstore?branch=master]
|
3
|
+
|
1
4
|
= Editstore
|
2
5
|
|
3
6
|
This project uses MIT-LICENSE.
|
@@ -8,63 +11,59 @@ It provides models that allow your client web application to cache descriptive m
|
|
8
11
|
|
9
12
|
1. Add the following to your application's 'Gemfile':
|
10
13
|
|
11
|
-
|
12
|
-
gem 'editstore'
|
14
|
+
gem 'editstore'
|
13
15
|
|
14
16
|
2. Install the gem
|
15
17
|
|
16
|
-
|
18
|
+
bundle install
|
17
19
|
|
18
20
|
3. Add the migrations to your app
|
19
21
|
|
20
|
-
|
22
|
+
rake editstore:install:migrations
|
21
23
|
|
22
24
|
4. Add development and test database connection stings to the 'database.yml' file in your app for development/test:
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
26
|
+
editstore_development:
|
27
|
+
adapter: sqlite3
|
28
|
+
database: db/editstore_development.sqlite3
|
29
|
+
pool: 5
|
30
|
+
timeout: 5000
|
31
|
+
|
32
|
+
editstore_test:
|
33
|
+
adapter: sqlite3
|
34
|
+
database: db/editstore_test.sqlite3
|
35
|
+
pool: 5
|
36
|
+
timeout: 5000
|
37
|
+
|
38
|
+
editstore_production:
|
39
|
+
adapter: mysql2
|
40
|
+
database: # GET IT FROM FRIENDLY SYSADMIN IF YOU NEED IT FOR PRODUCTION
|
39
41
|
|
40
42
|
5. Generate a migration to store your project specific name and fields in your own test/dev databases:
|
41
43
|
|
42
|
-
|
44
|
+
rails g migration editstore_myproject
|
43
45
|
|
44
46
|
6. Edit your migration to add your project name and fields. Be sure to have the migration use the correct Editstore database
|
45
|
-
connection string as shown below. For servers (e.g. staging, production), these changes be done after your creating your template and running the
|
46
|
-
rake editstore:update_editstore_config RAILS_ENV=environment task.
|
47
|
+
connection string as shown below. For servers (e.g. staging, production), these changes be done after your creating your template and running the
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
will already be properly configured when you setup the project and do not want these migrations run again on the production servers during
|
51
|
-
deployment. However, since locally you are not running an actual correctly configured instance of the editstore system, these migrations give you
|
52
|
-
enough information to make the app work in development.
|
49
|
+
rake editstore:update_editstore_config RAILS_ENV=environment task.
|
50
|
+
|
51
|
+
By default, migrations such as this should only run in development and test mode. By adding the "if Editstore.run_migrations?" qualifier, you will ensure you will not get the migrations except in development and test. The reason is that in staging and production the actual editstore database will already be properly configured when you setup the project and do not want these migrations run again on the production servers during deployment. However, since locally you are not running an actual correctly configured instance of the editstore system, these migrations give you enough information to make the app work in development.
|
53
52
|
|
54
53
|
An example of this migration you need to add is shown below:
|
55
54
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
55
|
+
def up
|
56
|
+
if Editstore.run_migrations?
|
57
|
+
@connection=Editstore::Connection.connection
|
58
|
+
project=Editstore::Project.create(:name=>'Revs',:template=>'revs')
|
59
|
+
Editstore::Field.create(:name=>'title_tsi',:project_id=>project.id)
|
60
|
+
Editstore::Field.create(:name=>'pub_year_isim',:project_id=>project.id)
|
62
61
|
end
|
63
|
-
|
62
|
+
end
|
64
63
|
|
65
64
|
7. Run the migrations
|
66
65
|
|
67
|
-
|
66
|
+
rake db:migrate
|
68
67
|
|
69
68
|
== Usage
|
70
69
|
|
@@ -72,7 +71,7 @@ An example of this migration you need to add is shown below:
|
|
72
71
|
editstore database , the gem will automatically associated all updates with your project. A good spot to set this
|
73
72
|
constant in a Rails app is at the bottom of the 'config/application.rb' file, e.g.
|
74
73
|
|
75
|
-
|
74
|
+
EDITSTORE_PROJECT='Revs'
|
76
75
|
|
77
76
|
2. In the application, to apply an update to DOR, you just need to create a new "Editstore::Change" object and save it.
|
78
77
|
If your application needs to update a local SOLR or MySQL, you will need to do this yourself. This object just saves
|
@@ -90,101 +89,100 @@ The properties you need to set are:
|
|
90
89
|
-- if you set to 'wait', you will need to keep track of the change yourself (probably using the object ID once it is saved)
|
91
90
|
so you can come and update the state later to 'ready' when you want the change propagated. This might happen if you
|
92
91
|
have curated changes
|
93
|
-
|
94
|
-
|
92
|
+
|
93
|
+
field : a valid field name defined in your project template and listed in the 'fields' table of the editstore database for your project
|
95
94
|
druid : the druid of the object you want to update (can include or not include the 'druid:' prefix)
|
96
95
|
client_note : an optional note you can set for your application purposes only
|
97
96
|
|
98
97
|
Some examples are below:
|
99
98
|
|
100
99
|
a. Add a new value:
|
101
|
-
|
100
|
+
|
102
101
|
add=Editstore::Change.new
|
103
102
|
add.new_value='new value'
|
104
103
|
add.operation=:create
|
105
|
-
add.state=Editstore::State.ready
|
104
|
+
add.state=Editstore::State.ready
|
106
105
|
#add.project_id=1 # you can leave this off if you set the EDITSTORE_PROJECT constant as describe above
|
107
106
|
add.field='title'
|
108
107
|
add.druid='druid:oo000oo0001'
|
109
|
-
add.client_note='some note'
|
108
|
+
add.client_note='some note'
|
110
109
|
add.save
|
111
|
-
|
110
|
+
|
112
111
|
b. Change an existing value:
|
113
112
|
|
114
113
|
change=Editstore::Change.new
|
115
|
-
change.new_value='new value'
|
116
|
-
change.old_value='previous value'
|
114
|
+
change.new_value='new value'
|
115
|
+
change.old_value='previous value'
|
117
116
|
change.operation=:update
|
118
|
-
change.state=Editstore::State.ready
|
117
|
+
change.state=Editstore::State.ready
|
119
118
|
#change.project_id=1 # you can leave this off if you set the EDITSTORE_PROJECT constant as describe above
|
120
|
-
change.field='title'
|
119
|
+
change.field='title'
|
121
120
|
change.druid='druid:oo000oo0001'
|
122
|
-
change.client_note='some note'
|
121
|
+
change.client_note='some note'
|
123
122
|
change.save
|
124
|
-
|
123
|
+
|
125
124
|
c. Delete an existing value (useful to delete just value in a multivalued field):
|
126
125
|
|
127
126
|
delete=Editstore::Change.new
|
128
127
|
delete.old_value='value to delete'
|
129
128
|
delete.operation=:delete
|
130
|
-
delete.state=Editstore::State.ready
|
129
|
+
delete.state=Editstore::State.ready
|
131
130
|
#delete.project_id=1 # you can leave this off if you set the EDITSTORE_PROJECT constant as describe above
|
132
|
-
delete.field='title'
|
131
|
+
delete.field='title'
|
133
132
|
delete.druid='druid:oo000oo0001'
|
134
|
-
delete.client_note='some note'
|
135
|
-
delete.save
|
133
|
+
delete.client_note='some note'
|
134
|
+
delete.save
|
136
135
|
|
137
136
|
d. Delete all existing values (can be used for either a single valued field or can be used to delete *all* values in a multivalued field):
|
138
|
-
|
137
|
+
|
139
138
|
# just leave off the 'old_value' attribute to delete any values associated with this field
|
140
139
|
delete=Editstore::Change.new
|
141
140
|
delete.operation=:delete
|
142
|
-
delete.state=Editstore::State.ready
|
141
|
+
delete.state=Editstore::State.ready
|
143
142
|
#delete.project_id=1 # you can leave this off if you set the EDITSTORE_PROJECT constant as describe above
|
144
|
-
delete.field='title'
|
143
|
+
delete.field='title'
|
145
144
|
delete.druid='druid:oo000oo0001'
|
146
|
-
delete.client_note='some note'
|
145
|
+
delete.client_note='some note'
|
147
146
|
delete.save
|
148
|
-
|
147
|
+
|
149
148
|
== Useful Cleanup Tasks
|
150
149
|
|
151
150
|
When running in development mode, you will get a lot of unprocessed changes building up in the development
|
152
151
|
editstore database (since you won't have the back-end system processing them and cleaning them out). To clean out
|
153
152
|
entries from the editstore database:
|
154
153
|
|
155
|
-
|
156
|
-
|
154
|
+
rake editstore:remove_pending
|
155
|
+
|
157
156
|
In production, you can also use this task to clean out any rows that have been marked as completed:
|
158
157
|
|
159
|
-
|
160
|
-
|
158
|
+
rake editstore:remove_complete
|
159
|
+
|
161
160
|
Use this task to clear out the unlocked druids from the object lock table. Should be safe to run at any time.
|
162
161
|
|
163
162
|
rake editstore:prune_locks # prune any unlocked druids older than 1 month
|
164
163
|
rake editstore:prune_locks_all # prune all unlocked druids
|
165
|
-
|
166
|
-
Use this task to clear out the locked druids from the object lock table. Should only be run if you are sure locks have hung and
|
164
|
+
|
165
|
+
Use this task to clear out the locked druids from the object lock table. Should only be run if you are sure locks have hung and
|
167
166
|
there are no other processes running.
|
168
167
|
|
169
|
-
rake editstore:clear_locks
|
168
|
+
rake editstore:clear_locks
|
170
169
|
|
171
170
|
Use this task to clear out the any log run entries older than one month. Should be safe to run at any time if you don't need more than 1 month of run log history
|
172
171
|
|
173
172
|
rake editstore:prune_run_log # prune any run logs older than 1 month and any run logs older than 24 hours with no activity
|
174
173
|
rake editstore:prune_run_log_all # prune any run logs that are not in process
|
175
|
-
|
176
|
-
|
174
|
+
|
175
|
+
|
177
176
|
== Running Tests
|
178
177
|
|
179
178
|
There is a "dummy" rails app in "spec/dummy" that is used for testing. To run the tests, run the migrations and then
|
180
179
|
run the standard rspec tests:
|
181
180
|
|
182
|
-
|
183
|
-
|
184
|
-
|
181
|
+
cd ./spec/dummy && rake editstore:install:migrations && rake db:migrate RAILS_ENV=test && cd ../..
|
182
|
+
bundle exec rspec
|
183
|
+
|
185
184
|
== Building and Pushing Gem to RubyGems
|
186
185
|
|
187
186
|
You will need to have an account on RubyGems and be listed as an owner for this gem.
|
188
187
|
|
189
|
-
|
190
|
-
gem push edistore-X.Y.Z.gem
|
188
|
+
rake release
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Editstore
|
2
2
|
require 'druid-tools'
|
3
|
-
|
3
|
+
|
4
4
|
class Change < Connection
|
5
5
|
belongs_to :state
|
6
6
|
belongs_to :project
|
@@ -12,11 +12,11 @@ module Editstore
|
|
12
12
|
# end
|
13
13
|
|
14
14
|
OPERATIONS=%w{create update delete}
|
15
|
-
|
15
|
+
|
16
16
|
validates :field, presence: true
|
17
17
|
validates :operation, presence: true
|
18
|
-
validates :new_value, presence: true, :if =>
|
19
|
-
validates :old_value, presence: true, :if =>
|
18
|
+
validates :new_value, presence: true, :if => Proc.new{ %w(update create).include? self.operation.to_s }
|
19
|
+
validates :old_value, presence: true, :if => Proc.new{ 'update'.include? self.operation.to_s }
|
20
20
|
validates :project_id, presence: true, numericality: { only_integer: true }
|
21
21
|
validates :state_id, presence: true, numericality: { only_integer: true }
|
22
22
|
validate :valid_state_id
|
@@ -24,13 +24,13 @@ module Editstore
|
|
24
24
|
validate :valid_field_name
|
25
25
|
validate :valid_druid
|
26
26
|
validate :valid_operation
|
27
|
-
|
28
|
-
before_validation :set_default_project, :if =>
|
29
|
-
|
27
|
+
|
28
|
+
before_validation :set_default_project, :if => Proc.new{ defined?(EDITSTORE_PROJECT) && !EDITSTORE_PROJECT.nil? }# this allows the user to set this in their project so it will set automatically for each change
|
29
|
+
|
30
30
|
def self.prune
|
31
|
-
self.destroy_all(:state_id=>Editstore::State.complete)
|
31
|
+
self.destroy_all(:state_id=>Editstore::State.complete)
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
def self.by_project_id(project_id)
|
35
35
|
if project_id.to_s.empty?
|
36
36
|
#scoped
|
@@ -57,7 +57,7 @@ module Editstore
|
|
57
57
|
limit=params[:limit]
|
58
58
|
project_id=params[:project_id]
|
59
59
|
druid=params[:druid]
|
60
|
-
|
60
|
+
|
61
61
|
#changes = scoped
|
62
62
|
changes = where(nil)
|
63
63
|
changes = changes.includes(:project)
|
@@ -67,16 +67,16 @@ module Editstore
|
|
67
67
|
changes = changes.order('created_at,id asc')
|
68
68
|
changes = changes.limit(limit) unless limit.blank?
|
69
69
|
druid ? changes : changes.group_by {|c| c.druid}
|
70
|
-
|
70
|
+
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
# get the latest list of unique druids to process for a specific state (defaults to ready) and an optional limit, return an array
|
74
74
|
def self.latest_druids(params={})
|
75
75
|
|
76
76
|
state_id=params[:state_id] || Editstore::State.ready.id
|
77
77
|
limit=params[:limit]
|
78
78
|
project_id=params[:project_id]
|
79
|
-
|
79
|
+
|
80
80
|
#changes = scoped
|
81
81
|
changes = where(nil)
|
82
82
|
changes = changes.includes(:project)
|
@@ -84,33 +84,33 @@ module Editstore
|
|
84
84
|
changes = changes.where(:project_id=>project_id) if project_id
|
85
85
|
changes = changes.order('editstore_changes.created_at,editstore_changes.id asc')
|
86
86
|
changes = changes.limit(limit) unless limit.blank?
|
87
|
-
changes.
|
87
|
+
changes.distinct.pluck('druid').uniq
|
88
88
|
|
89
89
|
end
|
90
|
-
|
90
|
+
|
91
91
|
private
|
92
92
|
def valid_operation
|
93
|
-
errors.add(:operation, "is not valid") unless OPERATIONS.include? operation.to_s
|
93
|
+
errors.add(:operation, "is not valid") unless OPERATIONS.include? operation.to_s
|
94
94
|
end
|
95
|
-
|
95
|
+
|
96
96
|
# project name is case insensitive
|
97
97
|
def set_default_project
|
98
98
|
default_project = Editstore::Project.where('lower(name)=?',EDITSTORE_PROJECT.downcase).limit(1)
|
99
99
|
self.project_id = default_project.first.id if (default_project.size == 1 && !self.project_id)
|
100
100
|
end
|
101
|
-
|
101
|
+
|
102
102
|
def valid_druid
|
103
103
|
if !DruidTools::Druid.valid?(self.druid)
|
104
104
|
errors.add(:druid,"is invalid")
|
105
105
|
end
|
106
106
|
end
|
107
|
-
|
107
|
+
|
108
108
|
def valid_field_name
|
109
109
|
if Editstore::Field.where(:name=>self.field,:project_id=>self.project_id).count == 0
|
110
110
|
errors.add(:field, "is invalid")
|
111
|
-
end
|
111
|
+
end
|
112
112
|
end
|
113
|
-
|
113
|
+
|
114
114
|
def valid_state_id
|
115
115
|
if !Editstore::State.exists?(self.state_id)
|
116
116
|
errors.add(:state_id, "is invalid")
|
@@ -122,6 +122,6 @@ module Editstore
|
|
122
122
|
errors.add(:project_id, "is invalid")
|
123
123
|
end
|
124
124
|
end
|
125
|
-
|
125
|
+
|
126
126
|
end
|
127
127
|
end
|
@@ -5,23 +5,23 @@ module Editstore
|
|
5
5
|
# def objectlock_params
|
6
6
|
# params.require(:objectlock).permit(:locked, :druid)
|
7
7
|
# end
|
8
|
-
|
8
|
+
|
9
9
|
def self.prune_all
|
10
|
-
self.
|
11
|
-
end
|
12
|
-
|
10
|
+
self.where(:locked=>nil).destroy_all # anything that is not locked
|
11
|
+
end
|
12
|
+
|
13
13
|
def self.prune
|
14
14
|
self.where(:locked=>nil).where('updated_at < ?',1.month.ago).each {|obj| obj.destroy} # anything that is not locked older than 1 month
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def self.unlock_all
|
18
18
|
self.all_locked.each {|obj| obj.unlock} # unlock anything that is locked
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def self.get_pid(pid)
|
22
22
|
pid.start_with?('druid:') ? pid : "druid:#{pid}"
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def self.all_locked
|
26
26
|
self.where('locked IS NOT NULL')
|
27
27
|
end
|
@@ -29,7 +29,7 @@ module Editstore
|
|
29
29
|
def self.all_unlocked
|
30
30
|
self.where(:locked=>nil)
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
# some convenience class level methods for operating on a specific druid
|
34
34
|
def self.lock(pid)
|
35
35
|
status=self.find_by_druid(self.get_pid(pid))
|
@@ -40,7 +40,7 @@ module Editstore
|
|
40
40
|
return true
|
41
41
|
end
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
def self.unlock(pid)
|
45
45
|
status=self.find_by_druid(self.get_pid(pid))
|
46
46
|
if status # this druid already exists in the table
|
@@ -49,22 +49,22 @@ module Editstore
|
|
49
49
|
return false # druid doesn't exist, can't unlock
|
50
50
|
end
|
51
51
|
end
|
52
|
-
|
52
|
+
|
53
53
|
# check to see if this druid is locked
|
54
54
|
def self.locked?(pid)
|
55
55
|
status=self.find_by_druid(self.get_pid(pid))
|
56
56
|
status.nil? ? false : status.locked?
|
57
57
|
end
|
58
|
-
|
59
|
-
# object level methods for performing actions
|
58
|
+
|
59
|
+
# object level methods for performing actions
|
60
60
|
def locked?
|
61
61
|
!unlocked?
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
def unlocked?
|
65
65
|
locked == nil
|
66
66
|
end
|
67
|
-
|
67
|
+
|
68
68
|
# lock this object
|
69
69
|
def lock
|
70
70
|
if unlocked?
|
@@ -75,17 +75,17 @@ module Editstore
|
|
75
75
|
return false # already locked
|
76
76
|
end
|
77
77
|
end
|
78
|
-
|
78
|
+
|
79
79
|
# unlock this object
|
80
80
|
def unlock
|
81
81
|
if locked?
|
82
82
|
self.locked = nil
|
83
83
|
save
|
84
|
-
return true # unlock it
|
84
|
+
return true # unlock it
|
85
85
|
else
|
86
86
|
return false # already unlocked
|
87
87
|
end
|
88
88
|
end
|
89
|
-
|
89
|
+
|
90
90
|
end
|
91
91
|
end
|
@@ -1,15 +1,15 @@
|
|
1
|
-
class CreateEditstoreProjects < ActiveRecord::Migration
|
2
|
-
|
1
|
+
class CreateEditstoreProjects < ActiveRecord::Migration[4.2]
|
2
|
+
|
3
3
|
def change
|
4
4
|
if Editstore.run_migrations?
|
5
5
|
@connection=Editstore::Connection.connection
|
6
6
|
create_table :editstore_projects do |t|
|
7
7
|
t.string :name, :null=>false
|
8
8
|
t.string :template, :null=>false
|
9
|
-
t.timestamps
|
9
|
+
t.timestamps :null=>true
|
10
10
|
end
|
11
11
|
Editstore::Project.create(:id=>1,:name=>'Generic',:template=>'generic')
|
12
12
|
end
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class CreateEditstoreChanges < ActiveRecord::Migration
|
1
|
+
class CreateEditstoreChanges < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
if Editstore.run_migrations?
|
4
4
|
@connection=Editstore::Connection.connection
|
@@ -11,7 +11,7 @@ class CreateEditstoreChanges < ActiveRecord::Migration
|
|
11
11
|
t.string :operation, :null=>false
|
12
12
|
t.integer :state_id, :null=>false
|
13
13
|
t.text :client_note
|
14
|
-
t.timestamps
|
14
|
+
t.timestamps :null=>true
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -1,17 +1,17 @@
|
|
1
|
-
class CreateEditstoreStates < ActiveRecord::Migration
|
1
|
+
class CreateEditstoreStates < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
if Editstore.run_migrations?
|
4
4
|
@connection=Editstore::Connection.connection
|
5
5
|
create_table :editstore_states do |t|
|
6
6
|
t.string :name, :null=>false
|
7
|
-
t.timestamps
|
7
|
+
t.timestamps :null=>true
|
8
8
|
end
|
9
9
|
Editstore::State.create(:id=>1,:name=>'wait')
|
10
10
|
Editstore::State.create(:id=>2,:name=>'ready')
|
11
11
|
Editstore::State.create(:id=>3,:name=>'in process')
|
12
12
|
Editstore::State.create(:id=>4,:name=>'error')
|
13
13
|
Editstore::State.create(:id=>5,:name=>'applied')
|
14
|
-
Editstore::State.create(:id=>6,:name=>'complete')
|
14
|
+
Editstore::State.create(:id=>6,:name=>'complete')
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
class CreateEditstoreFields < ActiveRecord::Migration
|
1
|
+
class CreateEditstoreFields < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
if Editstore.run_migrations?
|
4
4
|
@connection=Editstore::Connection.connection
|
5
5
|
create_table :editstore_fields do |t|
|
6
6
|
t.integer :project_id,:null=>false
|
7
7
|
t.string :name,:null=>false
|
8
|
-
t.timestamps
|
8
|
+
t.timestamps :null=>true
|
9
9
|
end
|
10
10
|
Editstore::Field.create(:id=>1,:name=>'title',:project_id=>'1')
|
11
|
-
Editstore::Field.create(:id=>
|
11
|
+
Editstore::Field.create(:id=>2,:name=>'description',:project_id=>'1')
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
class CreateObjectLock < ActiveRecord::Migration
|
1
|
+
class CreateObjectLock < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
if Editstore.run_migrations?
|
4
4
|
@connection=Editstore::Connection.connection
|
5
5
|
create_table :editstore_object_locks do |t|
|
6
6
|
t.string :druid, :null=>false
|
7
7
|
t.datetime :locked
|
8
|
-
t.timestamps
|
8
|
+
t.timestamps :null=>true
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class CreateRunLog < ActiveRecord::Migration
|
1
|
+
class CreateRunLog < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
if Editstore.run_migrations?
|
4
4
|
@connection=Editstore::Connection.connection
|
@@ -10,7 +10,7 @@ class CreateRunLog < ActiveRecord::Migration
|
|
10
10
|
t.string :note
|
11
11
|
t.datetime :started
|
12
12
|
t.datetime :ended
|
13
|
-
t.timestamps
|
13
|
+
t.timestamps :null=>true
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
data/lib/editstore/version.rb
CHANGED
metadata
CHANGED
@@ -1,83 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: editstore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Mangiafico
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: druid-tools
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sqlite3
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: coveralls
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rspec
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- - ~>
|
73
|
+
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
75
|
version: '3.0'
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- - ~>
|
80
|
+
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '3.0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rspec-rails
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- -
|
87
|
+
- - ">="
|
74
88
|
- !ruby/object:Gem::Version
|
75
89
|
version: '0'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- -
|
94
|
+
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
83
97
|
description: The editstore gem is a Rails engine, including all models and migrations
|
@@ -128,20 +142,19 @@ require_paths:
|
|
128
142
|
- lib
|
129
143
|
required_ruby_version: !ruby/object:Gem::Requirement
|
130
144
|
requirements:
|
131
|
-
- -
|
145
|
+
- - ">="
|
132
146
|
- !ruby/object:Gem::Version
|
133
147
|
version: '0'
|
134
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
|
-
- -
|
150
|
+
- - ">="
|
137
151
|
- !ruby/object:Gem::Version
|
138
152
|
version: '0'
|
139
153
|
requirements: []
|
140
154
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
155
|
+
rubygems_version: 2.7.8
|
142
156
|
signing_key:
|
143
157
|
specification_version: 4
|
144
158
|
summary: The editstore gem is used by client web applications (like Revs Digital Library)
|
145
159
|
to stage changes to descriptive metadata in DOR
|
146
160
|
test_files: []
|
147
|
-
has_rdoc:
|