enju_subject 0.1.0.pre12 → 0.1.0.pre13

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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/subjects_controller.rb +3 -9
  3. data/app/models/classification.rb +6 -17
  4. data/app/models/classification_type.rb +2 -2
  5. data/app/models/enju_subject/ability.rb +0 -5
  6. data/app/models/subject.rb +7 -7
  7. data/app/models/subject_heading_type.rb +2 -2
  8. data/app/models/subject_heading_type_has_subject.rb +2 -2
  9. data/app/models/subject_sweeper.rb +2 -10
  10. data/app/models/subject_type.rb +2 -2
  11. data/app/models/work_has_subject.rb +2 -2
  12. data/app/views/classifications/index.html.erb +51 -4
  13. data/app/views/manifestations/_classification_detail.html.erb +14 -0
  14. data/app/views/manifestations/_subject_detail.html.erb +14 -0
  15. data/app/views/subjects/index.html.erb +1 -3
  16. data/app/views/subjects/show.html.erb +2 -6
  17. data/db/migrate/20130504133816_add_manifestation_id_to_subject.rb +6 -0
  18. data/db/migrate/20130504143515_add_manifestation_id_to_classification.rb +6 -0
  19. data/lib/enju_subject/manifestation.rb +5 -9
  20. data/lib/enju_subject/version.rb +1 -1
  21. data/lib/generators/enju_subject/setup/templates/db/fixtures/classification_types.yml +8 -2
  22. data/spec/dummy/app/models/ability.rb +0 -5
  23. data/spec/dummy/db/development.sqlite3 +0 -0
  24. data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +5 -0
  25. data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +7 -0
  26. data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +5 -0
  27. data/spec/dummy/db/schema.rb +21 -27
  28. data/spec/dummy/db/test.sqlite3 +0 -0
  29. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  30. data/spec/dummy/solr/data/test/index/segments_1n5 +0 -0
  31. data/spec/fixtures/classification_types.yml +2 -2
  32. data/spec/fixtures/classifications.yml +3 -2
  33. data/spec/fixtures/subject_heading_type_has_subjects.yml +2 -2
  34. data/spec/fixtures/subject_heading_types.yml +2 -2
  35. data/spec/fixtures/subject_types.yml +2 -2
  36. data/spec/fixtures/subjects.yml +3 -0
  37. data/spec/fixtures/work_has_subjects.yml +2 -2
  38. data/spec/models/classification_spec.rb +3 -2
  39. data/spec/models/classification_type_spec.rb +2 -2
  40. data/spec/models/subject_heading_type_has_subject_spec.rb +2 -2
  41. data/spec/models/subject_heading_type_spec.rb +2 -2
  42. data/spec/models/subject_spec.rb +2 -0
  43. data/spec/models/subject_type_spec.rb +2 -2
  44. data/spec/models/work_has_subject_spec.rb +2 -2
  45. metadata +33 -29
  46. data/app/controllers/subject_has_classifications_controller.rb +0 -97
  47. data/app/models/subject_has_classification.rb +0 -37
  48. data/app/views/classifications/_index.html.erb +0 -52
  49. data/app/views/classifications/_index_subject.html.erb +0 -62
  50. data/app/views/subject_has_classifications/edit.html.erb +0 -30
  51. data/app/views/subject_has_classifications/index.html.erb +0 -38
  52. data/app/views/subject_has_classifications/new.html.erb +0 -32
  53. data/app/views/subject_has_classifications/show.html.erb +0 -22
  54. data/app/views/subjects/_index_classification.html.erb +0 -57
  55. data/db/migrate/143_create_subject_has_classifications.rb +0 -16
  56. data/spec/controllers/subject_has_classifications_controller_spec.rb +0 -443
  57. data/spec/dummy/db/migrate/20110918161853_rename_series_statement_manifestation_id_to_root_manifestation_id.rb +0 -13
  58. data/spec/dummy/solr/data/test/index/segments_19e +0 -0
  59. data/spec/factories/subject_has_classification.rb +0 -6
  60. data/spec/fixtures/subject_has_classifications.yml +0 -74
  61. data/spec/models/subject_has_classification_spec.rb +0 -20
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6316e829623beca0b99b9af59ced119df3644d4
4
- data.tar.gz: 48e221f325a04d5c0f914dc9ac371e28cba421c0
3
+ metadata.gz: 2a89e5f25c1f9c4b71c86a465ba2444e76df5a2d
4
+ data.tar.gz: c5057ad5dd20114fb5efb76e4334b7e8b5ca756e
5
5
  SHA512:
6
- metadata.gz: 05de8257b4d0366436c6cdb167a0beaf0894eda446db6eb5e362578920df7c3d6dcab69670ae0c0e24a950220e3bf2f735d97342a0f536d6ab73538ed8f0926d
7
- data.tar.gz: aa7b096175f48c5b9eb1338eceb0a87e4ba3e7d479b9f661c1d795c42e5db0422a4fba1347e1a910acd9a5906944263540bfa7630926435a98036e6cb6f6d82d
6
+ metadata.gz: 07634d10d3e400ae41d3ffb3c170da6f6647e69e63d54e26e35126e36b2403d310039a578fd52b62ec07131c5d89be80c54906dc47a054c52955f6e5d2e98bb8
7
+ data.tar.gz: c39aaf878922caeea0dfc026763c7d5b88616edfe0d7d4ee8266cc8e54888a6e03e180ee796f549b8476ddac5a38e3bfa71dcfad49d7508eb675481cfa34a68e
@@ -2,7 +2,7 @@
2
2
  class SubjectsController < ApplicationController
3
3
  load_and_authorize_resource :except => :index
4
4
  authorize_resource :only => :index
5
- before_filter :get_work, :get_subject_heading_type, :get_classification
5
+ before_filter :get_work, :get_subject_heading_type
6
6
  before_filter :prepare_options, :only => :new
7
7
  after_filter :solr_commit, :only => [:create, :update, :destroy]
8
8
  cache_sweeper :subject_sweeper, :only => [:create, :update, :destroy]
@@ -17,7 +17,7 @@ class SubjectsController < ApplicationController
17
17
  end
18
18
  sort[:order] = 'asc' if params[:order] == 'asc'
19
19
 
20
- search = Subject.search(:include => [:works])
20
+ search = Subject.search(:include => [:manifestation])
21
21
  query = params[:query].to_s.strip
22
22
  unless query.blank?
23
23
  @query = query.dup
@@ -33,11 +33,9 @@ class SubjectsController < ApplicationController
33
33
 
34
34
  unless params[:mode] == 'add'
35
35
  work = @work
36
- classification = @classification
37
36
  subject_heading_type = @subject_heading_type
38
37
  search.build do
39
- with(:work_ids).equal_to work.id if work
40
- with(:classification_ids).equal_to classification.id if classification
38
+ with(:work_id).equal_to work.id if work
41
39
  with(:subject_heading_type_ids).equal_to subject_heading_type.id if subject_heading_type
42
40
  end
43
41
  end
@@ -96,7 +94,6 @@ class SubjectsController < ApplicationController
96
94
  # GET /subjects/new
97
95
  def new
98
96
  @subject = Subject.new
99
- @subject.classification_id = @classification.id if @classification
100
97
  @subject.subject_heading_type_id = @subject_heading_type.id if @subject_heading_type
101
98
 
102
99
  respond_to do |format|
@@ -123,17 +120,14 @@ class SubjectsController < ApplicationController
123
120
  else
124
121
  @subject = Subject.new(params[:subject])
125
122
  end
126
- classification = Classification.find(@subject.classification_id) if @subject.classification_id.present?
127
123
  subject_heading_type = SubjectHeadingType.find(@subject.subject_heading_type_id) if @subject.subject_heading_type_id.present?
128
124
 
129
125
  respond_to do |format|
130
126
  if @subject.save
131
- @subject.classifications << classification if classification
132
127
  @subject.subject_heading_types << subject_heading_type if subject_heading_type
133
128
  format.html { redirect_to @subject, :notice => t('controller.successfully_created', :model => t('activerecord.models.subject')) }
134
129
  format.json { render :json => @subject, :status => :created, :location => @subject }
135
130
  else
136
- @classification = classification
137
131
  @subject_heading_type = subject_heading_type
138
132
  prepare_options
139
133
  format.html { render :action => "new" }
@@ -1,30 +1,18 @@
1
- #!/usr/bin/env ruby
2
- # -*- encoding: utf-8 -*-
3
1
  class Classification < ActiveRecord::Base
4
2
  attr_accessible :parent_id, :category, :note, :classification_type_id
5
- has_many :subject_has_classifications, :dependent => :destroy
6
- has_many :subjects, :through => :subject_has_classifications
7
- belongs_to :classification_type, :validate => true
8
- #has_many_polymorphs :subjects, :from => [:concepts, :places], :through => :subject_has_classifications
3
+ belongs_to :classification_type
4
+ belongs_to :manifestation
9
5
 
10
6
  validates_associated :classification_type
11
7
  validates_presence_of :category, :classification_type
12
8
  validates_uniqueness_of :category, :scope => :classification_type_id
13
9
  searchable do
14
- text :category, :note, :subject
15
- integer :subject_ids, :multiple => true
10
+ text :category, :note
16
11
  integer :classification_type_id
17
12
  end
18
- #acts_as_nested_set
19
- #acts_as_taggable_on :tags
20
13
  normalize_attributes :category
21
14
 
22
15
  paginates_per 10
23
-
24
- private
25
- def subject
26
- subjects.collect{|s| [s.term, s.term_transcription]}
27
- end
28
16
  end
29
17
 
30
18
  # == Schema Information
@@ -36,9 +24,10 @@ end
36
24
  # category :string(255) not null
37
25
  # note :text
38
26
  # classification_type_id :integer not null
39
- # created_at :datetime
40
- # updated_at :datetime
27
+ # created_at :datetime not null
28
+ # updated_at :datetime not null
41
29
  # lft :integer
42
30
  # rgt :integer
31
+ # manifestation_id :integer
43
32
  #
44
33
 
@@ -14,7 +14,7 @@ end
14
14
  # display_name :text
15
15
  # note :text
16
16
  # position :integer
17
- # created_at :datetime
18
- # updated_at :datetime
17
+ # created_at :datetime not null
18
+ # updated_at :datetime not null
19
19
  #
20
20
 
@@ -8,7 +8,6 @@ module EnjuSubject
8
8
  can :manage, [
9
9
  Classification,
10
10
  Subject,
11
- SubjectHasClassification,
12
11
  SubjectHeadingTypeHasSubject
13
12
  ]
14
13
  can :manage, WorkHasSubject
@@ -20,7 +19,6 @@ module EnjuSubject
20
19
  can :manage, [
21
20
  Classification,
22
21
  Subject,
23
- SubjectHasClassification,
24
22
  SubjectHeadingType,
25
23
  SubjectType
26
24
  ]
@@ -33,7 +31,6 @@ module EnjuSubject
33
31
  end
34
32
  when 'Librarian'
35
33
  can :manage, [
36
- SubjectHasClassification,
37
34
  WorkHasSubject
38
35
  ]
39
36
  can :read, [
@@ -49,7 +46,6 @@ module EnjuSubject
49
46
  Classification,
50
47
  ClassificationType,
51
48
  Subject,
52
- SubjectHasClassification,
53
49
  SubjectHeadingType,
54
50
  WorkHasSubject
55
51
  ]
@@ -58,7 +54,6 @@ module EnjuSubject
58
54
  Classification,
59
55
  ClassificationType,
60
56
  Subject,
61
- SubjectHasClassification,
62
57
  SubjectHeadingType,
63
58
  WorkHasSubject
64
59
  ]
@@ -2,12 +2,8 @@ class Subject < ActiveRecord::Base
2
2
  attr_accessible :parent_id, :use_term_id, :term, :term_transcription,
3
3
  :subject_type_id, :note, :required_role_id
4
4
 
5
- has_many :work_has_subjects, :dependent => :destroy
6
- has_many :works, :through => :work_has_subjects, :class_name => 'Manifestation'
5
+ belongs_to :manifestation
7
6
  belongs_to :subject_type
8
- has_many :subject_has_classifications, :dependent => :destroy
9
- has_many :classifications, :through => :subject_has_classifications
10
- belongs_to :subject_type, :validate => true
11
7
  has_many :subject_heading_type_has_subjects
12
8
  has_many :subject_heading_types, :through => :subject_heading_type_has_subjects
13
9
  belongs_to :required_role, :class_name => 'Role', :foreign_key => 'required_role_id'
@@ -15,13 +11,15 @@ class Subject < ActiveRecord::Base
15
11
  validates_associated :subject_type
16
12
  validates_presence_of :term, :subject_type
17
13
 
18
- attr_accessor :classification_id, :subject_heading_type_id
14
+ attr_accessor :subject_heading_type_id
19
15
 
20
16
  searchable do
21
17
  text :term
22
18
  time :created_at
23
19
  integer :required_role_id
24
- integer :work_ids, :multiple => true
20
+ integer :work_id do
21
+ manifestation_id
22
+ end
25
23
  end
26
24
 
27
25
  normalize_attributes :term
@@ -46,5 +44,7 @@ end
46
44
  # created_at :datetime
47
45
  # updated_at :datetime
48
46
  # deleted_at :datetime
47
+ # url :string(255)
48
+ # manifestation_id :integer
49
49
  #
50
50
 
@@ -15,7 +15,7 @@ end
15
15
  # display_name :text
16
16
  # note :text
17
17
  # position :integer
18
- # created_at :datetime
19
- # updated_at :datetime
18
+ # created_at :datetime not null
19
+ # updated_at :datetime not null
20
20
  #
21
21
 
@@ -16,7 +16,7 @@ end
16
16
  # subject_id :integer not null
17
17
  # subject_type :string(255)
18
18
  # subject_heading_type_id :integer not null
19
- # created_at :datetime
20
- # updated_at :datetime
19
+ # created_at :datetime not null
20
+ # updated_at :datetime not null
21
21
  #
22
22
 
@@ -1,5 +1,6 @@
1
1
  class SubjectSweeper < ActionController::Caching::Sweeper
2
- observe Subject, Classification, SubjectHeadingTypeHasSubject, WorkHasSubject, SubjectHeadingType
2
+ observe Subject, Classification, SubjectHeadingTypeHasSubject,
3
+ SubjectHeadingType
3
4
  include ExpireEditableFragment
4
5
 
5
6
  def after_save(record)
@@ -9,19 +10,10 @@ class SubjectSweeper < ActionController::Caching::Sweeper
9
10
  record.works.each do |work|
10
11
  expire_editable_fragment(work)
11
12
  end
12
- record.classifications.each do |classification|
13
- expire_editable_fragment(classification)
14
- end
15
13
  when :Classification
16
14
  expire_editable_fragment(record)
17
- record.subjects.each do |subject|
18
- expire_editable_fragment(subject)
19
- end
20
15
  when :SubjectHeadingTypeHasSubject
21
16
  expire_editable_fragment(record.subject)
22
- when :WorkHasSubject
23
- expire_editable_fragment(record.work)
24
- expire_editable_fragment(record.subject)
25
17
  end
26
18
  end
27
19
 
@@ -14,7 +14,7 @@ end
14
14
  # display_name :text
15
15
  # note :text
16
16
  # position :integer
17
- # created_at :datetime
18
- # updated_at :datetime
17
+ # created_at :datetime not null
18
+ # updated_at :datetime not null
19
19
  #
20
20
 
@@ -26,7 +26,7 @@ end
26
26
  # subject_type :string(255)
27
27
  # work_id :integer
28
28
  # position :integer
29
- # created_at :datetime
30
- # updated_at :datetime
29
+ # created_at :datetime not null
30
+ # updated_at :datetime not null
31
31
  #
32
32
 
@@ -1,5 +1,52 @@
1
- <%- if @subject -%>
2
- <%= render 'index_subject' -%>
3
- <%- else -%>
4
- <%= render 'index' -%>
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.classification')) -%></h1>
3
+ <div id="content_list">
4
+
5
+ <div class="search_form">
6
+ <%= form_for :classifications, :url => classifications_path, :html => {:method => 'get'} do -%>
7
+ <p>
8
+ <%= t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {:id => 'search_form_top', :class => 'search_form', :placeholder => t('page.search_term')} -%>
9
+ <%= submit_tag t('page.search') -%>
10
+ </p>
11
+ <%- end -%>
12
+ </div>
13
+
14
+ <table class="table table-striped index">
15
+ <tr>
16
+ <th><%= t('activerecord.attributes.classification.category') -%></th>
17
+ <th><%= t('activerecord.attributes.classification.note') -%></th>
18
+ <th><%= t('activerecord.models.classification_type') -%></th>
19
+ <th></th>
20
+ </tr>
21
+
22
+ <%- @classifications.each do |classification| -%>
23
+ <tr class="line<%= cycle("0", "1") -%>">
24
+ <td><%= link_to classification.category, classification -%></td>
25
+ <td><%= classification.note -%></td>
26
+ <td><%= link_to classification.classification_type.display_name.localize, classification.classification_type -%></td>
27
+ <td>
28
+ <%- if can? :delete, classification -%>
29
+ <%= link_to t('page.edit'), edit_classification_path(classification) -%>
30
+ <%= link_to t('page.destroy'), classification, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
31
+ <%- end -%>
32
+ </td>
33
+ </tr>
5
34
  <%- end -%>
35
+ </table>
36
+
37
+ <%= paginate(@classifications) -%>
38
+
39
+ </div>
40
+ </div>
41
+
42
+ <div id="submenu" class="ui-corner-all">
43
+ <ul>
44
+ <%- if can? :create, Classification -%>
45
+ <%- if @classification_type -%>
46
+ <li><%= link_to t('page.new', :model => t('activerecord.models.classification')), new_classification_type_classification_path(@classification_type) -%></li>
47
+ <%- else -%>
48
+ <li><%= link_to t('page.new', :model => t('activerecord.models.classification')), new_classification_path -%></li>
49
+ <%- end -%>
50
+ <%- end -%>
51
+ </ul>
52
+ </div>
@@ -0,0 +1,14 @@
1
+ <tr>
2
+ <td><%= t('activerecord.models.classification') -%>:</td>
3
+ <td>
4
+ <%- if manifestation.classifications.exists? -%>
5
+ <ul>
6
+ <%- manifestation.classifications.each do |classification| -%>
7
+ <li>
8
+ <%= link_to "#{classification.classification_type.display_name.localize}: #{classification.category}", manifestations_path(:query => "classification_sm:#{classification.category}") -%>
9
+ </li>
10
+ <%- end -%>
11
+ </ul>
12
+ <%- end -%>
13
+ </td>
14
+ </tr>
@@ -0,0 +1,14 @@
1
+ <tr>
2
+ <td><%= t('activerecord.models.subject') -%>:</td>
3
+ <td>
4
+ <%- if manifestation.subjects.exists? -%>
5
+ <ul>
6
+ <%- manifestation.subjects.each do |subject| -%>
7
+ <li>
8
+ <%= link_to subject.term, manifestations_path(:query => "subject_sm:#{subject.term}") -%>
9
+ </li>
10
+ <%- end -%>
11
+ </ul>
12
+ <%- end -%>
13
+ </td>
14
+ </tr>
@@ -1,7 +1,5 @@
1
- <%- case when @work -%>
1
+ <%- if @work -%>
2
2
  <%= render 'subjects/index_work', :subjects => @subjects -%>
3
- <%- when @classification -%>
4
- <%= render 'subjects/index_classification', :subjects => @subjects -%>
5
3
  <%- else -%>
6
4
  <%= render 'subjects/index', :subjects => @subjects -%>
7
5
  <%- end -%>
@@ -56,12 +56,8 @@
56
56
  <div id="submenu" class="ui-corner-all">
57
57
  <ul>
58
58
  <li><%= back_to_index(flash[:page_info]) -%></li>
59
- <%- if can? :create, SubjectHasClassification -%>
60
- <li><%= link_to t('page.edit'), edit_subject_path(@subject) -%></li>
61
- <li><%= link_to t('page.destroy'), subject_path(@subject), :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%></li>
62
- <%- end -%>
63
- <li><%= link_to t('page.listing', :model => t('activerecord.models.classification')), subject_classifications_path(@subject) -%></li>
64
- <li><%= link_to t('page.listing', :model => t('activerecord.models.work')), subject_works_path(@subject) -%></li>
59
+ <li><%= link_to t('page.edit'), edit_subject_path(@subject) -%></li>
60
+ <li><%= link_to t('page.destroy'), subject_path(@subject), :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%></li>
65
61
  <li><%= link_to t('page.listing', :model => t('activerecord.models.subject_heading_type')), subject_subject_heading_types_path(@subject) -%></li>
66
62
  </ul>
67
63
  </div>
@@ -0,0 +1,6 @@
1
+ class AddManifestationIdToSubject < ActiveRecord::Migration
2
+ def change
3
+ add_column :subjects, :manifestation_id, :integer
4
+ add_index :subjects, :manifestation_id
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ class AddManifestationIdToClassification < ActiveRecord::Migration
2
+ def change
3
+ add_column :classifications, :manifestation_id, :integer
4
+ add_index :classifications, :manifestation_id
5
+ end
6
+ end
@@ -7,9 +7,11 @@ module EnjuSubject
7
7
  module ClassMethods
8
8
  def enju_subject_manifestation_model
9
9
  include InstanceMethods
10
- attr_accessible :ndc, :classification_number
11
- has_many :work_has_subjects, :foreign_key => 'work_id', :dependent => :destroy
12
- has_many :subjects, :through => :work_has_subjects
10
+ attr_accessible :subjects_attributes, :classifications_attributes
11
+ has_many :subjects
12
+ has_many :classifications
13
+ accepts_nested_attributes_for :subjects, :allow_destroy => true, :reject_if => :all_blank
14
+ accepts_nested_attributes_for :classifications, :allow_destroy => true, :reject_if => :all_blank
13
15
 
14
16
  searchable do
15
17
  text :subject do
@@ -25,11 +27,5 @@ module EnjuSubject
25
27
  end
26
28
  end
27
29
  end
28
-
29
- module InstanceMethods
30
- def classifications
31
- subjects.collect(&:classifications).flatten
32
- end
33
- end
34
30
  end
35
31
  end
@@ -1,3 +1,3 @@
1
1
  module EnjuSubject
2
- VERSION = "0.1.0.pre12"
2
+ VERSION = "0.1.0.pre13"
3
3
  end
@@ -1,7 +1,13 @@
1
1
  ---
2
2
  classification_type_00001:
3
- name: unknown
4
- display_name: unknown
3
+ name: NDC
4
+ display_name: NDC
5
5
  id: 1
6
6
  note: ""
7
7
  position: 1
8
+ classification_type_00002:
9
+ name: DDC
10
+ display_name: DDC
11
+ id: 2
12
+ note: ""
13
+ position: 2
@@ -8,7 +8,6 @@
8
8
  can :manage, [
9
9
  Classification,
10
10
  Subject,
11
- SubjectHasClassification,
12
11
  SubjectHeadingTypeHasSubject
13
12
  ]
14
13
  can :manage, WorkHasSubject
@@ -20,7 +19,6 @@
20
19
  can :manage, [
21
20
  Classification,
22
21
  Subject,
23
- SubjectHasClassification,
24
22
  SubjectHeadingType,
25
23
  SubjectType
26
24
  ]
@@ -34,7 +32,6 @@
34
32
  can :read, Manifestation
35
33
  when 'Librarian'
36
34
  can :manage, [
37
- SubjectHasClassification,
38
35
  WorkHasSubject
39
36
  ]
40
37
  can :read, [
@@ -51,7 +48,6 @@
51
48
  Classification,
52
49
  ClassificationType,
53
50
  Subject,
54
- SubjectHasClassification,
55
51
  SubjectHeadingType,
56
52
  WorkHasSubject
57
53
  ]
@@ -61,7 +57,6 @@
61
57
  Classification,
62
58
  ClassificationType,
63
59
  Subject,
64
- SubjectHasClassification,
65
60
  SubjectHeadingType,
66
61
  WorkHasSubject
67
62
  ]
Binary file
@@ -0,0 +1,5 @@
1
+ class AddPeriodicalToManifestation < ActiveRecord::Migration
2
+ def change
3
+ add_column :manifestations, :periodical, :boolean
4
+ end
5
+ 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
@@ -0,0 +1,5 @@
1
+ class AddSeriesMasterToSeriesStatement < ActiveRecord::Migration
2
+ def change
3
+ add_column :series_statements, :series_master, :boolean
4
+ end
5
+ end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20120602141129) do
14
+ ActiveRecord::Schema.define(:version => 20130504143515) do
15
15
 
16
16
  create_table "accepts", :force => true do |t|
17
17
  t.integer "basket_id"
@@ -84,10 +84,12 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
84
84
  t.datetime "updated_at", :null => false
85
85
  t.integer "lft"
86
86
  t.integer "rgt"
87
+ t.integer "manifestation_id"
87
88
  end
88
89
 
89
90
  add_index "classifications", ["category"], :name => "index_classifications_on_category"
90
91
  add_index "classifications", ["classification_type_id"], :name => "index_classifications_on_classification_type_id"
92
+ add_index "classifications", ["manifestation_id"], :name => "index_classifications_on_manifestation_id"
91
93
  add_index "classifications", ["parent_id"], :name => "index_classifications_on_parent_id"
92
94
 
93
95
  create_table "content_types", :force => true do |t|
@@ -199,28 +201,24 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
199
201
  create_table "items", :force => true do |t|
200
202
  t.string "call_number"
201
203
  t.string "item_identifier"
202
- t.integer "circulation_status_id", :default => 5, :null => false
203
- t.integer "checkout_type_id", :default => 1, :null => false
204
- t.datetime "created_at", :null => false
205
- t.datetime "updated_at", :null => false
204
+ t.datetime "created_at", :null => false
205
+ t.datetime "updated_at", :null => false
206
206
  t.datetime "deleted_at"
207
- t.integer "shelf_id", :default => 1, :null => false
208
- t.boolean "include_supplements", :default => false, :null => false
207
+ t.integer "shelf_id", :default => 1, :null => false
208
+ t.boolean "include_supplements", :default => false, :null => false
209
209
  t.text "note"
210
210
  t.string "url"
211
211
  t.integer "price"
212
- t.integer "lock_version", :default => 0, :null => false
213
- t.integer "required_role_id", :default => 1, :null => false
212
+ t.integer "lock_version", :default => 0, :null => false
213
+ t.integer "required_role_id", :default => 1, :null => false
214
214
  t.string "state"
215
- t.integer "required_score", :default => 0, :null => false
215
+ t.integer "required_score", :default => 0, :null => false
216
216
  t.datetime "acquired_at"
217
217
  t.integer "bookstore_id"
218
218
  t.integer "budget_type_id"
219
219
  end
220
220
 
221
221
  add_index "items", ["bookstore_id"], :name => "index_items_on_bookstore_id"
222
- add_index "items", ["checkout_type_id"], :name => "index_items_on_checkout_type_id"
223
- add_index "items", ["circulation_status_id"], :name => "index_items_on_circulation_status_id"
224
222
  add_index "items", ["item_identifier"], :name => "index_items_on_item_identifier"
225
223
  add_index "items", ["required_role_id"], :name => "index_items_on_required_role_id"
226
224
  add_index "items", ["shelf_id"], :name => "index_items_on_shelf_id"
@@ -379,6 +377,7 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
379
377
  t.integer "year_of_publication"
380
378
  t.text "attachment_meta"
381
379
  t.integer "month_of_publication"
380
+ t.boolean "periodical"
382
381
  end
383
382
 
384
383
  add_index "manifestations", ["access_address"], :name => "index_manifestations_on_access_address"
@@ -701,19 +700,23 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
701
700
  t.text "title_subseries"
702
701
  t.text "numbering_subseries"
703
702
  t.integer "position"
704
- t.datetime "created_at", :null => false
705
- t.datetime "updated_at", :null => false
703
+ t.datetime "created_at", :null => false
704
+ t.datetime "updated_at", :null => false
706
705
  t.text "title_transcription"
707
706
  t.text "title_alternative"
708
707
  t.string "series_statement_identifier"
709
708
  t.string "issn"
710
709
  t.boolean "periodical"
711
- t.integer "root_manifestation_id"
710
+ t.integer "manifestation_id"
712
711
  t.text "note"
713
712
  t.text "title_subseries_transcription"
713
+ t.text "creator_string"
714
+ t.text "volume_number_string"
715
+ t.text "volume_number_transcription_string"
716
+ t.boolean "series_master"
714
717
  end
715
718
 
716
- add_index "series_statements", ["root_manifestation_id"], :name => "index_series_statements_on_manifestation_id"
719
+ add_index "series_statements", ["manifestation_id"], :name => "index_series_statements_on_manifestation_id"
717
720
  add_index "series_statements", ["series_statement_identifier"], :name => "index_series_statements_on_series_statement_identifier"
718
721
 
719
722
  create_table "shelves", :force => true do |t|
@@ -731,17 +734,6 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
731
734
 
732
735
  add_index "shelves", ["library_id"], :name => "index_shelves_on_library_id"
733
736
 
734
- create_table "subject_has_classifications", :force => true do |t|
735
- t.integer "subject_id"
736
- t.string "subject_type"
737
- t.integer "classification_id", :null => false
738
- t.datetime "created_at", :null => false
739
- t.datetime "updated_at", :null => false
740
- end
741
-
742
- add_index "subject_has_classifications", ["classification_id"], :name => "index_subject_has_classifications_on_classification_id"
743
- add_index "subject_has_classifications", ["subject_id"], :name => "index_subject_has_classifications_on_subject_id"
744
-
745
737
  create_table "subject_heading_type_has_subjects", :force => true do |t|
746
738
  t.integer "subject_id", :null => false
747
739
  t.string "subject_type"
@@ -784,8 +776,10 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
784
776
  t.datetime "updated_at"
785
777
  t.datetime "deleted_at"
786
778
  t.string "url"
779
+ t.integer "manifestation_id"
787
780
  end
788
781
 
782
+ add_index "subjects", ["manifestation_id"], :name => "index_subjects_on_manifestation_id"
789
783
  add_index "subjects", ["parent_id"], :name => "index_subjects_on_parent_id"
790
784
  add_index "subjects", ["required_role_id"], :name => "index_subjects_on_required_role_id"
791
785
  add_index "subjects", ["subject_type_id"], :name => "index_subjects_on_subject_type_id"
Binary file