public
Description: The Rails Engines plugin
Homepage: http://rails-engines.org
Clone URL: git://github.com/lazyatom/engines.git
Since rails tracks *all* the migrated migrations now, we need to simulate that 
for the legacy numeric migrations we're using at the moment. So, find the 
current version and then create an array from 1 up to that number.
lazyatom (author)
Tue Jun 10 08:41:08 -0700 2008
commit  14fd63fba239b835e822df9435dcc99dbcf2ee58
tree    52010c73eaae3400300857bba4864ea9bf331690
parent  755efd571d963929fbeb6843aaa140abf6bee2e4
...
53
54
55
56
 
57
58
59
60
 
 
61
62
63
...
53
54
55
 
56
57
58
59
 
60
61
62
63
64
0
@@ -53,11 +53,12 @@ class Engines::Plugin::Migrator < ActiveRecord::Migrator
0
   end
0
   
0
   def migrated(plugin=current_plugin)
0
-    ActiveRecord::Base.connection.select_values(<<-ESQL
0
+    current = ActiveRecord::Base.connection.select_value(<<-ESQL
0
       SELECT version FROM #{self.class.schema_info_table_name}
0
       WHERE plugin_name = '#{plugin.name}'
0
     ESQL
0
-    ).map(&:to_i).sort - [0]
0
+    ).to_i
0
+    current ? (1..current).to_a : []
0
   end
0
   
0
   # Sets the version of the plugin in Engines::Plugin::Migrator.current_plugin to

Comments