Sha256: daea63c069689b283884603644befc35b2e1d56b984c442e6962a511cc6dd3ec
Contents?: true
Size: 489 Bytes
Versions: 23
Compression:
Stored size: 489 Bytes
Contents
# Prevent `MyModel.inspect` failing with `ActiveRecord::ConnectionNotEstablished` # (triggered by elasticsearch-model/lib/elasticsearch/model.rb:79:in `included') # ActiveRecord::Base.instance_eval do class << self def inspect_with_rescue inspect_without_rescue rescue ActiveRecord::ConnectionNotEstablished "#{self}(no database connection)" end alias_method_chain :inspect, :rescue end end if defined?(ActiveRecord) && ActiveRecord::VERSION::STRING < '4'
Version data entries
23 entries across 23 versions & 2 rubygems