Skip to content

Commit

Permalink
Merge pull request #14 from Morozzzko/master
Browse files Browse the repository at this point in the history
Add support for views
  • Loading branch information
7even authored Feb 4, 2019
2 parents 560af45 + a50c0d2 commit d4ab3e9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/active_record/annotate/dumper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ module Dumper
class << self
def dump(table_name, connection = ActiveRecord::Base.connection, config = ActiveRecord::Base)
string_io = StringIO.new

if connection.table_exists?(table_name)

if connection.table_exists?(table_name) ||
connection.respond_to?(:view_exists?) && connection.view_exists?(table_name)
dumper(connection, config).send(:table, table_name, string_io)
else
string_io.write(" # can't find table `#{table_name}`")
Expand Down

0 comments on commit d4ab3e9

Please sign in to comment.