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

New gem release #399

Closed
nathany opened this issue Jul 2, 2014 · 3 comments
Closed

New gem release #399

nathany opened this issue Jul 2, 2014 · 3 comments

Comments

@nathany
Copy link
Contributor

nathany commented Jul 2, 2014

I'm seeing errors when using total_entries since switching from master to 3.0.6. If I switch back to master my specs pass again.

Is #372 included in the 3.0.6 gem release?

@O-I
Copy link

O-I commented Jul 2, 2014

No, it is not. I was just playing around with this.

This is what the relevant code looks like in master in active_record.rb:

def count(*args)
  if limit_value
    excluded = [:order, :limit, :offset, :reorder]
    excluded << :includes unless eager_loading?
    rel = self.except(*excluded)
    # TODO: hack. decide whether to keep
    rel = rel.apply_finder_options(@wp_count_options) if defined? @wp_count_options

    column_name = (select_for_count(rel) || :all)
    rel.count(column_name)
  else
    super(*args)
  end
end

def select_for_count(rel)
  if rel.select_values.present?
    select = rel.select_values.join(", ")
    select if select !~ /[,*]/
  end
end

And this is what they have so far in v3.0.6:

def count(*args)
  if limit_value
    excluded = [:order, :limit, :offset, :reorder]
    excluded << :includes unless eager_loading?
    rel = self.except(*excluded)
    # TODO: hack. decide whether to keep
    rel = rel.apply_finder_options(@wp_count_options) if defined? @wp_count_options
    rel.count(*args)
  else
    super(*args)
  end
end

@nathany
Copy link
Contributor Author

nathany commented Jul 4, 2014

@mislav released 3.0.7. #372 (comment)

Testing it now.

@nathany
Copy link
Contributor Author

nathany commented Jul 4, 2014

Good to go.

@nathany nathany closed this as completed Jul 4, 2014
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