preston/bittorious

View on GitHub
app/models/permission.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Permission < ApplicationRecord

    belongs_to :feed
    belongs_to :user

    NO_ROLE = 'none'
    SUBSCRIBER_ROLE = 'subscriber'
    PUBLISHER_ROLE = 'publisher'

    validates_presence_of :user
    validates_presence_of :feed
    validates_uniqueness_of :user, scope: [:feed_id]

end