* meta_search now pulls directly from GitHub
* Updated gems * [inprogress] New pagination helpers used instead of pagination presenters * [inprogress] Favorites refactored to use ActiveRecord * [inprogress] PostSets refactored to use a decorator/dependency injection pattern * [inprogress] Made pool/post interaction more robust * Pool#posts now returns an ActiveRelation object * Fixed unit tests
This commit is contained in:
@@ -3,7 +3,7 @@ class Favorite < ActiveRecord::Base
|
||||
validates_uniqueness_of :post_id, :scope => :user_id
|
||||
|
||||
def self.model_for(user_id)
|
||||
mod = user_id % TABLE_COUNT
|
||||
mod = user_id.to_i % TABLE_COUNT
|
||||
Object.const_get("Favorite#{mod}")
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user