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

Using multiple filters doesn't work as expected #119

Open
lpdahito opened this issue Apr 6, 2012 · 2 comments
Open

Using multiple filters doesn't work as expected #119

lpdahito opened this issue Apr 6, 2012 · 2 comments

Comments

@lpdahito
Copy link

lpdahito commented Apr 6, 2012

I have the following code:

require 'garb'

Garb::Session.login("username", "password")

profile = Garb::Management::Profile.all.detect {|p| p.title == "Admin"}

class PageViews
  extend Garb::Model

  metrics :pageviews
  dimensions :page_path
end

date1 = Date.today - 30
date2 = Date.today

object = PageViews.results(profile, :start_date => date1, :end_date => date2, :filters => [{:page_path.matches => "/home"}, {:page_path.matches => "/about"}])

object.each do |result|
  puts "#{result.page_path} #{result.pageviews}"
end

The output expected from this code should be this:

/about 32
/home 106

Instead, the result I get outputs all the "page_paths" of my website with its number of pageviews:

/ 503
/about 32
/contact 12
/home 106
... etc

What seems to be the problem?
How do I fix it?

Thank you,

LP

@lpdahito
Copy link
Author

lpdahito commented Apr 6, 2012

By the way I'm using:
Ruby 1.9.2
garb (0.9.1)

@cirdes
Copy link

cirdes commented Jan 2, 2013

+1

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