lib/generators/schemable/model_generator.rb in schemable-0.1.1 vs lib/generators/schemable/model_generator.rb in schemable-0.1.2
- old
+ new
@@ -10,11 +10,11 @@
@model_name = options[:model_name]
@model_name != 'Model' || raise('Model name is required')
end
def copy_initializer
- target_path = "lib/swagger/definitions/#{@model_name.underscore.downcase.singlurize}.rb"
+ target_path = "lib/swagger/definitions/#{@model_name.underscore.downcase.singularize}.rb"
if Rails.root.join(target_path).exist?
say_status('skipped', 'Model definition already exists')
else
@@ -27,10 +27,10 @@
include SerializersHelper # This is a helper module that contains a method "serializers_map" that maps models to serializers
attr_accessor :instance
def initialize
- @instance ||= JSONAPI::Serializable::Renderer.new.render(FactoryBot.create(:#{@model_name.underscore.downcase.singlurize}), class: serializers_map, include: [])
+ @instance ||= JSONAPI::Serializable::Renderer.new.render(FactoryBot.create(:#{@model_name.underscore.downcase.singularize}), class: serializers_map, include: [])
end
def serializer
V1::#{@model_name.classify}Serializer
end