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

criteria.resources ignores opts parameters #25

Open
fonji opened this issue Nov 6, 2013 · 3 comments
Open

criteria.resources ignores opts parameters #25

fonji opened this issue Nov 6, 2013 · 3 comments

Comments

@fonji
Copy link

fonji commented Nov 6, 2013

Hello!

I found an error in lib/tripod/criteria/execution.rb:15.
There's a closing parenthesis at the end of the line instead of an opening {.
This ends the method call and so parameters are ignored.
Third line here:

def resources(opts={})
  Tripod::ResourceCollection.new(
    self.resource_class._resources_from_sparql(self.as_query(opts)),
     # pass in the criteria that was used to generate this collection, as well as whether the user specified return graph
    :return_graph => (opts.has_key?(:return_graph) ? opts[:return_graph] : true),
    :criteria => self
  )
end

Should be

def resources(opts={})
  Tripod::ResourceCollection.new(
    self.resource_class._resources_from_sparql(self.as_query(opts),{
         # pass in the criteria that was used to generate this collection, as well as whether the user specified return graph
        :return_graph => (opts.has_key?(:return_graph) ? opts[:return_graph] : true),
        :criteria => self
      }
    )
  )
end

Sorry I can't create a commit right now, maybe tomorrow.

@RicSwirrl
Copy link
Member

Thanks - I'll take a look. By the way, not forgotten about the other issues; just been super-busy!

On 6 Nov 2013, at 17:42, Yannick Fonjallaz notifications@github.com wrote:

Hello!

I found an error in lib/tripod/criteria/execution.rb:15.
There's a closing parenthesis at the end of the line instead of an opening {.
This ends the method call and so parameters are ignored.
Third line here:

def resources(opts={})
Tripod::ResourceCollection.new(
self.resource_class._resources_from_sparql(self.as_query(opts)),
# pass in the criteria that was used to generate this collection, as well as whether the user specified return graph
:return_graph => (opts.has_key?(:return_graph) ? opts[:return_graph] : true),
:criteria => self
)
end
Should be

def resources(opts={})
Tripod::ResourceCollection.new(
self.resource_class._resources_from_sparql(self.as_query(opts),{
# pass in the criteria that was used to generate this collection, as well as whether the user specified return graph
:return_graph => (opts.has_key?(:return_graph) ? opts[:return_graph] : true),
:criteria => self
}
)
)
end
Sorry I can't create a commit right now, maybe tomorrow.


Reply to this email directly or view it on GitHub.

@fonji
Copy link
Author

fonji commented Nov 6, 2013

Thanks for the answer, sorry for the flood!
I'm super-busy as well, developping an app that uses tripod ;)

@fonji
Copy link
Author

fonji commented Nov 7, 2013

Here's the commit.
I also added some lines in .gitignore to fit my linux env.

Sorry for not creating a pull request, my patch to support Sesame (see #15) makes it ugly.

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