Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 236 lines (187 sloc) 8.718 kB
7ebf4fe @davidcelis Add a change log.
authored
1 Changelog
2 =========
3
7c0d92f @davidcelis Recommendable 2.0 - please read the CHANGELOG
authored
4 2.0.0 (Current version)
5 -----------------------
6 **IMPORTANT**: This is a MAJOR version bump that should greatly improve the performance of Recommendable. Most of the library has been rewritten from the ground up and, as such, there are steps you must take to make your application compatibile with this version.
7
8 1. Flush your Redis database. Yes, you'll have to regenerate any recommendations at the end. Sorry.
9 2. Please make a migration like the following. This migration will be irreversible if you uncomment the bit to drop the tables. If you do want to drop the tables, you should probably make a backup of your database first. I am not responsible for lost data, angry users, broken marriages, _et cetera_.
10
11 ```ruby
12 # Require the model that receives recommendations so Recommendable detects it
13 require Rails.root.join('app', 'models', 'user')
14
15 class UpdateRecommendable < ActiveRecord::Migration
16 def up
17 Recommendable.redis.flushdb # Step 1
18
19 connection = ActiveRecord::Base.connection
20 # Transfer likes
21 result = connection.execute('SELECT * FROM recommendable_likes')
22 result.each do |row|
23 liked_set = Recommendable::Helpers::RedisKeyMapper.liked_set_for(row['likeable_type'], row['user_id'])
24 liked_by_set = Recommendable::Helpers::RedisKeyMapper.liked_by_set_for(row['likeable_type'], row['likeable_id'])
25 Recommendable.redis.sadd(liked_set, row['likeable_id'])
26 Recommendable.redis.sadd(liked_by_set, row['user_id'])
27 end
28
29 # Transfer dislikes
30 result = connection.execute('SELECT * FROM recommendable_dislikes')
31 result.each do |row|
32 disliked_set = Recommendable::Helpers::RedisKeyMapper.disliked_set_for(row['dislikeable_type'], row['user_id'])
33 disliked_by_set = Recommendable::Helpers::RedisKeyMapper.disliked_by_set_for(row['dislikeable_type'], row['dislikeable_id'])
34 Recommendable.redis.sadd(disliked_set, row['dislikeable_id'])
35 Recommendable.redis.sadd(disliked_by_set, row['user_id'])
36 end
37
38 # Transfer hidden items
39 result = connection.execute('SELECT * FROM recommendable_ignores')
40 result.each do |row|
41 set = Recommendable::Helpers::RedisKeyMapper.hidden_set_for(row['ignorable_type'], row['user_id'])
42 Recommendable.redis.sadd(set, row['ignorable_id'])
43 end
44
45 # Transfer bookmarks
46 result = connection.execute('SELECT * FROM recommendable_stashes')
47 result.each do |row|
48 set = Recommendable::Helpers::RedisKeyMapper.bookmarked_set_for(row['stashable_type'], row['user_id'])
49 Recommendable.redis.sadd(set, row['stashable_id'])
50 end
51
52 # Recalculate scores
53 Recommendable.config.ratable_classes.each do |klass|
54 klass.pluck(:id).each { |id| Recommendable::Helpers::Calculations.update_score_for(klass, id) }
55 end
56
57 # Remove old tables. Uncomment this if you're feeling confident. Please
58 # back up your database before doing this. Thanks.
59 # drop_table :recommendable_likes
60 # drop_table :recommendable_dislikes
61 # drop_table :recommendable_ignores
62 # drop_Table :recommendable_stashes
63 end
64
65 def down
66 # Recreate the tables from previous migrations, if you must.
67 end
68 end
69
70 ```
71
72 * Recommendable no longer requires Rails (it does, however, still require ActiveSupport)
73 * Add support for more ORMs: DataMapper, Mongoid, and MongoMapper
74 * Renamed the concept of Ignoring to Hiding
75 * Renamed the concept of Stashing to Bookmarking
76 * Likes, Dislikes, Hidden Items, and Bookmarked items are no longer stored as models. They are, instead, permanently stored in Redis.
77 * Added a Configuration class
78 * Enable Ruby 1.8.7 support
b47cd05 @davidcelis Don't use a queue named recommendable
authored
79
5cb31ff @davidcelis Bump version to 1.1.7.
authored
80 1.1.7 (Current version)
fdd1ef7 @davidcelis Bump version to 1.1.0
authored
81 -----------------------
5cb31ff @davidcelis Bump version to 1.1.7.
authored
82 * Fix #50, a method that was forgotten to time during the ignoreable => ignorable typo update
83
84 1.1.6
85 -----
3703a19 @davidcelis Bump version to 1.1.6.
authored
86 * Minor code cleanup for my benefit
87
88 1.1.5
89 -----
c6c98ed @davidcelis Bump version to 1.1.5.
authored
90 * Fix #47, a problem where models could not recommend themselves
91
92 1.1.4
93 -----
94 * Fix #41, a problem where Resque rake tasks were required regardless of whether or not it was bundled
95 * Fix #46 by adding UniqueJob middleware for Sidekiq.
96 * Added caches for an item's number of likes and dislikes received
97
98 1.1.3
99 -----
100 * Update Redis.
101
102 1.1.2
103 -----
e204f50 @davidcelis Bump version to 1.1.2.
authored
104 * Fix #38, a problem with enqueueing users based on updating the score of a recommendable record
105
106 1.1.1
107 -----
fdd1ef7 @davidcelis Bump version to 1.1.0
authored
108 * Support for Sidekiq, Resque, DelayedJob and Rails::Queueing (issue #28)
109 * You must manually bundle Sidekiq, Resque, or DelayedJob. Rails::Queueing is available as a fallback for Rails 4.x
110 * Use [apotonick/hooks](https://github.com/apotonick/hooks) to implement callbacks (issue #25). See the [detailed README](http://davidcelis.com/recommendable) for more info on usage.
111
112 1.0.0
113 -----
1fa0639 @davidcelis Bump version to 1.0.0.
authored
114 * Dynamic finders now return ActiveRecord::Relations! This means you can chain other ActiveRecord query methods like so:
a2c2d25 @davidcelis Syntax.
authored
115
1fa0639 @davidcelis Bump version to 1.0.0.
authored
116 ```ruby
117 current_user.recommended_posts.where(:category => "technology")
118 current_user.liked_movies.limit(10)
119 current_user.stashed_books.where(:author => "Cormac McCarthy")
120 current_user.disliked_shows.joins(:cast_members).where('cast_members.name = Kim Kardashian')
121 ```
122
123 * You can now specify a count for `User#recommendations`:
124
125 ```ruby
126 current_user.recommendations(10)
127 ```
a2c2d25 @davidcelis Syntax.
authored
128
1fa0639 @davidcelis Bump version to 1.0.0.
authored
129 * Bug fixes
a2c2d25 @davidcelis Syntax.
authored
130
131 0.2.0
132 -----
dcf7578 @davidcelis Fix spec/dummy application.
authored
133 * NOTE: This release is NOT backwards compatible. Please migrate your databases:
134
135 ```
136 rename_column :recommendable_ignores, :ignoreable_id, :ignorable_id
137 rename_column :recommendable_ignores, :ignoreable_type, :ignorable_type
a70ffa4 @davidcelis Bump version to 0.2.0
authored
138 rename_table :recommendable_stashed_items, :recommendable_stashes
dcf7578 @davidcelis Fix spec/dummy application.
authored
139 ```
140
470a27e @davidcelis Code cleanup
authored
141 * Fix an issue with recommendable models implemented via STI
5a73667 @davidcelis Bump version to 0.1.9. NOTE: Backwards-incompatible update.
authored
142 * Fix a library-wide typo of "ignoreable" to "ignorable"
a70ffa4 @davidcelis Bump version to 0.2.0
authored
143
144 0.1.9
145 -----
146 * Yanked due to breaking bug
5a73667 @davidcelis Bump version to 0.1.9. NOTE: Backwards-incompatible update.
authored
147
148 0.1.8
149 -----
150 * Revert changes made in 0.1.7 due to licensing
151
152 0.1.7
153 -----
154 * Yanked and no longer available.
155 * Attempted switch from Resque to Sidekiq
156
157 0.1.6
158 -----
a406434 @davidcelis Bump version to 0.1.6
authored
159 * Dynamic finders for your User class:
160
161 `current_user.liked_movies`
162 `current_user.disliked_shows`
163 `current_user.recommended_movies`
164
165 * Implement sorting of recommendable models:
166
167 ``` ruby
168 >> Movie.top(5)
169 => [#<Movie id: 14>, #<Movie id: 15>, #<Movie id: 13>, #<Movie id: 12>, #<Movie id: 11>]
170 >> Movie.top
171 => #<Movie id: 14>
172 ```
173
174 * Bugfix: users/recommendable objects will now be removed from Redis upon being destroyed
175
176 0.1.5
177 -----
5b1e912 @davidcelis Bump version to 0.1.5
authored
178 * Major bugfix: similarity values were, incorrectly, being calculated as 0.0 for every user pair. Sorry!
179 * The tables for all models are now all prepended with "recommendable_" to avoid possible collision. If upgrading from a previous version, please do the following:
180
181 ``` bash
182 $ rails g migration RenameRecommendableTables
183 ```
184
185 And paste this into your new migration:
186
187 ``` ruby
188 class RenameRecommendableTables < ActiveRecord::Migration
189 def up
190 rename_table :likes, :recommendable_likes
191 rename_table :dislikes, :recommendable_dislikes
192 rename_table :ignores, :recommendable_ignores
193 rename_table :stashed_items, :recommendable_stashed_items
194 end
195
196 def down
197 rename_table :recommendable_likes, :likes
198 rename_table :recommendable_dislikes, :dislikes
199 rename_table :recommendable_ignores, :ignores
200 rename_table :recommendable_stashed_items, :stashed_items
201 end
202 end
203 ```
204
205 0.1.4
206 -----
7ba3a7d @davidcelis Bump version to 0.1.4
authored
207 * `acts_as_recommendable` is no longer needed in your models
208 * Instead of declaring `acts_as_recommended_to` in your User class, please use `recommends` instead, passing in a list of your recommendable models as a list of symbols (e.g. `recommends :movies, :books`)
209 * Your initializer should no longer declare the user class. This is no longer necessary and is deprecated.
210 * Fix an issue that caused the unnecessary need for eager loading models in development
211 * Removed aliases: `liked_records`, `liked_records_for`, `disliked_records`, and `disliked_records_for`
212 * Renamed methods:
213 * `has_ignored?` => `ignored?`
214 * `has_stashed?` => `stashed?`
215 * Code quality tweaks
216
31544f7 @davidcelis Bump version to 0.1.3
authored
217 0.1.3 (current version)
7ebf4fe @davidcelis Add a change log.
authored
218 -----------------------
219
31544f7 @davidcelis Bump version to 0.1.3
authored
220 * Improvements to speed of similarity calculations.
221 * Added an instance method to items that act_as_recommendable, `rated_by`. This returns an array of users that like or dislike the item.
222
223 0.1.2
224 -----
225
7ebf4fe @davidcelis Add a change log.
authored
226 * Fix an issue that could cause similarity values between users to be incorrect.
227 * `User#common_likes_with` and `User#common_dislikes_with` now return the actual Model instances by default. Accordingly, these methods are no longer private.
228
229 0.1.1
230 -----
231 * Introduce the "stashed item" feature. This gives the ability for users to save an item in a list to try later, while at the same time removing it from their list of recommendations. This lets your users keep getting new recommendations without necessarily having to rate what they know they want to try.
232
233 0.1.0
234 -----
235 * Welcome to recommendable!
Something went wrong with that request. Please try again.