Sha256: 94447b2cd8521a526f33a321ee968f80bf79fada9378902b87fa30e0ba0f3113

Contents?: true

Size: 462 Bytes

Versions: 1

Compression:

Stored size: 462 Bytes

Contents

require 'phony_rails'

module Gringotts
  class Settings < ActiveRecord::Base
    
    belongs_to :vault
    validates  :vault_id,     presence: true, uniqueness: true
    phony_normalize :phone_number, :default_country_code => 'US'
    validates  :phone_number, presence: true, uniqueness: true, phony_plausible: true
    
    after_update :unconfirm!, :if => :phone_number_changed?
    
    def unconfirm!
      self.vault.unconfirm!
    end
    
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gringotts-0.6.7 app/models/gringotts/settings.rb