Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSL support for aliasing attributes #64

Open
palexander opened this issue Jan 30, 2013 · 0 comments
Open

DSL support for aliasing attributes #64

palexander opened this issue Jan 30, 2013 · 0 comments
Assignees
Milestone

Comments

@palexander
Copy link
Member

There are cases where Goo objects may need to reference attributes that exist on other Goo objects, generally when you have a container object (Ontology) and related objects (OntologySubmission). For example, when serializing OntologySubmission you want to display the acronym, groups, etc which only exist on the Ontology object.

Here's a sample syntax

class Ontology
  attribute :acronym, :unique => true
  attribute :creator
end

class OntologySubmission
  attribute :submissionId, :unique => true
  attribute :ontology, :instance_of => {:with => :ontology}
  # Default
  alias_attribute :acronym, :instance_of => {:with => :ontology}
  # Change the attribute name
  alias_attribute :author :instance_of => {:with => :ontology, :attribute => :creator}
end

Not sure if this should support read/write or just read

@ghost ghost assigned msalvadores Jan 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants