mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-20 00:35:22 +00:00
* linting * migrations * user modelassss * controllers * views and shii * fix bad input on seeds * fix intenting * DRY!!!
19 lines
447 B
Ruby
19 lines
447 B
Ruby
class OauthApplication < Doorkeeper::Application
|
|
belongs_to :owner, polymorphic: true, optional: true
|
|
|
|
scope :verified, -> { where(verified: true) }
|
|
scope :unverified, -> { where(verified: false) }
|
|
|
|
attr_accessor :admin_bypass
|
|
|
|
validate :locked_name, on: :update
|
|
|
|
private
|
|
|
|
def locked_name
|
|
return if admin_bypass
|
|
return unless verified? && name_changed?
|
|
|
|
errors.add(:name, "cannot be changed for verified apps")
|
|
end
|
|
end
|