Rename is_sample PushRule db column to global
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
While investigating PushRule logic I noticed that the global push rule is defined using a is_sample column which does not clearly indicate the intention of the column and also goes against ruby naming norms.
We use a column "push_rules"."is_sample" to define if the PushRule is global.
We also have a method PushRule#global? that checks if is_sample is true.
We then have another method PushRule::global to fetch the global rules by calling find_by(is_sample: true)
We should rename the column to global so it is clear what this column configures. Once we rename we can remove the PushRule#global? method as it will be generated by ActiveRecord::Base automatically.