mack-active_record 0.6.1.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/doc/classes/Mack/Database/Generators.html +140 -0
  2. data/doc/classes/Mack/Database/{Migrator.html → Migrations.html} +74 -39
  3. data/doc/classes/Mack/Database.html +158 -61
  4. data/doc/classes/Mack/Testing/ActiveRecordHelpers.html +168 -0
  5. data/doc/classes/Mack/ViewHelpers/ActiveRecordHelpers.html +52 -52
  6. data/doc/classes/Mack.html +8 -15
  7. data/doc/created.rid +1 -1
  8. data/doc/files/lib/mack-active_record/{genosaurus_helpers_rb.html → database_migrations_rb.html} +4 -4
  9. data/doc/files/lib/mack-active_record/database_rb.html +1 -11
  10. data/doc/files/lib/mack-active_record/{model_column_rb.html → generators_rb.html} +4 -4
  11. data/doc/files/lib/mack-active_record/helpers/orm_helpers_rb.html +1 -1
  12. data/doc/files/lib/mack-active_record/{scaffold_generator/scaffold_generator_rb.html → test_extensions_rb.html} +12 -17
  13. data/doc/files/lib/mack-active_record_rb.html +2 -1
  14. data/doc/files/lib/mack-active_record_tasks_rb.html +8 -1
  15. data/doc/fr_class_index.html +3 -5
  16. data/doc/fr_file_index.html +3 -3
  17. data/doc/fr_method_index.html +11 -14
  18. data/lib/mack-active_record/database.rb +81 -59
  19. data/lib/mack-active_record/database_migrations.rb +29 -0
  20. data/lib/mack-active_record/generators.rb +11 -0
  21. data/lib/mack-active_record/helpers/orm_helpers.rb +9 -12
  22. data/lib/mack-active_record/model_generator/manifest.yml +2 -2
  23. data/lib/mack-active_record/tasks/db_migration_tasks.rake +2 -15
  24. data/lib/mack-active_record/test_extensions.rb +101 -0
  25. data/lib/mack-active_record.rb +4 -3
  26. data/lib/mack-active_record_tasks.rb +1 -0
  27. metadata +22 -22
  28. data/doc/classes/Mack/Genosaurus/ActiveRecord/Helpers.html +0 -225
  29. data/doc/classes/Mack/Genosaurus/ActiveRecord/ModelColumn.html +0 -299
  30. data/doc/classes/Mack/ViewHelpers.html +0 -111
  31. data/doc/classes/ScaffoldGenerator.html +0 -123
  32. data/lib/mack-active_record/genosaurus_helpers.rb +0 -40
  33. data/lib/mack-active_record/model_column.rb +0 -55
  34. data/lib/mack-active_record/scaffold_generator/manifest.yml +0 -31
  35. data/lib/mack-active_record/scaffold_generator/scaffold_generator.rb +0 -42
  36. data/lib/mack-active_record/scaffold_generator/templates/app/views/edit.html.erb.template +0 -19
  37. data/lib/mack-active_record/scaffold_generator/templates/app/views/index.html.erb.template +0 -41
  38. data/lib/mack-active_record/scaffold_generator/templates/app/views/new.html.erb.template +0 -19
  39. data/lib/mack-active_record/scaffold_generator/templates/app/views/show.html.erb.template +0 -12
  40. data/lib/mack-active_record/scaffold_generator/templates/spec.rb.template +0 -47
  41. data/lib/mack-active_record/scaffold_generator/templates/test.rb.template +0 -9
  42. data/lib/mack-active_record/tasks/db_create_drop_tasks.rake +0 -52
@@ -0,0 +1,140 @@
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: Mack::Database::Generators</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">Mack::Database::Generators</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/mack-active_record/generators_rb.html">
59
+ lib/mack-active_record/generators.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="#M000007">controller_template_location</a>&nbsp;&nbsp;
84
+ </div>
85
+ </div>
86
+
87
+ </div>
88
+
89
+
90
+ <!-- if includes -->
91
+
92
+ <div id="section">
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+ <!-- if method_list -->
102
+ <div id="methods">
103
+ <h3 class="section-bar">Public Class methods</h3>
104
+
105
+ <div id="method-M000007" class="method-detail">
106
+ <a name="M000007"></a>
107
+
108
+ <div class="method-heading">
109
+ <a href="#M000007" class="method-signature">
110
+ <span class="method-name">controller_template_location</span><span class="method-args">()</span>
111
+ </a>
112
+ </div>
113
+
114
+ <div class="method-description">
115
+ <p><a class="source-toggle" href="#"
116
+ onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
117
+ <div class="method-source-code" id="M000007-source">
118
+ <pre>
119
+ <span class="ruby-comment cmt"># File lib/mack-active_record/generators.rb, line 5</span>
120
+ 5: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">controller_template_location</span>
121
+ 6: <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>), <span class="ruby-value str">&quot;scaffold_generator&quot;</span>, <span class="ruby-value str">&quot;templates&quot;</span>, <span class="ruby-value str">&quot;app&quot;</span>, <span class="ruby-value str">&quot;controllers&quot;</span>, <span class="ruby-value str">&quot;controller.rb.template&quot;</span>)
122
+ 7: <span class="ruby-keyword kw">end</span>
123
+ </pre>
124
+ </div>
125
+ </div>
126
+ </div>
127
+
128
+
129
+ </div>
130
+
131
+
132
+ </div>
133
+
134
+
135
+ <div id="validator-badges">
136
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
137
+ </div>
138
+
139
+ </body>
140
+ </html>
@@ -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::Database::Migrator</title>
8
+ <title>Module: Mack::Database::Migrations</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" />
@@ -50,13 +50,13 @@
50
50
  <table class="header-table">
51
51
  <tr class="top-aligned-row">
52
52
  <td><strong>Module</strong></td>
53
- <td class="class-name-in-header">Mack::Database::Migrator</td>
53
+ <td class="class-name-in-header">Mack::Database::Migrations</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-active_record/database_rb.html">
59
- lib/mack-active_record/database.rb
58
+ <a href="../../../files/lib/mack-active_record/database_migrations_rb.html">
59
+ lib/mack-active_record/database_migrations.rb
60
60
  </a>
61
61
  <br />
62
62
  </td>
@@ -80,9 +80,10 @@
80
80
  <h3 class="section-bar">Methods</h3>
81
81
 
82
82
  <div class="name-list">
83
- <a href="#M000014">migrate</a>&nbsp;&nbsp;
84
- <a href="#M000015">rollback</a>&nbsp;&nbsp;
85
- <a href="#M000013">version</a>&nbsp;&nbsp;
83
+ <a href="#M000010">abort_if_pending_migrations</a>&nbsp;&nbsp;
84
+ <a href="#M000008">migrate</a>&nbsp;&nbsp;
85
+ <a href="#M000009">rollback</a>&nbsp;&nbsp;
86
+ <a href="#M000011">version</a>&nbsp;&nbsp;
86
87
  </div>
87
88
  </div>
88
89
 
@@ -104,75 +105,109 @@
104
105
  <div id="methods">
105
106
  <h3 class="section-bar">Public Class methods</h3>
106
107
 
107
- <div id="method-M000014" class="method-detail">
108
- <a name="M000014"></a>
108
+ <div id="method-M000010" class="method-detail">
109
+ <a name="M000010"></a>
109
110
 
110
111
  <div class="method-heading">
111
- <a href="#M000014" class="method-signature">
112
+ <a href="#M000010" class="method-signature">
113
+ <span class="method-name">abort_if_pending_migrations</span><span class="method-args">()</span>
114
+ </a>
115
+ </div>
116
+
117
+ <div class="method-description">
118
+ <p>
119
+ Not implemented
120
+ </p>
121
+ <p><a class="source-toggle" href="#"
122
+ onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
123
+ <div class="method-source-code" id="M000010-source">
124
+ <pre>
125
+ <span class="ruby-comment cmt"># File lib/mack-active_record/database_migrations.rb, line 19</span>
126
+ 19: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">abort_if_pending_migrations</span>
127
+ 20: <span class="ruby-keyword kw">end</span>
128
+ </pre>
129
+ </div>
130
+ </div>
131
+ </div>
132
+
133
+ <div id="method-M000008" class="method-detail">
134
+ <a name="M000008"></a>
135
+
136
+ <div class="method-heading">
137
+ <a href="#M000008" class="method-signature">
112
138
  <span class="method-name">migrate</span><span class="method-args">()</span>
113
139
  </a>
114
140
  </div>
115
141
 
116
142
  <div class="method-description">
143
+ <p>
144
+ Migrates the database to the latest <a
145
+ href="Migrations.html#M000011">version</a>
146
+ </p>
117
147
  <p><a class="source-toggle" href="#"
118
- onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
119
- <div class="method-source-code" id="M000014-source">
148
+ onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
149
+ <div class="method-source-code" id="M000008-source">
120
150
  <pre>
121
- <span class="ruby-comment cmt"># File lib/mack-active_record/database.rb, line 16</span>
122
- 16: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">migrate</span>
123
- 17: <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Migrator</span>.<span class="ruby-identifier">up</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-value str">&quot;migrations&quot;</span>))
124
- 18: <span class="ruby-keyword kw">end</span>
151
+ <span class="ruby-comment cmt"># File lib/mack-active_record/database_migrations.rb, line 6</span>
152
+ 6: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">migrate</span>
153
+ 7: <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Migrator</span>.<span class="ruby-identifier">up</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-value str">&quot;migrations&quot;</span>))
154
+ 8: <span class="ruby-keyword kw">end</span>
125
155
  </pre>
126
156
  </div>
127
157
  </div>
128
158
  </div>
129
159
 
130
- <div id="method-M000015" class="method-detail">
131
- <a name="M000015"></a>
160
+ <div id="method-M000009" class="method-detail">
161
+ <a name="M000009"></a>
132
162
 
133
163
  <div class="method-heading">
134
- <a href="#M000015" class="method-signature">
164
+ <a href="#M000009" class="method-signature">
135
165
  <span class="method-name">rollback</span><span class="method-args">(step = 1)</span>
136
166
  </a>
137
167
  </div>
138
168
 
139
169
  <div class="method-description">
170
+ <p>
171
+ Rolls back the database by the specified number of steps. Default is 1
172
+ </p>
140
173
  <p><a class="source-toggle" href="#"
141
- onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
142
- <div class="method-source-code" id="M000015-source">
174
+ onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
175
+ <div class="method-source-code" id="M000009-source">
143
176
  <pre>
144
- <span class="ruby-comment cmt"># File lib/mack-active_record/database.rb, line 20</span>
145
- 20: <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>)
146
- 21: <span class="ruby-identifier">step</span> = (<span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;STEP&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">step</span>).<span class="ruby-identifier">to_i</span>
147
- 22: <span class="ruby-identifier">cur_version</span> = <span class="ruby-identifier">version</span>.<span class="ruby-identifier">to_i</span>
148
- 23: <span class="ruby-identifier">target_version</span> = <span class="ruby-identifier">cur_version</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">step</span>
149
- 24: <span class="ruby-identifier">target_version</span> = <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">target_version</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
150
- 25:
151
- 26: <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Migrator</span>.<span class="ruby-identifier">down</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-value str">&quot;migrations&quot;</span>), <span class="ruby-identifier">target_version</span>)
152
- 27: <span class="ruby-keyword kw">end</span>
177
+ <span class="ruby-comment cmt"># File lib/mack-active_record/database_migrations.rb, line 11</span>
178
+ 11: <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>)
179
+ 12: <span class="ruby-identifier">cur_version</span> = <span class="ruby-identifier">version</span>.<span class="ruby-identifier">to_i</span>
180
+ 13: <span class="ruby-identifier">target_version</span> = <span class="ruby-identifier">cur_version</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">step</span>
181
+ 14: <span class="ruby-identifier">target_version</span> = <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">target_version</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
182
+ 15: <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Migrator</span>.<span class="ruby-identifier">down</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-value str">&quot;migrations&quot;</span>), <span class="ruby-identifier">target_version</span>)
183
+ 16: <span class="ruby-keyword kw">end</span>
153
184
  </pre>
154
185
  </div>
155
186
  </div>
156
187
  </div>
157
188
 
158
- <div id="method-M000013" class="method-detail">
159
- <a name="M000013"></a>
189
+ <div id="method-M000011" class="method-detail">
190
+ <a name="M000011"></a>
160
191
 
161
192
  <div class="method-heading">
162
- <a href="#M000013" class="method-signature">
193
+ <a href="#M000011" class="method-signature">
163
194
  <span class="method-name">version</span><span class="method-args">()</span>
164
195
  </a>
165
196
  </div>
166
197
 
167
198
  <div class="method-description">
199
+ <p>
200
+ Returns the current <a href="Migrations.html#M000011">version</a> of the
201
+ database
202
+ </p>
168
203
  <p><a class="source-toggle" href="#"
169
- onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
170
- <div class="method-source-code" id="M000013-source">
204
+ onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
205
+ <div class="method-source-code" id="M000011-source">
171
206
  <pre>
172
- <span class="ruby-comment cmt"># File lib/mack-active_record/database.rb, line 12</span>
173
- 12: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">version</span>
174
- 13: <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Migrator</span>.<span class="ruby-identifier">current_version</span>
175
- 14: <span class="ruby-keyword kw">end</span>
207
+ <span class="ruby-comment cmt"># File lib/mack-active_record/database_migrations.rb, line 23</span>
208
+ 23: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">version</span>
209
+ 24: <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Migrator</span>.<span class="ruby-identifier">current_version</span>
210
+ 25: <span class="ruby-keyword kw">end</span>
176
211
  </pre>
177
212
  </div>
178
213
  </div>