aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2015-09-09 12:02:35 +0200
committerYves Senn <yves.senn@gmail.com>2015-09-09 12:02:35 +0200
commit51c0cec9c9596386356a4c1ea77e42850f78f498 (patch)
tree580500ab7ca4686f38aab6af147de6d6555536de /activerecord
parent1663f5ad879519544affc7364e18bfb7c9bfd0a9 (diff)
downloadrails-51c0cec9c9596386356a4c1ea77e42850f78f498.tar.gz
rails-51c0cec9c9596386356a4c1ea77e42850f78f498.tar.bz2
rails-51c0cec9c9596386356a4c1ea77e42850f78f498.zip
adjust method visibility according to it's usage.
`Schema#migrations_paths` is not supposed to be public API. In fact it's only used inside `Schema` itself, so let's make it private.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/schema.rb36
1 files changed, 18 insertions, 18 deletions
diff --git a/activerecord/lib/active_record/schema.rb b/activerecord/lib/active_record/schema.rb
index f58ee87f1f..c1a42dc629 100644
--- a/activerecord/lib/active_record/schema.rb
+++ b/activerecord/lib/active_record/schema.rb
@@ -28,24 +28,6 @@ module ActiveRecord
# ActiveRecord::Schema is only supported by database adapters that also
# support migrations, the two features being very similar.
class Schema < Migration
-
- # Returns the migrations paths.
- #
- # ActiveRecord::Schema.new.migrations_paths
- # # => ["db/migrate"] # Rails migration path by default.
- def migrations_paths
- ActiveRecord::Migrator.migrations_paths
- end
-
- def define(info, &block) # :nodoc:
- instance_eval(&block)
-
- if info[:version].present?
- initialize_schema_migrations_table
- connection.assume_migrated_upto_version(info[:version], migrations_paths)
- end
- end
-
# Eval the given block. All methods available to the current connection
# adapter are available within the block, so you can easily use the
# database definition DSL to build up your schema (+create_table+,
@@ -60,5 +42,23 @@ module ActiveRecord
def self.define(info={}, &block)
new.define(info, &block)
end
+
+ def define(info, &block) # :nodoc:
+ instance_eval(&block)
+
+ if info[:version].present?
+ initialize_schema_migrations_table
+ connection.assume_migrated_upto_version(info[:version], migrations_paths)
+ end
+ end
+
+ private
+ # Returns the migrations paths.
+ #
+ # ActiveRecord::Schema.new.migrations_paths
+ # # => ["db/migrate"] # Rails migration path by default.
+ def migrations_paths # :nodoc:
+ ActiveRecord::Migrator.migrations_paths
+ end
end
end