#RubyOnRails - 03 March 2019
« Back 1 day Forward 1 day »
[00:58:32] uplime: is there an article or document that details what should go into a git repo and what shouldn't, for a project generated with `rails g projectname`?
[17:42:23] davidfetter: is there a standard way to run over a model and spit out the DDL it would produce?
[18:30:17] Sylario: If by DDL you are talking about the migrations, all that information is in the schema and rails is able to rebuild a database from it
[19:44:04] davidfetter: sylario, is there a way to flip the defaults so foreign keys in the model turn into actual foreign keys in the DB?
[19:44:36] davidfetter: what I'm picturing is that "has_one" would turn into a foreign key constraint and a UNIQUE constraint
[19:45:12] Sylario: That's when you create the migration, you specify it's a relation and it create foreign keys
[19:45:49] davidfetter: As with many situations, it is the result of choices, each of which could well have been rational in context, and probably was
[19:46:13] davidfetter: I *think* it's the Rails version. I don't have access to that code right this minute, but where would I look?
[19:47:56] davidfetter: If there are good resources as to how to upgrade large Rails environments, I'd love to look them over
[19:49:17] davidfetter: I've been there a week, and I'm the DBA, not an application developer, so any suggestions I have in this arena are going to be delicate to negotiate
[19:50:26] davidfetter: Is it standard in modern version of Rails to turn "has_*" into actual foreign key constraints?
[19:51:18] davidfetter: ACTION is trying to do the simplest and most thorough job he can of inferring the FK relationships, as they are not yet enforced by the DB, which is to say they're not enforced.
[19:56:46] davidfetter: in Rails land, would it be reasonable to infer, as a first approximation, that foo_id refers to the id column of the foo table?
[20:10:46] Sylario: Since rails 3 or 4 migrations, that are the way to create new table on an ongoing project, have the notions of relation, that will use the foreign key notion of the DB and also index it
[20:11:43] Sylario: schema.rb is the product of migrations, and what an app will use to create the DB structure
[20:13:23] Sylario: at the very least, has_many :bars in class foo.rb implies that the table bars has a foo_id
[20:28:27] bswinnerton: How are folks precompiling assets in Docker with nginx? Sharing volumes? Some sort of entrypoint script?
[22:16:18] mojtaba: Hello, I am new to Rails, and I want to use Heroku. I have lots of pictures to (Catalogues of the products). I just wanted to know that can I use a shared host (like Bluehost; which I have an account there), to place the pictures there? (May be using the second db, or just on the file system.)