Print out better model details with to_s
class User
# ...
def to_s
"#<User:#{id} @name='#{name}'>"
end
end
Really helps with logging!
Written by dickeyxxx
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Related Tags
#rails
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#