hyper-mesh
hyper-mesh copied to clipboard
add exists? method
Proof of concept below.
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
def self.exists?(*args)
HyperMeshExists.run(model: name, args: args)
end if RUBY_ENGINE == 'opal'
class HyperMeshExists < Hyperloop::ServerOp
param acting_user: nil, allow_nils: true
param :model
param :args
# use policy system to insure we have permission to ask this question
step { Module.const_get(params.model).exists?(*params.args) }
end
end
i will take it?
@frostmark you may, please do a PR - need help? Just ask.
@catmando okay