Created
September 26, 2012 16:07
-
-
Save ehlertij/3788907 to your computer and use it in GitHub Desktop.
AREL SHOW TABLES logging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/arel.rb | |
module Arel | |
class Table | |
@@show_table_logger = Logger.new('log/show_tables.log') | |
def table_exists? | |
@table_exists ||= tables.key?(@name) || engine.connection.table_exists?(name) | |
@@show_table_logger.info "#{Time.now} - #{@name}" unless @table_exists | |
@table_exists | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment