Dynamoid / dynamoid

Ruby ORM for Amazon's DynamoDB.
MIT License
580 stars 195 forks source link

Add #inspect method to display only attributes #633

Closed andrykonchin closed 1 year ago

andrykonchin commented 1 year ago

Problem - there are a lot of "system" instance variables in a model that mostly come from the Dirty module. Here we hide this internal details like Rails does.

u = User.create(name: 'Andrii', age: 37)
u.inspect
# => "#<User id: \"ff500e9a-4120-449a-aca3-0aad3ac39198\", name: \"Andrii\", age: 37, created_at: Sun, 05 Feb 2023 22:30:17 +0200, updated_at: Sun, 05 Feb 2023 22:30:17 +0200>"
codecov[bot] commented 1 year ago

Codecov Report

Merging #633 (7ce08c3) into master (103a4c7) will increase coverage by 0.03%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #633      +/-   ##
==========================================
+ Coverage   90.22%   90.25%   +0.03%     
==========================================
  Files          61       61              
  Lines        3100     3110      +10     
==========================================
+ Hits         2797     2807      +10     
  Misses        303      303              
Impacted Files Coverage Δ
lib/dynamoid/document.rb 96.00% <100.00%> (+0.44%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

github-actions[bot] commented 1 year ago

Code Coverage

Package Line Rate Health
dynamoid 90%
Summary 90% (2807 / 3110)

Minimum allowed line rate is 90%