Namespace
Methods
D
O
P
R
Included Modules
Instance Public methods
display_name()
   # File rhino/rhino/lib/rhino/resource.rb
34 def display_name
35   return name if respond_to? :name
36   return title if respond_to? :title
37 
38   nil
39 end
owner()
   # File rhino/rhino/lib/rhino/resource.rb
30 def owner
31   send self.class.resource_owned_by
32 end
policy_class()
   # File rhino/rhino/lib/rhino/resource.rb
43 def policy_class
44   _policy_class
45 end
rhino_policy(policy)
   # File rhino/rhino/lib/rhino/resource.rb
47 def rhino_policy(policy)
48   self._policy_class = "rhino/#{policy}_policy".classify.constantize
49 end
route_api()
    # File rhino/rhino/lib/rhino/resource/routing.rb
103 def route_api
104   "#{self.class.route_api}/#{id}"
105 end
route_frontend()
    # File rhino/rhino/lib/rhino/resource/routing.rb
 78 def route_frontend # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
 79   base_owner_pk = "#{Rhino.base_owner.table_name}.#{Rhino.base_owner.primary_key}"
 80 
 81   joins = joins_for_base_owner
 82   base_owner_id = if joins.empty?
 83     # if this is Model is the base owner, we don't to include it in frontend url
 84     nil
 85   else
 86     base_owner_ids = self.class.joins(joins).where(id: id).pluck(base_owner_pk)
 87     if base_owner_ids.length != 1
 88       # if this Model doesn't have a clear single path to the base owner Model,
 89       # we shouldn't include it in the frontend url
 90       nil
 91     else
 92       base_owner_ids.first
 93     end
 94   end
 95 
 96   if base_owner_id.nil?
 97     "#{self.class.route_frontend}/#{id}"
 98   else
 99     "/#{base_owner_id}#{self.class.route_frontend}/#{id}"
100   end
101 end