Ruby on rails with existing database

I am very new to rails, and from what I read and looked at in textbooks, it only helps me to create things from scratch, while creating new databases and models.

my company has a project management software system in the field of accounting and construction, which was recently stored in ms sql server.

how will I build models from the existing table structure. they do not need to remove updates. im looking for creating a remote web query tool.

thank.

+3
source share
2 answers

Rails SQL- - , ..

, , , , , Rails. Project, Rails , projects ( ). Project, :

class Project < ActiveRecord::Base
  set_table_name "project"
end

, project_id, id, :

class Project < ActiveRecord::Base
  primary_key = 'project_id'
end
+5

SQL- .

sqlite3.
-1

Source: https://habr.com/ru/post/1751877/


All Articles