diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-03-16 16:22:50 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-03-16 16:22:50 +0300 |
commit | 410d25c8ca8afabb25e5f89b36e3cfd09ffe6f87 (patch) | |
tree | 8f159d92f86fbebde5a97cb7c410c85b669475ca /app/models/subscription.rb | |
parent | 0e20dc910f25db3b3f71867d54367db36334ff45 (diff) |
rename table subscribe; make it polymorfic
Diffstat (limited to 'app/models/subscription.rb')
-rw-r--r-- | app/models/subscription.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/subscription.rb b/app/models/subscription.rb new file mode 100644 index 00000000000..7e57a8570ec --- /dev/null +++ b/app/models/subscription.rb @@ -0,0 +1,7 @@ +class Subscription < ActiveRecord::Base + belongs_to :subscribable, polymorphic: true + + validates :user_id, + uniqueness: { scope: [:subscribable_id, :subscribable_type]}, + presence: true +end |