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.
- data/doc/classes/Mack/Database/Generators.html +140 -0
- data/doc/classes/Mack/Database/{Migrator.html → Migrations.html} +74 -39
- data/doc/classes/Mack/Database.html +158 -61
- data/doc/classes/Mack/Testing/ActiveRecordHelpers.html +168 -0
- data/doc/classes/Mack/ViewHelpers/ActiveRecordHelpers.html +52 -52
- data/doc/classes/Mack.html +8 -15
- data/doc/created.rid +1 -1
- data/doc/files/lib/mack-active_record/{genosaurus_helpers_rb.html → database_migrations_rb.html} +4 -4
- data/doc/files/lib/mack-active_record/database_rb.html +1 -11
- data/doc/files/lib/mack-active_record/{model_column_rb.html → generators_rb.html} +4 -4
- data/doc/files/lib/mack-active_record/helpers/orm_helpers_rb.html +1 -1
- data/doc/files/lib/mack-active_record/{scaffold_generator/scaffold_generator_rb.html → test_extensions_rb.html} +12 -17
- data/doc/files/lib/mack-active_record_rb.html +2 -1
- data/doc/files/lib/mack-active_record_tasks_rb.html +8 -1
- data/doc/fr_class_index.html +3 -5
- data/doc/fr_file_index.html +3 -3
- data/doc/fr_method_index.html +11 -14
- data/lib/mack-active_record/database.rb +81 -59
- data/lib/mack-active_record/database_migrations.rb +29 -0
- data/lib/mack-active_record/generators.rb +11 -0
- data/lib/mack-active_record/helpers/orm_helpers.rb +9 -12
- data/lib/mack-active_record/model_generator/manifest.yml +2 -2
- data/lib/mack-active_record/tasks/db_migration_tasks.rake +2 -15
- data/lib/mack-active_record/test_extensions.rb +101 -0
- data/lib/mack-active_record.rb +4 -3
- data/lib/mack-active_record_tasks.rb +1 -0
- metadata +22 -22
- data/doc/classes/Mack/Genosaurus/ActiveRecord/Helpers.html +0 -225
- data/doc/classes/Mack/Genosaurus/ActiveRecord/ModelColumn.html +0 -299
- data/doc/classes/Mack/ViewHelpers.html +0 -111
- data/doc/classes/ScaffoldGenerator.html +0 -123
- data/lib/mack-active_record/genosaurus_helpers.rb +0 -40
- data/lib/mack-active_record/model_column.rb +0 -55
- data/lib/mack-active_record/scaffold_generator/manifest.yml +0 -31
- data/lib/mack-active_record/scaffold_generator/scaffold_generator.rb +0 -42
- data/lib/mack-active_record/scaffold_generator/templates/app/views/edit.html.erb.template +0 -19
- data/lib/mack-active_record/scaffold_generator/templates/app/views/index.html.erb.template +0 -41
- data/lib/mack-active_record/scaffold_generator/templates/app/views/new.html.erb.template +0 -19
- data/lib/mack-active_record/scaffold_generator/templates/app/views/show.html.erb.template +0 -12
- data/lib/mack-active_record/scaffold_generator/templates/spec.rb.template +0 -47
- data/lib/mack-active_record/scaffold_generator/templates/test.rb.template +0 -9
- 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>
|
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">"scaffold_generator"</span>, <span class="ruby-value str">"templates"</span>, <span class="ruby-value str">"app"</span>, <span class="ruby-value str">"controllers"</span>, <span class="ruby-value str">"controller.rb.template"</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::
|
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::
|
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/
|
59
|
-
lib/mack-active_record/
|
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="#
|
84
|
-
<a href="#
|
85
|
-
<a href="#
|
83
|
+
<a href="#M000010">abort_if_pending_migrations</a>
|
84
|
+
<a href="#M000008">migrate</a>
|
85
|
+
<a href="#M000009">rollback</a>
|
86
|
+
<a href="#M000011">version</a>
|
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-
|
108
|
-
<a name="
|
108
|
+
<div id="method-M000010" class="method-detail">
|
109
|
+
<a name="M000010"></a>
|
109
110
|
|
110
111
|
<div class="method-heading">
|
111
|
-
<a href="#
|
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('
|
119
|
-
<div class="method-source-code" id="
|
148
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
149
|
+
<div class="method-source-code" id="M000008-source">
|
120
150
|
<pre>
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
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">"db"</span>, <span class="ruby-value str">"migrations"</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-
|
131
|
-
<a name="
|
160
|
+
<div id="method-M000009" class="method-detail">
|
161
|
+
<a name="M000009"></a>
|
132
162
|
|
133
163
|
<div class="method-heading">
|
134
|
-
<a href="#
|
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('
|
142
|
-
<div class="method-source-code" id="
|
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/
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
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">"db"</span>, <span class="ruby-value str">"migrations"</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"><</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">"db"</span>, <span class="ruby-value str">"migrations"</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-
|
159
|
-
<a name="
|
189
|
+
<div id="method-M000011" class="method-detail">
|
190
|
+
<a name="M000011"></a>
|
160
191
|
|
161
192
|
<div class="method-heading">
|
162
|
-
<a href="#
|
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('
|
170
|
-
<div class="method-source-code" id="
|
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/
|
173
|
-
|
174
|
-
|
175
|
-
|
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>
|