Sha256: ec3ad8ae6a654d4840569f6e5da4200ca525d9434510997320163f090a26050f
Contents?: true
Size: 754 Bytes
Versions: 39
Compression:
Stored size: 754 Bytes
Contents
module Gris module CrudHelpers def create(type, options = {}) instance = type.create! options[:from] present instance, with: options[:with] end def update(instance, options = {}) instance.update_attributes! options[:from] present instance, with: options[:with] end def delete(instance, options = {}) instance.destroy present instance, with: options[:with] end def permitted_params(options = {}) options = { include_missing: false }.merge(options) process_datetime_params(params) if respond_to?(:process_datetime_params) declared(params, options) end # extend all endpoints to include this Grape::Endpoint.send :include, self if defined?(Grape) end end
Version data entries
39 entries across 39 versions & 1 rubygems