Class: Relation::Single
- Defined in:
- app/models/relation/single.rb
Overview
Constant Summary
Constants inherited from Relation
Class Method Summary collapse
- .default_for(actor) ⇒ Object
-
.of(actor) ⇒ Object
The Public belonging to actor.
Instance Method Summary collapse
-
#name ⇒ Object
The name of public relation.
Methods inherited from Relation
allow, allow?, #mode, negative_names, normalize, normalize_id, #positive?, positive_names
Class Method Details
.default_for(actor) ⇒ Object
8 9 10 |
# File 'app/models/relation/single.rb', line 8 def default_for(actor) create! :actor => actor end |
.of(actor) ⇒ Object
The Public belonging to actor
13 14 15 |
# File 'app/models/relation/single.rb', line 13 def of(actor) actor(actor).first end |
Instance Method Details
#name ⇒ Object
The name of public relation
19 20 21 |
# File 'app/models/relation/single.rb', line 19 def name I18n.t("relation_#{ self.class.name.split("::").last.underscore }.name") end |