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

Revert Reload on #new #87

Open
tpendragon opened this issue Jan 6, 2015 · 5 comments
Open

Revert Reload on #new #87

tpendragon opened this issue Jan 6, 2015 · 5 comments
Labels
Milestone

Comments

@tpendragon
Copy link
Contributor

So in using ActiveTriples::Resources as "Almost ActiveRecord" objects, the only big difference I found was that because they reload on #new, there's no such thing as a record with a URI in the database that's not persisted, which makes things like #new forms difficult.

We ended up writing https://github.com/OregonDigital/ControlledVocabularyManager/blob/feature/ActiveTermWrapper/lib/active_triples_adapter.rb

Should we push this kind of behavior into the AT API for a new major version?

@no-reply
Copy link
Member

no-reply commented Jan 6, 2015

I'm in favor of changing this and targeting it at the 1.0 release.

@mjsuhonos
Copy link
Member

Following up on this; we are still calling #reload in #initialize here.

I might propose rewriting L101-103 like so:

if resource_uri
      set_subject!(resource_uri) 
      reload
end

Would this fit with the past (now closed) issues that reference this one? I haven't tested this change against the specs, just brainstorming.

@elrayle
Copy link
Member

elrayle commented Feb 25, 2016

There is an open issue (#194) that is affected by reload. I do not know whether @mjsuhonos proposal would impact this for the better or worse. This issue came with the change from 0.6 to 0.8.

@mjsuhonos
Copy link
Member

Thanks @elrayle - I'll keep an eye on #194; unfortunately I'm not too familiar with ParentStrategy so probably can't help much on that issue right now.

Implementing the code above against the blank_node_test branch had no effect on the test results, so they're likely separate issues.

@no-reply
Copy link
Member

no-reply commented Aug 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants