aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-11-20 19:17:10 -0700
committerSean Griffin <sean@thoughtbot.com>2014-11-20 19:17:10 -0700
commit17efb3b919e8eff1ca5da49b12e3c1f607eb93e3 (patch)
tree52fdbc0f20d053f11b1db3a37d3d8e064696d36f /activerecord/lib
parentf767ac22fa213df754e160c59189d28ed4f95568 (diff)
downloadrails-17efb3b919e8eff1ca5da49b12e3c1f607eb93e3.tar.gz
rails-17efb3b919e8eff1ca5da49b12e3c1f607eb93e3.tar.bz2
rails-17efb3b919e8eff1ca5da49b12e3c1f607eb93e3.zip
Remove is_a? check when ignoring tables
Technically changes the API, as it will allow any object which responds to `===`. Personally, I think this is more flexible.
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/schema_dumper.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/schema_dumper.rb b/activerecord/lib/active_record/schema_dumper.rb
index 261fb9d992..1dd2cadc01 100644
--- a/activerecord/lib/active_record/schema_dumper.rb
+++ b/activerecord/lib/active_record/schema_dumper.rb
@@ -244,12 +244,7 @@ HEADER
def ignored?(table_name)
['schema_migrations', ignore_tables].flatten.any? do |ignored|
- case ignored
- when String; remove_prefix_and_suffix(table_name) == ignored
- when Regexp; remove_prefix_and_suffix(table_name) =~ ignored
- else
- raise StandardError, 'ActiveRecord::SchemaDumper.ignore_tables accepts an array of String and / or Regexp values.'
- end
+ ignored === remove_prefix_and_suffix(table_name)
end
end
end