Fix Connections servlet, set table name on models

This commit is contained in:
0x1eef 2023-12-19 23:06:42 -03:00
parent ec2be8825e
commit de2c2aeaea
3 changed files with 5 additions and 1 deletions

View file

@ -1,4 +1,6 @@
class Twenty::Connection < Twenty::Model
self.table_name = 'connections'
##
# Validations
validates :name, presence: true

View file

@ -1,4 +1,6 @@
class Twenty::Issue < Twenty::Model
self.table_name = 'issues'
##
# Validations
validates :title, presence: true

View file

@ -7,6 +7,6 @@ class Twenty::Servlet::Connections < Twenty::Servlet
private
def body
JSON.dump database.connections.map { Ryo.table_of(_1,recursive: true) }
JSON.dump(Twenty::Connection.all)
end
end