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

Added Base#to_json and Base#attributes. #296

Merged
merged 1 commit into from
Jan 2, 2014
Merged

Added Base#to_json and Base#attributes. #296

merged 1 commit into from
Jan 2, 2014

Conversation

jcoyne
Copy link
Member

@jcoyne jcoyne commented Dec 31, 2013

ActiveFedora::Base#attributes is required to support the #to_json
method, but it's useful in it's own right.

In order to accomplish this, we had to remove auto-generating datastream
accessor methods when ActiveFedora::Base#add_datastream is called. If
you want an accessor for your datastream (and you aren't using has_metadata
or has_file_datastream) then you should call
self.class.build_datastream_accessor(dsid)

`ActiveFedora::Base#attributes` is required to support the #to_json
method, but it's useful in it's own right.

In order to accomplish this, we had to remove auto-generating datastream
accessor methods when `ActiveFedora::Base#add_datastream` is called.  If
you want an accessor for your datastream (and you aren't using `has_metadata`
or `has_file_datastream`) then you should call
`self.class.build_datastream_accessor(dsid)`
dchandekstark added a commit that referenced this pull request Jan 2, 2014
Added Base#to_json and Base#attributes.
@dchandekstark dchandekstark merged commit 8c9643d into master Jan 2, 2014
@jcoyne jcoyne deleted the to_json branch January 6, 2014 22:44
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

Successfully merging this pull request may close these issues.

2 participants