Repository URL to install this package:
|
Version:
3.2.0 ▾
|
# frozen_string_literal: true
require 'delegate'
module FacultyRBAC
# Simply delegates to a dataset, but provides some "obvious" helpers for magic columns
class DatasetDelegator < SimpleDelegator
# Returns a proc that maps a dataset to a delegator wrapping it on the specified field
def self.mapping(map_field)
proc { |*args| new(map_field, *args) }
end
def initialize(map_field, *args)
@map_field = map_field
super(*args)
end
def to_a
map @map_field
end
end
end