Class: Relation::Single
- Defined in:
- app/models/relation/single.rb
Overview
Constant Summary collapse
- PERMISSIONS =
[]
Constants inherited from Relation
Class Method Summary collapse
Instance Method Summary collapse
-
#name ⇒ Object
The name of public relation.
Methods inherited from Relation
allow, allow?, #follow?, ids_shared_with, #mode, negative_names, normalize, normalize_id, #positive?, positive_names
Class Method Details
.instance ⇒ Object
10 11 12 13 14 |
# File 'app/models/relation/single.rb', line 10 def instance @instance ||= first || create!(:permissions => ) end |
.permissions ⇒ Object
16 17 18 19 20 |
# File 'app/models/relation/single.rb', line 16 def self::PERMISSIONS.map{ |p| Permission.find_or_create_by_action_and_object p.first, p.last } end |
Instance Method Details
#name ⇒ Object
The name of public relation
25 26 27 |
# File 'app/models/relation/single.rb', line 25 def name I18n.t("relation_#{ self.class.name.split("::").last.underscore }.name") end |