muck-users 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -1
- data/Rakefile +8 -13
- data/VERSION +1 -1
- data/app/controllers/admin/muck/users_controller.rb +1 -1
- data/app/models/user_mailer.rb +1 -1
- data/lib/active_record/acts/muck_user.rb +17 -20
- data/lib/active_record/secure_methods.rb +1 -1
- data/lib/muck_users/tasks.rb +2 -2
- data/locales/ar.yml +1 -1
- data/locales/bg.yml +2 -2
- data/locales/ca.yml +2 -2
- data/locales/cs.yml +1 -1
- data/locales/da.yml +1 -1
- data/locales/de.yml +2 -2
- data/locales/el.yml +4 -4
- data/locales/en.yml +5 -5
- data/locales/es.yml +1 -1
- data/locales/et.yml +126 -0
- data/locales/fa.yml +126 -0
- data/locales/fi.yml +126 -0
- data/locales/fr.yml +1 -1
- data/locales/gl.yml +126 -0
- data/locales/hi.yml +126 -0
- data/locales/hr.yml +126 -0
- data/locales/hu.yml +126 -0
- data/locales/id.yml +126 -0
- data/locales/it.yml +1 -1
- data/locales/iw.yml +1 -1
- data/locales/ja.yml +2 -2
- data/locales/ko.yml +1 -1
- data/locales/lt.yml +2 -2
- data/locales/lv.yml +2 -2
- data/locales/mt.yml +126 -0
- data/locales/nl.yml +2 -2
- data/locales/no.yml +2 -2
- data/locales/pl.yml +1 -1
- data/locales/pt-PT.yml +126 -0
- data/locales/ro.yml +1 -1
- data/locales/ru.yml +3 -3
- data/locales/sk.yml +1 -1
- data/locales/sl.yml +3 -3
- data/locales/sq.yml +126 -0
- data/locales/sr.yml +2 -2
- data/locales/sv.yml +1 -1
- data/locales/th.yml +126 -0
- data/locales/tl.yml +1 -1
- data/locales/tr.yml +126 -0
- data/locales/uk.yml +2 -2
- data/locales/vi.yml +1 -1
- data/locales/zh-CN.yml +1 -1
- data/locales/zh-TW.yml +1 -1
- data/locales/zh.yml +1 -1
- data/muck-users.gemspec +18 -32
- data/test/rails_root/config/global_config.yml +49 -2
- data/test/rails_root/test/functional/password_resets_controller_test.rb +13 -1
- data/test/rails_root/test/unit/role_test.rb +1 -1
- data/test/rails_root/test/unit/user_mailer_test.rb +6 -6
- data/test/rails_root/test/unit/user_test.rb +79 -1
- metadata +25 -32
- data/muck-users-0.1.4.gem +0 -0
- data/pkg/muck-users-0.1.11.gem +0 -0
- data/rdoc/classes/ActionController.html +0 -112
- data/rdoc/classes/ActionController/AuthenticApplication.html +0 -161
- data/rdoc/classes/ActionController/AuthenticApplication/InstanceMethods.html +0 -741
- data/rdoc/classes/ActionController/Routing.html +0 -107
- data/rdoc/classes/ActionController/Routing/RouteSet.html +0 -148
- data/rdoc/classes/ActiveRecord.html +0 -115
- data/rdoc/classes/ActiveRecord/Acts/MuckUser/ClassMethods.html +0 -167
- data/rdoc/classes/ActiveRecord/Acts/MuckUser/InstanceMethods.html +0 -537
- data/rdoc/classes/ActiveRecord/Acts/MuckUser/SingletonMethods.html +0 -296
- data/rdoc/classes/ActiveRecord/SecureMethods.html +0 -216
- data/rdoc/classes/MuckUsers.html +0 -116
- data/rdoc/classes/MuckUsers/Exceptions.html +0 -111
- data/rdoc/classes/MuckUsers/Exceptions/InvalidPasswordResetCode.html +0 -111
- data/rdoc/classes/MuckUsers/Tasks.html +0 -146
- data/rdoc/created.rid +0 -1
- data/rdoc/files/README_rdoc.html +0 -211
- data/rdoc/files/lib/action_controller/authentic_application_rb.html +0 -101
- data/rdoc/files/lib/active_record/acts/muck_user_rb.html +0 -101
- data/rdoc/files/lib/active_record/secure_methods_rb.html +0 -101
- data/rdoc/files/lib/muck_users/exceptions_rb.html +0 -101
- data/rdoc/files/lib/muck_users/initialize_routes_rb.html +0 -101
- data/rdoc/files/lib/muck_users/tasks_rb.html +0 -110
- data/rdoc/files/lib/muck_users_rb.html +0 -117
- data/rdoc/fr_class_index.html +0 -40
- data/rdoc/fr_file_index.html +0 -34
- data/rdoc/fr_method_index.html +0 -77
- data/rdoc/index.html +0 -24
- data/rdoc/rdoc-style.css +0 -208
@@ -1,296 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Module: ActiveRecord::Acts::MuckUser::SingletonMethods</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Module</strong></td>
|
53
|
-
<td class="class-name-in-header">ActiveRecord::Acts::MuckUser::SingletonMethods</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../../../files/lib/active_record/acts/muck_user_rb.html">
|
59
|
-
lib/active_record/acts/muck_user.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
</table>
|
66
|
-
</div>
|
67
|
-
<!-- banner header -->
|
68
|
-
|
69
|
-
<div id="bodyContent">
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
<div id="contextContent">
|
74
|
-
|
75
|
-
<div id="description">
|
76
|
-
<p>
|
77
|
-
class methods
|
78
|
-
</p>
|
79
|
-
|
80
|
-
</div>
|
81
|
-
|
82
|
-
|
83
|
-
</div>
|
84
|
-
|
85
|
-
<div id="method-list">
|
86
|
-
<h3 class="section-bar">Methods</h3>
|
87
|
-
|
88
|
-
<div class="name-list">
|
89
|
-
<a href="#M000026">activate_all</a>
|
90
|
-
<a href="#M000024">do_search</a>
|
91
|
-
<a href="#M000029">email_exists?</a>
|
92
|
-
<a href="#M000027">find_and_activate!</a>
|
93
|
-
<a href="#M000025">inactive_count</a>
|
94
|
-
<a href="#M000028">login_exists?</a>
|
95
|
-
</div>
|
96
|
-
</div>
|
97
|
-
|
98
|
-
</div>
|
99
|
-
|
100
|
-
|
101
|
-
<!-- if includes -->
|
102
|
-
|
103
|
-
<div id="section">
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
<!-- if method_list -->
|
113
|
-
<div id="methods">
|
114
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
115
|
-
|
116
|
-
<div id="method-M000026" class="method-detail">
|
117
|
-
<a name="M000026"></a>
|
118
|
-
|
119
|
-
<div class="method-heading">
|
120
|
-
<a href="#M000026" class="method-signature">
|
121
|
-
<span class="method-name">activate_all</span><span class="method-args">()</span>
|
122
|
-
</a>
|
123
|
-
</div>
|
124
|
-
|
125
|
-
<div class="method-description">
|
126
|
-
<p><a class="source-toggle" href="#"
|
127
|
-
onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
|
128
|
-
<div class="method-source-code" id="M000026-source">
|
129
|
-
<pre>
|
130
|
-
<span class="ruby-comment cmt"># File lib/active_record/acts/muck_user.rb, line 54</span>
|
131
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">activate_all</span>
|
132
|
-
<span class="ruby-constant">User</span>.<span class="ruby-identifier">update_all</span>(<span class="ruby-node">"activated_at = '#{Time.now}'"</span>, <span class="ruby-value str">'activated_at IS NULL'</span>)
|
133
|
-
<span class="ruby-keyword kw">end</span>
|
134
|
-
</pre>
|
135
|
-
</div>
|
136
|
-
</div>
|
137
|
-
</div>
|
138
|
-
|
139
|
-
<div id="method-M000024" class="method-detail">
|
140
|
-
<a name="M000024"></a>
|
141
|
-
|
142
|
-
<div class="method-heading">
|
143
|
-
<a href="#M000024" class="method-signature">
|
144
|
-
<span class="method-name">do_search</span><span class="method-args">(query)</span>
|
145
|
-
</a>
|
146
|
-
</div>
|
147
|
-
|
148
|
-
<div class="method-description">
|
149
|
-
<p><a class="source-toggle" href="#"
|
150
|
-
onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
|
151
|
-
<div class="method-source-code" id="M000024-source">
|
152
|
-
<pre>
|
153
|
-
<span class="ruby-comment cmt"># File lib/active_record/acts/muck_user.rb, line 46</span>
|
154
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">do_search</span>(<span class="ruby-identifier">query</span>)
|
155
|
-
<span class="ruby-constant">User</span>.<span class="ruby-identifier">search</span>(<span class="ruby-identifier">query</span>)
|
156
|
-
<span class="ruby-keyword kw">end</span>
|
157
|
-
</pre>
|
158
|
-
</div>
|
159
|
-
</div>
|
160
|
-
</div>
|
161
|
-
|
162
|
-
<div id="method-M000029" class="method-detail">
|
163
|
-
<a name="M000029"></a>
|
164
|
-
|
165
|
-
<div class="method-heading">
|
166
|
-
<a href="#M000029" class="method-signature">
|
167
|
-
<span class="method-name">email_exists?</span><span class="method-args">(email)</span>
|
168
|
-
</a>
|
169
|
-
</div>
|
170
|
-
|
171
|
-
<div class="method-description">
|
172
|
-
<p>
|
173
|
-
checks to see if a given email is already in the database
|
174
|
-
</p>
|
175
|
-
<p><a class="source-toggle" href="#"
|
176
|
-
onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
|
177
|
-
<div class="method-source-code" id="M000029-source">
|
178
|
-
<pre>
|
179
|
-
<span class="ruby-comment cmt"># File lib/active_record/acts/muck_user.rb, line 82</span>
|
180
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">email_exists?</span>(<span class="ruby-identifier">email</span>)
|
181
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-constant">User</span>.<span class="ruby-identifier">find_by_email</span>(<span class="ruby-identifier">email</span>).<span class="ruby-identifier">nil?</span>
|
182
|
-
<span class="ruby-keyword kw">false</span>
|
183
|
-
<span class="ruby-keyword kw">else</span>
|
184
|
-
<span class="ruby-keyword kw">true</span>
|
185
|
-
<span class="ruby-keyword kw">end</span>
|
186
|
-
<span class="ruby-keyword kw">end</span>
|
187
|
-
</pre>
|
188
|
-
</div>
|
189
|
-
</div>
|
190
|
-
</div>
|
191
|
-
|
192
|
-
<div id="method-M000027" class="method-detail">
|
193
|
-
<a name="M000027"></a>
|
194
|
-
|
195
|
-
<div class="method-heading">
|
196
|
-
<a href="#M000027" class="method-signature">
|
197
|
-
<span class="method-name">find_and_activate!</span><span class="method-args">(activation_code)</span>
|
198
|
-
</a>
|
199
|
-
</div>
|
200
|
-
|
201
|
-
<div class="method-description">
|
202
|
-
<p>
|
203
|
-
Finds the user with the corresponding activation code, activates their
|
204
|
-
account and returns the user.
|
205
|
-
</p>
|
206
|
-
<p>
|
207
|
-
Raises:
|
208
|
-
</p>
|
209
|
-
<pre>
|
210
|
-
+User::ActivationCodeNotFound+ if there is no user with the corresponding activation code
|
211
|
-
+User::AlreadyActivated+ if the user with the corresponding activation code has already activated their account
|
212
|
-
</pre>
|
213
|
-
<p><a class="source-toggle" href="#"
|
214
|
-
onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
|
215
|
-
<div class="method-source-code" id="M000027-source">
|
216
|
-
<pre>
|
217
|
-
<span class="ruby-comment cmt"># File lib/active_record/acts/muck_user.rb, line 63</span>
|
218
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_and_activate!</span>(<span class="ruby-identifier">activation_code</span>)
|
219
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">activation_code</span>.<span class="ruby-identifier">nil?</span>
|
220
|
-
<span class="ruby-identifier">user</span> = <span class="ruby-identifier">find_by_activation_code</span>(<span class="ruby-identifier">activation_code</span>)
|
221
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ActivationCodeNotFound</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">user</span>
|
222
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">AlreadyActivated</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">user</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">active?</span>
|
223
|
-
<span class="ruby-identifier">user</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:activate!</span>)
|
224
|
-
<span class="ruby-identifier">user</span>
|
225
|
-
<span class="ruby-keyword kw">end</span>
|
226
|
-
</pre>
|
227
|
-
</div>
|
228
|
-
</div>
|
229
|
-
</div>
|
230
|
-
|
231
|
-
<div id="method-M000025" class="method-detail">
|
232
|
-
<a name="M000025"></a>
|
233
|
-
|
234
|
-
<div class="method-heading">
|
235
|
-
<a href="#M000025" class="method-signature">
|
236
|
-
<span class="method-name">inactive_count</span><span class="method-args">()</span>
|
237
|
-
</a>
|
238
|
-
</div>
|
239
|
-
|
240
|
-
<div class="method-description">
|
241
|
-
<p><a class="source-toggle" href="#"
|
242
|
-
onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
|
243
|
-
<div class="method-source-code" id="M000025-source">
|
244
|
-
<pre>
|
245
|
-
<span class="ruby-comment cmt"># File lib/active_record/acts/muck_user.rb, line 50</span>
|
246
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inactive_count</span>
|
247
|
-
<span class="ruby-constant">User</span>.<span class="ruby-identifier">count</span> <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"activated_at is null"</span>
|
248
|
-
<span class="ruby-keyword kw">end</span>
|
249
|
-
</pre>
|
250
|
-
</div>
|
251
|
-
</div>
|
252
|
-
</div>
|
253
|
-
|
254
|
-
<div id="method-M000028" class="method-detail">
|
255
|
-
<a name="M000028"></a>
|
256
|
-
|
257
|
-
<div class="method-heading">
|
258
|
-
<a href="#M000028" class="method-signature">
|
259
|
-
<span class="method-name">login_exists?</span><span class="method-args">(login)</span>
|
260
|
-
</a>
|
261
|
-
</div>
|
262
|
-
|
263
|
-
<div class="method-description">
|
264
|
-
<p>
|
265
|
-
checks to see if a given login is already in the database
|
266
|
-
</p>
|
267
|
-
<p><a class="source-toggle" href="#"
|
268
|
-
onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
|
269
|
-
<div class="method-source-code" id="M000028-source">
|
270
|
-
<pre>
|
271
|
-
<span class="ruby-comment cmt"># File lib/active_record/acts/muck_user.rb, line 73</span>
|
272
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">login_exists?</span>(<span class="ruby-identifier">login</span>)
|
273
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-constant">User</span>.<span class="ruby-identifier">find_by_login</span>(<span class="ruby-identifier">login</span>).<span class="ruby-identifier">nil?</span>
|
274
|
-
<span class="ruby-keyword kw">false</span>
|
275
|
-
<span class="ruby-keyword kw">else</span>
|
276
|
-
<span class="ruby-keyword kw">true</span>
|
277
|
-
<span class="ruby-keyword kw">end</span>
|
278
|
-
<span class="ruby-keyword kw">end</span>
|
279
|
-
</pre>
|
280
|
-
</div>
|
281
|
-
</div>
|
282
|
-
</div>
|
283
|
-
|
284
|
-
|
285
|
-
</div>
|
286
|
-
|
287
|
-
|
288
|
-
</div>
|
289
|
-
|
290
|
-
|
291
|
-
<div id="validator-badges">
|
292
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
293
|
-
</div>
|
294
|
-
|
295
|
-
</body>
|
296
|
-
</html>
|
@@ -1,216 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Module: ActiveRecord::SecureMethods</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Module</strong></td>
|
53
|
-
<td class="class-name-in-header">ActiveRecord::SecureMethods</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/active_record/secure_methods_rb.html">
|
59
|
-
lib/active_record/secure_methods.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
</table>
|
66
|
-
</div>
|
67
|
-
<!-- banner header -->
|
68
|
-
|
69
|
-
<div id="bodyContent">
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
<div id="contextContent">
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
</div>
|
78
|
-
|
79
|
-
<div id="method-list">
|
80
|
-
<h3 class="section-bar">Methods</h3>
|
81
|
-
|
82
|
-
<div class="name-list">
|
83
|
-
<a href="#M000050">check</a>
|
84
|
-
<a href="#M000047">check_creator</a>
|
85
|
-
<a href="#M000049">check_sharer</a>
|
86
|
-
<a href="#M000048">check_user</a>
|
87
|
-
</div>
|
88
|
-
</div>
|
89
|
-
|
90
|
-
</div>
|
91
|
-
|
92
|
-
|
93
|
-
<!-- if includes -->
|
94
|
-
|
95
|
-
<div id="section">
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
<!-- if method_list -->
|
105
|
-
<div id="methods">
|
106
|
-
<h3 class="section-bar">Protected Instance methods</h3>
|
107
|
-
|
108
|
-
<div id="method-M000050" class="method-detail">
|
109
|
-
<a name="M000050"></a>
|
110
|
-
|
111
|
-
<div class="method-heading">
|
112
|
-
<a href="#M000050" class="method-signature">
|
113
|
-
<span class="method-name">check</span><span class="method-args">(user, field)</span>
|
114
|
-
</a>
|
115
|
-
</div>
|
116
|
-
|
117
|
-
<div class="method-description">
|
118
|
-
<p><a class="source-toggle" href="#"
|
119
|
-
onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
|
120
|
-
<div class="method-source-code" id="M000050-source">
|
121
|
-
<pre>
|
122
|
-
<span class="ruby-comment cmt"># File lib/active_record/secure_methods.rb, line 18</span>
|
123
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check</span>(<span class="ruby-identifier">user</span>, <span class="ruby-identifier">field</span>)
|
124
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">user</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">user</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">:false</span>
|
125
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">field</span>) <span class="ruby-operator">==</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">admin?</span>
|
126
|
-
<span class="ruby-keyword kw">else</span>
|
127
|
-
<span class="ruby-keyword kw">false</span>
|
128
|
-
<span class="ruby-keyword kw">end</span>
|
129
|
-
<span class="ruby-keyword kw">end</span>
|
130
|
-
</pre>
|
131
|
-
</div>
|
132
|
-
</div>
|
133
|
-
</div>
|
134
|
-
|
135
|
-
<div id="method-M000047" class="method-detail">
|
136
|
-
<a name="M000047"></a>
|
137
|
-
|
138
|
-
<div class="method-heading">
|
139
|
-
<a href="#M000047" class="method-signature">
|
140
|
-
<span class="method-name">check_creator</span><span class="method-args">(user)</span>
|
141
|
-
</a>
|
142
|
-
</div>
|
143
|
-
|
144
|
-
<div class="method-description">
|
145
|
-
<p><a class="source-toggle" href="#"
|
146
|
-
onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
|
147
|
-
<div class="method-source-code" id="M000047-source">
|
148
|
-
<pre>
|
149
|
-
<span class="ruby-comment cmt"># File lib/active_record/secure_methods.rb, line 6</span>
|
150
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_creator</span>(<span class="ruby-identifier">user</span>)
|
151
|
-
<span class="ruby-identifier">check</span>(<span class="ruby-identifier">user</span>, <span class="ruby-identifier">:creator_id</span>)
|
152
|
-
<span class="ruby-keyword kw">end</span>
|
153
|
-
</pre>
|
154
|
-
</div>
|
155
|
-
</div>
|
156
|
-
</div>
|
157
|
-
|
158
|
-
<div id="method-M000049" class="method-detail">
|
159
|
-
<a name="M000049"></a>
|
160
|
-
|
161
|
-
<div class="method-heading">
|
162
|
-
<a href="#M000049" class="method-signature">
|
163
|
-
<span class="method-name">check_sharer</span><span class="method-args">(user)</span>
|
164
|
-
</a>
|
165
|
-
</div>
|
166
|
-
|
167
|
-
<div class="method-description">
|
168
|
-
<p><a class="source-toggle" href="#"
|
169
|
-
onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
|
170
|
-
<div class="method-source-code" id="M000049-source">
|
171
|
-
<pre>
|
172
|
-
<span class="ruby-comment cmt"># File lib/active_record/secure_methods.rb, line 14</span>
|
173
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_sharer</span>(<span class="ruby-identifier">user</span>)
|
174
|
-
<span class="ruby-identifier">check</span>(<span class="ruby-identifier">user</span>, <span class="ruby-identifier">:shared_by_id</span>)
|
175
|
-
<span class="ruby-keyword kw">end</span>
|
176
|
-
</pre>
|
177
|
-
</div>
|
178
|
-
</div>
|
179
|
-
</div>
|
180
|
-
|
181
|
-
<div id="method-M000048" class="method-detail">
|
182
|
-
<a name="M000048"></a>
|
183
|
-
|
184
|
-
<div class="method-heading">
|
185
|
-
<a href="#M000048" class="method-signature">
|
186
|
-
<span class="method-name">check_user</span><span class="method-args">(user)</span>
|
187
|
-
</a>
|
188
|
-
</div>
|
189
|
-
|
190
|
-
<div class="method-description">
|
191
|
-
<p><a class="source-toggle" href="#"
|
192
|
-
onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
|
193
|
-
<div class="method-source-code" id="M000048-source">
|
194
|
-
<pre>
|
195
|
-
<span class="ruby-comment cmt"># File lib/active_record/secure_methods.rb, line 10</span>
|
196
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_user</span>(<span class="ruby-identifier">user</span>)
|
197
|
-
<span class="ruby-identifier">check</span>(<span class="ruby-identifier">user</span>, <span class="ruby-identifier">:user_id</span>)
|
198
|
-
<span class="ruby-keyword kw">end</span>
|
199
|
-
</pre>
|
200
|
-
</div>
|
201
|
-
</div>
|
202
|
-
</div>
|
203
|
-
|
204
|
-
|
205
|
-
</div>
|
206
|
-
|
207
|
-
|
208
|
-
</div>
|
209
|
-
|
210
|
-
|
211
|
-
<div id="validator-badges">
|
212
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
213
|
-
</div>
|
214
|
-
|
215
|
-
</body>
|
216
|
-
</html>
|