lib/desert/plugin_migrations/extensions/1.0/schema_statements.rb in desert-0.2.1 vs lib/desert/plugin_migrations/extensions/1.0/schema_statements.rb in desert-0.2.2

- old
+ new

@@ -1,11 +1,11 @@ ActiveRecord::ConnectionAdapters::SchemaStatements.module_eval do def initialize_schema_information_with_plugins initialize_schema_information_without_plugins begin - execute "CREATE TABLE #{PluginAWeek::PluginMigrations::Migrator.schema_info_table_name} (plugin_name #{type_to_sql(:string)}, version #{type_to_sql(:integer)})" + execute "CREATE TABLE #{Desert::PluginMigrations::Migrator.schema_info_table_name} (plugin_name #{type_to_sql(:string)}, version #{type_to_sql(:integer)})" rescue ActiveRecord::StatementInvalid # Schema has been initialized end end alias_method_chain :initialize_schema_information, :plugins @@ -15,14 +15,14 @@ dump = dump_schema_information_without_plugins schema_information << dump if dump begin - plugins = ActiveRecord::Base.connection.select_all("SELECT * FROM #{PluginAWeek::PluginMigrations::Migrator.schema_info_table_name}") + plugins = ActiveRecord::Base.connection.select_all("SELECT * FROM #{Desert::PluginMigrations::Migrator.schema_info_table_name}") plugins.each do |plugin| if (version = plugin['version'].to_i) > 0 plugin_name = ActiveRecord::Base.quote_value(plugin['plugin_name']) - schema_information << "INSERT INTO #{PluginAWeek::PluginMigrations::Migrator.schema_info_table_name} (plugin_name, version) VALUES (#{plugin_name}, #{version})" + schema_information << "INSERT INTO #{Desert::PluginMigrations::Migrator.schema_info_table_name} (plugin_name, version) VALUES (#{plugin_name}, #{version})" end end rescue ActiveRecord::StatementInvalid # No Schema Info end \ No newline at end of file