Skip to content

Use the definition class name as the name of the counter (Counter::Value#name) #13

@ideasasylum

Description

@ideasasylum

Currently the Counter::Value#name column stores a name like "students-broadcast_clicks_counter". The first part (before the underscore) is the parent model; the second part is the counter definition class name.

This seems pretty ugly and the format changes if it's a global counter unrelated to an association. The name also isn't really used anywhere unless you are querying the table directly.

My proposal is that the name stored should be the class name of the counter definition. This has several advantages:

  • When a value is loaded, it becomes trivial to find the definition instance
  • It becomes much clearer when querying the table directly what to search for

Originally I had thought that counters could be reused for different models/associations but that seems unnecessary

Metadata

Metadata

Assignees

Labels

DXDeveloper experience

Type

No type

Projects

Status

Noodling on

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions