re: RuboCop - replace rocket style hashes

This commit is contained in:
Alexey Dubovskoy
2016-06-20 20:58:50 +01:00
parent 004f1437d8
commit 024b2d51d3
19 changed files with 99 additions and 108 deletions

View File

@@ -2,11 +2,11 @@ module Rails
module Generators
class SerializerGenerator < NamedBase
source_root File.expand_path('../templates', __FILE__)
check_class_collision :suffix => 'Serializer'
check_class_collision suffix: 'Serializer'
argument :attributes, :type => :array, :default => [], :banner => 'field:type field:type'
argument :attributes, type: :array, default: [], banner: 'field:type field:type'
class_option :parent, :type => :string, :desc => 'The parent class for the generated serializer'
class_option :parent, type: :string, desc: 'The parent class for the generated serializer'
def create_serializer_file
template 'serializer.rb.erb', File.join('app/serializers', class_path, "#{file_name}_serializer.rb")