Class: SharedFolder
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- SharedFolder
- Defined in:
- app/models/shared_folder.rb
Overview
the shared folder model
Instance Method Summary collapse
-
#fetch_user_id_associated_to_email ⇒ Object
Return user id associated to share_email
used only when share_user_id is missing
it happens when a share is given to an email that has not created an account in the database
the system uses the method fetch_user_id_associated_to_email after the user’s registration
and fills the share_user_id field in the table shared_folders. -
#missing_share_user_id? ⇒ Boolean
Return true if share refers to an email that has not yet created an account.
Instance Method Details
#fetch_user_id_associated_to_email ⇒ Object
Return user id associated to share_email
used only when share_user_id is missing
it happens when a share is given to an email that has not created an account in the database
the system uses the method fetch_user_id_associated_to_email after the user’s registration
and fills the share_user_id field in the table shared_folders
26 27 28 29 30 31 32 |
# File 'app/models/shared_folder.rb', line 26 def fetch_user_id_associated_to_email shemail = self.share_email if Rails.configuration.sharebox["downcase_email_search_autocomplete"] shemail=shemail.downcase end return User.where(email: shemail).ids[0] end |
#missing_share_user_id? ⇒ Boolean
Return true if share refers to an email that has not yet created an account
16 17 18 |
# File 'app/models/shared_folder.rb', line 16 def missing_share_user_id? return (self.share_email and not self.share_user_id) end |