parent
c4a3be6f73
commit
c4c30f1f86
@ -1,6 +1,18 @@ |
||||
class TableModel |
||||
class TableModel # Base model |
||||
attr_reader :table_name |
||||
def initialize(table_name) |
||||
@table_name = table_name |
||||
end |
||||
|
||||
private def get(entity, filter="") |
||||
db = db_handle # get the db handle |
||||
query = "SELECT #{entity} FROM #{@table_name} " # create the query string |
||||
if filter != "" then query += "WHERE #{filter}" end |
||||
|
||||
db.execute query |
||||
end |
||||
end |
||||
|
||||
|
||||
class User < TableModel |
||||
end |
||||
|
Loading…
Reference in new issue