mirror of
https://github.com/we-promise/sure.git
synced 2026-09-05 23:01:26 +00:00
* Add Swift-native Sure app * Fix push subscriptions schema for CI * Address native app review feedback * Address remaining native app review feedback * Use Flutter app logo for native icon * Honor insight notification preferences and locale --------- Co-authored-by: Juan Jose Mata <2v8shcb6pz@privaterelay.appleid.com> Co-authored-by: sure-admin <sure-admin@splashblot.com>
15 lines
516 B
Ruby
15 lines
516 B
Ruby
class PushSubscription < ApplicationRecord
|
|
belongs_to :user
|
|
|
|
enum :environment, { sandbox: "sandbox", production: "production" }, validate: true
|
|
|
|
normalizes :token, with: ->(token) { token.downcase }
|
|
|
|
validates :token, presence: true, uniqueness: { case_sensitive: false },
|
|
format: { with: /\A[0-9a-f]{64,200}\z/i }
|
|
validates :platform, inclusion: { in: %w[ios] }
|
|
validates :last_registered_at, presence: true
|
|
|
|
scope :recent, -> { where("last_registered_at > ?", 90.days.ago) }
|
|
end
|