hyper-mesh icon indicating copy to clipboard operation
hyper-mesh copied to clipboard

add exists? method

Open catmando opened this issue 8 years ago • 3 comments

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

catmando avatar Sep 18 '17 02:09 catmando

i will take it?

frostmark avatar Oct 27 '17 19:10 frostmark

@frostmark you may, please do a PR - need help? Just ask.

catmando avatar Nov 21 '17 12:11 catmando

@catmando okay

frostmark avatar Nov 22 '17 09:11 frostmark