module Recurso class Global # no-op methods to support being a Recurso::Resource define_singleton_method :has_one, ->(*args) {} define_singleton_method :has_many, ->(*args) {} define_singleton_method :belongs_to, ->(*args) {} include Singleton include Recurso::Resource def permission_policy OpenStruct.new(policy_type: :open) end def method_missing(method) super unless Recurso::Config.instance.global_relations.include?(method) method.to_s.classify.constantize.all end end end