mack-data_mapper 0.7.0.1 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/doc/classes/Mack.html +8 -0
  2. data/doc/classes/Mack/{Testing/Helpers.html → DataMapper/Session.html} +24 -18
  3. data/doc/classes/Mack/Database.html +35 -35
  4. data/doc/classes/Mack/Database/Generators.html +6 -6
  5. data/doc/classes/Mack/Database/Migrations.html +24 -24
  6. data/doc/classes/Mack/SessionStore/DataMapper.html +262 -0
  7. data/doc/classes/Mack/Testing/DataMapperHelpers.html +21 -21
  8. data/doc/classes/Mack/ViewHelpers/DataMapperHelpers.html +1 -1
  9. data/doc/created.rid +1 -1
  10. data/doc/files/README.html +1 -1
  11. data/doc/files/lib/mack-data_mapper/database_migrations_rb.html +1 -1
  12. data/doc/files/lib/mack-data_mapper/database_rb.html +1 -1
  13. data/doc/files/lib/mack-data_mapper/dm_patches/dm-timestamps_rb.html +16 -1
  14. data/doc/files/lib/mack-data_mapper/dm_patches/migrations_rb.html +1 -1
  15. data/doc/files/lib/mack-data_mapper/dm_patches/model_rb.html +58 -1
  16. data/doc/files/lib/mack-data_mapper/dm_patches/property_set_rb.html +25 -1
  17. data/doc/files/lib/mack-data_mapper/dm_patches/validations_rb.html +25 -1
  18. data/doc/files/lib/mack-data_mapper/generators_rb.html +1 -1
  19. data/doc/files/lib/mack-data_mapper/helpers/orm_helpers_rb.html +1 -1
  20. data/doc/files/lib/mack-data_mapper/migration_generator/migration_generator_rb.html +1 -1
  21. data/doc/files/lib/mack-data_mapper/model_generator/model_generator_rb.html +1 -1
  22. data/doc/files/lib/mack-data_mapper/resource_rb.html +1 -1
  23. data/doc/files/lib/mack-data_mapper/runner_rb.html +1 -1
  24. data/doc/files/lib/mack-data_mapper/sessions/data_mapper_session_store_rb.html +101 -0
  25. data/doc/files/lib/mack-data_mapper/sessions/session_rb.html +101 -0
  26. data/doc/files/lib/mack-data_mapper/test_extensions_rb.html +1 -1
  27. data/doc/files/lib/mack-data_mapper_rb.html +1 -1
  28. data/doc/files/lib/mack-data_mapper_tasks_rb.html +1 -1
  29. data/doc/fr_class_index.html +2 -1
  30. data/doc/fr_file_index.html +2 -0
  31. data/doc/fr_method_index.html +14 -10
  32. data/lib/mack-data_mapper.rb +11 -7
  33. data/lib/mack-data_mapper/database.rb +8 -8
  34. data/lib/mack-data_mapper/database_migrations.rb +6 -6
  35. data/lib/mack-data_mapper/dm_patches/dm-timestamps.rb +6 -6
  36. data/lib/mack-data_mapper/dm_patches/model.rb +48 -48
  37. data/lib/mack-data_mapper/dm_patches/property_set.rb +15 -15
  38. data/lib/mack-data_mapper/dm_patches/validations.rb +15 -15
  39. data/lib/mack-data_mapper/helpers/orm_helpers.rb +1 -1
  40. data/lib/mack-data_mapper/sessions/data_mapper_session_store.rb +62 -0
  41. data/lib/mack-data_mapper/sessions/session.rb +14 -0
  42. data/lib/mack-data_mapper/test_extensions.rb +0 -9
  43. metadata +17 -22
@@ -70,6 +70,14 @@
70
70
  <a href="../files/lib/mack-data_mapper/helpers/orm_helpers_rb.html">
71
71
  lib/mack-data_mapper/helpers/orm_helpers.rb
72
72
  </a>
73
+ <br />
74
+ <a href="../files/lib/mack-data_mapper/sessions/data_mapper_session_store_rb.html">
75
+ lib/mack-data_mapper/sessions/data_mapper_session_store.rb
76
+ </a>
77
+ <br />
78
+ <a href="../files/lib/mack-data_mapper/sessions/session_rb.html">
79
+ lib/mack-data_mapper/sessions/session.rb
80
+ </a>
73
81
  <br />
74
82
  <a href="../files/lib/mack-data_mapper/test_extensions_rb.html">
75
83
  lib/mack-data_mapper/test_extensions.rb
@@ -5,7 +5,7 @@
5
5
 
6
6
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
7
  <head>
8
- <title>Module: Mack::Testing::Helpers</title>
8
+ <title>Class: Mack::DataMapper::Session</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
11
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
@@ -49,19 +49,25 @@
49
49
  <div id="classHeader">
50
50
  <table class="header-table">
51
51
  <tr class="top-aligned-row">
52
- <td><strong>Module</strong></td>
53
- <td class="class-name-in-header">Mack::Testing::Helpers</td>
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Mack::DataMapper::Session</td>
54
54
  </tr>
55
55
  <tr class="top-aligned-row">
56
56
  <td><strong>In:</strong></td>
57
57
  <td>
58
- <a href="../../../files/lib/mack-data_mapper/test_extensions_rb.html">
59
- lib/mack-data_mapper/test_extensions.rb
58
+ <a href="../../../files/lib/mack-data_mapper/sessions/session_rb.html">
59
+ lib/mack-data_mapper/sessions/session.rb
60
60
  </a>
61
61
  <br />
62
62
  </td>
63
63
  </tr>
64
64
 
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Object
69
+ </td>
70
+ </tr>
65
71
  </table>
66
72
  </div>
67
73
  <!-- banner header -->
@@ -72,6 +78,12 @@
72
78
 
73
79
  <div id="contextContent">
74
80
 
81
+ <div id="description">
82
+ <p>
83
+ Used to store the Mack::Session object in the db.
84
+ </p>
85
+
86
+ </div>
75
87
 
76
88
 
77
89
  </div>
@@ -81,24 +93,18 @@
81
93
 
82
94
 
83
95
  <!-- if includes -->
96
+ <div id="includes">
97
+ <h3 class="section-bar">Included Modules</h3>
84
98
 
85
- <div id="section">
99
+ <div id="includes-list">
100
+ <span class="include-name"><a href="../../DataMapper/Resource.html">::DataMapper::Resource</a></span>
101
+ </div>
102
+ </div>
86
103
 
104
+ <div id="section">
87
105
 
88
106
 
89
- <div id="aliases-list">
90
- <h3 class="section-bar">External Aliases</h3>
91
107
 
92
- <div class="name-list">
93
- <table summary="aliases">
94
- <tr class="top-aligned-row context-row">
95
- <td class="context-item-name">rake_task</td>
96
- <td>-&gt;</td>
97
- <td class="context-item-value">mack_rake_task</td>
98
- </tr>
99
- </table>
100
- </div>
101
- </div>
102
108
 
103
109
 
104
110
 
@@ -88,11 +88,11 @@
88
88
  <h3 class="section-bar">Methods</h3>
89
89
 
90
90
  <div class="name-list">
91
- <a href="#M000004">create</a>&nbsp;&nbsp;
92
- <a href="#M000005">drop</a>&nbsp;&nbsp;
93
- <a href="#M000007">dump_structure</a>&nbsp;&nbsp;
94
- <a href="#M000003">establish_connection</a>&nbsp;&nbsp;
95
- <a href="#M000006">load_structure</a>&nbsp;&nbsp;
91
+ <a href="#M000008">create</a>&nbsp;&nbsp;
92
+ <a href="#M000009">drop</a>&nbsp;&nbsp;
93
+ <a href="#M000011">dump_structure</a>&nbsp;&nbsp;
94
+ <a href="#M000007">establish_connection</a>&nbsp;&nbsp;
95
+ <a href="#M000010">load_structure</a>&nbsp;&nbsp;
96
96
  </div>
97
97
  </div>
98
98
 
@@ -121,11 +121,11 @@ Module <a href="Database/Migrations.html" class="link">Mack::Database::Migration
121
121
  <div id="methods">
122
122
  <h3 class="section-bar">Public Class methods</h3>
123
123
 
124
- <div id="method-M000004" class="method-detail">
125
- <a name="M000004"></a>
124
+ <div id="method-M000008" class="method-detail">
125
+ <a name="M000008"></a>
126
126
 
127
127
  <div class="method-heading">
128
- <a href="#M000004" class="method-signature">
128
+ <a href="#M000008" class="method-signature">
129
129
  <span class="method-name">create</span><span class="method-args">(env = Mack.env, repis = :default)</span>
130
130
  </a>
131
131
  </div>
@@ -136,8 +136,8 @@ Creates a database, if it doesn&#8216;t already exist for the specified
136
136
  environment
137
137
  </p>
138
138
  <p><a class="source-toggle" href="#"
139
- onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
140
- <div class="method-source-code" id="M000004-source">
139
+ onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
140
+ <div class="method-source-code" id="M000008-source">
141
141
  <pre>
142
142
  <span class="ruby-comment cmt"># File lib/mack-data_mapper/database.rb, line 20</span>
143
143
  20: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create</span>(<span class="ruby-identifier">env</span> = <span class="ruby-constant">Mack</span>.<span class="ruby-identifier">env</span>, <span class="ruby-identifier">repis</span> = <span class="ruby-identifier">:default</span>)
@@ -149,11 +149,11 @@ environment
149
149
  </div>
150
150
  </div>
151
151
 
152
- <div id="method-M000005" class="method-detail">
153
- <a name="M000005"></a>
152
+ <div id="method-M000009" class="method-detail">
153
+ <a name="M000009"></a>
154
154
 
155
155
  <div class="method-heading">
156
- <a href="#M000005" class="method-signature">
156
+ <a href="#M000009" class="method-signature">
157
157
  <span class="method-name">drop</span><span class="method-args">(env = Mack.env, repis = :default)</span>
158
158
  </a>
159
159
  </div>
@@ -163,8 +163,8 @@ environment
163
163
  Drops a database, if it exists for the specified environment
164
164
  </p>
165
165
  <p><a class="source-toggle" href="#"
166
- onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
167
- <div class="method-source-code" id="M000005-source">
166
+ onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
167
+ <div class="method-source-code" id="M000009-source">
168
168
  <pre>
169
169
  <span class="ruby-comment cmt"># File lib/mack-data_mapper/database.rb, line 26</span>
170
170
  26: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">drop</span>(<span class="ruby-identifier">env</span> = <span class="ruby-constant">Mack</span>.<span class="ruby-identifier">env</span>, <span class="ruby-identifier">repis</span> = <span class="ruby-identifier">:default</span>)
@@ -176,11 +176,11 @@ Drops a database, if it exists for the specified environment
176
176
  </div>
177
177
  </div>
178
178
 
179
- <div id="method-M000007" class="method-detail">
180
- <a name="M000007"></a>
179
+ <div id="method-M000011" class="method-detail">
180
+ <a name="M000011"></a>
181
181
 
182
182
  <div class="method-heading">
183
- <a href="#M000007" class="method-signature">
183
+ <a href="#M000011" class="method-signature">
184
184
  <span class="method-name">dump_structure</span><span class="method-args">(env = Mack.env, repis = :default)</span>
185
185
  </a>
186
186
  </div>
@@ -190,8 +190,8 @@ Drops a database, if it exists for the specified environment
190
190
  Dumps the structure of the database to a file.
191
191
  </p>
192
192
  <p><a class="source-toggle" href="#"
193
- onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
194
- <div class="method-source-code" id="M000007-source">
193
+ onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
194
+ <div class="method-source-code" id="M000011-source">
195
195
  <pre>
196
196
  <span class="ruby-comment cmt"># File lib/mack-data_mapper/database.rb, line 48</span>
197
197
  48: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dump_structure</span>(<span class="ruby-identifier">env</span> = <span class="ruby-constant">Mack</span>.<span class="ruby-identifier">env</span>, <span class="ruby-identifier">repis</span> = <span class="ruby-identifier">:default</span>)
@@ -199,7 +199,7 @@ Dumps the structure of the database to a file.
199
199
  50: <span class="ruby-identifier">adapter</span> = <span class="ruby-identifier">repository</span>(<span class="ruby-identifier">repis</span>).<span class="ruby-identifier">adapter</span>
200
200
  51: <span class="ruby-identifier">uri</span> = <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">uri</span>
201
201
  52: <span class="ruby-identifier">structure</span> = <span class="ruby-value str">&quot;&quot;</span>
202
- 53: <span class="ruby-identifier">output_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Mack</span>.<span class="ruby-identifier">root</span>, <span class="ruby-value str">&quot;db&quot;</span>, <span class="ruby-node">&quot;#{env}_schema_structure.sql&quot;</span>)
202
+ 53: <span class="ruby-identifier">output_file</span> = <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Paths</span>.<span class="ruby-identifier">db</span>(<span class="ruby-node">&quot;#{env}_schema_structure.sql&quot;</span>)
203
203
  54: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>
204
204
  55: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Mysql/</span>
205
205
  56: <span class="ruby-identifier">sql</span> = <span class="ruby-value str">&quot;SHOW TABLES&quot;</span>
@@ -212,7 +212,7 @@ Dumps the structure of the database to a file.
212
212
  63: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Postgres/</span>
213
213
  64: <span class="ruby-node">`pg_dump -i -U &quot;#{uri.user}&quot; -s -x -O -n #{ENV[&quot;SCHEMA&quot;] ||= &quot;public&quot;} -f #{output_file} #{uri.basename}`</span>
214
214
  65: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Sqlite3/</span>
215
- 66: <span class="ruby-identifier">db_dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Mack</span>.<span class="ruby-identifier">root</span>, <span class="ruby-value str">&quot;db&quot;</span>)
215
+ 66: <span class="ruby-identifier">db_dir</span> = <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Paths</span>.<span class="ruby-identifier">db</span>
216
216
  67: <span class="ruby-node">`sqlite3 #{File.join(db_dir, uri.basename)} .schema &gt; #{output_file}`</span>
217
217
  68: <span class="ruby-keyword kw">else</span>
218
218
  69: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Task not supported for '#{repository(repis).adapter.class.name}'&quot;</span>
@@ -223,11 +223,11 @@ Dumps the structure of the database to a file.
223
223
  </div>
224
224
  </div>
225
225
 
226
- <div id="method-M000003" class="method-detail">
227
- <a name="M000003"></a>
226
+ <div id="method-M000007" class="method-detail">
227
+ <a name="M000007"></a>
228
228
 
229
229
  <div class="method-heading">
230
- <a href="#M000003" class="method-signature">
230
+ <a href="#M000007" class="method-signature">
231
231
  <span class="method-name">establish_connection</span><span class="method-args">(env = Mack.env)</span>
232
232
  </a>
233
233
  </div>
@@ -238,20 +238,20 @@ Sets up and establishes connections to the database based on the specified
238
238
  environment and the settings in the database.yml file.
239
239
  </p>
240
240
  <p><a class="source-toggle" href="#"
241
- onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
242
- <div class="method-source-code" id="M000003-source">
241
+ onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
242
+ <div class="method-source-code" id="M000007-source">
243
243
  <pre>
244
244
  <span class="ruby-comment cmt"># File lib/mack-data_mapper/database.rb, line 6</span>
245
245
  6: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">establish_connection</span>(<span class="ruby-identifier">env</span> = <span class="ruby-constant">Mack</span>.<span class="ruby-identifier">env</span>)
246
- 7: <span class="ruby-identifier">dbs</span> = <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">IO</span>.<span class="ruby-identifier">read</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Mack</span>.<span class="ruby-identifier">root</span>, <span class="ruby-value str">&quot;config&quot;</span>, <span class="ruby-value str">&quot;database.yml&quot;</span>))).<span class="ruby-identifier">result</span>)
246
+ 7: <span class="ruby-identifier">dbs</span> = <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">IO</span>.<span class="ruby-identifier">read</span>(<span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Paths</span>.<span class="ruby-identifier">config</span>(<span class="ruby-value str">&quot;database.yml&quot;</span>))).<span class="ruby-identifier">result</span>)
247
247
  8: <span class="ruby-identifier">settings</span> = <span class="ruby-identifier">dbs</span>[<span class="ruby-identifier">env</span>]
248
248
  9: <span class="ruby-identifier">settings</span>.<span class="ruby-identifier">symbolize_keys!</span>
249
249
  10: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">settings</span>[<span class="ruby-identifier">:default</span>]
250
250
  11: <span class="ruby-identifier">settings</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
251
- 12: <span class="ruby-constant">DataMapper</span>.<span class="ruby-identifier">setup</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>.<span class="ruby-identifier">symbolize_keys</span>)
251
+ 12: <span class="ruby-operator">::</span><span class="ruby-constant">DataMapper</span>.<span class="ruby-identifier">setup</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>.<span class="ruby-identifier">symbolize_keys</span>)
252
252
  13: <span class="ruby-keyword kw">end</span>
253
253
  14: <span class="ruby-keyword kw">else</span>
254
- 15: <span class="ruby-constant">DataMapper</span>.<span class="ruby-identifier">setup</span>(<span class="ruby-identifier">:default</span>, <span class="ruby-identifier">settings</span>)
254
+ 15: <span class="ruby-operator">::</span><span class="ruby-constant">DataMapper</span>.<span class="ruby-identifier">setup</span>(<span class="ruby-identifier">:default</span>, <span class="ruby-identifier">settings</span>)
255
255
  16: <span class="ruby-keyword kw">end</span>
256
256
  17: <span class="ruby-keyword kw">end</span>
257
257
  </pre>
@@ -259,11 +259,11 @@ environment and the settings in the database.yml file.
259
259
  </div>
260
260
  </div>
261
261
 
262
- <div id="method-M000006" class="method-detail">
263
- <a name="M000006"></a>
262
+ <div id="method-M000010" class="method-detail">
263
+ <a name="M000010"></a>
264
264
 
265
265
  <div class="method-heading">
266
- <a href="#M000006" class="method-signature">
266
+ <a href="#M000010" class="method-signature">
267
267
  <span class="method-name">load_structure</span><span class="method-args">(file, env = Mack.env, repis = :default)</span>
268
268
  </a>
269
269
  </div>
@@ -273,8 +273,8 @@ environment and the settings in the database.yml file.
273
273
  Loads the structure of the given file into the database
274
274
  </p>
275
275
  <p><a class="source-toggle" href="#"
276
- onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
277
- <div class="method-source-code" id="M000006-source">
276
+ onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
277
+ <div class="method-source-code" id="M000010-source">
278
278
  <pre>
279
279
  <span class="ruby-comment cmt"># File lib/mack-data_mapper/database.rb, line 32</span>
280
280
  32: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_structure</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">env</span> = <span class="ruby-constant">Mack</span>.<span class="ruby-identifier">env</span>, <span class="ruby-identifier">repis</span> = <span class="ruby-identifier">:default</span>)
@@ -80,7 +80,7 @@
80
80
  <h3 class="section-bar">Methods</h3>
81
81
 
82
82
  <div class="name-list">
83
- <a href="#M000008">controller_template_location</a>&nbsp;&nbsp;
83
+ <a href="#M000012">controller_template_location</a>&nbsp;&nbsp;
84
84
  </div>
85
85
  </div>
86
86
 
@@ -102,19 +102,19 @@
102
102
  <div id="methods">
103
103
  <h3 class="section-bar">Public Class methods</h3>
104
104
 
105
- <div id="method-M000008" class="method-detail">
106
- <a name="M000008"></a>
105
+ <div id="method-M000012" class="method-detail">
106
+ <a name="M000012"></a>
107
107
 
108
108
  <div class="method-heading">
109
- <a href="#M000008" class="method-signature">
109
+ <a href="#M000012" class="method-signature">
110
110
  <span class="method-name">controller_template_location</span><span class="method-args">()</span>
111
111
  </a>
112
112
  </div>
113
113
 
114
114
  <div class="method-description">
115
115
  <p><a class="source-toggle" href="#"
116
- onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
117
- <div class="method-source-code" id="M000008-source">
116
+ onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
117
+ <div class="method-source-code" id="M000012-source">
118
118
  <pre>
119
119
  <span class="ruby-comment cmt"># File lib/mack-data_mapper/generators.rb, line 5</span>
120
120
  5: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">controller_template_location</span>
@@ -80,9 +80,9 @@
80
80
  <h3 class="section-bar">Methods</h3>
81
81
 
82
82
  <div class="name-list">
83
- <a href="#M000011">abort_if_pending_migrations</a>&nbsp;&nbsp;
84
- <a href="#M000009">migrate</a>&nbsp;&nbsp;
85
- <a href="#M000010">rollback</a>&nbsp;&nbsp;
83
+ <a href="#M000015">abort_if_pending_migrations</a>&nbsp;&nbsp;
84
+ <a href="#M000013">migrate</a>&nbsp;&nbsp;
85
+ <a href="#M000014">rollback</a>&nbsp;&nbsp;
86
86
  </div>
87
87
  </div>
88
88
 
@@ -104,38 +104,38 @@
104
104
  <div id="methods">
105
105
  <h3 class="section-bar">Public Class methods</h3>
106
106
 
107
- <div id="method-M000011" class="method-detail">
108
- <a name="M000011"></a>
107
+ <div id="method-M000015" class="method-detail">
108
+ <a name="M000015"></a>
109
109
 
110
110
  <div class="method-heading">
111
- <a href="#M000011" class="method-signature">
111
+ <a href="#M000015" class="method-signature">
112
112
  <span class="method-name">abort_if_pending_migrations</span><span class="method-args">()</span>
113
113
  </a>
114
114
  </div>
115
115
 
116
116
  <div class="method-description">
117
117
  <p><a class="source-toggle" href="#"
118
- onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
119
- <div class="method-source-code" id="M000011-source">
118
+ onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
119
+ <div class="method-source-code" id="M000015-source">
120
120
  <pre>
121
121
  <span class="ruby-comment cmt"># File lib/mack-data_mapper/database_migrations.rb, line 25</span>
122
122
  25: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">abort_if_pending_migrations</span>
123
123
  26: <span class="ruby-identifier">migration_files</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mig</span><span class="ruby-operator">|</span> <span class="ruby-identifier">load</span> <span class="ruby-identifier">mig</span> }
124
- 27: <span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">MigrationRunner</span>.<span class="ruby-identifier">migrations</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mig</span><span class="ruby-operator">|</span>
124
+ 27: <span class="ruby-operator">::</span><span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">MigrationRunner</span>.<span class="ruby-identifier">migrations</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mig</span><span class="ruby-operator">|</span>
125
125
  28: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">UnrunMigrations</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">mig</span>.<span class="ruby-identifier">name</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mig</span>.<span class="ruby-identifier">send</span>(<span class="ruby-value str">&quot;needs_up?&quot;</span>)
126
126
  29: <span class="ruby-keyword kw">end</span>
127
- 30: <span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">MigrationRunner</span>.<span class="ruby-identifier">migrations</span>.<span class="ruby-identifier">clear</span>
127
+ 30: <span class="ruby-operator">::</span><span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">MigrationRunner</span>.<span class="ruby-identifier">migrations</span>.<span class="ruby-identifier">clear</span>
128
128
  31: <span class="ruby-keyword kw">end</span>
129
129
  </pre>
130
130
  </div>
131
131
  </div>
132
132
  </div>
133
133
 
134
- <div id="method-M000009" class="method-detail">
135
- <a name="M000009"></a>
134
+ <div id="method-M000013" class="method-detail">
135
+ <a name="M000013"></a>
136
136
 
137
137
  <div class="method-heading">
138
- <a href="#M000009" class="method-signature">
138
+ <a href="#M000013" class="method-signature">
139
139
  <span class="method-name">migrate</span><span class="method-args">()</span>
140
140
  </a>
141
141
  </div>
@@ -145,26 +145,26 @@
145
145
  Migrates the database to the latest version
146
146
  </p>
147
147
  <p><a class="source-toggle" href="#"
148
- onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
149
- <div class="method-source-code" id="M000009-source">
148
+ onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
149
+ <div class="method-source-code" id="M000013-source">
150
150
  <pre>
151
151
  <span class="ruby-comment cmt"># File lib/mack-data_mapper/database_migrations.rb, line 8</span>
152
152
  8: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">migrate</span>
153
153
  9: <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Database</span>.<span class="ruby-identifier">establish_connection</span>
154
- 10: <span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">MigrationRunner</span>.<span class="ruby-identifier">reset!</span>
154
+ 10: <span class="ruby-operator">::</span><span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">MigrationRunner</span>.<span class="ruby-identifier">reset!</span>
155
155
  11: <span class="ruby-identifier">migration_files</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mig</span><span class="ruby-operator">|</span> <span class="ruby-identifier">load</span> <span class="ruby-identifier">mig</span> }
156
- 12: <span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">MigrationRunner</span>.<span class="ruby-identifier">migrate_up!</span>
156
+ 12: <span class="ruby-operator">::</span><span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">MigrationRunner</span>.<span class="ruby-identifier">migrate_up!</span>
157
157
  13: <span class="ruby-keyword kw">end</span>
158
158
  </pre>
159
159
  </div>
160
160
  </div>
161
161
  </div>
162
162
 
163
- <div id="method-M000010" class="method-detail">
164
- <a name="M000010"></a>
163
+ <div id="method-M000014" class="method-detail">
164
+ <a name="M000014"></a>
165
165
 
166
166
  <div class="method-heading">
167
- <a href="#M000010" class="method-signature">
167
+ <a href="#M000014" class="method-signature">
168
168
  <span class="method-name">rollback</span><span class="method-args">(step = 1)</span>
169
169
  </a>
170
170
  </div>
@@ -174,14 +174,14 @@ Migrates the database to the latest version
174
174
  Rolls back the database by the specified number of steps. Default is 1
175
175
  </p>
176
176
  <p><a class="source-toggle" href="#"
177
- onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
178
- <div class="method-source-code" id="M000010-source">
177
+ onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
178
+ <div class="method-source-code" id="M000014-source">
179
179
  <pre>
180
180
  <span class="ruby-comment cmt"># File lib/mack-data_mapper/database_migrations.rb, line 16</span>
181
181
  16: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rollback</span>(<span class="ruby-identifier">step</span> = <span class="ruby-value">1</span>)
182
- 17: <span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">MigrationRunner</span>.<span class="ruby-identifier">reset!</span>
182
+ 17: <span class="ruby-operator">::</span><span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">MigrationRunner</span>.<span class="ruby-identifier">reset!</span>
183
183
  18: <span class="ruby-identifier">migration_files</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mig</span><span class="ruby-operator">|</span> <span class="ruby-identifier">load</span> <span class="ruby-identifier">mig</span> }
184
- 19: <span class="ruby-identifier">migrations</span> = <span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">MigrationRunner</span>.<span class="ruby-identifier">migrations</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">reverse</span>
184
+ 19: <span class="ruby-identifier">migrations</span> = <span class="ruby-operator">::</span><span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">MigrationRunner</span>.<span class="ruby-identifier">migrations</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">reverse</span>
185
185
  20: <span class="ruby-identifier">step</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
186
186
  21: <span class="ruby-identifier">migrations</span>[<span class="ruby-identifier">migrations</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)].<span class="ruby-identifier">perform_down</span>
187
187
  22: <span class="ruby-keyword kw">end</span>
@@ -0,0 +1,262 @@
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>Class: Mack::SessionStore::DataMapper</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>Class</strong></td>
53
+ <td class="class-name-in-header">Mack::SessionStore::DataMapper</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/mack-data_mapper/sessions/data_mapper_session_store_rb.html">
59
+ lib/mack-data_mapper/sessions/data_mapper_session_store.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Mack::SessionStore::Base
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+ <div id="description">
82
+ <p>
83
+ Stores session information in the database. To <a
84
+ href="DataMapper.html#M000004">set</a> the expiry time for this session
85
+ store use the following app_config setting:
86
+ </p>
87
+ <pre>
88
+ data_mapper_session_store::expiry_time: &lt;%= 4.hours %&gt;
89
+ </pre>
90
+
91
+ </div>
92
+
93
+
94
+ </div>
95
+
96
+ <div id="method-list">
97
+ <h3 class="section-bar">Methods</h3>
98
+
99
+ <div class="name-list">
100
+ <a href="#M000005">expire</a>&nbsp;&nbsp;
101
+ <a href="#M000006">expire_all</a>&nbsp;&nbsp;
102
+ <a href="#M000003">get</a>&nbsp;&nbsp;
103
+ <a href="#M000004">set</a>&nbsp;&nbsp;
104
+ </div>
105
+ </div>
106
+
107
+ </div>
108
+
109
+
110
+ <!-- if includes -->
111
+
112
+ <div id="section">
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+ <!-- if method_list -->
122
+ <div id="methods">
123
+ <h3 class="section-bar">Public Class methods</h3>
124
+
125
+ <div id="method-M000005" class="method-detail">
126
+ <a name="M000005"></a>
127
+
128
+ <div class="method-heading">
129
+ <a href="#M000005" class="method-signature">
130
+ <span class="method-name">expire</span><span class="method-args">(id, *args)</span>
131
+ </a>
132
+ </div>
133
+
134
+ <div class="method-description">
135
+ <p>
136
+ Deletes the session from the db, if it exists.
137
+ </p>
138
+ <p><a class="source-toggle" href="#"
139
+ onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
140
+ <div class="method-source-code" id="M000005-source">
141
+ <pre>
142
+ <span class="ruby-comment cmt"># File lib/mack-data_mapper/sessions/data_mapper_session_store.rb, line 39</span>
143
+ 39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expire</span>(<span class="ruby-identifier">id</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
144
+ 40: <span class="ruby-identifier">create_storage_if_non_existent</span>
145
+ 41: <span class="ruby-identifier">sess</span> = <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">id</span>)
146
+ 42: <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">destroy</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">nil?</span>
147
+ 43: <span class="ruby-keyword kw">end</span>
148
+ </pre>
149
+ </div>
150
+ </div>
151
+ </div>
152
+
153
+ <div id="method-M000006" class="method-detail">
154
+ <a name="M000006"></a>
155
+
156
+ <div class="method-heading">
157
+ <a href="#M000006" class="method-signature">
158
+ <span class="method-name">expire_all</span><span class="method-args">(*args)</span>
159
+ </a>
160
+ </div>
161
+
162
+ <div class="method-description">
163
+ <p>
164
+ Deletes all the sessions from the db.
165
+ </p>
166
+ <p><a class="source-toggle" href="#"
167
+ onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
168
+ <div class="method-source-code" id="M000006-source">
169
+ <pre>
170
+ <span class="ruby-comment cmt"># File lib/mack-data_mapper/sessions/data_mapper_session_store.rb, line 46</span>
171
+ 46: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expire_all</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
172
+ 47: <span class="ruby-identifier">create_storage_if_non_existent</span>
173
+ 48: <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span>.<span class="ruby-identifier">all</span>.<span class="ruby-identifier">destroy!</span>
174
+ 49: <span class="ruby-keyword kw">end</span>
175
+ </pre>
176
+ </div>
177
+ </div>
178
+ </div>
179
+
180
+ <div id="method-M000003" class="method-detail">
181
+ <a name="M000003"></a>
182
+
183
+ <div class="method-heading">
184
+ <a href="#M000003" class="method-signature">
185
+ <span class="method-name">get</span><span class="method-args">(id, *args)</span>
186
+ </a>
187
+ </div>
188
+
189
+ <div class="method-description">
190
+ <p>
191
+ Gets the session from the db, using the specified id. If the session has
192
+ &#8216;expired&#8217; then it&#8216;s deleted from the db.
193
+ </p>
194
+ <p><a class="source-toggle" href="#"
195
+ onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
196
+ <div class="method-source-code" id="M000003-source">
197
+ <pre>
198
+ <span class="ruby-comment cmt"># File lib/mack-data_mapper/sessions/data_mapper_session_store.rb, line 12</span>
199
+ 12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">id</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
200
+ 13: <span class="ruby-identifier">create_storage_if_non_existent</span>
201
+ 14: <span class="ruby-identifier">sess</span> = <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span>.<span class="ruby-identifier">first</span>(<span class="ruby-identifier">:id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">id</span>)
202
+ 15: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">nil?</span>
203
+ 16: <span class="ruby-identifier">expire_date</span> = <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">minus_seconds</span>(<span class="ruby-identifier">app_config</span>.<span class="ruby-identifier">data_mapper_session_store</span>.<span class="ruby-identifier">expiry_time</span>)
204
+ 17: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">updated_at</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">expire_date</span>.<span class="ruby-identifier">to_s</span>
205
+ 18: <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">destroy</span>
206
+ 19: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
207
+ 20: <span class="ruby-keyword kw">end</span>
208
+ 21: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">data</span>
209
+ 22: <span class="ruby-keyword kw">end</span>
210
+ </pre>
211
+ </div>
212
+ </div>
213
+ </div>
214
+
215
+ <div id="method-M000004" class="method-detail">
216
+ <a name="M000004"></a>
217
+
218
+ <div class="method-heading">
219
+ <a href="#M000004" class="method-signature">
220
+ <span class="method-name">set</span><span class="method-args">(id, request, *args)</span>
221
+ </a>
222
+ </div>
223
+
224
+ <div class="method-description">
225
+ <p>
226
+ Creates or updates the session in the db.
227
+ </p>
228
+ <p><a class="source-toggle" href="#"
229
+ onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
230
+ <div class="method-source-code" id="M000004-source">
231
+ <pre>
232
+ <span class="ruby-comment cmt"># File lib/mack-data_mapper/sessions/data_mapper_session_store.rb, line 25</span>
233
+ 25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set</span>(<span class="ruby-identifier">id</span>, <span class="ruby-identifier">request</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
234
+ 26: <span class="ruby-identifier">create_storage_if_non_existent</span>
235
+ 27: <span class="ruby-identifier">sess</span> = <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">id</span>)
236
+ 28: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">nil?</span>
237
+ 29: <span class="ruby-identifier">sess</span> = <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">DataMapper</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">id</span>, <span class="ruby-identifier">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">session</span>)
238
+ 30: <span class="ruby-identifier">raise</span> <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">full_messages</span>.<span class="ruby-identifier">inspect</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">valid?</span>
239
+ 31: <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">save</span>
240
+ 32: <span class="ruby-keyword kw">else</span>
241
+ 33: <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">data</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">session</span>
242
+ 34: <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">save</span>
243
+ 35: <span class="ruby-keyword kw">end</span>
244
+ 36: <span class="ruby-keyword kw">end</span>
245
+ </pre>
246
+ </div>
247
+ </div>
248
+ </div>
249
+
250
+
251
+ </div>
252
+
253
+
254
+ </div>
255
+
256
+
257
+ <div id="validator-badges">
258
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
259
+ </div>
260
+
261
+ </body>
262
+ </html>