added 260907 version of worker toolkit
This commit is contained in:
18
worker-toolkit-flaredown/repo/backend/app/models/pattern.rb
Normal file
18
worker-toolkit-flaredown/repo/backend/app/models/pattern.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
class Pattern
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
field :encrypted_user_id, type: String, encrypted: {type: :integer}
|
||||
field :start_at, type: Date
|
||||
field :end_at, type: Date
|
||||
field :includes, type: Array, default: []
|
||||
field :name, type: String
|
||||
|
||||
index(encrypted_user_id: 1)
|
||||
|
||||
validates :encrypted_user_id, presence: true
|
||||
|
||||
def author
|
||||
@author ||= User.find_by(id: SymmetricEncryption.decrypt(encrypted_user_id))
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user