genesis 1.8.0 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/genesis/create_schema_seeds.rb +2 -2
- data/lib/genesis/seeder.rb +4 -4
- data/lib/genesis/version.rb +1 -1
- metadata +1 -1
@@ -4,7 +4,7 @@ module Genesis
|
|
4
4
|
options = {}
|
5
5
|
options.merge!(:guid => false) if defined?( UsesguidMigrations )
|
6
6
|
create_table :schema_seeds, options do |t|
|
7
|
-
t.string :
|
7
|
+
t.string :seed_version
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
@@ -12,4 +12,4 @@ module Genesis
|
|
12
12
|
drop_table :schema_seeds
|
13
13
|
end
|
14
14
|
end
|
15
|
-
end
|
15
|
+
end
|
data/lib/genesis/seeder.rb
CHANGED
@@ -80,8 +80,8 @@ module Genesis
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def self.determine_current_version
|
83
|
-
current_seed = SchemaSeed.find( :last, :order => :
|
84
|
-
@current_version = current_seed.nil? ? '' : current_seed[:
|
83
|
+
current_seed = SchemaSeed.find( :last, :order => :seed_version )
|
84
|
+
@current_version = current_seed.nil? ? '' : current_seed[:seed_version]
|
85
85
|
end
|
86
86
|
|
87
87
|
def self.determine_and_prepare_seed_direction( to_version )
|
@@ -136,9 +136,9 @@ module Genesis
|
|
136
136
|
log_entry_start( class_name )
|
137
137
|
klass.send( @method )
|
138
138
|
if @method == :up
|
139
|
-
ActiveRecord::Base.connection.execute( "INSERT INTO schema_seeds(#{ActiveRecord::Base.connection.quote_column_name '
|
139
|
+
ActiveRecord::Base.connection.execute( "INSERT INTO schema_seeds(#{ActiveRecord::Base.connection.quote_column_name 'seed_version'}) VALUES('#{version}');" )
|
140
140
|
else
|
141
|
-
schema_seed = SchemaSeed.find( :first, :conditions => { :
|
141
|
+
schema_seed = SchemaSeed.find( :first, :conditions => { :seed_version => version } )
|
142
142
|
schema_seed.destroy unless schema_seed.nil?
|
143
143
|
end
|
144
144
|
log_entry_finish( class_name, Time.now - start_time )
|
data/lib/genesis/version.rb
CHANGED