method
inspect
v4.2.7 -
Show 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 444
def inspect
# We check defined?(@attributes) not to issue warnings if the object is
# allocated but not initialized.
inspection = if defined?(@attributes) && @attributes
self.class.column_names.collect { |name|
if has_attribute?(name)
"#{name}: #{attribute_for_inspect(name)}"
end
}.compact.join(", ")
else
"not initialized"
end
"#<#{self.class} #{inspection}>"
end Related methods
- Instance methods
- <=>
- ==
- clone
- connection_handler
- dup
- encode_with
- eql?
- freeze
- frozen?
- hash
- init_with
- initialize_dup
- inspect
- pretty_print
- readonly!
- readonly?
- slice
- Class methods
- configurations
- configurations=
- connection_handler
- connection_handler=
- disable_implicit_join_references=
- new
- Private methods
-
custom_inspect_method_defined? -
has_transactional_callbacks? -
init_attributes -
init_internals -
initialize_internals_callback -
set_transaction_state -
sync_with_transaction_state -
thaw -
to_ary -
update_attributes_from_transaction_state