Coder Social home page Coder Social logo

Comments (9)

flyerhzm avatar flyerhzm commented on June 11, 2024

Can you give me the source codes that how you use the submissions collection?

from bullet.

peschkaj avatar peschkaj commented on June 11, 2024

Sure thing.

There is a controller method:

def show_category
    @category = Category.find_by_name(params[:category_name], 
                                      :include => {:submissions => :user},
                                      :order => "id DESC")
end

The view contains:
<%= render :partial => 'shared/submission', :collection => @category.submissions %>

And the shared/_submission.html.erb contains:


<%= link_to submission.title, submission.url, :target => "_blank" %> submitted by <%= link_to submission.user.name, user_path(submission.user) %> on <%= submission.created_at %>

from bullet.

flyerhzm avatar flyerhzm commented on June 11, 2024

It seems that I can't reproduce this issue.
Can you tell me more information? What is your rails version? How many submissions belong to @category when bullet gave you the wrong notify?

from bullet.

peschkaj avatar peschkaj commented on June 11, 2024

Thanks for the fast response. Rails version is 2.3.5, bullet is 1.7.2, ruby is ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]

@category.submissions had 3 rows in it when bullet gave me the notification.

from bullet.

flyerhzm avatar flyerhzm commented on June 11, 2024

I have add a spec spec/bullet/association_for_peschkaj_spec.rb for you and tried to reproduce the issue, but I failed. If possible, can you change the spec code to reproduce the issue.

I guess there is some other problem cause this, not partial collection. If possible, you can give me your rails app and some stub data that I can figure out where the problem is.

Thanks

from bullet.

peschkaj avatar peschkaj commented on June 11, 2024

I will send a copy of the source, including a sqlite database, to the email address listed on your github page.

from bullet.

peschkaj avatar peschkaj commented on June 11, 2024

When I run the spec, the spec created for me passes, but Bullet::Association has_many for unused cases fails with the following:

Bullet::Association has_many for unused cases

  • should not incorrectly mark associations as unused when multiple object instances (FAILED - 1)
  • should not incorrectly mark associations as unused when multiple object instances different Model (FAILED - 2)
  • should not have unused when small set of returned records are discarded

'Bullet::Association has_many for unused cases should not incorrectly mark associations as unused when multiple object instances' FAILED
expected unused_preload_associations_for?(Comment(id: integer, name: string, post_id: integer, author_id: integer), :post) to return true, got false
./spec/bullet/association_spec.rb:140:

'Bullet::Association has_many for unused cases should not incorrectly mark associations as unused when multiple object instances different Model' FAILED
expected unused_preload_associations_for?(Comment(id: integer, name: string, post_id: integer, author_id: integer), :author) to return true, got false
./spec/bullet/association_spec.rb:151:

Finished in 1.349615 seconds

73 examples, 2 failures
rake aborted!
Command /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I"lib" "/Library/Ruby/Gems/1.8/gems/rspec-1.2.9/bin/spec" "spec/bullet/association_for_chris_spec.rb" "spec/bullet/association_for_peschkaj_spec.rb" "spec/bullet/association_spec.rb" "spec/bullet/counter_spec.rb" failed

from bullet.

flyerhzm avatar flyerhzm commented on June 11, 2024

I have fixed this issue. Just upgrade to gem 1.7.3. This is because the logic of adding eager loadings has a slight error.
Thank you for providing me the source codes. And let me if the new gem works for you.

btw, the spec failures are not related to this issue.

from bullet.

peschkaj avatar peschkaj commented on June 11, 2024

Thank you, that worked perfectly.

from bullet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.