app/controllers/apicasso/crud_controller.rb in apicasso-0.6.5 vs app/controllers/apicasso/crud_controller.rb in apicasso-0.6.6
- old
+ new
@@ -89,17 +89,10 @@
@object = resource.find(id)
ensure
authorize! action_to_cancancan, @object
end
- # Used to setup the resource's schema, mapping attributes and it's types
- def resource_schema
- schemated = {}
- resource.columns_hash.each { |key, value| schemated[key] = value.type }
- schemated
- end
-
# Used to setup the records from the selected resource that are
# going to be rendered, if authorized
def set_records
authorize! :read, resource.name.underscore.to_sym
@records = resource.ransack(parsed_query).result
@@ -176,16 +169,9 @@
if params[:per_page].to_i < 0
built_unpaginated
else
built_paginated
end
- end
-
- # Only allow a trusted parameter "white list" through,
- # based on resource's schema.
- def object_params
- params.require(resource.name.underscore.to_sym)
- .permit(resource_params)
end
# Common setup to stablish which model is the resource of this request
def set_root_resource
@root_resource = params[:resource].classify.constantize