added the notification email method
This commit is contained in:
@@ -27,9 +27,7 @@ class Authentication < ApplicationRecord
|
||||
c.access_token = access_token
|
||||
c.refresh_token = refresh_token
|
||||
c.expires_at = expires_at
|
||||
if expires_at < 1.minute.from_now
|
||||
refresh_from(c)
|
||||
end
|
||||
refresh_from(c) if expires_at < 1.minute.from_now
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,7 +18,7 @@ class Form < ApplicationRecord
|
||||
validates :airtable_api_key, presence: { if: :airtable? }
|
||||
validates :airtable_app_key, presence: { if: :airtable? }
|
||||
validates :airtable_table, presence: { if: :airtable? }
|
||||
|
||||
validates :notify_email, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, on: :update }
|
||||
# TODO: use counter_cache option on association
|
||||
def submissions_count
|
||||
@submissions_count ||= submissions.count
|
||||
@@ -41,7 +41,11 @@ class Form < ApplicationRecord
|
||||
def google?
|
||||
backend_name == 'google_sheets'
|
||||
end
|
||||
def google; google?; end # TODO: remove this alias
|
||||
|
||||
# TODO: remove this alias
|
||||
def google
|
||||
google?
|
||||
end
|
||||
|
||||
def backend
|
||||
@backend ||= SpreadsheetBackends.const_get(backend_name.camelize).new(self)
|
||||
|
||||
Reference in New Issue
Block a user