enju_biblio 0.1.0.pre41 → 0.1.0.pre42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/manifestations_controller.rb +22 -17
- data/app/controllers/patron_import_results_controller.rb +1 -1
- data/app/controllers/resource_import_results_controller.rb +1 -1
- data/app/models/item.rb +0 -1
- data/app/models/manifestation.rb +1 -2
- data/app/models/patron.rb +0 -8
- data/app/views/notifier/manifestation_info.en.text.erb +18 -0
- data/app/views/notifier/manifestation_info.ja.text.erb +18 -0
- data/lib/enju_biblio/version.rb +1 -1
- data/spec/cassette_library/ImportRequest/import/should_import_bibliographic_record.yml +12 -12
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_isbn_which_is_already_imported/redirects_to_the_created_import_request.yml +12 -12
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/assigns_a_newly_created_import_request_as_import_request.yml +12 -12
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/redirects_to_the_created_import_request.yml +13 -13
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/assigns_a_newly_created_import_request_as_import_request.yml +13 -13
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/redirects_to_the_created_import_request.yml +12 -12
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_has_only_isbn/should_be_imported.yml +613 -0
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_shift_jis/should_be_imported.yml +431 -0
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_be_imported.yml +431 -0
- data/spec/controllers/items_controller_spec.rb +16 -8
- data/spec/controllers/patrons_controller_spec.rb +8 -4
- data/spec/dummy/app/controllers/application_controller.rb +1 -174
- data/spec/dummy/config/application.rb +1 -1
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/private/system/picture_files/pictures/000/000/005/medium/spinner.gif +0 -0
- data/spec/dummy/private/system/picture_files/pictures/000/000/005/thumb/spinner.gif +0 -0
- data/spec/dummy/solr/data/test/index/_goc.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_goc.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_goc.fnm +7 -0
- data/spec/dummy/solr/data/test/index/_goc.frq +0 -0
- data/spec/dummy/solr/data/test/index/_goc.nrm +1 -0
- data/spec/dummy/solr/data/test/index/_goc.prx +0 -0
- data/spec/dummy/solr/data/test/index/_goc.tii +0 -0
- data/spec/dummy/solr/data/test/index/_goc.tis +0 -0
- data/spec/dummy/solr/data/test/index/_god.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_god.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_god.fnm +7 -0
- data/spec/dummy/solr/data/test/index/_god.frq +0 -0
- data/spec/dummy/solr/data/test/index/_god.nrm +1 -0
- data/spec/dummy/solr/data/test/index/_god.prx +0 -0
- data/spec/dummy/solr/data/test/index/_god.tii +0 -0
- data/spec/dummy/solr/data/test/index/_god.tis +0 -0
- data/spec/dummy/solr/data/test/index/_goe.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_goe.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_goe.fnm +8 -0
- data/spec/dummy/solr/data/test/index/_goe.frq +0 -0
- data/spec/dummy/solr/data/test/index/_goe.nrm +1 -0
- data/spec/dummy/solr/data/test/index/_goe.prx +0 -0
- data/spec/dummy/solr/data/test/index/_goe.tii +0 -0
- data/spec/dummy/solr/data/test/index/_goe.tis +0 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/segments_otc +0 -0
- data/spec/dummy/tmp/cache/4AD/470/country_all +0 -0
- data/spec/fixtures/manifestations.yml +1 -1
- data/spec/models/manifestation_spec.rb +1 -1
- data/spec/models/resource_import_file_spec.rb +135 -137
- metadata +73 -39
- data/spec/cassette_library/Manifestation/should_import_isbn.yml +0 -3643
- data/spec/dummy/app/models/role.rb +0 -46
- data/spec/dummy/app/models/user_group.rb +0 -40
- data/spec/dummy/app/models/user_has_role.rb +0 -5
- data/spec/dummy/solr/data/test/index/segments_nq2 +0 -0
@@ -1,46 +0,0 @@
|
|
1
|
-
class Role < ActiveRecord::Base
|
2
|
-
include MasterModel
|
3
|
-
default_scope :order => "roles.position"
|
4
|
-
has_many :user_has_roles
|
5
|
-
has_many :users, :through => :user_has_roles
|
6
|
-
after_save :clear_all_cache
|
7
|
-
after_destroy :clear_all_cache
|
8
|
-
|
9
|
-
extend FriendlyId
|
10
|
-
friendly_id :name
|
11
|
-
|
12
|
-
def localized_name
|
13
|
-
display_name.localize
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.all_cache
|
17
|
-
if Rails.env == 'production'
|
18
|
-
Rails.cache.fetch('role_all'){Role.select(:name).all}
|
19
|
-
else
|
20
|
-
Role.select(:name)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def clear_all_cache
|
25
|
-
Rails.cache.delete('role_all')
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.default_role
|
29
|
-
Rails.cache.fetch('default_role'){Role.find('Guest')}
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
# == Schema Information
|
34
|
-
#
|
35
|
-
# Table name: roles
|
36
|
-
#
|
37
|
-
# id :integer not null, primary key
|
38
|
-
# name :string(255) not null
|
39
|
-
# display_name :string(255)
|
40
|
-
# note :text
|
41
|
-
# created_at :datetime
|
42
|
-
# updated_at :datetime
|
43
|
-
# score :integer default(0), not null
|
44
|
-
# position :integer
|
45
|
-
#
|
46
|
-
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
class UserGroup < ActiveRecord::Base
|
3
|
-
attr_accessible :name, :display_name, :note, :valid_period_for_new_user,
|
4
|
-
:expired_at, :number_of_day_to_notify_overdue,
|
5
|
-
:number_of_day_to_notify_overdue,
|
6
|
-
:number_of_day_to_notify_due_date,
|
7
|
-
:number_of_time_to_notify_overdue
|
8
|
-
|
9
|
-
include MasterModel
|
10
|
-
default_scope :order => "user_groups.position"
|
11
|
-
has_many :users
|
12
|
-
|
13
|
-
validates_numericality_of :valid_period_for_new_user,
|
14
|
-
:greater_than_or_equal_to => 0,
|
15
|
-
:allow_blank => true
|
16
|
-
|
17
|
-
def self.per_page
|
18
|
-
10
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
# == Schema Information
|
23
|
-
#
|
24
|
-
# Table name: user_groups
|
25
|
-
#
|
26
|
-
# id :integer not null, primary key
|
27
|
-
# name :string(255)
|
28
|
-
# display_name :text
|
29
|
-
# note :text
|
30
|
-
# position :integer
|
31
|
-
# created_at :datetime
|
32
|
-
# updated_at :datetime
|
33
|
-
# deleted_at :datetime
|
34
|
-
# valid_period_for_new_user :integer default(0), not null
|
35
|
-
# expired_at :datetime
|
36
|
-
# number_of_day_to_notify_overdue :integer default(1), not null
|
37
|
-
# number_of_day_to_notify_due_date :integer default(7), not null
|
38
|
-
# number_of_time_to_notify_overdue :integer default(3), not null
|
39
|
-
#
|
40
|
-
|
Binary file
|