Skip to content

Commit

Permalink
explicitly set table name
Browse files Browse the repository at this point in the history
otherwise active record assumes it's a lowercase + pluralized version of
the class name.
  • Loading branch information
yawboakye committed Jun 6, 2024
1 parent a59f1c7 commit 5c704d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/generators/categoria/templates/model.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ module <%= Rails.application.class.module_parent %>
module <%= domain_module %>
module Internal
module Models
class <%= internal_model_class_name %> < ApplicationRecord; end
class <%= internal_model_class_name %> < ApplicationRecord
self.table_name = "<%= domain_prefixed_relation_name %>"
end
end
end
end
Expand Down

0 comments on commit 5c704d8

Please sign in to comment.