@@ -188,27 +188,7 @@ def structure_load(*arguments)
188188 class_for_adapter ( configuration [ 'adapter' ] ) . new ( *arguments ) . structure_load ( filename )
189189 end
190190
191- def load_schema ( format = ActiveRecord ::Base . schema_format , file = nil )
192- ActiveSupport ::Deprecation . warn ( <<-MSG . squish )
193- This method will act on a specific connection in the future.
194- To act on the current connection, use `load_schema_current` instead.
195- MSG
196-
197- load_schema_current ( format , file )
198- end
199-
200- def schema_file ( format = ActiveSupport ::Base . schema_format )
201- case format
202- when :ruby
203- File . join ( db_dir , "schema.rb" )
204- when :sql
205- File . join ( db_dir , "structure.sql" )
206- end
207- end
208-
209- # This method is the successor of +load_schema+. We should rename it
210- # after +load_schema+ went through a deprecation cycle. (Rails > 4.2)
211- def load_schema_for ( configuration , format = ActiveRecord ::Base . schema_format , file = nil ) # :nodoc:
191+ def load_schema ( configuration , format = ActiveRecord ::Base . schema_format , file = nil ) # :nodoc:
212192 file ||= schema_file ( format )
213193
214194 case format
@@ -224,6 +204,23 @@ def load_schema_for(configuration, format = ActiveRecord::Base.schema_format, fi
224204 end
225205 end
226206
207+ def load_schema_for ( *args )
208+ ActiveSupport ::Deprecation . warn ( <<-MSG . squish )
209+ This method was renamed to `#load_schema` and will be removed in the future.
210+ Use `#load_schema` instead.
211+ MSG
212+ load_schema *args
213+ end
214+
215+ def schema_file ( format = ActiveSupport ::Base . schema_format )
216+ case format
217+ when :ruby
218+ File . join ( db_dir , "schema.rb" )
219+ when :sql
220+ File . join ( db_dir , "structure.sql" )
221+ end
222+ end
223+
227224 def load_schema_current_if_exists ( format = ActiveRecord ::Base . schema_format , file = nil , environment = env )
228225 if File . exist? ( file || schema_file ( format ) )
229226 load_schema_current ( format , file , environment )
@@ -232,7 +229,7 @@ def load_schema_current_if_exists(format = ActiveRecord::Base.schema_format, fil
232229
233230 def load_schema_current ( format = ActiveRecord ::Base . schema_format , file = nil , environment = env )
234231 each_current_configuration ( environment ) { |configuration |
235- load_schema_for configuration , format , file
232+ load_schema configuration , format , file
236233 }
237234 ActiveRecord ::Base . establish_connection ( environment . to_sym )
238235 end
0 commit comments