enju_trunk_message 0.1.14.pre3
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +46 -0
- data/app/controllers/message_requests_controller.rb +62 -0
- data/app/controllers/message_templates_controller.rb +17 -0
- data/app/controllers/messages_controller.rb +159 -0
- data/app/helpers/messages_helper.rb +2 -0
- data/app/models/message.rb +85 -0
- data/app/models/message_request.rb +97 -0
- data/app/models/message_template.rb +39 -0
- data/app/views/layouts/messages.html.erb +24 -0
- data/app/views/message_requests/edit.html.erb +40 -0
- data/app/views/message_requests/index.html.erb +58 -0
- data/app/views/message_requests/new.html.erb +40 -0
- data/app/views/message_requests/show.html.erb +55 -0
- data/app/views/message_templates/_form.html.erb +27 -0
- data/app/views/message_templates/edit.html.erb +13 -0
- data/app/views/message_templates/index.html.erb +44 -0
- data/app/views/message_templates/new.html.erb +12 -0
- data/app/views/message_templates/show.html.erb +33 -0
- data/app/views/messages/_form.html.erb +37 -0
- data/app/views/messages/edit.html.erb +42 -0
- data/app/views/messages/index.atom.builder +15 -0
- data/app/views/messages/index.html.erb +66 -0
- data/app/views/messages/index.rss.builder +41 -0
- data/app/views/messages/new.html.erb +43 -0
- data/app/views/messages/show.html.erb +48 -0
- data/app/views/notifier/message_notification.en.text.erb +14 -0
- data/app/views/notifier/message_notification.ja.text.erb +14 -0
- data/config/locales/translation_en.yml +51 -0
- data/config/locales/translation_ja.yml +51 -0
- data/config/routes.rb +9 -0
- data/db/fixtures/message_templates.yml +70 -0
- data/db/migrate/149_create_message_templates.rb +18 -0
- data/db/migrate/154_create_messages.rb +24 -0
- data/db/migrate/20080819181903_create_message_requests.rb +20 -0
- data/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +11 -0
- data/db/migrate/20120125050502_add_depth_to_message.rb +6 -0
- data/lib/enju_message.rb +7 -0
- data/lib/enju_message/engine.rb +10 -0
- data/lib/enju_message/user.rb +28 -0
- data/lib/enju_message/version.rb +3 -0
- data/lib/generators/enju_message/views_generator.rb +21 -0
- data/lib/tasks/enju_message_tasks.rake +5 -0
- data/spec/controllers/message_requests_controller_spec.rb +275 -0
- data/spec/controllers/message_templates_controller_spec.rb +439 -0
- data/spec/controllers/messages_controller_spec.rb +443 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +52 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/notifier.rb +30 -0
- data/spec/dummy/app/models/ability.rb +30 -0
- data/spec/dummy/app/models/library_group.rb +86 -0
- data/spec/dummy/app/models/patron.rb +167 -0
- data/spec/dummy/app/models/patron_type.rb +19 -0
- data/spec/dummy/app/models/role.rb +8 -0
- data/spec/dummy/app/models/setting.rb +4 -0
- data/spec/dummy/app/models/user.rb +46 -0
- data/spec/dummy/app/models/user_group.rb +2 -0
- data/spec/dummy/app/models/user_has_role.rb +4 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/page/403.html.erb +9 -0
- data/spec/dummy/app/views/page/403.mobile.erb +5 -0
- data/spec/dummy/app/views/page/403.xml.erb +4 -0
- data/spec/dummy/app/views/page/404.html.erb +9 -0
- data/spec/dummy/app/views/page/404.mobile.erb +5 -0
- data/spec/dummy/app/views/page/404.xml.erb +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +44 -0
- data/spec/dummy/config/application.yml +38 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +30 -0
- data/spec/dummy/config/environments/production.rb +60 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/devise.rb +205 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +6 -0
- data/spec/dummy/config/initializers/resque_mailer.rb +1 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +60 -0
- data/spec/dummy/db/migrate/001_create_patrons.rb +62 -0
- data/spec/dummy/db/migrate/080_create_library_groups.rb +25 -0
- data/spec/dummy/db/migrate/20080905191442_create_patron_types.rb +16 -0
- data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20100222124420_add_allow_bookmark_external_url_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20100527113752_create_delayed_jobs.rb +21 -0
- data/spec/dummy/db/migrate/20110115022329_add_position_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20111020063828_remove_dsbl_from_library_group.rb +11 -0
- data/spec/dummy/db/migrate/20111201121636_create_languages.rb +16 -0
- data/spec/dummy/db/migrate/20111201121844_create_roles.rb +12 -0
- data/spec/dummy/db/migrate/20111201155456_create_users.rb +14 -0
- data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +52 -0
- data/spec/dummy/db/migrate/20111201163342_create_user_groups.rb +12 -0
- data/spec/dummy/db/migrate/20111201163718_create_user_has_roles.rb +10 -0
- data/spec/dummy/db/migrate/20120213092115_add_queue_to_delayed_jobs.rb +9 -0
- data/spec/dummy/db/schema.rb +236 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/delayed_job +5 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/factories/message.rb +8 -0
- data/spec/factories/message_request.rb +8 -0
- data/spec/factories/message_template.rb +7 -0
- data/spec/factories/user.rb +34 -0
- data/spec/fixtures/library_groups.yml +34 -0
- data/spec/fixtures/message_requests.yml +30 -0
- data/spec/fixtures/message_templates.yml +85 -0
- data/spec/fixtures/messages.yml +62 -0
- data/spec/fixtures/patrons.yml +338 -0
- data/spec/fixtures/roles.yml +21 -0
- data/spec/fixtures/user_groups.yml +25 -0
- data/spec/fixtures/user_has_roles.yml +41 -0
- data/spec/fixtures/users.yml +71 -0
- data/spec/models/message_request_spec.rb +24 -0
- data/spec/models/message_spec.rb +59 -0
- data/spec/models/message_template_spec.rb +22 -0
- data/spec/spec_helper.rb +46 -0
- data/spec/support/controller_macros.rb +48 -0
- data/spec/support/devise.rb +4 -0
- metadata +440 -0
@@ -0,0 +1,236 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended to check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(:version => 20120213092115) do
|
15
|
+
|
16
|
+
create_table "delayed_jobs", :force => true do |t|
|
17
|
+
t.integer "priority", :default => 0
|
18
|
+
t.integer "attempts", :default => 0
|
19
|
+
t.text "handler"
|
20
|
+
t.text "last_error"
|
21
|
+
t.datetime "run_at"
|
22
|
+
t.datetime "locked_at"
|
23
|
+
t.datetime "failed_at"
|
24
|
+
t.string "locked_by"
|
25
|
+
t.datetime "created_at", :null => false
|
26
|
+
t.datetime "updated_at", :null => false
|
27
|
+
t.string "queue"
|
28
|
+
end
|
29
|
+
|
30
|
+
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
31
|
+
|
32
|
+
create_table "languages", :force => true do |t|
|
33
|
+
t.string "name"
|
34
|
+
t.string "native_name"
|
35
|
+
t.text "display_name"
|
36
|
+
t.string "iso_639_1"
|
37
|
+
t.string "iso_639_2"
|
38
|
+
t.string "iso_639_3"
|
39
|
+
t.text "note"
|
40
|
+
t.integer "position"
|
41
|
+
t.datetime "created_at", :null => false
|
42
|
+
t.datetime "updated_at", :null => false
|
43
|
+
end
|
44
|
+
|
45
|
+
create_table "library_groups", :force => true do |t|
|
46
|
+
t.string "name", :null => false
|
47
|
+
t.text "display_name"
|
48
|
+
t.string "short_name", :null => false
|
49
|
+
t.string "email"
|
50
|
+
t.text "my_networks"
|
51
|
+
t.text "login_banner"
|
52
|
+
t.text "note"
|
53
|
+
t.integer "valid_period_for_new_user", :default => 365, :null => false
|
54
|
+
t.boolean "post_to_union_catalog", :default => false, :null => false
|
55
|
+
t.integer "country_id"
|
56
|
+
t.datetime "created_at", :null => false
|
57
|
+
t.datetime "updated_at", :null => false
|
58
|
+
t.text "admin_networks"
|
59
|
+
t.boolean "allow_bookmark_external_url", :default => false, :null => false
|
60
|
+
t.integer "position"
|
61
|
+
t.string "url", :default => "http://localhost:3000/"
|
62
|
+
end
|
63
|
+
|
64
|
+
add_index "library_groups", ["short_name"], :name => "index_library_groups_on_short_name"
|
65
|
+
|
66
|
+
create_table "message_requests", :force => true do |t|
|
67
|
+
t.integer "sender_id"
|
68
|
+
t.integer "receiver_id"
|
69
|
+
t.integer "message_template_id"
|
70
|
+
t.datetime "sent_at"
|
71
|
+
t.datetime "deleted_at"
|
72
|
+
t.text "body"
|
73
|
+
t.string "state"
|
74
|
+
t.datetime "created_at", :null => false
|
75
|
+
t.datetime "updated_at", :null => false
|
76
|
+
end
|
77
|
+
|
78
|
+
add_index "message_requests", ["state"], :name => "index_message_requests_on_state"
|
79
|
+
|
80
|
+
create_table "message_templates", :force => true do |t|
|
81
|
+
t.string "status", :null => false
|
82
|
+
t.text "title", :null => false
|
83
|
+
t.text "body", :null => false
|
84
|
+
t.integer "position"
|
85
|
+
t.string "locale", :default => "en"
|
86
|
+
t.datetime "created_at", :null => false
|
87
|
+
t.datetime "updated_at", :null => false
|
88
|
+
end
|
89
|
+
|
90
|
+
add_index "message_templates", ["status"], :name => "index_message_templates_on_status", :unique => true
|
91
|
+
|
92
|
+
create_table "messages", :force => true do |t|
|
93
|
+
t.datetime "read_at"
|
94
|
+
t.integer "receiver_id"
|
95
|
+
t.integer "sender_id"
|
96
|
+
t.string "subject", :null => false
|
97
|
+
t.text "body"
|
98
|
+
t.integer "message_request_id"
|
99
|
+
t.string "state"
|
100
|
+
t.integer "parent_id"
|
101
|
+
t.datetime "created_at", :null => false
|
102
|
+
t.datetime "updated_at", :null => false
|
103
|
+
t.integer "lft"
|
104
|
+
t.integer "rgt"
|
105
|
+
t.integer "depth"
|
106
|
+
end
|
107
|
+
|
108
|
+
add_index "messages", ["message_request_id"], :name => "index_messages_on_message_request_id"
|
109
|
+
add_index "messages", ["parent_id"], :name => "index_messages_on_parent_id"
|
110
|
+
add_index "messages", ["receiver_id"], :name => "index_messages_on_receiver_id"
|
111
|
+
add_index "messages", ["sender_id"], :name => "index_messages_on_sender_id"
|
112
|
+
|
113
|
+
create_table "patron_types", :force => true do |t|
|
114
|
+
t.string "name", :null => false
|
115
|
+
t.text "display_name"
|
116
|
+
t.text "note"
|
117
|
+
t.integer "position"
|
118
|
+
t.datetime "created_at", :null => false
|
119
|
+
t.datetime "updated_at", :null => false
|
120
|
+
end
|
121
|
+
|
122
|
+
create_table "patrons", :force => true do |t|
|
123
|
+
t.integer "user_id"
|
124
|
+
t.string "last_name"
|
125
|
+
t.string "middle_name"
|
126
|
+
t.string "first_name"
|
127
|
+
t.string "last_name_transcription"
|
128
|
+
t.string "middle_name_transcription"
|
129
|
+
t.string "first_name_transcription"
|
130
|
+
t.string "corporate_name"
|
131
|
+
t.string "corporate_name_transcription"
|
132
|
+
t.string "full_name"
|
133
|
+
t.text "full_name_transcription"
|
134
|
+
t.text "full_name_alternative"
|
135
|
+
t.datetime "created_at", :null => false
|
136
|
+
t.datetime "updated_at", :null => false
|
137
|
+
t.datetime "deleted_at"
|
138
|
+
t.string "zip_code_1"
|
139
|
+
t.string "zip_code_2"
|
140
|
+
t.text "address_1"
|
141
|
+
t.text "address_2"
|
142
|
+
t.text "address_1_note"
|
143
|
+
t.text "address_2_note"
|
144
|
+
t.string "telephone_number_1"
|
145
|
+
t.string "telephone_number_2"
|
146
|
+
t.string "fax_number_1"
|
147
|
+
t.string "fax_number_2"
|
148
|
+
t.text "other_designation"
|
149
|
+
t.text "place"
|
150
|
+
t.string "postal_code"
|
151
|
+
t.text "street"
|
152
|
+
t.text "locality"
|
153
|
+
t.text "region"
|
154
|
+
t.datetime "date_of_birth"
|
155
|
+
t.datetime "date_of_death"
|
156
|
+
t.integer "language_id", :default => 1, :null => false
|
157
|
+
t.integer "country_id", :default => 1, :null => false
|
158
|
+
t.integer "patron_type_id", :default => 1, :null => false
|
159
|
+
t.integer "lock_version", :default => 0, :null => false
|
160
|
+
t.text "note"
|
161
|
+
t.integer "creates_count", :default => 0, :null => false
|
162
|
+
t.integer "realizes_count", :default => 0, :null => false
|
163
|
+
t.integer "produces_count", :default => 0, :null => false
|
164
|
+
t.integer "owns_count", :default => 0, :null => false
|
165
|
+
t.integer "required_role_id", :default => 1, :null => false
|
166
|
+
t.integer "required_score", :default => 0, :null => false
|
167
|
+
t.string "state"
|
168
|
+
t.text "email"
|
169
|
+
t.text "url"
|
170
|
+
end
|
171
|
+
|
172
|
+
add_index "patrons", ["country_id"], :name => "index_patrons_on_country_id"
|
173
|
+
add_index "patrons", ["full_name"], :name => "index_patrons_on_full_name"
|
174
|
+
add_index "patrons", ["language_id"], :name => "index_patrons_on_language_id"
|
175
|
+
add_index "patrons", ["required_role_id"], :name => "index_patrons_on_required_role_id"
|
176
|
+
add_index "patrons", ["user_id"], :name => "index_patrons_on_user_id", :unique => true
|
177
|
+
|
178
|
+
create_table "roles", :force => true do |t|
|
179
|
+
t.string "name"
|
180
|
+
t.text "display_name"
|
181
|
+
t.text "note"
|
182
|
+
t.integer "position"
|
183
|
+
t.datetime "created_at", :null => false
|
184
|
+
t.datetime "updated_at", :null => false
|
185
|
+
end
|
186
|
+
|
187
|
+
create_table "user_groups", :force => true do |t|
|
188
|
+
t.string "name"
|
189
|
+
t.text "display_name"
|
190
|
+
t.text "note"
|
191
|
+
t.integer "position"
|
192
|
+
t.datetime "created_at", :null => false
|
193
|
+
t.datetime "updated_at", :null => false
|
194
|
+
end
|
195
|
+
|
196
|
+
create_table "user_has_roles", :force => true do |t|
|
197
|
+
t.integer "user_id"
|
198
|
+
t.integer "role_id"
|
199
|
+
t.datetime "created_at", :null => false
|
200
|
+
t.datetime "updated_at", :null => false
|
201
|
+
end
|
202
|
+
|
203
|
+
create_table "users", :force => true do |t|
|
204
|
+
t.integer "user_group_id"
|
205
|
+
t.integer "required_role_id"
|
206
|
+
t.string "username"
|
207
|
+
t.text "note"
|
208
|
+
t.string "locale"
|
209
|
+
t.string "user_number"
|
210
|
+
t.datetime "created_at", :null => false
|
211
|
+
t.datetime "updated_at", :null => false
|
212
|
+
t.string "email", :default => "", :null => false
|
213
|
+
t.string "encrypted_password", :default => "", :null => false
|
214
|
+
t.string "reset_password_token"
|
215
|
+
t.datetime "reset_password_sent_at"
|
216
|
+
t.datetime "remember_created_at"
|
217
|
+
t.integer "sign_in_count", :default => 0
|
218
|
+
t.datetime "current_sign_in_at"
|
219
|
+
t.datetime "last_sign_in_at"
|
220
|
+
t.string "current_sign_in_ip"
|
221
|
+
t.string "last_sign_in_ip"
|
222
|
+
t.string "password_salt"
|
223
|
+
t.string "confirmation_token"
|
224
|
+
t.datetime "confirmed_at"
|
225
|
+
t.datetime "confirmation_sent_at"
|
226
|
+
t.string "unconfirmed_email"
|
227
|
+
t.integer "failed_attempts", :default => 0
|
228
|
+
t.string "unlock_token"
|
229
|
+
t.datetime "locked_at"
|
230
|
+
t.string "authentication_token"
|
231
|
+
end
|
232
|
+
|
233
|
+
add_index "users", ["email"], :name => "index_users_on_email"
|
234
|
+
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
|
235
|
+
|
236
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
@@ -0,0 +1,34 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
factory :admin, :class => User do |f|
|
3
|
+
f.sequence(:username){|n| "admin_#{n}"}
|
4
|
+
f.sequence(:email){|n| "admin_#{n}@example.jp"}
|
5
|
+
f.role {Role.find_by_name('Administrator')}
|
6
|
+
f.password 'adminpassword'
|
7
|
+
f.password_confirmation 'adminpassword'
|
8
|
+
f.user_group {UserGroup.first}
|
9
|
+
f.required_role {Role.find_by_name('User')}
|
10
|
+
end
|
11
|
+
|
12
|
+
factory :librarian, :class => User do |f|
|
13
|
+
f.sequence(:username){|n| "librarian_#{n}"}
|
14
|
+
f.sequence(:email){|n| "librarian_#{n}@example.jp"}
|
15
|
+
f.role {Role.find_by_name('Librarian')}
|
16
|
+
f.password 'librarianpassword'
|
17
|
+
f.password_confirmation 'librarianpassword'
|
18
|
+
f.user_group {UserGroup.first}
|
19
|
+
f.required_role {Role.find_by_name('User')}
|
20
|
+
end
|
21
|
+
|
22
|
+
factory :user, :class => User do |f|
|
23
|
+
f.sequence(:username){|n| "user_#{n}"}
|
24
|
+
f.sequence(:email){|n| "user_#{n}@example.jp"}
|
25
|
+
f.role {Role.find_by_name('User')}
|
26
|
+
f.password 'userpassword'
|
27
|
+
f.password_confirmation 'userpassword'
|
28
|
+
f.user_group {UserGroup.first}
|
29
|
+
f.required_role {Role.find_by_name('User')}
|
30
|
+
end
|
31
|
+
|
32
|
+
factory :invalid_user, :class => User do |f|
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
2
|
+
one:
|
3
|
+
id: 1
|
4
|
+
name: unknown
|
5
|
+
display_name: unknown
|
6
|
+
short_name: unknown
|
7
|
+
email: next-l@library.example.jp
|
8
|
+
note:
|
9
|
+
my_networks: 0.0.0.0/0
|
10
|
+
url: "http://localhost:3000/"
|
11
|
+
|
12
|
+
|
13
|
+
# == Schema Information
|
14
|
+
#
|
15
|
+
# Table name: library_groups
|
16
|
+
#
|
17
|
+
# id :integer not null, primary key
|
18
|
+
# name :string(255) not null
|
19
|
+
# display_name :text
|
20
|
+
# short_name :string(255) not null
|
21
|
+
# email :string(255)
|
22
|
+
# my_networks :text
|
23
|
+
# login_banner :text
|
24
|
+
# note :text
|
25
|
+
# post_to_union_catalog :boolean default(FALSE), not null
|
26
|
+
# country_id :integer
|
27
|
+
# created_at :datetime
|
28
|
+
# updated_at :datetime
|
29
|
+
# admin_networks :text
|
30
|
+
# allow_bookmark_external_url :boolean default(FALSE), not null
|
31
|
+
# position :integer
|
32
|
+
# url :string(255) default("http://localhost:3000/")
|
33
|
+
#
|
34
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
2
|
+
|
3
|
+
one:
|
4
|
+
sender_id: 1
|
5
|
+
receiver_id: 1
|
6
|
+
message_template_id: 1
|
7
|
+
state: pending
|
8
|
+
|
9
|
+
two:
|
10
|
+
sender_id: 1
|
11
|
+
receiver_id: 1
|
12
|
+
message_template_id: 1
|
13
|
+
state: pending
|
14
|
+
|
15
|
+
# == Schema Information
|
16
|
+
#
|
17
|
+
# Table name: message_requests
|
18
|
+
#
|
19
|
+
# id :integer not null, primary key
|
20
|
+
# sender_id :integer
|
21
|
+
# receiver_id :integer
|
22
|
+
# message_template_id :integer
|
23
|
+
# sent_at :datetime
|
24
|
+
# deleted_at :datetime
|
25
|
+
# body :text
|
26
|
+
# state :string(255)
|
27
|
+
# created_at :datetime not null
|
28
|
+
# updated_at :datetime not null
|
29
|
+
#
|
30
|
+
|