transferred Code Ocean from original repository to GitHub
This commit is contained in:
13
app/models/consumer.rb
Normal file
13
app/models/consumer.rb
Normal file
@ -0,0 +1,13 @@
|
||||
class Consumer < ActiveRecord::Base
|
||||
has_many :users
|
||||
|
||||
scope :with_users, -> { where('id IN (SELECT consumer_id FROM internal_users)') }
|
||||
|
||||
validates :name, presence: true
|
||||
validates :oauth_key, presence: true, uniqueness: true
|
||||
validates :oauth_secret, presence: true
|
||||
|
||||
def to_s
|
||||
name
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user