enju_biblio 0.1.0.pre63 → 0.1.0.pre64

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/agent_import_files_controller.rb +9 -2
  3. data/app/controllers/agent_import_results_controller.rb +7 -0
  4. data/app/controllers/agent_merge_lists_controller.rb +7 -2
  5. data/app/controllers/agent_merges_controller.rb +7 -2
  6. data/app/controllers/agent_relationship_types_controller.rb +9 -4
  7. data/app/controllers/agent_relationships_controller.rb +8 -2
  8. data/app/controllers/agent_types_controller.rb +9 -4
  9. data/app/controllers/agents_controller.rb +15 -10
  10. data/app/controllers/carrier_types_controller.rb +14 -2
  11. data/app/controllers/content_types_controller.rb +9 -4
  12. data/app/controllers/countries_controller.rb +11 -4
  13. data/app/controllers/create_types_controller.rb +9 -4
  14. data/app/controllers/creates_controller.rb +8 -2
  15. data/app/controllers/donates_controller.rb +7 -2
  16. data/app/controllers/form_of_works_controller.rb +9 -4
  17. data/app/controllers/frequencies_controller.rb +9 -4
  18. data/app/controllers/identifier_types_controller.rb +11 -4
  19. data/app/controllers/import_requests_controller.rb +15 -2
  20. data/app/controllers/items_controller.rb +21 -3
  21. data/app/controllers/languages_controller.rb +12 -4
  22. data/app/controllers/licenses_controller.rb +9 -4
  23. data/app/controllers/manifestation_relationship_types_controller.rb +11 -4
  24. data/app/controllers/manifestation_relationships_controller.rb +8 -2
  25. data/app/controllers/manifestations_controller.rb +105 -10
  26. data/app/controllers/medium_of_performances_controller.rb +9 -4
  27. data/app/controllers/owns_controller.rb +7 -2
  28. data/app/controllers/picture_files_controller.rb +8 -2
  29. data/app/controllers/produce_types_controller.rb +9 -4
  30. data/app/controllers/produces_controller.rb +8 -2
  31. data/app/controllers/realize_types_controller.rb +11 -4
  32. data/app/controllers/realizes_controller.rb +8 -2
  33. data/app/controllers/resource_export_files_controller.rb +7 -2
  34. data/app/controllers/resource_import_files_controller.rb +9 -2
  35. data/app/controllers/resource_import_results_controller.rb +7 -0
  36. data/app/controllers/series_statement_merge_lists_controller.rb +7 -2
  37. data/app/controllers/series_statement_merges_controller.rb +9 -2
  38. data/app/controllers/series_statements_controller.rb +13 -2
  39. data/app/models/agent.rb +0 -9
  40. data/app/models/agent_import_file.rb +3 -3
  41. data/app/models/agent_import_file_transition.rb +1 -1
  42. data/app/models/agent_import_result.rb +0 -1
  43. data/app/models/agent_merge.rb +0 -1
  44. data/app/models/agent_merge_list.rb +0 -1
  45. data/app/models/agent_relationship.rb +0 -1
  46. data/app/models/agent_relationship_type.rb +0 -1
  47. data/app/models/agent_type.rb +0 -1
  48. data/app/models/carrier_type.rb +1 -7
  49. data/app/models/content_type.rb +0 -1
  50. data/app/models/country.rb +0 -1
  51. data/app/models/create.rb +0 -1
  52. data/app/models/create_type.rb +0 -1
  53. data/app/models/donate.rb +0 -1
  54. data/app/models/enju_biblio/ability.rb +25 -2
  55. data/app/models/exemplify.rb +1 -1
  56. data/app/models/form_of_work.rb +0 -1
  57. data/app/models/frequency.rb +0 -1
  58. data/app/models/identifier.rb +1 -1
  59. data/app/models/identifier_type.rb +0 -1
  60. data/app/models/import_request.rb +8 -7
  61. data/app/models/import_request_transition.rb +1 -1
  62. data/app/models/item.rb +0 -5
  63. data/app/models/language.rb +0 -2
  64. data/app/models/license.rb +0 -1
  65. data/app/models/manifestation.rb +29 -33
  66. data/app/models/manifestation_relationship.rb +0 -1
  67. data/app/models/manifestation_relationship_type.rb +0 -1
  68. data/app/models/medium_of_performance.rb +0 -1
  69. data/app/models/own.rb +0 -1
  70. data/app/models/picture_file.rb +1 -3
  71. data/app/models/produce.rb +0 -1
  72. data/app/models/produce_type.rb +0 -1
  73. data/app/models/realize.rb +0 -1
  74. data/app/models/realize_type.rb +0 -1
  75. data/app/models/resource_export_file.rb +9 -3
  76. data/app/models/resource_export_file_transition.rb +1 -1
  77. data/app/models/resource_import_file.rb +18 -10
  78. data/app/models/resource_import_file_transition.rb +1 -1
  79. data/app/models/resource_import_result.rb +0 -1
  80. data/app/models/series_statement.rb +0 -7
  81. data/app/models/series_statement_merge.rb +0 -1
  82. data/app/models/series_statement_merge_list.rb +0 -1
  83. data/app/views/items/index.html.erb +11 -0
  84. data/app/views/layouts/items.html.erb +29 -0
  85. data/app/views/manifestations/_form.html.erb +3 -3
  86. data/app/views/manifestations/_index_form_series_statement.html.erb +1 -1
  87. data/app/views/manifestations/_list.html.erb +15 -0
  88. data/app/views/manifestations/_manifestation.html.erb +59 -38
  89. data/app/views/manifestations/_pickup.html.erb +8 -0
  90. data/app/views/manifestations/_show_detail_librarian.html.erb +8 -0
  91. data/app/views/manifestations/_show_detail_user.html.erb +8 -0
  92. data/app/views/manifestations/_show_holding.html.erb +19 -0
  93. data/app/views/manifestations/_submenu_parent.html.erb +3 -0
  94. data/app/views/manifestations/index.atom.builder +3 -0
  95. data/app/views/manifestations/index.html.erb +31 -1
  96. data/app/views/manifestations/index.opds.builder +3 -0
  97. data/app/views/manifestations/show.html.erb +4 -1
  98. data/app/views/resource_export_files/index.html.erb +2 -2
  99. data/app/views/resource_export_files/show.html.erb +1 -1
  100. data/config/locales/translation_en.yml +1 -0
  101. data/config/locales/translation_ja.yml +1 -0
  102. data/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
  103. data/lib/enju_biblio/biblio_helper.rb +2 -0
  104. data/lib/enju_biblio/engine.rb +0 -1
  105. data/lib/enju_biblio/version.rb +1 -1
  106. data/spec/controllers/agent_import_files_controller_spec.rb +3 -3
  107. data/spec/controllers/agent_merge_lists_controller_spec.rb +2 -2
  108. data/spec/controllers/agent_merges_controller_spec.rb +1 -1
  109. data/spec/controllers/agent_types_controller_spec.rb +8 -8
  110. data/spec/controllers/carrier_types_controller_spec.rb +8 -8
  111. data/spec/controllers/content_types_controller_spec.rb +8 -8
  112. data/spec/controllers/create_types_controller_spec.rb +6 -6
  113. data/spec/controllers/form_of_works_controller_spec.rb +6 -6
  114. data/spec/controllers/frequencies_controller_spec.rb +8 -8
  115. data/spec/controllers/identifier_types_controller_spec.rb +8 -8
  116. data/spec/controllers/licenses_controller_spec.rb +6 -6
  117. data/spec/controllers/manifestations_controller_spec.rb +22 -2
  118. data/spec/controllers/medium_of_performances_controller_spec.rb +6 -6
  119. data/spec/controllers/produce_types_controller_spec.rb +6 -6
  120. data/spec/controllers/realize_types_controller_spec.rb +6 -6
  121. data/spec/controllers/resource_export_files_controller_spec.rb +23 -23
  122. data/spec/controllers/resource_import_files_controller_spec.rb +4 -4
  123. data/spec/dummy/app/models/user.rb +0 -1
  124. data/spec/dummy/bin/bundle +3 -0
  125. data/spec/dummy/bin/rails +4 -0
  126. data/spec/dummy/bin/rake +4 -0
  127. data/spec/dummy/bin/setup +29 -0
  128. data/spec/dummy/config/application.rb +2 -2
  129. data/spec/dummy/config/boot.rb +4 -9
  130. data/spec/dummy/config/environment.rb +3 -3
  131. data/spec/dummy/db/schema.rb +118 -118
  132. data/spec/factories/manifestation.rb +8 -0
  133. data/spec/factories/series_statement.rb +5 -0
  134. data/spec/fixtures/events.yml +13 -39
  135. data/spec/fixtures/identifier_types.yml +7 -0
  136. data/spec/fixtures/identifiers.yml +7 -0
  137. data/spec/fixtures/manifestations.yml +9 -0
  138. data/spec/fixtures/use_restrictions.yml +1 -1
  139. data/spec/views/manifestations/show.html.erb_spec.rb +8 -0
  140. metadata +31 -43
  141. data/spec/dummy/db/test.sqlite3 +0 -0
  142. data/spec/dummy/script/rails +0 -6
  143. data/spec/dummy/tmp/cache/stdout +0 -25
  144. data/spec/dummy/tmp/pids/redis-test.pid +0 -1
@@ -1,5 +1,4 @@
1
1
  class AgentMergeList < ActiveRecord::Base
2
- attr_accessible :title
3
2
  has_many :agent_merges, dependent: :destroy
4
3
  has_many :agents, through: :agent_merges
5
4
  validates_presence_of :title
@@ -1,5 +1,4 @@
1
1
  class AgentRelationship < ActiveRecord::Base
2
- attr_accessible :parent_id, :child_id, :agent_relationship_type_id
3
2
  belongs_to :parent, foreign_key: 'parent_id', class_name: 'Agent'
4
3
  belongs_to :child, foreign_key: 'child_id', class_name: 'Agent'
5
4
  belongs_to :agent_relationship_type
@@ -1,5 +1,4 @@
1
1
  class AgentRelationshipType < ActiveRecord::Base
2
- attr_accessible :name, :display_name, :note
3
2
  include MasterModel
4
3
  default_scope { order('agent_relationship_types.position') }
5
4
  has_many :agent_relationships
@@ -1,5 +1,4 @@
1
1
  class AgentType < ActiveRecord::Base
2
- attr_accessible :name, :display_name, :note
3
2
  include MasterModel
4
3
  default_scope { order('agent_types.position') }
5
4
  has_many :agents
@@ -1,14 +1,8 @@
1
1
  class CarrierType < ActiveRecord::Base
2
- attr_accessible :name, :display_name, :note, :position
3
2
  include MasterModel
4
3
  default_scope { order("carrier_types.position") }
5
4
  has_many :manifestations
6
- if defined?(EnjuCirculation)
7
- attr_accessible :carrier_type_has_checkout_types_attributes
8
- has_many :carrier_type_has_checkout_types, dependent: :destroy
9
- has_many :checkout_types, through: :carrier_type_has_checkout_types
10
- accepts_nested_attributes_for :carrier_type_has_checkout_types, allow_destroy: true, reject_if: :all_blank
11
- end
5
+ enju_circulation_carrier_type_model if defined?(EnjuCirculation)
12
6
 
13
7
  def mods_type
14
8
  case name
@@ -1,5 +1,4 @@
1
1
  class ContentType < ActiveRecord::Base
2
- attr_accessible :name, :display_name, :note
3
2
  include MasterModel
4
3
  default_scope { order('content_types.position') }
5
4
  has_many :manifestations
@@ -1,5 +1,4 @@
1
1
  class Country < ActiveRecord::Base
2
- attr_accessible :name, :display_name, :alpha_2, :alpha_3, :numeric_3, :note
3
2
  include MasterModel
4
3
  default_scope { order('countries.position') }
5
4
  has_many :agents
data/app/models/create.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  class Create < ActiveRecord::Base
2
- attr_accessible :agent_id, :work_id, :create_type_id, :position
3
2
  belongs_to :agent
4
3
  belongs_to :work, class_name: 'Manifestation', foreign_key: 'work_id', touch: true
5
4
  belongs_to :create_type
@@ -1,5 +1,4 @@
1
1
  class CreateType < ActiveRecord::Base
2
- attr_accessible :name, :display_name, :note, :position
3
2
  include MasterModel
4
3
  default_scope { order('create_types.position') }
5
4
  end
data/app/models/donate.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  class Donate < ActiveRecord::Base
2
- attr_accessible :agent_id, :item_id
3
2
  belongs_to :agent
4
3
  belongs_to :item
5
4
  validates_associated :agent, :item
@@ -19,7 +19,17 @@ module EnjuBiblio
19
19
  end
20
20
  can [:read, :create, :update], Manifestation
21
21
  can [:destroy, :delete], Manifestation do |manifestation|
22
- manifestation.items.empty? && !manifestation.series_master?
22
+ if manifestation.items.empty?
23
+ if manifestation.series_master?
24
+ if manifestation.children.empty?
25
+ true
26
+ else
27
+ false
28
+ end
29
+ else
30
+ true
31
+ end
32
+ end
23
33
  end
24
34
  can :manage, [
25
35
  AgentMerge,
@@ -73,10 +83,23 @@ module EnjuBiblio
73
83
  ]
74
84
  when 'Librarian'
75
85
  can :manage, Item
86
+ can [:destroy, :delete], Item do |item|
87
+ item.removable?
88
+ end
76
89
  can :index, Manifestation
77
90
  can [:show, :create, :update], Manifestation
78
91
  can [:destroy, :delete], Manifestation do |manifestation|
79
- manifestation.items.empty? && !manifestation.series_master?
92
+ if manifestation.items.empty?
93
+ if manifestation.series_master?
94
+ if manifestation.children.empty?
95
+ return true
96
+ else
97
+ return false
98
+ end
99
+ else
100
+ true
101
+ end
102
+ end
80
103
  end
81
104
  can [:index, :create], Agent
82
105
  can :show, Agent do |agent|
@@ -1,5 +1,5 @@
1
1
  class Exemplify < ActiveRecord::Base
2
- attr_accessible :manifestation_id, :item_id, :position
2
+ #attr_accessible :manifestation_id, :item_id, :position
3
3
  belongs_to :manifestation
4
4
  belongs_to :item
5
5
  #accepts_nested_attributes_for :item
@@ -1,5 +1,4 @@
1
1
  class FormOfWork < ActiveRecord::Base
2
- attr_accessible :name, :display_name, :note
3
2
  include MasterModel
4
3
  default_scope { order('form_of_works.position') }
5
4
  has_many :works
@@ -1,5 +1,4 @@
1
1
  class Frequency < ActiveRecord::Base
2
- attr_accessible :name, :display_name, :note
3
2
  include MasterModel
4
3
  default_scope { order('frequencies.position') }
5
4
  has_many :manifestations
@@ -1,5 +1,5 @@
1
1
  class Identifier < ActiveRecord::Base
2
- attr_accessible :body, :identifier_type_id, :manifestation_id, :primary, :position
2
+ #attr_accessible :body, :identifier_type_id, :manifestation_id, :primary, :position
3
3
  belongs_to :identifier_type
4
4
  belongs_to :manifestation, touch: true
5
5
 
@@ -1,5 +1,4 @@
1
1
  class IdentifierType < ActiveRecord::Base
2
- attr_accessible :display_name, :name, :note, :position
3
2
  include MasterModel
4
3
  default_scope { order('identifier_types.position') }
5
4
  has_many :identifiers
@@ -1,6 +1,5 @@
1
1
  class ImportRequest < ActiveRecord::Base
2
- include Statesman::Adapters::ActiveRecordModel
3
- attr_accessible :isbn, :manifestation_id, :user_id
2
+ include Statesman::Adapters::ActiveRecordQueries
4
3
  default_scope { order('import_requests.id DESC') }
5
4
  belongs_to :manifestation
6
5
  belongs_to :user
@@ -28,7 +27,9 @@ class ImportRequest < ActiveRecord::Base
28
27
 
29
28
  def check_imported
30
29
  if isbn.present?
31
- if Identifier.where(body: isbn, identifier_type_id: IdentifierType.where(name: 'isbn').first_or_create.id).first.try(:manifestation)
30
+ identifier_type = IdentifierType.where(name: 'isbn').first
31
+ identifier_type = IdentifierType.where(name: 'isbn').create! unless identifier_type
32
+ if Identifier.where(body: isbn, identifier_type_id: identifier_type.id).first.try(:manifestation)
32
33
  errors.add(:isbn, I18n.t('import_request.isbn_taken'))
33
34
  end
34
35
  end
@@ -45,8 +46,8 @@ class ImportRequest < ActiveRecord::Base
45
46
  else
46
47
  transition_to!(:failed)
47
48
  end
48
- else
49
- transition_to!(:failed)
49
+ #else
50
+ # transition_to!(:failed)
50
51
  end
51
52
  save
52
53
  rescue ActiveRecord::RecordInvalid
@@ -55,8 +56,8 @@ class ImportRequest < ActiveRecord::Base
55
56
  transition_to!(:failed)
56
57
  rescue EnjuNdl::RecordNotFound
57
58
  transition_to!(:failed)
58
- #rescue EnjuNii::RecordNotFound
59
- # transition_to!(:failed)
59
+ rescue EnjuNii::RecordNotFound
60
+ transition_to!(:failed)
60
61
  end
61
62
 
62
63
  private
@@ -3,7 +3,7 @@ class ImportRequestTransition < ActiveRecord::Base
3
3
 
4
4
 
5
5
  belongs_to :import_request, inverse_of: :import_request_transitions
6
- attr_accessible :to_state, :sort_key, :metadata
6
+ #attr_accessible :to_state, :sort_key, :metadata
7
7
  end
8
8
 
9
9
  # == Schema Information
data/app/models/item.rb CHANGED
@@ -6,11 +6,6 @@ class Item < ActiveRecord::Base
6
6
  enju_question_item_model if defined?(EnjuQuestion)
7
7
  enju_inventory_item_model if defined?(EnjuInventory)
8
8
  enju_inter_library_loan_item_model if defined?(EnjuInterLibraryLoan)
9
- attr_accessible :call_number, :item_identifier, :circulation_status_id,
10
- :checkout_type_id, :shelf_id, :include_supplements, :note, :url, :price,
11
- :acquired_at, :bookstore_id, :missing_since, :budget_type_id, :lock_version,
12
- :manifestation_id, :library_id, :required_role_id,
13
- :binding_item_identifier, :binding_call_number, :binded_at
14
9
  scope :on_shelf, -> { where('shelf_id != 1') }
15
10
  scope :on_web, -> { where(shelf_id: 1) }
16
11
  delegate :display_name, to: :shelf, prefix: true
@@ -1,6 +1,4 @@
1
1
  class Language < ActiveRecord::Base
2
- attr_accessible :name, :native_name, :display_name, :iso_639_1, :iso_639_2,
3
- :iso_639_3, :note
4
2
  include MasterModel
5
3
  default_scope { order('languages.position') }
6
4
  # If you wish to change the field names for brevity, feel free to enable/modify these.
@@ -1,5 +1,4 @@
1
1
  class License < ActiveRecord::Base
2
- attr_accessible :name, :display_name, :note
3
2
  include MasterModel
4
3
  default_scope { order('licenses.position') }
5
4
  end
@@ -10,22 +10,6 @@ class Manifestation < ActiveRecord::Base
10
10
  enju_oai if defined?(EnjuOai)
11
11
  enju_question_manifestation_model if defined?(EnjuQuestion)
12
12
  enju_bookmark_manifestation_model if defined?(EnjuBookmark)
13
- attr_accessible :original_title, :title_alternative, :title_transcription,
14
- :manifestation_identifier, :date_copyrighted,
15
- :access_address, :language_id, :carrier_type_id, :extent, :start_page,
16
- :end_page, :height, :width, :depth, :publication_place,
17
- :price, :fulltext, :volume_number_string,
18
- :issue_number_string, :serial_number_string, :edition, :note,
19
- :repository_content, :required_role_id, :frequency_id,
20
- :title_alternative_transcription, :description, :abstract, :available_at,
21
- :valid_until, :date_submitted, :date_accepted, :date_captured, :ndl_bib_id,
22
- :pub_date, :edition_string, :volume_number, :issue_number, :serial_number,
23
- :content_type_id, :attachment, :lock_version,
24
- :series_statements_attributes, :serial, :statement_of_responsibility,
25
- :creators_attributes, :contributors_attributes, :publishers_attributes,
26
- :identifiers_attributes, :dimensions
27
- attr_accessible :fulltext_content, :extent,
28
- :number_of_page_string, :parent_id
29
13
 
30
14
  has_many :creates, dependent: :destroy, foreign_key: 'work_id'
31
15
  has_many :creators, through: :creates, source: :agent #, order: 'creates.position'
@@ -224,7 +208,8 @@ class Manifestation < ActiveRecord::Base
224
208
  end
225
209
 
226
210
  if Setting.uploaded_file.storage == :s3
227
- has_attached_file :attachment, storage: :s3, s3_credentials: "#{Rails.root.to_s}/config/s3.yml",
211
+ has_attached_file :attachment, storage: :s3,
212
+ s3_credentials: Setting.amazon,
228
213
  s3_permissions: :private
229
214
  else
230
215
  has_attached_file :attachment,
@@ -262,24 +247,35 @@ class Manifestation < ActiveRecord::Base
262
247
 
263
248
  def set_date_of_publication
264
249
  return if pub_date.blank?
250
+ year = Time.utc(pub_date.rjust(4, "0")).year rescue nil
265
251
  begin
266
- date = Time.zone.parse(pub_date)
252
+ date = Time.zone.parse(pub_date.rjust(4, "0"))
253
+ if date.year != year
254
+ raise ArgumentError
255
+ end
267
256
  rescue ArgumentError, TZInfo::AmbiguousTime
268
257
  date = nil
269
258
  end
270
- pub_date_string = pub_date.split(';').first.gsub(/[\[\]]/, '')
271
-
272
- while date.nil? do
273
- pub_date_string += '-01'
274
- break if pub_date_string =~ /-01-01-01$/
275
- begin
276
- date = Time.zone.parse(pub_date_string)
277
- rescue ArgumentError
278
- date = nil
279
- rescue TZInfo::AmbiguousTime
280
- date = nil
281
- self.year_of_publication = pub_date_string.to_i if pub_date_string =~ /^\d+$/
282
- break
259
+
260
+ pub_date_string = pub_date.rjust(4, "0").split(';').first.gsub(/[\[\]]/, '')
261
+ if pub_date_string.length == 4
262
+ date = Time.zone.parse(Time.utc(pub_date_string).to_s).beginning_of_day
263
+ else
264
+ while date.nil? do
265
+ pub_date_string += '-01'
266
+ break if pub_date_string =~ /-01-01-01$/
267
+ begin
268
+ date = Time.zone.parse(pub_date_string)
269
+ if date.year != year
270
+ raise ArgumentError
271
+ end
272
+ rescue ArgumentError
273
+ date = nil
274
+ rescue TZInfo::AmbiguousTime
275
+ date = nil
276
+ self.year_of_publication = pub_date_string.to_i if pub_date_string =~ /^\d+$/
277
+ break
278
+ end
283
279
  end
284
280
  end
285
281
 
@@ -495,7 +491,7 @@ class Manifestation < ActiveRecord::Base
495
491
 
496
492
  def identifier_contents(name)
497
493
  if IdentifierType.where(name: name.to_s).exists?
498
- identifiers.where(identifier_type_id: IdentifierType.where(name: name).first.id).pluck(:body)
494
+ identifiers.where(identifier_type_id: IdentifierType.where(name: name).first.id).order(:position).pluck(:body)
499
495
  else
500
496
  []
501
497
  end
@@ -533,6 +529,7 @@ class Manifestation < ActiveRecord::Base
533
529
  item_lines << m.pub_date
534
530
  item_lines << m.price
535
531
  item_lines << m.identifier_contents(:isbn).first
532
+ item_lines << m.identifier_contents(:issn).first
536
533
  item_lines << i.item_identifier
537
534
  item_lines << i.call_number
538
535
  item_lines << i.price
@@ -542,7 +539,6 @@ class Manifestation < ActiveRecord::Base
542
539
  item_lines << i.circulation_status.try(:name)
543
540
  item_lines << i.shelf.name
544
541
  item_lines << i.shelf.library.name
545
- #raise item_lines.to_s if i.item_identifier == '10202'
546
542
  lines << item_lines
547
543
  end
548
544
  lines
@@ -1,5 +1,4 @@
1
1
  class ManifestationRelationship < ActiveRecord::Base
2
- attr_accessible :parent_id, :child_id, :manifestation_relationship_type_id
3
2
  belongs_to :parent, foreign_key: 'parent_id', class_name: 'Manifestation'
4
3
  belongs_to :child, foreign_key: 'child_id', class_name: 'Manifestation'
5
4
  belongs_to :manifestation_relationship_type
@@ -1,5 +1,4 @@
1
1
  class ManifestationRelationshipType < ActiveRecord::Base
2
- attr_accessible :name, :display_name, :note
3
2
  include MasterModel
4
3
  default_scope { order('manifestation_relationship_types.position') }
5
4
  has_many :manifestation_relationships
@@ -1,5 +1,4 @@
1
1
  class MediumOfPerformance < ActiveRecord::Base
2
- attr_accessible :name, :display_name, :note
3
2
  include MasterModel
4
3
  default_scope { order('medium_of_performances.position') }
5
4
  has_many :works
data/app/models/own.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  class Own < ActiveRecord::Base
2
- attr_accessible :agent_id, :item_id
3
2
  belongs_to :agent
4
3
  belongs_to :item
5
4
 
@@ -1,12 +1,10 @@
1
1
  class PictureFile < ActiveRecord::Base
2
- attr_accessible :picture, :picture_attachable_id,
3
- :picture_attachable_type
4
2
  scope :attached, -> { where('picture_attachable_id IS NOT NULL') }
5
3
  belongs_to :picture_attachable, polymorphic: true, validate: true
6
4
 
7
5
  if Setting.uploaded_file.storage == :s3
8
6
  has_attached_file :picture, storage: :s3, styles: { medium: "600x600>", thumb: "100x100>" },
9
- s3_credentials: "#{Rails.root}/config/s3.yml",
7
+ s3_credentials: Setting.amazon,
10
8
  s3_permissions: :private
11
9
  else
12
10
  has_attached_file :picture, styles: { medium: "600x600>", thumb: "100x100>" },
@@ -1,5 +1,4 @@
1
1
  class Produce < ActiveRecord::Base
2
- attr_accessible :agent_id, :manifestation_id, :produce_type_id, :position
3
2
  belongs_to :agent
4
3
  belongs_to :manifestation, touch: true
5
4
  belongs_to :produce_type
@@ -1,5 +1,4 @@
1
1
  class ProduceType < ActiveRecord::Base
2
- attr_accessible :name, :display_name, :note, :position
3
2
  include MasterModel
4
3
  default_scope { order('produce_types.position') }
5
4
  end
@@ -1,5 +1,4 @@
1
1
  class Realize < ActiveRecord::Base
2
- attr_accessible :agent_id, :expression_id, :realize_type_id, :position
3
2
  belongs_to :agent
4
3
  belongs_to :expression, class_name: 'Manifestation', foreign_key: 'expression_id', touch: true
5
4
  belongs_to :realize_type
@@ -1,5 +1,4 @@
1
1
  class RealizeType < ActiveRecord::Base
2
- attr_accessible :name, :display_name, :note, :position
3
2
  include MasterModel
4
3
  default_scope { order('realize_types.position') }
5
4
  end
@@ -1,9 +1,15 @@
1
1
  class ResourceExportFile < ActiveRecord::Base
2
- attr_accessible
3
- include Statesman::Adapters::ActiveRecordModel
2
+ include Statesman::Adapters::ActiveRecordQueries
4
3
  include ExportFile
5
4
  enju_export_file_model
6
- has_attached_file :resource_export
5
+ if Setting.uploaded_file.storage == :s3
6
+ has_attached_file :resource_export, storage: :s3,
7
+ s3_credentials: Setting.amazon,
8
+ s3_permissions: :private
9
+ else
10
+ has_attached_file :resource_export,
11
+ path: ":rails_root/private/system/:class/:attachment/:id_partition/:style/:filename"
12
+ end
7
13
  validates_attachment_content_type :resource_export, content_type: /\Atext\/plain\Z/
8
14
 
9
15
  has_many :resource_export_file_transitions
@@ -3,7 +3,7 @@ class ResourceExportFileTransition < ActiveRecord::Base
3
3
 
4
4
 
5
5
  belongs_to :resource_export_file, inverse_of: :resource_export_file_transitions
6
- attr_accessible :to_state, :sort_key, :metadata
6
+ #attr_accessible :to_state, :sort_key, :metadata
7
7
  end
8
8
 
9
9
  # == Schema Information