Method: Tripod::Links::ClassMethods#linked_from
- Defined in:
- lib/tripod/links.rb
#linked_from(name, incoming_field_name, options = {}) ⇒ LinkedTo
Define that another resource links to this one. Creates a getter with the name you specify. For this to work, the incoming class needs to define a linked_to relationship. Just creates the relevant getter which always return an array of objects.
linked_from :dogs, :owner
linked_from :doggies, :person, class_name: ‘Dog’
@option options [ String ] class_name The name of the class that links to this resource, if we can’t guess it from the link name
60 61 62 |
# File 'lib/tripod/links.rb', line 60 def linked_from(name, incoming_field_name, = {}) add_linked_from(name, incoming_field_name, ) end |