Class: Dscf::Marketplace::Agent

Inherits:
ApplicationRecord show all
Includes:
AttachmentUrls
Defined in:
app/models/dscf/marketplace/agent.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.ransackable_associations(_auth_object = nil) ⇒ Object



44
45
46
# File 'app/models/dscf/marketplace/agent.rb', line 44

def self.ransackable_associations(_auth_object = nil)
  %w[onboarded_by photo_attachment photo_blob national_id_attachment national_id_blob]
end

.ransackable_attributes(_auth_object = nil) ⇒ Object

Ransack



38
39
40
41
42
# File 'app/models/dscf/marketplace/agent.rb', line 38

def self.ransackable_attributes(_auth_object = nil)
  %w[id code name phone service_area sub_city woreda status fayda_number
     verification_status rejection_reason rejected_at modified_at gender
     onboarded_by_id created_at updated_at]
end

Instance Method Details

#national_id_urlObject



52
53
54
# File 'app/models/dscf/marketplace/agent.rb', line 52

def national_id_url
  attachment_url_for(national_id)
end

#photo_urlObject



48
49
50
# File 'app/models/dscf/marketplace/agent.rb', line 48

def photo_url
  attachment_url_for(photo)
end