Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pksunkara committed Sep 21, 2021
1 parent c025e15 commit a9a0a8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ inflect.camelize = function (lower_case_and_underscored_word, first_letter_in_up
inflect.underscore = function (camel_cased_word) {
var self;
self = util.string.gsub(camel_cased_word, /\./, '/');
self = util.string.gsub(self, /([A-Z]+)([A-Z][a-z])/, '$1_$2');
self = util.string.gsub(self, /([A-Z])([A-Z][a-z])/, '$1_$2');
self = util.string.gsub(self, /([a-z\d])([A-Z])/, '$1_$2');
self = util.string.gsub(self, /-/, '_');
return self.toLowerCase();
Expand Down Expand Up @@ -230,5 +230,5 @@ inflect.tableize = function (class_name) {
//
// "business".classify() // => "Busines"
inflect.classify = function (table_name) {
return inflect.camelize(inflect.singularize(util.string.gsub(table_name, /.*\./, '')));
return inflect.camelize(inflect.singularize(util.string.gsub(table_name, /^.*\./, '')));
};

0 comments on commit a9a0a8e

Please sign in to comment.