enju_inter_library_loan 0.0.1

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 (104) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +45 -0
  4. data/app/controllers/inter_library_loans_controller.rb +125 -0
  5. data/app/models/inter_library_loan.rb +111 -0
  6. data/app/views/inter_library_loans/edit.html.erb +149 -0
  7. data/app/views/inter_library_loans/index.atom.builder +11 -0
  8. data/app/views/inter_library_loans/index.html.erb +50 -0
  9. data/app/views/inter_library_loans/index.rss.builder +31 -0
  10. data/app/views/inter_library_loans/new.html.erb +42 -0
  11. data/app/views/inter_library_loans/show.html.erb +58 -0
  12. data/config/locales/translation_en.yml +20 -0
  13. data/config/locales/translation_ja.yml +20 -0
  14. data/config/routes.rb +6 -0
  15. data/db/migrate/148_create_inter_library_loans.rb +23 -0
  16. data/lib/enju_inter_library_loan.rb +4 -0
  17. data/lib/enju_inter_library_loan/engine.rb +13 -0
  18. data/lib/enju_inter_library_loan/version.rb +3 -0
  19. data/lib/tasks/enju_inter_library_loan_tasks.rake +4 -0
  20. data/spec/controllers/inter_library_loans_controller_spec.rb +185 -0
  21. data/spec/dummy/Rakefile +7 -0
  22. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  23. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  24. data/spec/dummy/app/controllers/application_controller.rb +71 -0
  25. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  26. data/spec/dummy/app/models/ability.rb +12 -0
  27. data/spec/dummy/app/models/item.rb +7 -0
  28. data/spec/dummy/app/models/library.rb +128 -0
  29. data/spec/dummy/app/models/library_group.rb +86 -0
  30. data/spec/dummy/app/models/manifestation.rb +6 -0
  31. data/spec/dummy/app/models/patron.rb +167 -0
  32. data/spec/dummy/app/models/patron_type.rb +19 -0
  33. data/spec/dummy/app/models/role.rb +5 -0
  34. data/spec/dummy/app/models/shelf.rb +54 -0
  35. data/spec/dummy/app/models/user.rb +27 -0
  36. data/spec/dummy/app/models/user_has_role.rb +4 -0
  37. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  38. data/spec/dummy/app/views/page/403.html.erb +9 -0
  39. data/spec/dummy/app/views/page/403.mobile.erb +5 -0
  40. data/spec/dummy/app/views/page/403.xml.erb +4 -0
  41. data/spec/dummy/app/views/page/404.html.erb +9 -0
  42. data/spec/dummy/app/views/page/404.mobile.erb +5 -0
  43. data/spec/dummy/app/views/page/404.xml.erb +4 -0
  44. data/spec/dummy/config.ru +4 -0
  45. data/spec/dummy/config/application.rb +47 -0
  46. data/spec/dummy/config/boot.rb +10 -0
  47. data/spec/dummy/config/database.yml +25 -0
  48. data/spec/dummy/config/environment.rb +5 -0
  49. data/spec/dummy/config/environments/development.rb +30 -0
  50. data/spec/dummy/config/environments/production.rb +60 -0
  51. data/spec/dummy/config/environments/test.rb +39 -0
  52. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  53. data/spec/dummy/config/initializers/devise.rb +209 -0
  54. data/spec/dummy/config/initializers/inflections.rb +10 -0
  55. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  56. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  57. data/spec/dummy/config/initializers/session_store.rb +8 -0
  58. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  59. data/spec/dummy/config/locales/en.yml +5 -0
  60. data/spec/dummy/config/routes.rb +60 -0
  61. data/spec/dummy/db/migrate/001_create_patrons.rb +62 -0
  62. data/spec/dummy/db/migrate/005_create_manifestations.rb +68 -0
  63. data/spec/dummy/db/migrate/006_create_items.rb +36 -0
  64. data/spec/dummy/db/migrate/059_create_libraries.rb +34 -0
  65. data/spec/dummy/db/migrate/069_create_shelves.rb +19 -0
  66. data/spec/dummy/db/migrate/080_create_library_groups.rb +25 -0
  67. data/spec/dummy/db/migrate/20080905191442_create_patron_types.rb +16 -0
  68. data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +9 -0
  69. data/spec/dummy/db/migrate/20100222124420_add_allow_bookmark_external_url_to_library_group.rb +9 -0
  70. data/spec/dummy/db/migrate/20110115022329_add_position_to_library_group.rb +9 -0
  71. data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +9 -0
  72. data/spec/dummy/db/migrate/20111020063828_remove_dsbl_from_library_group.rb +11 -0
  73. data/spec/dummy/db/migrate/20111201121844_create_roles.rb +12 -0
  74. data/spec/dummy/db/migrate/20111201155456_create_users.rb +13 -0
  75. data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +31 -0
  76. data/spec/dummy/db/migrate/20111201163718_create_user_has_roles.rb +10 -0
  77. data/spec/dummy/db/schema.rb +289 -0
  78. data/spec/dummy/db/test.sqlite3 +0 -0
  79. data/spec/dummy/lib/master_model.rb +41 -0
  80. data/spec/dummy/lib/url_validator.rb +10 -0
  81. data/spec/dummy/log/test.log +5034 -0
  82. data/spec/dummy/public/404.html +26 -0
  83. data/spec/dummy/public/422.html +26 -0
  84. data/spec/dummy/public/500.html +26 -0
  85. data/spec/dummy/public/favicon.ico +0 -0
  86. data/spec/dummy/script/rails +6 -0
  87. data/spec/factories/inter_library_loan.rb +6 -0
  88. data/spec/factories/item.rb +7 -0
  89. data/spec/factories/library.rb +13 -0
  90. data/spec/factories/manifestation.rb +5 -0
  91. data/spec/factories/user.rb +31 -0
  92. data/spec/fixtures/inter_library_loans.yml +84 -0
  93. data/spec/fixtures/libraries.yml +108 -0
  94. data/spec/fixtures/library_groups.yml +34 -0
  95. data/spec/fixtures/patron_types.yml +35 -0
  96. data/spec/fixtures/patrons.yml +338 -0
  97. data/spec/fixtures/roles.yml +21 -0
  98. data/spec/fixtures/user_has_roles.yml +41 -0
  99. data/spec/fixtures/users.yml +69 -0
  100. data/spec/models/inter_library_loan_spec.rb +26 -0
  101. data/spec/spec_helper.rb +46 -0
  102. data/spec/support/controller_macros.rb +48 -0
  103. data/spec/support/devise.rb +4 -0
  104. metadata +386 -0
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,9 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require_tree .
@@ -0,0 +1,7 @@
1
+ /*
2
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *= require_self
6
+ *= require_tree .
7
+ */
@@ -0,0 +1,71 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+
4
+ rescue_from CanCan::AccessDenied, :with => :render_403
5
+ rescue_from ActiveRecord::RecordNotFound, :with => :render_404
6
+
7
+ before_filter :set_locale
8
+
9
+ private
10
+ def render_403
11
+ return if performed?
12
+ if user_signed_in?
13
+ respond_to do |format|
14
+ format.html {render :template => 'page/403', :status => 403}
15
+ format.xml {render :template => 'page/403', :status => 403}
16
+ format.json
17
+ end
18
+ else
19
+ respond_to do |format|
20
+ format.html {redirect_to new_user_session_url}
21
+ format.xml {render :template => 'page/403', :status => 403}
22
+ format.json
23
+ end
24
+ end
25
+ end
26
+
27
+ def render_404
28
+ return if performed?
29
+ respond_to do |format|
30
+ format.html {render :template => 'page/404', :status => 404}
31
+ format.xml {render :template => 'page/404', :status => 404}
32
+ format.json
33
+ end
34
+ end
35
+
36
+ def set_locale
37
+ if params[:locale]
38
+ unless I18n.available_locales.include?(params[:locale].to_s.intern)
39
+ raise InvalidLocaleError
40
+ end
41
+ end
42
+ if user_signed_in?
43
+ locale = params[:locale] || session[:locale] || current_user.locale.try(:to_sym)
44
+ else
45
+ locale = params[:locale] || session[:locale]
46
+ end
47
+ if locale
48
+ I18n.locale = @locale = session[:locale] = locale.to_sym
49
+ else
50
+ I18n.locale = @locale = session[:locale] = I18n.default_locale
51
+ end
52
+ rescue InvalidLocaleError
53
+ @locale = I18n.default_locale
54
+ end
55
+
56
+ def access_denied
57
+ raise CanCan::AccessDenied
58
+ end
59
+
60
+ def get_item
61
+ @item = Item.find(params[:item_id]) if params[:item_id]
62
+ authorize! :show, @item if @item
63
+ end
64
+
65
+ def store_page
66
+ flash[:page] = params[:page] if params[:page].to_i > 0
67
+ end
68
+ end
69
+
70
+ class InvalidLocaleError < StandardError
71
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,12 @@
1
+ class Ability
2
+ include CanCan::Ability
3
+
4
+ def initialize(user)
5
+ case user.try(:role).try(:name)
6
+ when 'Administrator'
7
+ can :manage, InterLibraryLoan
8
+ when 'Librarian'
9
+ can :manage, InterLibraryLoan
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,7 @@
1
+ # -*- encoding: utf-8 -*-
2
+ class Item < ActiveRecord::Base
3
+ scope :on_shelf, where('shelf_id != 1')
4
+ scope :on_web, where(:shelf_id => 1)
5
+
6
+ attr_accessor :library_id, :manifestation_id
7
+ end
@@ -0,0 +1,128 @@
1
+ # -*- encoding: utf-8 -*-
2
+ class Library < ActiveRecord::Base
3
+ include MasterModel
4
+ default_scope :order => 'libraries.position'
5
+ scope :real, where('id != 1')
6
+ has_many :shelves, :order => 'shelves.position'
7
+ belongs_to :library_group, :validate => true
8
+ has_many :events, :include => :event_category
9
+ #belongs_to :holding_patron, :polymorphic => true, :validate => true
10
+ belongs_to :patron #, :validate => true
11
+ has_many :inter_library_loans, :foreign_key => 'borrowing_library_id'
12
+ has_many :users
13
+ belongs_to :country
14
+
15
+ extend FriendlyId
16
+ friendly_id :name
17
+ #geocoded_by :address
18
+
19
+ searchable do
20
+ text :name, :display_name, :note, :address
21
+ time :created_at
22
+ time :updated_at
23
+ integer :position
24
+ end
25
+
26
+ #validates_associated :library_group, :holding_patron
27
+ validates_associated :library_group, :patron
28
+ validates_presence_of :short_display_name, :library_group, :patron
29
+ validates_uniqueness_of :short_display_name, :case_sensitive => false
30
+ validates :display_name, :uniqueness => true
31
+ validates :name, :format => {:with => /^[a-z][0-9a-z]{2,254}$/}
32
+ before_validation :set_patron, :on => :create
33
+ #before_save :set_calil_neighborhood_library
34
+ after_validation :geocode, :if => :address_changed?
35
+ after_create :create_shelf
36
+ after_save :clear_all_cache
37
+ after_destroy :clear_all_cache
38
+
39
+ def self.per_page
40
+ 10
41
+ end
42
+
43
+ def self.all_cache
44
+ if Rails.env == 'production'
45
+ Rails.cache.fetch('library_all'){Library.all}
46
+ else
47
+ Library.all
48
+ end
49
+ end
50
+
51
+ def clear_all_cache
52
+ Rails.cache.delete('library_all')
53
+ end
54
+
55
+ def set_patron
56
+ self.patron = Patron.new(
57
+ :full_name => self.name
58
+ )
59
+ end
60
+
61
+ def create_shelf
62
+ Shelf.create!(:name => "#{self.name}_default", :library => self)
63
+ end
64
+
65
+ def closed?(date)
66
+ events.closing_days.collect{|c| c.start_at.beginning_of_day}.include?(date.beginning_of_day)
67
+ end
68
+
69
+ def web?
70
+ return true if self.id == 1
71
+ false
72
+ end
73
+
74
+ def self.web
75
+ Library.find(1)
76
+ end
77
+
78
+ def address(locale = I18n.locale)
79
+ case locale.to_sym
80
+ when :ja
81
+ "#{self.region.to_s.localize(locale)}#{self.locality.to_s.localize(locale)}#{self.street.to_s.localize(locale)}"
82
+ else
83
+ "#{self.street.to_s.localize(locale)} #{self.locality.to_s.localize(locale)} #{self.region.to_s.localize(locale)}"
84
+ end
85
+ rescue
86
+ nil
87
+ end
88
+
89
+ def address_changed?
90
+ return true if region_changed? or locality_changed? or street_changed?
91
+ false
92
+ end
93
+ end
94
+
95
+ # == Schema Information
96
+ #
97
+ # Table name: libraries
98
+ #
99
+ # id :integer not null, primary key
100
+ # patron_id :integer
101
+ # patron_type :string(255)
102
+ # name :string(255) not null
103
+ # display_name :text
104
+ # short_display_name :string(255) not null
105
+ # zip_code :string(255)
106
+ # street :text
107
+ # locality :text
108
+ # region :text
109
+ # telephone_number_1 :string(255)
110
+ # telephone_number_2 :string(255)
111
+ # fax_number :string(255)
112
+ # note :text
113
+ # call_number_rows :integer default(1), not null
114
+ # call_number_delimiter :string(255) default("|"), not null
115
+ # library_group_id :integer default(1), not null
116
+ # users_count :integer default(0), not null
117
+ # position :integer
118
+ # country_id :integer
119
+ # created_at :datetime
120
+ # updated_at :datetime
121
+ # deleted_at :datetime
122
+ # opening_hour :text
123
+ # latitude :float
124
+ # longitude :float
125
+ # calil_systemid :string(255)
126
+ # calil_neighborhood_systemid :text
127
+ #
128
+
@@ -0,0 +1,86 @@
1
+ # -*- encoding: utf-8 -*-
2
+ class LibraryGroup < ActiveRecord::Base
3
+ #include Singleton
4
+ #include Configurator
5
+ include MasterModel
6
+
7
+ has_many :libraries
8
+ has_many :search_engines
9
+ #has_many :news_feeds
10
+ belongs_to :country
11
+
12
+ validates :email, :format => {:with => /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i}, :presence => true
13
+ validates :url, :presence => true, :url => true
14
+ after_save :clear_site_config_cache
15
+
16
+ def clear_site_config_cache
17
+ Rails.cache.delete('library_site_config')
18
+ end
19
+
20
+ def self.site_config
21
+ #if Rails.env == 'production'
22
+ # Rails.cache.fetch('library_site_config'){LibraryGroup.find(1)}
23
+ #else
24
+ LibraryGroup.find(1)
25
+ #end
26
+ rescue
27
+ nil
28
+ end
29
+
30
+ def self.system_name(locale = I18n.locale)
31
+ LibraryGroup.site_config.display_name.localize(locale)
32
+ end
33
+
34
+ def config?
35
+ true if self == LibraryGroup.site_config
36
+ end
37
+
38
+ def real_libraries
39
+ # 物理的な図書館 = IDが1以外
40
+ libraries.where('id != 1').all
41
+ end
42
+
43
+ def network_access_allowed?(ip_address, options = {})
44
+ options = {:network_type => :lan}.merge(options)
45
+ client_ip = IPAddr.new(ip_address)
46
+ case options[:network_type]
47
+ when :admin
48
+ allowed_networks = self.admin_networks.to_s.split
49
+ else
50
+ allowed_networks = self.my_networks.to_s.split
51
+ end
52
+ allowed_networks.each do |allowed_network|
53
+ begin
54
+ network = IPAddr.new(allowed_network)
55
+ return true if network.include?(client_ip)
56
+ rescue ArgumentError
57
+ nil
58
+ end
59
+ end
60
+ return false
61
+ end
62
+ end
63
+
64
+
65
+ # == Schema Information
66
+ #
67
+ # Table name: library_groups
68
+ #
69
+ # id :integer not null, primary key
70
+ # name :string(255) not null
71
+ # display_name :text
72
+ # short_name :string(255) not null
73
+ # email :string(255)
74
+ # my_networks :text
75
+ # login_banner :text
76
+ # note :text
77
+ # post_to_union_catalog :boolean default(FALSE), not null
78
+ # country_id :integer
79
+ # created_at :datetime
80
+ # updated_at :datetime
81
+ # admin_networks :text
82
+ # allow_bookmark_external_url :boolean default(FALSE), not null
83
+ # position :integer
84
+ # url :string(255) default("http://localhost:3000/")
85
+ #
86
+
@@ -0,0 +1,6 @@
1
+ class Manifestation < ActiveRecord::Base
2
+ belongs_to :carrier_type
3
+ has_many :exemplifies, :foreign_key => 'manifestation_id'
4
+ has_many :items, :through => :exemplifies
5
+ has_many :reserves, :foreign_key => :manifestation_id
6
+ end
@@ -0,0 +1,167 @@
1
+ # -*- encoding: utf-8 -*-
2
+ class Patron < ActiveRecord::Base
3
+ scope :readable_by, lambda{|user| {:conditions => ['required_role_id <= ?', user.try(:user_has_role).try(:role_id) || Role.where(:name => 'Guest').select(:id).first.id]}}
4
+ belongs_to :user
5
+ belongs_to :patron_type
6
+ belongs_to :required_role, :class_name => 'Role', :foreign_key => 'required_role_id', :validate => true
7
+
8
+ validates_presence_of :patron_type
9
+ validates_associated :patron_type
10
+ validates :full_name, :presence => true, :length => {:maximum => 255}
11
+ validates :user_id, :uniqueness => true, :allow_nil => true
12
+ validates :email, :format => {:with => /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i}, :allow_blank => true
13
+ before_validation :set_role_and_name, :on => :create
14
+
15
+ #has_paper_trail
16
+ attr_accessor :user_username
17
+ #[:address_1, :address_2].each do |column|
18
+ # encrypt_with_public_key column,
19
+ # :key_pair => File.join(Rails.root.to_s,'config','keypair.pem'),
20
+ # :base64 => true
21
+ #end
22
+
23
+ searchable do
24
+ text :name, :place, :address_1, :address_2, :other_designation, :note
25
+ string :zip_code_1
26
+ string :zip_code_2
27
+ string :username do
28
+ user.username if user
29
+ end
30
+ time :created_at
31
+ time :updated_at
32
+ string :user
33
+ integer :work_ids, :multiple => true
34
+ integer :expression_ids, :multiple => true
35
+ integer :manifestation_ids, :multiple => true
36
+ integer :patron_merge_list_ids, :multiple => true if defined?(EnjuResourceMerge)
37
+ integer :original_patron_ids, :multiple => true
38
+ integer :required_role_id
39
+ integer :patron_type_id
40
+ end
41
+
42
+ def self.per_page
43
+ 10
44
+ end
45
+
46
+ def full_name_without_space
47
+ full_name.gsub(/\s/, "")
48
+ end
49
+
50
+ def set_role_and_name
51
+ self.required_role = Role.where(:name => 'Librarian').first if self.required_role_id.nil?
52
+ set_full_name
53
+ end
54
+
55
+ def set_full_name
56
+ if self.full_name.blank?
57
+ if self.last_name.to_s.strip and self.first_name.to_s.strip and configatron.family_name_first == true
58
+ self.full_name = [last_name, middle_name, first_name].compact.join(" ").to_s.strip
59
+ else
60
+ self.full_name = [first_name, last_name, middle_name].compact.join(" ").to_s.strip
61
+ end
62
+ end
63
+ if self.full_name_transcription.blank?
64
+ self.full_name_transcription = [last_name_transcription, middle_name_transcription, first_name_transcription].join(" ").to_s.strip
65
+ end
66
+ [self.full_name, self.full_name_transcription]
67
+ end
68
+
69
+ def full_name_without_space
70
+ full_name.gsub(/\s/, "")
71
+ # # TODO: 日本人以外は?
72
+ # name = []
73
+ # name << self.last_name.to_s.strip
74
+ # name << self.middle_name.to_s.strip
75
+ # name << self.first_name.to_s.strip
76
+ # name << self.corporate_name.to_s.strip
77
+ # name.join("").strip
78
+ end
79
+
80
+ def full_name_transcription_without_space
81
+ full_name_transcription.to_s.gsub(/\s/, "")
82
+ end
83
+
84
+ def full_name_alternative_without_space
85
+ full_name_alternative.to_s.gsub(/\s/, "")
86
+ end
87
+
88
+ def name
89
+ name = []
90
+ name << full_name.to_s.strip
91
+ name << full_name_transcription.to_s.strip
92
+ name << full_name_alternative.to_s.strip
93
+ #name << full_name_without_space
94
+ #name << full_name_transcription_without_space
95
+ #name << full_name_alternative_without_space
96
+ #name << full_name.wakati rescue nil
97
+ #name << full_name_transcription.wakati rescue nil
98
+ #name << full_name_alternative.wakati rescue nil
99
+ name
100
+ end
101
+
102
+ def date
103
+ if date_of_birth
104
+ if date_of_death
105
+ "#{date_of_birth} - #{date_of_death}"
106
+ else
107
+ "#{date_of_birth} -"
108
+ end
109
+ end
110
+ end
111
+
112
+ def creator?(resource)
113
+ resource.creators.include?(self)
114
+ end
115
+
116
+ def publisher?(resource)
117
+ resource.publishers.include?(self)
118
+ end
119
+
120
+ def check_required_role(user)
121
+ return true if self.user.blank?
122
+ return true if self.user.required_role.name == 'Guest'
123
+ return true if user == self.user
124
+ return true if user.has_role?(self.user.required_role.name)
125
+ false
126
+ rescue NoMethodError
127
+ false
128
+ end
129
+
130
+ def created(work)
131
+ creates.where(:work_id => work.id).first
132
+ end
133
+
134
+ def realized(expression)
135
+ realizes.where(:expression_id => expression.id).first
136
+ end
137
+
138
+ def produced(manifestation)
139
+ produces.where(:manifestation_id => manifestation.id).first
140
+ end
141
+
142
+ def owned(item)
143
+ owns.where(:item_id => item.id)
144
+ end
145
+
146
+ def self.import_patrons(patron_lists)
147
+ list = []
148
+ patron_lists.each do |patron_list|
149
+ patron = Patron.where(:full_name => patron_list[:full_name]).first
150
+ unless patron
151
+ patron = Patron.new(
152
+ :full_name => patron_list[:full_name],
153
+ :full_name_transcription => patron_list[:full_name_transcription],
154
+ :language_id => 1
155
+ )
156
+ patron.required_role = Role.where(:name => 'Guest').first
157
+ patron.save
158
+ end
159
+ list << patron
160
+ end
161
+ list
162
+ end
163
+
164
+ def patrons
165
+ self.original_patrons + self.derived_patrons
166
+ end
167
+ end