lib/generators/schemable/model_generator.rb in schemable-0.1.4 vs lib/generators/schemable/model_generator.rb in schemable-1.0.0
- old
+ new
@@ -19,25 +19,11 @@
else
create_file(target_path, <<-FILE
module Swagger
module Definitions
- class #{@model_name.classify}
-
- include Schemable
- 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.singularize}), class: serializers_map, include: [])
- end
-
- def serializer
- V1::#{@model_name.classify}Serializer
- end
-
+ class #{@model_name.classify} < Schemable::Definition
def excluded_create_request_attributes
%i[updated_at created_at]
end
def excluded_update_request_attributes
@@ -46,10 +32,9 @@
end
end
end
FILE
)
-
end
end
end
end