enju_resource_merge 0.1.0.pre7 → 0.1.0.pre8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/patron_merge_lists_controller.rb +37 -37
- data/app/controllers/patron_merges_controller.rb +35 -35
- data/app/controllers/series_statement_merge_lists_controller.rb +0 -1
- data/app/models/agent_merge.rb +21 -0
- data/app/models/agent_merge_list.rb +29 -0
- data/app/models/enju_resource_merge/ability.rb +4 -4
- data/app/models/series_statement_merge_list.rb +0 -18
- data/app/views/{patron_merge_lists → agent_merge_lists}/_form.html.erb +1 -1
- data/app/views/{patron_merge_lists → agent_merge_lists}/edit.html.erb +3 -3
- data/app/views/agent_merge_lists/index.html.erb +33 -0
- data/app/views/{patron_merge_lists → agent_merge_lists}/new.html.erb +1 -1
- data/app/views/agent_merge_lists/show.html.erb +31 -0
- data/app/views/agent_merges/edit.html.erb +31 -0
- data/app/views/agent_merges/index.html.erb +32 -0
- data/app/views/agent_merges/new.html.erb +39 -0
- data/app/views/agent_merges/show.html.erb +25 -0
- data/config/routes.rb +7 -7
- data/db/migrate/133_create_agent_merges.rb +15 -0
- data/db/migrate/134_create_agent_merge_lists.rb +13 -0
- data/lib/enju_resource_merge/version.rb +1 -1
- data/lib/enju_resource_merge.rb +2 -2
- data/spec/controllers/agent_merge_lists_controller_spec.rb +456 -0
- data/spec/controllers/agent_merges_controller_spec.rb +437 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -68
- data/spec/dummy/app/models/ability.rb +4 -4
- data/spec/dummy/app/models/user.rb +5 -25
- data/spec/dummy/config/application.rb +1 -1
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/{001_create_patrons.rb → 001_create_agents.rb} +8 -8
- data/spec/dummy/db/migrate/012_create_owns.rb +2 -2
- data/spec/dummy/db/migrate/015_create_creates.rb +2 -2
- data/spec/dummy/db/migrate/047_create_produces.rb +2 -2
- data/spec/dummy/db/migrate/059_create_libraries.rb +28 -0
- data/spec/dummy/db/migrate/069_create_shelves.rb +15 -0
- data/spec/dummy/db/migrate/077_create_user_groups.rb +16 -0
- data/spec/dummy/db/migrate/080_create_library_groups.rb +18 -0
- data/spec/dummy/db/migrate/120_create_baskets.rb +12 -0
- data/spec/dummy/db/migrate/124_create_bookstores.rb +17 -0
- data/spec/dummy/db/migrate/125_create_donates.rb +2 -2
- data/spec/dummy/db/migrate/{20090812151902_create_patron_relationship_types.rb → 130_create_request_status_types.rb} +2 -2
- data/spec/dummy/db/migrate/131_create_request_types.rb +12 -0
- data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +2 -2
- data/spec/dummy/db/migrate/{20080905191442_create_patron_types.rb → 20080905191442_create_agent_types.rb} +2 -2
- data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +17 -0
- data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +14 -0
- data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +17 -0
- data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +22 -0
- data/spec/dummy/db/migrate/20090812151902_create_agent_relationship_types.rb +12 -0
- data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +2 -2
- data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +9 -0
- data/spec/dummy/db/migrate/20100606073747_create_agent_relationships.rb +13 -0
- data/spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb +11 -0
- data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +12 -0
- data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +11 -0
- data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +11 -0
- data/spec/dummy/db/migrate/20111201155456_create_users.rb +0 -5
- data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +5 -0
- data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +12 -0
- data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +14 -0
- data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +5 -0
- data/spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +6 -0
- data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +26 -0
- data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +6 -0
- data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +7 -0
- data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +5 -0
- data/spec/dummy/db/schema.rb +352 -154
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/factories/{patron.rb → agent.rb} +2 -2
- data/spec/factories/agent_merge.rb +6 -0
- data/spec/factories/agent_merge_list.rb +5 -0
- data/spec/factories/library.rb +13 -0
- data/spec/factories/user.rb +34 -6
- data/spec/fixtures/{patron_merge_lists.yml → agent_merge_lists.yml} +4 -4
- data/spec/fixtures/agent_merges.yml +31 -0
- data/spec/fixtures/{patron_types.yml → agent_types.yml} +4 -4
- data/spec/fixtures/{patrons.yml → agents.yml} +46 -46
- data/spec/fixtures/libraries.yml +102 -0
- data/spec/fixtures/library_groups.yml +34 -0
- data/spec/fixtures/series_statements.yml +23 -22
- data/spec/fixtures/shelves.yml +47 -0
- data/spec/fixtures/user_groups.yml +45 -0
- data/spec/models/{patron_merge_list_spec.rb → agent_merge_list_spec.rb} +2 -2
- data/spec/models/agent_merge_spec.rb +19 -0
- data/spec/models/series_statement_merge_list_spec.rb +0 -5
- metadata +136 -72
- data/app/models/patron_merge.rb +0 -21
- data/app/models/patron_merge_list.rb +0 -29
- data/app/views/patron_merge_lists/index.html.erb +0 -33
- data/app/views/patron_merge_lists/show.html.erb +0 -31
- data/app/views/patron_merges/edit.html.erb +0 -31
- data/app/views/patron_merges/index.html.erb +0 -32
- data/app/views/patron_merges/new.html.erb +0 -39
- data/app/views/patron_merges/show.html.erb +0 -25
- data/db/migrate/133_create_patron_merges.rb +0 -15
- data/db/migrate/134_create_patron_merge_lists.rb +0 -13
- data/spec/controllers/patron_merge_lists_controller_spec.rb +0 -456
- data/spec/controllers/patron_merges_controller_spec.rb +0 -437
- data/spec/dummy/app/models/role.rb +0 -47
- data/spec/dummy/app/models/user_has_role.rb +0 -4
- data/spec/dummy/db/migrate/20081028083142_create_patron_import_files.rb +0 -22
- data/spec/dummy/db/migrate/20100606073747_create_patron_relationships.rb +0 -13
- data/spec/dummy/db/migrate/20100814091104_add_position_to_patron_relationship.rb +0 -11
- data/spec/dummy/db/migrate/20100925074559_create_patron_import_results.rb +0 -12
- data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +0 -11
- data/spec/dummy/db/migrate/20110918161853_rename_series_statement_manifestation_id_to_root_manifestation_id.rb +0 -13
- data/spec/dummy/db/migrate/20111009183423_add_ndc_to_manifestation.rb +0 -9
- data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_patron_import_file.rb +0 -5
- data/spec/dummy/db/migrate/20120413170720_add_error_message_to_patron_import_file.rb +0 -5
- data/spec/dummy/db/migrate/20120415060323_rename_patron_import_file_imported_at_to_executed_at.rb +0 -9
- data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_patron_import_file.rb +0 -5
- data/spec/factories/patron_merge.rb +0 -6
- data/spec/factories/patron_merge_list.rb +0 -5
- data/spec/fixtures/patron_merges.yml +0 -31
- data/spec/models/patron_merge_spec.rb +0 -19
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateShelves < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :shelves do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.text :note
|
7
|
+
t.integer :library_id, :default => 1, :null => false
|
8
|
+
t.integer :items_count, :default => 0, :null => false
|
9
|
+
t.integer :position
|
10
|
+
t.timestamps
|
11
|
+
t.datetime :deleted_at
|
12
|
+
end
|
13
|
+
add_index :shelves, :library_id
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateUserGroups < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :user_groups do |t|
|
4
|
+
t.string :name, :string, :not_null => true
|
5
|
+
t.text :display_name, :string
|
6
|
+
t.text :note
|
7
|
+
t.integer :position
|
8
|
+
t.timestamps
|
9
|
+
t.datetime :deleted_at
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :user_groups
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateLibraryGroups < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :library_groups do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.string :short_name, :null => false
|
7
|
+
t.string :email
|
8
|
+
t.text :my_networks
|
9
|
+
t.text :login_banner
|
10
|
+
t.text :note
|
11
|
+
t.integer :country_id
|
12
|
+
t.integer :position
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
add_index :library_groups, :short_name
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateBookstores < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :bookstores do |t|
|
4
|
+
t.text :name, :null => false
|
5
|
+
t.string :zip_code
|
6
|
+
t.text :address
|
7
|
+
t.text :note
|
8
|
+
t.string :telephone_number
|
9
|
+
t.string :fax_number
|
10
|
+
t.string :url
|
11
|
+
t.integer :position
|
12
|
+
t.datetime :deleted_at
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
class CreateDonates < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :donates do |t|
|
4
|
-
t.integer :
|
4
|
+
t.integer :agent_id, :null => false
|
5
5
|
t.integer :item_id, :null => false
|
6
6
|
|
7
7
|
t.timestamps
|
8
8
|
end
|
9
|
-
add_index :donates, :
|
9
|
+
add_index :donates, :agent_id
|
10
10
|
add_index :donates, :item_id
|
11
11
|
end
|
12
12
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
class
|
1
|
+
class CreateRequestStatusTypes < ActiveRecord::Migration
|
2
2
|
def change
|
3
|
-
create_table :
|
3
|
+
create_table :request_status_types do |t|
|
4
4
|
t.string :name, :null => false
|
5
5
|
t.text :display_name
|
6
6
|
t.text :note
|
@@ -1,13 +1,13 @@
|
|
1
1
|
class CreateRealizes < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :realizes do |t|
|
4
|
-
t.references :
|
4
|
+
t.references :agent, :null => false
|
5
5
|
t.references :expression, :null => false
|
6
6
|
t.integer :position
|
7
7
|
|
8
8
|
t.timestamps
|
9
9
|
end
|
10
|
-
add_index :realizes, :
|
10
|
+
add_index :realizes, :agent_id
|
11
11
|
add_index :realizes, :expression_id
|
12
12
|
end
|
13
13
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateSubscriptions < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :subscriptions do |t|
|
4
|
+
t.text :title, :null => false
|
5
|
+
t.text :note
|
6
|
+
#t.integer :subscription_list_id, :integer
|
7
|
+
t.integer :user_id
|
8
|
+
t.integer :order_list_id
|
9
|
+
t.datetime :deleted_at
|
10
|
+
t.integer :subscribes_count, :default => 0, :null => false
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
add_index :subscriptions, :user_id
|
15
|
+
add_index :subscriptions, :order_list_id
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateSubscribes < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :subscribes do |t|
|
4
|
+
t.integer :subscription_id, :null => false
|
5
|
+
t.integer :work_id, :null => false
|
6
|
+
t.datetime :start_at, :null => false
|
7
|
+
t.datetime :end_at, :null => false
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
add_index :subscribes, :subscription_id
|
12
|
+
add_index :subscribes, :work_id
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateSearchEngines < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :search_engines do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.string :url, :null => false
|
7
|
+
t.text :base_url, :null => false
|
8
|
+
t.text :http_method, :null => false
|
9
|
+
t.text :query_param, :null => false
|
10
|
+
t.text :additional_param
|
11
|
+
t.text :note
|
12
|
+
t.integer :position
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class CreateAgentImportFiles < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :agent_import_files do |t|
|
4
|
+
t.integer :parent_id
|
5
|
+
t.string :content_type
|
6
|
+
t.integer :size
|
7
|
+
t.integer :user_id
|
8
|
+
t.text :note
|
9
|
+
t.datetime :executed_at
|
10
|
+
t.string :state
|
11
|
+
t.string :agent_import_file_name
|
12
|
+
t.string :agent_import_content_type
|
13
|
+
t.integer :agent_import_file_size
|
14
|
+
t.datetime :agent_import_updated_at
|
15
|
+
|
16
|
+
t.timestamps
|
17
|
+
end
|
18
|
+
add_index :agent_import_files, :parent_id
|
19
|
+
add_index :agent_import_files, :user_id
|
20
|
+
add_index :agent_import_files, :state
|
21
|
+
end
|
22
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class AddDcndlSchema < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
3
|
add_column :manifestations, :title_alternative_transcription, :text
|
4
|
-
add_column :
|
4
|
+
add_column :agents, :full_name_alternative_transcription, :text
|
5
5
|
add_column :manifestations, :description, :text
|
6
6
|
add_column :manifestations, :abstract, :text
|
7
7
|
add_column :manifestations, :available_at, :timestamp
|
@@ -14,7 +14,7 @@ class AddDcndlSchema < ActiveRecord::Migration
|
|
14
14
|
|
15
15
|
def self.down
|
16
16
|
remove_column :manifestations, :title_alternative_transcription
|
17
|
-
remove_column :
|
17
|
+
remove_column :agents, :full_name_alternative_transcription
|
18
18
|
remove_column :manifestations, :description
|
19
19
|
remove_column :manifestations, :abstract
|
20
20
|
remove_column :manifestations, :available_at
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateAgentRelationships < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :agent_relationships do |t|
|
4
|
+
t.integer :parent_id
|
5
|
+
t.integer :child_id
|
6
|
+
t.integer :agent_relationship_type_id
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
add_index :agent_relationships, :parent_id
|
11
|
+
add_index :agent_relationships, :child_id
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class AddPositionToAgentRelationship < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :manifestation_relationships, :position, :integer
|
4
|
+
add_column :agent_relationships, :position, :integer
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.down
|
8
|
+
remove_column :agent_relationships, :position
|
9
|
+
remove_column :manifestation_relationships, :position
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class AddBirthDateAndDeathDateToAgent < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :agents, :birth_date, :string
|
4
|
+
add_column :agents, :death_date, :string
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.down
|
8
|
+
remove_column :agents, :death_date
|
9
|
+
remove_column :agents, :birth_date
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class AddValidPeriodForNewUserToUserGroup < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :user_groups, :valid_period_for_new_user, :integer, :default => 0, :null => false
|
4
|
+
add_column :user_groups, :expired_at, :timestamp
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.down
|
8
|
+
remove_column :user_groups, :valid_period_for_new_user
|
9
|
+
remove_column :user_groups, :expired_at
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateAccepts < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :accepts do |t|
|
4
|
+
t.integer :basket_id
|
5
|
+
t.integer :item_id
|
6
|
+
t.integer :librarian_id
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
|
11
|
+
add_index :accepts, :basket_id
|
12
|
+
add_index :accepts, :item_id
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class AddAdditionalAttributesToUser < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
add_column :users, :username, :string
|
4
|
+
add_column :users, :user_number, :string
|
5
|
+
add_column :users, :state, :string
|
6
|
+
add_column :users, :locale, :string
|
7
|
+
add_column :users, :deleted_at, :datetime
|
8
|
+
add_column :users, :expired_at, :datetime
|
9
|
+
add_column :users, :library_id, :integer, :default => 1, :null => false
|
10
|
+
add_column :users, :required_role_id, :integer, :default => 1, :null => false
|
11
|
+
add_column :users, :user_group_id, :integer, :default => 1, :null => false
|
12
|
+
add_column :users, :note, :text
|
13
|
+
add_column :users, :keyword_list, :text
|
14
|
+
|
15
|
+
add_column :users, :failed_attempts, :integer
|
16
|
+
add_column :users, :unlock_token, :string
|
17
|
+
add_column :users, :locked_at, :datetime
|
18
|
+
|
19
|
+
add_column :users, :confirmed_at, :datetime
|
20
|
+
|
21
|
+
add_index :users, :username, :unique => true
|
22
|
+
add_index :users, :user_group_id
|
23
|
+
add_index :users, :user_number, :unique => true
|
24
|
+
add_index :users, :unlock_token, :unique => true
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
class AddCreatorStringToSeriesStatement < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
add_column :series_statements, :creator_string, :text
|
4
|
+
add_column :series_statements, :volume_number_string, :text
|
5
|
+
add_column :series_statements, :volume_number_transcription_string, :text
|
6
|
+
end
|
7
|
+
end
|