scinote-web/app/models/wopi_action.rb

13 lines
393 B
Ruby
Raw Normal View History

2017-06-23 21:19:08 +08:00
class WopiAction < ApplicationRecord
2017-06-28 21:21:32 +08:00
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