davidcelis / recommendable

:+1::-1: A recommendation engine using Likes and Dislikes for your Ruby app
http://davidcelis.github.io/recommendable/
MIT License
1.36k stars 115 forks source link

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

Closed zenati closed 9 years ago

zenati commented 9 years ago

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 commented 9 years ago

Gemfile:

gem 'recommendable'

Gemfile.lock:

    recommendable (2.2.0)
      activesupport (>= 3.0.0)
      hooks (>= 0.2.1)
      redis (>= 2.2.0)
mhuggins commented 9 years ago

Same issue as #96.

davidcelis commented 9 years ago

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 commented 9 years ago

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