method
inspect
rails latest stable - Class:
ActiveRecord::Core
inspect()public
Returns the contents of the record as a nicely formatted string.
# File activerecord/lib/active_record/core.rb, line 718
def inspect
# We check defined?(@attributes) not to issue warnings if the object is
# allocated but not initialized.
inspection = if defined?(@attributes) && @attributes
attribute_names.filter_map do |name|
if _has_attribute?(name)
"#{name}: #{attribute_for_inspect(name)}"
end
end.join(", ")
else
"not initialized"
end
"#<#{self.class} #{inspection}>"
end Related methods
- Instance methods
- <=>
- ==
- blank?
- clone
- connection_handler
- dup
- encode_with
- eql?
- freeze
- frozen?
- hash
- init_with
- init_with_attributes
- initialize_dup
- inspect
- present?
- pretty_print
- readonly!
- readonly?
- slice
- strict_loading!
- strict_loading?
- strict_loading_n_plus_one_only?
- values_at
- Class methods
- application_record_class?
- asynchronous_queries_session
- asynchronous_queries_tracker
- configurations
- configurations=
- connected_to_stack
- connection_class
- connection_class=
- connection_class?
- connection_class_for_self
- connection_handler
- connection_handler=
- current_preventing_writes
- current_role
- current_shard
- destroy_association_async_job
- new
- strict_loading_violation!
- Private methods
-
custom_inspect_method_defined? -
init_internals -
initialize_internals_callback -
inspection_filter -
to_ary