#RubyOnRails - 05 October 2018
« Back 1 day Forward 1 day »
[12:07:31] kat3kasper: I have a one off .csv file I would like to import into a Rails app on production. The app is open source so I do not want to add the .csv file in the project directory. The app is currently hosted on Heroku. So far the only thing I've come up with is to add a form with in my app, but felt that was overkill for an one-off. Any other ideas?
[12:39:49] catphish: TvL2386: in that case you might want to consider changing to use any? and empty?
[12:41:16] catphish: means the database (with mysql at least) only has to pull entry instead of all of them
[12:42:10] another-user: where can i look for maintenace schedule for rails versions? specifically i'm interested when support for 4.2 ends
[12:42:47] another-user: https://guides.rubyonrails.org/maintenance_policy.html doesn't provide such info
[12:52:49] sevenseacat: it does list that info. currently 4.2 only gets fixes for severe security issues
[17:09:01] davidh38: hey guys, i am in rails version 2.3.1 and i have trouble understanding this route: https://dpaste.de/eoDg
[17:44:37] davidh38: @tbuehlmann the problem i face is the following: in a controller there is the following code: application_charge.return_url = charge. Sow i wondered, where the charge comes from. I clicked with command (on a mac in rubymine) on this variable and it directed me to the resource.
[17:45:34] davidh38: so when charge is assigned to application_charg.return_url, does it have anything to do with the resource?
[17:47:37] tbuehlmann: if it's not a local variable it's a method. check the controller and the parent controller
[17:57:39] davidh38: tbuehlmann, okay, i checked both the superclass of the controller and the controller and i could not find a corresponding method or a variable. Is there something i miss?
[17:59:34] MrCrackPotBuilde: when adding devise custom controller using scope how would i add multiple rails generate devise:controllers [api], [v1], [user]
[18:02:30] MrCrackPotBuilde: ah i got it 4th time was the charm its rails g devise:controllers api/v1/user
[18:05:16] tbuehlmann: davidh38: you could search for "def charge" or search for "charge" in general
[19:43:03] samort7: Question: Why do we have migrations? Like, I understand what they do, but why do we incrementally change a database schema? Why don't we just have one massive file that lays out what the schema should look like?
[20:00:10] samort7: tbuehlmann, oh, right. So if we have that file, why do we have migrations? Why don't we just adjust schema.rb when we need the schema to change?
[20:00:12] tbuehlmann: see https://guides.rubyonrails.org/active_record_migrations.html#migration-overview for an overview on why migrations are useful
[20:02:02] tbuehlmann: well, let's say we only have that file. when you changed the database locally and committed that change, your production rails app would somehow need to determine what exactly changed since its last version
[20:02:25] tbuehlmann: it might calculate a diff from an earlier version of something like that, but that seems too complicated
[20:02:45] samort7: oh, so for example, if we were to rename a column, we would somehow need to communicate that to the production version.