mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Rubocop: Consistent spacing
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
module ActiveModel
|
||||
class Serializer
|
||||
class Fieldset
|
||||
|
||||
def initialize(fields, root = nil)
|
||||
@root = root
|
||||
@raw_fields = fields
|
||||
@@ -16,7 +15,7 @@ module ActiveModel
|
||||
fields[key.to_sym] || fields[key.pluralize.to_sym]
|
||||
end
|
||||
|
||||
private
|
||||
private
|
||||
|
||||
ActiveModelSerializers.silence_warnings do
|
||||
attr_reader :raw_fields, :root
|
||||
@@ -24,7 +23,7 @@ module ActiveModel
|
||||
|
||||
def parsed_fields
|
||||
if raw_fields.is_a?(Hash)
|
||||
raw_fields.inject({}) { |h,(k,v)| h[k.to_sym] = v.map(&:to_sym); h}
|
||||
raw_fields.inject({}) { |h, (k, v)| h[k.to_sym] = v.map(&:to_sym); h }
|
||||
elsif raw_fields.is_a?(Array)
|
||||
if root.nil?
|
||||
raise ArgumentError, 'The root argument must be specified if the fileds argument is an array.'
|
||||
@@ -36,7 +35,6 @@ module ActiveModel
|
||||
{}
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user