Hello,
I have a posts model which has_one reposts and has_one sponsored. User can purchase reposts and sponsored posts while creating a post. I want that the minimum purchase(sum of reposts and sponsored purchases) be atleast 1$. so i want to validate this in the post model but i can't figure out on how to write such a validation rule. Here is my post model:
class Post < ActiveRecord::Base
has_one :repost
has_one :sponsor
Any help is more than appreciated.
Thanks