I was working on another branch and as part of my commit, Rubocop
removed a validation (but not the spec that asserted the validation).
Below is the "non-updating" rubocop offense on the other branch.
```shell
❯ rubocop ./app/models/notification_subscription.rb
Inspecting 1 file
C
Offenses:
app/models/notification_subscription.rb:13:29: C: [Correctable]
Rails/RedundantPresenceValidationOnBelongsTo: Remove explicit presence
validation for notifiable_id.
validates :notifiable_id, presence: true
^^^^^^^^^^^^^^
1 file inspected, 1 offense detected, 1 offense auto-correctable
```
To remediate, I ran:
```shell
> rubocop --only "Rails/RedundantPresenceValidationOnBelongsTo" \
--auto-correct
```
This resolved the `app/models`. Then did some regex magic and removed
the assertions from `spec/models`.
For Forem folks, I wrote a [forem.team post][1] discuss if this is how
we want to proceed.
[1]:https://forem.team/jeremy/rubocop-auto-updating-mayhem-33a6
* Refactor controller validations to model
* Update specs and move current email validation back
* Refactor #subscribed
* Cleanup UserSubscriptions::Create service
* Refactor service
* Move source inside of call for clarity
* Specs for UserSubscription::Create
* Cleanup spec
* Fix Article spec
* Updated for subscriber_email
* Add comment for explicitness of subscriber_email
* Fix reference in comment...oops!
* I know what I'm doing...sometimes...maybe
* Rename CachChecker - Subscription to IsSubscribed
* Use include vs eq in specs for error messages
* attr_accessor --> attr_reader
* Don't explicitly set nil
* Rename Create service to CreateFromService
* Use errors_as_sentence
* Rename service to CreateFromControllerParams
* Assign Struct to a new constant
* Create "blank" EmailSubscriptionTag
* Refactor liquid_tags_used with spec
* Create /user_subscriptions#create
- Update liquid tag name to UserSubscriptionTag
* Add rate limiting and specs
* Add counter_culture for user_subscriptions
* Update /async_info/base_data
- Alphabetize user_data
- Add email
- Add subscription_source_article_ids
- Cache subscription_source_article_ids on User model
* Add stale email check and specs
* Change user_email to subscriber_email for clarity
* Restrict UserSubscriptionTag
* Rename RESTRICTED_TAGS to RESTRICTED_LIQUID_TAGS
* Make TODO comment more clear
* Refactor error responses and update specs
* Update type to source_type in error message
* Use constantize over safe_constantize
* Add check for active source
* Refactor checking of current_user's subscriptions
- Remove data from async_info
- Create a new service to fetch/cache a user's existing subscriptions
* Restrict email in base_data to admin roles
* Oops! Rename liquid tag file
* Change error back to result...oops!
* It's not goodbye, it's see you later. RIP email :/
* Add current_email to /user_subscriptions/base_data
* Revert adding current_email
* Undo async_info_controller changes/fix conflict
* Move params to constant
* Refactor SubscriptionCacheChecker
* Remove duplicate status code in JSON response
* Remove duplicate status code for #subscribed
* Use response.parsed_body
* Remove user guard in SubscriptionCacheChecker
* Add migrations for subscriber_email column
* Add new schema
* Update relationships, specs, and factory
* Use unless index_exists? over if !index_exists?
* Fix typo in last fix for migration
* Rename authored_user_subscriptions
- to source_authored_user_subcriptions
* Add factory methods and specs
- UserSubscription.make
- UserSubscription.make_new
- Article.new_user_subscription
- Article.create_user_subscription
* Remove self and &
* Change make_new to build
* new_user_subscription --> build_user_subscription
* Come on, Travis
* Backend MVP
- Migration
- Model
- Associations
* Add factory, spec, and validations
- Add unqiue index for validations
* Fix specs
* Add author to email_subscriptions
* Add user association to set_author_id
* Add clarifying comment to set_author_id
* Writing is hard sometimes
* Rename email_subscriptions to subscription_sources
* UserSubscription and user_subscription_sourceable
* subscribers --> sourced_subscribers
* Add comment to explain UserSubscription model