Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

mini_api

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mini_api - npm Package Compare versions

Comparing version
0.1.5
to
0.1.6
+7
-1
lib/mini_api/model_responder.rb

@@ -22,3 +22,3 @@ # frozen_string_literal: true

success: resource_has_errors? == false,
message: @options[:message] || message
message: message
}

@@ -40,2 +40,8 @@

def message
return if @options[:message] == :empty
@options[:message] || i18n_message
end
def resource_has_errors?

@@ -42,0 +48,0 @@ !@resource.errors.empty?

+6
-8

@@ -9,3 +9,4 @@ # frozen_string_literal: true

# With this, is possible define serializers for the same resource
# in different controller scopes
# in different controller scopes.
# If the resource class does not have a resource, will be use the default `as_json` method
def serialiable_body(resource)

@@ -28,3 +29,3 @@ controller_scope = @controller.class.module_parents

break DefaultResource if controller_scope.empty?
break if controller_scope.empty?

@@ -34,3 +35,5 @@ controller_scope.shift

serializer_class.new(resource)
return serializer_class.new(resource) if serializer_class
resource
end

@@ -47,8 +50,3 @@

end
# Empty serializer class for when resource does not have a custom class
class DefaultResource
include Alba::Resource
end
end
end

@@ -36,3 +36,3 @@ # frozen_string_literal: true

module Message
def message
def i18n_message
kind = @resource.errors.empty? ? 'notice' : 'alert'

@@ -39,0 +39,0 @@

# frozen_string_literal: true
module MiniApi
VERSION = '0.1.5'
VERSION = '0.1.6'
end

@@ -207,2 +207,7 @@ ![](https://github.com/leoncruz/api-responder/actions/workflows/tests.yml/badge.svg)

If you would like to send the message as `null`, has to use the `:empty` symbol, like:
```ruby
render_json @object, message: :empty
```
### Transform keys

@@ -209,0 +214,0 @@