diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2012-05-16 15:08:17 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2012-05-16 15:19:59 -0700 |
commit | a57990ff51800bb05cebaf102e7d288487c98bd8 (patch) | |
tree | 8d30639532067f603e6be2b5d18b8e9e8b5f02b3 /activerecord/test | |
parent | d6e4c06a8a995a572237ebca96fa1d320e2418b3 (diff) | |
download | rails-a57990ff51800bb05cebaf102e7d288487c98bd8.tar.gz rails-a57990ff51800bb05cebaf102e7d288487c98bd8.tar.bz2 rails-a57990ff51800bb05cebaf102e7d288487c98bd8.zip |
Call methods on the correct instance in AR::Schema.define
Now that migrations support instance methods, we should
use the same instance rather than relying on delegation
to a global instance. This allows subclassing AR::Schema.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/ar_schema_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/ar_schema_test.rb b/activerecord/test/cases/ar_schema_test.rb index 588adc38e3..b2eac0349b 100644 --- a/activerecord/test/cases/ar_schema_test.rb +++ b/activerecord/test/cases/ar_schema_test.rb @@ -37,6 +37,13 @@ if ActiveRecord::Base.connection.supports_migrations? end end end + + def test_schema_subclass + Class.new(ActiveRecord::Schema).define(:version => 9) do + create_table :fruits + end + assert_nothing_raised { @connection.select_all "SELECT * FROM fruits" } + end end end |