Ruby on Rails
Friday, May 22, 2015
I'm evaluating Rails (vs Django) for a new project. A requirement of this project is that the Rails app(s) be able to work with a database (PostgreSQL, in case that matters) whose schemas (table definitions) have been created and, over time, will be modified independently of the Rails app(s).
Though I'm a newbie to Rails, it already seems to be that Rails' standard mode of operation is: (1) Models are created and modified within Rails, and then (2) Rails Migration creates and modifies the database table definitions.
What I need is the opposite sequence: (1) The database table definitions are created and modified through tools external to Rails, and then (2) the Rails models are created and modified to fit the database table definitions.
So my questions are:
1. First and most important, is there a Gem (or some other tool in the Ruby-Rails world) that can generate a model from a database table definition?
2. If not, presumably one could use Rails on a pre-existing database by manually editing the Rails models. Right?
3. If that's right, what are the requirements for the table designs to enable them to work as viable Rails models? It seems that one requirement is that each table have a sequence-assigned primary key named "id". Right? Any others?
~ Thanks in advance
~ Ken
-- Though I'm a newbie to Rails, it already seems to be that Rails' standard mode of operation is: (1) Models are created and modified within Rails, and then (2) Rails Migration creates and modifies the database table definitions.
What I need is the opposite sequence: (1) The database table definitions are created and modified through tools external to Rails, and then (2) the Rails models are created and modified to fit the database table definitions.
So my questions are:
1. First and most important, is there a Gem (or some other tool in the Ruby-Rails world) that can generate a model from a database table definition?
2. If not, presumably one could use Rails on a pre-existing database by manually editing the Rails models. Right?
3. If that's right, what are the requirements for the table designs to enable them to work as viable Rails models? It seems that one requirement is that each table have a sequence-assigned primary key named "id". Right? Any others?
~ Thanks in advance
~ Ken
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fdb2c7b8-0beb-4ccd-9870-51512d744533%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment