Uses model_name as an instance method

This commit is contained in:
Muhammad Nawzad 2023-11-10 23:44:11 +03:00
parent 0da8634c76
commit b03fcc60ca
No known key found for this signature in database
GPG Key ID: B954B6AAE33940B2
2 changed files with 3 additions and 3 deletions

View File

@ -92,8 +92,8 @@ module Schemable
self.class.name.gsub('Swagger::Definitions::', '').constantize
end
def self.model_name
name.gsub('Swagger::Definitions::', '').pluralize.underscore.downcase
def model_name
self.class.name.gsub('Swagger::Definitions::', '').pluralize.underscore.downcase
end
end
end

View File

@ -246,6 +246,6 @@ module Schemable
# @example
# 'users' for the User model
# 'citizen_applications' for the CitizenApplication model
def self.model_name: -> String
def model_name: -> String
end
end