mack-active_record 0.7.0.1 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/doc/classes/Mack/Database/Migrations.html +2 -2
- data/doc/classes/Mack/Database.html +1 -1
- data/doc/classes/Mack/ViewHelpers/ActiveRecordHelpers.html +1 -1
- data/doc/created.rid +1 -1
- data/doc/files/README.html +1 -1
- data/doc/files/lib/mack-active_record/database_migrations_rb.html +1 -1
- data/doc/files/lib/mack-active_record/database_rb.html +1 -1
- data/doc/files/lib/mack-active_record/generators_rb.html +1 -1
- data/doc/files/lib/mack-active_record/helpers/orm_helpers_rb.html +1 -1
- data/doc/files/lib/mack-active_record/migration_generator/migration_generator_rb.html +1 -1
- data/doc/files/lib/mack-active_record/model_generator/model_generator_rb.html +1 -1
- data/doc/files/lib/mack-active_record/test_extensions_rb.html +1 -1
- data/doc/files/lib/mack-active_record_rb.html +1 -1
- data/doc/files/lib/mack-active_record_tasks_rb.html +1 -1
- data/lib/mack-active_record/database.rb +2 -2
- data/lib/mack-active_record/database_migrations.rb +2 -2
- data/lib/mack-active_record/helpers/orm_helpers.rb +1 -1
- data/lib/mack-active_record.rb +1 -3
- metadata +3 -3
@@ -150,7 +150,7 @@ href="Migrations.html#M000011">version</a>
|
|
150
150
|
<pre>
|
151
151
|
<span class="ruby-comment cmt"># File lib/mack-active_record/database_migrations.rb, line 6</span>
|
152
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">
|
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">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Paths</span>.<span class="ruby-identifier">db</span>(<span class="ruby-value str">"migrations"</span>))
|
154
154
|
8: <span class="ruby-keyword kw">end</span>
|
155
155
|
</pre>
|
156
156
|
</div>
|
@@ -179,7 +179,7 @@ Rolls back the database by the specified number of steps. Default is 1
|
|
179
179
|
12: <span class="ruby-identifier">cur_version</span> = <span class="ruby-identifier">version</span>.<span class="ruby-identifier">to_i</span>
|
180
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
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">
|
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">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Paths</span>.<span class="ruby-identifier">db</span>(<span class="ruby-value str">"migrations"</span>), <span class="ruby-identifier">target_version</span>)
|
183
183
|
16: <span class="ruby-keyword kw">end</span>
|
184
184
|
</pre>
|
185
185
|
</div>
|
@@ -224,7 +224,7 @@ Dumps the structure of the database to a file.
|
|
224
224
|
67: <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Database</span>.<span class="ruby-identifier">establish_connection</span>(<span class="ruby-identifier">env</span>)
|
225
225
|
68: <span class="ruby-identifier">dbs</span> = <span class="ruby-identifier">db_settings</span>(<span class="ruby-identifier">env</span>)
|
226
226
|
69: <span class="ruby-identifier">structure</span> = <span class="ruby-value str">""</span>
|
227
|
-
70: <span class="ruby-identifier">output_file</span> = <span class="ruby-constant">
|
227
|
+
70: <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">"#{env}_schema_structure.sql"</span>)
|
228
228
|
71: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">dbs</span>[<span class="ruby-identifier">:adapter</span>]
|
229
229
|
72: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">"mysql"</span>
|
230
230
|
73: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">output_file</span>, <span class="ruby-value str">"w"</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">connection</span>.<span class="ruby-identifier">structure_dump</span>}
|
@@ -168,7 +168,7 @@
|
|
168
168
|
55: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">app_errors</span>.<span class="ruby-identifier">empty?</span>
|
169
169
|
56: <span class="ruby-identifier">app_errors</span>.<span class="ruby-identifier">uniq!</span>
|
170
170
|
57: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">view_partial</span>.<span class="ruby-identifier">nil?</span>
|
171
|
-
58: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-constant">
|
171
|
+
58: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Paths</span>.<span class="ruby-identifier">views</span>(<span class="ruby-value str">"application"</span>, <span class="ruby-value str">"_error_messages.html.erb"</span>))
|
172
172
|
59: <span class="ruby-identifier">render</span>(<span class="ruby-identifier">:partial</span>, <span class="ruby-value str">"application/error_messages"</span>, <span class="ruby-identifier">:locals</span> =<span class="ruby-operator">></span> {<span class="ruby-identifier">:errors</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">app_errors</span>})
|
173
173
|
60: <span class="ruby-keyword kw">else</span>
|
174
174
|
61: <span class="ruby-identifier">render</span>(<span class="ruby-identifier">:inline</span>, <span class="ruby-constant">DEFAULT_PARTIAL</span>, <span class="ruby-identifier">:locals</span> =<span class="ruby-operator">></span> {<span class="ruby-identifier">:errors</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">app_errors</span>})
|
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Mon, 08 Sep 2008 10:56:06 -0400
|
data/doc/files/README.html
CHANGED
@@ -67,7 +67,7 @@ module Mack
|
|
67
67
|
Mack::Database.establish_connection(env)
|
68
68
|
dbs = db_settings(env)
|
69
69
|
structure = ""
|
70
|
-
output_file =
|
70
|
+
output_file = Mack::Paths.db("#{env}_schema_structure.sql")
|
71
71
|
case dbs[:adapter]
|
72
72
|
when "mysql"
|
73
73
|
File.open(output_file, "w") {|f| f.puts ActiveRecord::Base.connection.structure_dump}
|
@@ -82,7 +82,7 @@ module Mack
|
|
82
82
|
|
83
83
|
private
|
84
84
|
def self.db_settings(env)
|
85
|
-
dbs = YAML::load(ERB.new(IO.read(
|
85
|
+
dbs = YAML::load(ERB.new(IO.read(Mack::Paths.config("database.yml"))).result)
|
86
86
|
dbs = dbs[env]
|
87
87
|
dbs.symbolize_keys!
|
88
88
|
return dbs
|
@@ -4,7 +4,7 @@ module Mack
|
|
4
4
|
|
5
5
|
# Migrates the database to the latest version
|
6
6
|
def self.migrate
|
7
|
-
ActiveRecord::Migrator.up(
|
7
|
+
ActiveRecord::Migrator.up(Mack::Paths.db("migrations"))
|
8
8
|
end
|
9
9
|
|
10
10
|
# Rolls back the database by the specified number of steps. Default is 1
|
@@ -12,7 +12,7 @@ module Mack
|
|
12
12
|
cur_version = version.to_i
|
13
13
|
target_version = cur_version - step
|
14
14
|
target_version = 0 if target_version < 0
|
15
|
-
ActiveRecord::Migrator.down(
|
15
|
+
ActiveRecord::Migrator.down(Mack::Paths.db("migrations"), target_version)
|
16
16
|
end
|
17
17
|
|
18
18
|
# Not implemented
|
@@ -55,7 +55,7 @@ module Mack
|
|
55
55
|
unless app_errors.empty?
|
56
56
|
app_errors.uniq!
|
57
57
|
if view_partial.nil?
|
58
|
-
if File.exist?(
|
58
|
+
if File.exist?(Mack::Paths.views("application", "_error_messages.html.erb"))
|
59
59
|
render(:partial, "application/error_messages", :locals => {:errors => app_errors})
|
60
60
|
else
|
61
61
|
render(:inline, DEFAULT_PARTIAL, :locals => {:errors => app_errors})
|
data/lib/mack-active_record.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mack-active_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markbates
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-08
|
12
|
+
date: 2008-09-08 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.7.
|
33
|
+
version: 0.7.1
|
34
34
|
version:
|
35
35
|
description: "mack-active_record was developed by: markbates"
|
36
36
|
email: mark@mackframework.com
|