Skip to content
This repository

Fixed test for 3-1-stable. Abstract class is having nil class name. #2831

Merged
merged 1 commit into from almost 3 years ago

2 participants

Arun Agrawal Aaron Patterson
Arun Agrawal
Collaborator

We need to check here for the table name.
Abstract classes are having nil class name.
So nil.gsub will give a error here.

1) Error:
test_include_polymorphic_has_one_defined_in_abstract_parent(AssociationsJoinModelTest):
NoMethodError: undefined method `gsub' for nil:NilClass
Arun Agrawal arunagw We need to check here for the table name.
Abstract classes are having nil class name.
So nil.gsub will give a error here.
891d0d7
Aaron Patterson tenderlove merged commit e835aa0 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 03, 2011
Arun Agrawal arunagw We need to check here for the table name.
Abstract classes are having nil class name.
So nil.gsub will give a error here.
891d0d7
This page is out of date. Refresh to see the latest.
1  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -672,6 +672,7 @@ def tables(name = nil)
672 672
673 673 def table_exists?(name)
674 674 schema, table = extract_schema_and_table(name.to_s)
  675 + return false unless table # Abstract classes is having nil table name
675 676
676 677 binds = [[nil, table.gsub(/(^"|"$)/,'')]]
677 678 binds << [nil, schema] if schema

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.