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

recommended_* returns an Array and not an ActiveRecord::Relation #103

Closed
zenati opened this issue Mar 11, 2015 · 4 comments
Closed

recommended_* returns an Array and not an ActiveRecord::Relation #103

zenati opened this issue Mar 11, 2015 · 4 comments

Comments

@zenati
Copy link

zenati commented Mar 11, 2015

Hello,

class User
  recommends :books
end

If a user has recommendations:

@user.recommended_books => [#<Book...>, #<Book...>, #<Book...>, ...]

if a user doesn't have recommendations:

@user.recommended_books =>  #<ActiveRecord::Relation []>

Am I missing something?

@zenati
Copy link
Author

zenati commented Mar 11, 2015

Gemfile:

gem 'recommendable'

Gemfile.lock:

    recommendable (2.2.0)
      activesupport (>= 3.0.0)
      hooks (>= 0.2.1)
      redis (>= 2.2.0)

@mhuggins
Copy link

Same issue as #96.

davidcelis added a commit that referenced this issue Mar 11, 2015
A supposedly database-compatible way to do this; possibly addresses #96
and #103, but I'd like user feedback first.

Signed-off-by: David Celis <[email protected]>
@davidcelis
Copy link
Owner

Hey. I implemented a supposedly database-compatible way to do this in that above commit. Can you please try bundling off of master? I'd like to get this tested across several databases before releasing a new version.

@davidcelis
Copy link
Owner

closing this as a duplicate of #96, actually. please comment there. thanks!

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

3 participants