* Some major bug fixes related to post sets. Tests for pools and favorites were added.
* Refactored the favorites code a bit. Adding a favorite from either an user or a post now works and will update all necessary records.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class Favorite < ActiveRecord::Base
|
||||
TABLE_COUNT = 100
|
||||
validates_uniqueness_of :post_id, :scope => :user_id
|
||||
belongs_to :post
|
||||
|
||||
def self.model_for(user_id)
|
||||
mod = user_id.to_i % TABLE_COUNT
|
||||
|
||||
Reference in New Issue
Block a user