DRY up reblog vs original status check
Checking reblog vs original status was happening in multiple places across the app. For views, this logic was encapsulated in a helper method named `proper_status` but in the other layers of the app, the logic was duplicated. Because the logic is used at all layers of the app, we extracted it into a `Status#proper` method on the model and changed all uses of the logic to use this method. There is now a single source of truth for this condition. We added test coverage to untested methods that got refactored.
Showing
- app/helpers/stream_entries_helper.rb 0 additions, 4 deletionsapp/helpers/stream_entries_helper.rb
- app/lib/atom_serializer.rb 1 addition, 1 deletionapp/lib/atom_serializer.rb
- app/models/account.rb 2 additions, 2 deletionsapp/models/account.rb
- app/models/status.rb 5 additions, 1 deletionapp/models/status.rb
- app/views/stream_entries/_status.html.haml 1 addition, 1 deletionapp/views/stream_entries/_status.html.haml
- spec/models/account_spec.rb 66 additions, 2 deletionsspec/models/account_spec.rb
- spec/models/status_spec.rb 11 additions, 0 deletionsspec/models/status_spec.rb
Loading
Please register or sign in to comment