2

When I open the rails console and print out my most recent object I am not able to see all of the fields and values. However, when I call the object.field_name it will display the value.

Does console cut off after a certain number of fields or am I experiencing some type of error?

Questifer
  • 1,113
  • 3
  • 18
  • 48
  • 3
    What command did you use to print the object? – Hesham Jan 19 '15 at 01:33
  • That object can have custom `export` method, for example ActiveRecord objects. May be that attribute is not an instance variable, you can see it by: `my_object.instance_variables`. May be some gem in your Gemfile override Object#inspect – Pavel Evstigneev Jan 19 '15 at 03:58

1 Answers1

1

Try attributes method

User.first.attributes

Taken from this answer: https://stackoverflow.com/a/39632742

Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367