diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-14 14:55:01 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-14 14:55:01 -0800 |
commit | f9ea47736e270152c264bb5f8fdbfaa1d04fe82f (patch) | |
tree | d2c14760c4d1cd92b818ecb822c8707a3d4c57f6 | |
parent | fd81c700ec4ff7a8170e5497ecc351d76fa50b84 (diff) | |
download | rails-f9ea47736e270152c264bb5f8fdbfaa1d04fe82f.tar.gz rails-f9ea47736e270152c264bb5f8fdbfaa1d04fe82f.tar.bz2 rails-f9ea47736e270152c264bb5f8fdbfaa1d04fe82f.zip |
remove unused methods
-rw-r--r-- | activerecord/lib/active_record/fixtures.rb | 35 | ||||
-rw-r--r-- | activerecord/test/cases/fixtures_test.rb | 5 |
2 files changed, 0 insertions, 40 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 97d814eb71..3876e57210 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -606,33 +606,6 @@ class Fixtures fixtures.size end - def delete_existing_fixtures - tables.each do |table| - @connection.delete "DELETE FROM #{@connection.quote_table_name(table)}", 'Fixture Delete' - end - end - - # Return a list of tables this fixture effect. This is typically the +table_name+ - # along with any habtm tables specified via Foxy Fixtures. - def tables - [table_name] + fixtures.values.map { |fixture| - row = fixture.to_hash - - # If STI is used, find the correct subclass for association reflection - associations = [] - if model_class && model_class < ActiveRecord::Base - reflection_class = row[inheritance_column_name].constantize rescue model_class - associations = reflection_class.reflect_on_all_associations - end - - foxy_habtms = associations.find_all { |assoc| - assoc.macro == :has_and_belongs_to_many && row.key?(assoc.name.to_s) - } - - foxy_habtms.map { |assoc| assoc.options[:join_table] } - }.flatten.uniq - end - # Return a hash of rows to be inserted. The key is the table, the value is # a list of rows to insert to that table. def table_rows @@ -706,14 +679,6 @@ class Fixtures rows end - def insert_fixtures - table_rows.each do |table_name, rows| - rows.each do |row| - @connection.insert_fixture(row, table_name) - end - end - end - private def primary_key_name @primary_key_name ||= model_class && model_class.primary_key diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index 2a5d6b2beb..ee51692f93 100644 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -188,11 +188,6 @@ class FixturesTest < ActiveRecord::TestCase end end - def test_tables - fixtures = Fixtures.new(Parrot.connection, 'parrots', 'Parrot', FIXTURES_ROOT + "/parrots") - assert_equal %w{parrots parrots_treasures}, fixtures.tables - end - def test_yml_file_in_subdirectory assert_equal(categories(:sub_special_1).name, "A special category in a subdir file") assert_equal(categories(:sub_special_1).class, SpecialCategory) |