Sha256: 4d331e9cc48fd0a5dc45b85f09282556fbf0854359c182326d3ca96bc5a714a5
Contents?: true
Size: 353 Bytes
Versions: 8
Compression:
Stored size: 353 Bytes
Contents
module Spree class Favorite < ActiveRecord::Base belongs_to :product belongs_to :user validates :user_id, :product_id, :presence => true validates :product_id, :uniqueness => { :scope => :user_id, :message => "already marked as favorite" } validates :product, :presence => { :message => "is invalid" }, :if => :product_id end end
Version data entries
8 entries across 8 versions & 1 rubygems