Ah. It's pretty easy to access the attribute's custom option.
If the type is declared like this:
class QueryParamType < ActiveModel::Type::Value
def type = :query_param
def initialize(**args)
@accepts = args[:accepts]
end
end
then a caller can access the attribute's option value (for the Comment class above) like this:
Query::Comments.attribute_types["created_at"].accepts
Note that the hash keys of attribute_types
are strings, not symbols.