scinote-web/app/models/wopi_action.rb
2017-06-28 15:21:32 +02:00

12 lines
393 B
Ruby

class WopiAction < ApplicationRecord
belongs_to :wopi_app,
foreign_key: 'wopi_app_id',
class_name: 'WopiApp',
optional: true
validates :action, :extension, :urlsrc, :wopi_app, presence: true
def self.find_action(extension, activity)
WopiAction.distinct
.where('extension = ? and action = ?', extension, activity).first
end
end