I have for example this code in my model validation:
validates :fb_user_id, :uniqueness => {:scope => :campaign_id}
But can occurs that campaign_id has value -1 for different users, that raises the validate exception.
It’s possible to do something like this?
validates :fb_user_id, :uniqueness => {:scope => :campaign_id}, if :campaign_id != -1
Can I put a if conditions inline in the validates statement or if not possible how can I do the trick?
Following the idea of MagicMarkker, I have found a solution: