« Back to channel list

#RubyOnRails - 27 March 2017

« Back 1 day Forward 1 day »
[00:00:55] arBmind1: has joined #RubyOnRails
[00:07:01] Technodrome: has joined #RubyOnRails
[00:17:49] Pumukel: has joined #RubyOnRails
[00:19:58] l4v2: has joined #RubyOnRails
[00:41:33] bronson: has joined #RubyOnRails
[00:46:14] l4v2: Just got a job as a mvc developer, however, not with Rails… I’ve been around Rails for a year or so, (that’s how I got the job, but now I have to learn node stuff)
[00:49:15] zeddan: has joined #RubyOnRails
[00:52:43] superlou: has joined #RubyOnRails
[00:57:41] gambl0re: has joined #RubyOnRails
[01:07:26] hahuang65: has joined #RubyOnRails
[01:09:13] l4v2: has left #RubyOnRails: ()
[01:15:31] mooser: has joined #RubyOnRails
[01:15:43] l4v2: has joined #RubyOnRails
[01:18:35] l4v2: has left #RubyOnRails: ()
[01:28:29] cam27: has joined #RubyOnRails
[01:30:15] bawsky: has joined #RubyOnRails
[01:31:01] cam27: has joined #RubyOnRails
[01:31:06] cam27: has left #RubyOnRails: ()
[01:32:24] cam27: has joined #RubyOnRails
[01:39:38] cam27: has joined #RubyOnRails
[01:40:37] inkshark: has joined #RubyOnRails
[01:42:57] cam27: has left #RubyOnRails: ()
[01:43:40] cam27: has joined #RubyOnRails
[01:48:49] Pumukel: has joined #RubyOnRails
[01:50:33] cam27: has joined #RubyOnRails
[01:51:43] cam27: just got hired as a node developer, however, I would rather be using rails
[01:53:25] davedo321: has joined #RubyOnRails
[01:54:56] cam27: Anyone have a remote rails position for me?
[01:55:01] greengriminal: has joined #RubyOnRails
[01:56:41] eclecticjohny: has joined #RubyOnRails
[01:59:31] Jameser: has joined #RubyOnRails
[02:01:04] irishfromua: has joined #RubyOnRails
[02:04:18] Velizar: has joined #RubyOnRails
[02:05:07] libastral: has joined #RubyOnRails
[02:05:40] nyaa: has joined #RubyOnRails
[02:05:49] Velizar: One of my controllers takes a string parameter like so: params.require(:reply); but the parameter is sometimes an empty string (like so: `GET url/path?reply=`), and this causes require to raise an exception. Is there a require which allows empty strings?
[02:06:00] Velizar: I still want to raise an exception if the parameter is missing.
[02:06:53] irishfromua: has joined #RubyOnRails
[02:06:59] matthewd: Velizar: No; require is intended to be a tiny convenience for the most common case; if you need something else, it's easy enough to check it yourself
[02:08:50] Velizar: okay got it
[02:14:09] Radar: cam27: Hi. Try here: https://weworkremotely.com/
[02:15:04] Velizar: ACTION used `raise ActionController::ParameterMissing, 'reply' unless params.include?('reply')` and `reply = params[:reply]`
[02:15:26] cam27: Hi Radar, thank you. I’ve actually applied to jobs through there and never heard back from anyone.
[02:16:02] Radar: cam27: Oh I am sorry to hear that. Do you have a resume I can look at?
[02:21:33] Rodya_: has joined #RubyOnRails
[02:23:33] zeddan: has joined #RubyOnRails
[02:29:09] Rodya_: has joined #RubyOnRails
[02:32:30] DaniG2k: has joined #RubyOnRails
[02:34:50] Faradome: has joined #RubyOnRails
[02:38:19] DaniG2k: hello all. I'm trying to get a docker container with Rails+Postgres up and running for local development
[02:38:29] DaniG2k: my config looks like this at the moment: https://gist.github.com/DaniG2k/1971f0073daf18fa883d87a83780cdeb
[02:38:46] DaniG2k: however, I am having a hard time starting the app up for database creation issues
[02:38:52] DaniG2k: can anyone tell what I'm doing wrong?
[02:42:24] bronson: has joined #RubyOnRails
[02:46:13] jeyraof^mbpr: has joined #RubyOnRails
[02:50:15] fryguy: DaniG2k: what issues
[02:50:34] DaniG2k: when I run docker-compose run web rails db:create
[02:50:40] DaniG2k: could not connect to server: Connection refused
[02:51:35] DaniG2k: maybe the db name is not right?
[02:52:02] ahrs: has joined #RubyOnRails
[02:52:09] DaniG2k: Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "username"=>"postgres", "pool"=>5, "timeout"=>5000, "host"=>"localhost", "port"=>5432, "password"=>nil, "database"=>"app_home_development"}
[02:53:38] Trynemjoel: has joined #RubyOnRails
[02:54:05] fryguy: well, i'm sure that localhost isn't right
[02:54:31] fryguy: where are you injecting environment variables from?
[02:54:59] DaniG2k: those env variables don't exist yet
[02:54:59] Radar: Your docker container isn't running a postgresql instance or you're not making the host's postgresql port available to the docker container
[02:55:02] DaniG2k: they will in production
[02:55:05] Radar: I need to go into a meeting v. soon so I won't be able to help you.
[02:55:16] fryguy: DaniG2k: well, what do you expect to happen in dev?
[02:55:35] DaniG2k: I'm just trying to get a basic rails app up and running with Docker+Postgres
[02:55:54] fryguy: if your configuration is environment variable based, then you need to inject those environment variables
[02:55:58] DaniG2k: just trying to access localhost but it seems i need to get Postgres up
[02:56:18] fryguy: your rails container isn't running postgres, so trying to connect to postgres on localhost won't do what you want
[02:56:22] DaniG2k: fryguy: I am doing something like database: <%= ENV['DATABASE_NAME'] || 'app_home_test' %>
[02:56:30] Radar: [13:54:58] <Radar> Your docker container isn't running a postgresql instance or you're not making the host's postgresql port available to the docker container
[02:56:33] DaniG2k: so it should default to using 'app_home_test'
[02:56:39] fryguy: DaniG2k: yes, but ENV['DATABASE_NAME'] isn't set to anything
[02:56:50] DaniG2k: Radar: yea I think you're right
[02:56:51] fryguy: so it uses the default, right
[02:57:05] fryguy: what are the defaults for the other environment variables, and do those make sense for your docker container (hint: the answer is no)
[02:57:20] roamingdog: has joined #RubyOnRails
[02:59:01] DaniG2k: hmm im following this guide almost verbatim
[02:59:02] DaniG2k: https://docs.docker.com/compose/rails/#connect-the-database
[02:59:06] DaniG2k: so it should be correct :/
[02:59:48] fryguy: where are references to environment variables there
[03:00:33] fryguy: The app is now bootable, but you’re not quite there yet. By default, Rails expects a database to be running on localhost - so you need to point it at the db container instead. You also need to change the database and username to align with the defaults set by the postgres image.
[03:00:38] fryguy: quote from the page you linked
[03:01:00] DaniG2k: the image is
[03:01:00] DaniG2k: postgres:9.6.2
[03:01:57] DaniG2k: so user should be postgres
[03:02:04] flegent: has joined #RubyOnRails
[03:02:09] DaniG2k: which is correct
[03:02:31] fryguy: why are you ignoring the environment variable that we are telling you is wrong?
[03:02:57] fryguy: setting the host to localhost is wrong, change that
[03:03:59] pwnd_nsfw`: has joined #RubyOnRails
[03:04:07] Jasaka: has joined #RubyOnRails
[03:04:38] uxp: has joined #RubyOnRails
[03:04:49] fryguy: sure you can try that, i'm not sure how autolinking works in whatever version of docker you are using, so you might need to specify the link explicitly in your compose file as well, but you can try that to start with
[03:05:22] DaniG2k: still getting the same connection refused error
[03:05:28] DaniG2k: Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "username"=>"postgres", "pool"=>5, "timeout"=>5000, "host"=>"localhost", "port"=>5432, "password"=>nil, "database"=>"app_home_development"}
[03:05:41] shinnya: has joined #RubyOnRails
[03:06:34] fryguy: notice the host that you are connecting to
[03:06:43] fryguy: it's still localhost, that's wrong
[03:18:39] Pumukel: has joined #RubyOnRails
[03:22:17] flegent: has joined #RubyOnRails
[03:23:39] arBmind: has joined #RubyOnRails
[03:27:55] zeddan: has joined #RubyOnRails
[03:33:54] jdm: has joined #RubyOnRails
[03:43:56] nyaa: has joined #RubyOnRails
[03:46:20] gambl0re: has joined #RubyOnRails
[03:49:56] Rodya_: has joined #RubyOnRails
[03:52:40] Qwertii: has joined #RubyOnRails
[03:55:30] Qwertii: I have a model for products in my website and I want to store the other products which are required for the current one. I have created a new model called "RequiredProducts" but im not to sure how it will work in the db
[03:55:59] Qwertii: In the table required_parts should I store the primary key for both the product and the other product which is required?
[04:01:04] jenrzzz: has joined #RubyOnRails
[04:04:43] pickle_: has joined #RubyOnRails
[04:06:30] agent_white: has joined #RubyOnRails
[04:07:42] creature: Qwertii: This sounds a little bit like a has-and-belongs-to-many relationship (have a look at the Rails Associations guide). A Product has_many required products; each Product could be required by many other Products.
[04:08:41] creature: http://guides.rubyonrails.org/association_basics.html#the-has-and-belongs-to-many-association (see also section 2.8)
[04:09:06] mooser: has joined #RubyOnRails
[04:14:09] mostlybadfly: has joined #RubyOnRails
[04:16:51] kernelPaniq: has joined #RubyOnRails
[04:17:57] greengriminal: has joined #RubyOnRails
[04:21:08] spicerack: has joined #RubyOnRails
[04:21:28] Robtop__: has joined #RubyOnRails
[04:28:35] fugee: has joined #RubyOnRails
[04:28:46] fugee: rake db:create db:schema:load creates tables without id column and migration shows id="false" as it runs
[04:29:18] fugee: can i run the command with a switch for id="true"
[04:29:33] fugee: or argument
[04:31:25] nyanz: has joined #RubyOnRails
[04:34:53] Radar: fugee: It's likely because there are migrations which specify id: false.
[04:35:21] amperry: has joined #RubyOnRails
[04:35:31] fugee: Radar: the directory's empty
[04:37:02] amperry: hi folks, got a weird problem with (I think) the spring preloader. Whenever I alter a controller that uses a certain file in conrollers/concerns, it seems like rails can no longer find the 'concerned' class. Gist here: https://gist.github.com/amp108/a5e7794b1c3a7f8402f855a806feb283
[04:38:55] Radar: fugee: So then there's code in db/schema.rb which has that.
[04:39:05] Radar: amperry: solution: turn off spring
[04:39:10] fugee: Radar: sorry i'm an idiot it's right there in schema.rb
[04:41:19] WinterBluFox: has joined #RubyOnRails
[04:42:18] amperry: Radar: any downsides to that? Will I need to manually restart rails more or less frequently when I make changes?
[04:43:15] bronson: has joined #RubyOnRails
[04:45:44] Suslov: has joined #RubyOnRails
[04:48:33] nyaa: has joined #RubyOnRails
[04:48:58] Radar: amperry: It shouldn't change
[04:49:07] Pumukel: has joined #RubyOnRails
[04:49:45] jusa: has joined #RubyOnRails
[04:50:02] amperry: Radar: Cool. Removed. Thanks!
[04:50:12] Radar: Spring causes more trouble than it's worth. This is just one of a long line of examples.]
[04:50:26] Radar: Zeus is a much better alternative imo
[04:52:20] amperry: I'll look innto that. Yeah, a cursory google search seems to find more criticism than praise for spring.
[05:00:14] fugee: in application.html.erb if <div id="side"> has no contents to display when the page loads, should it still have any width?
[05:00:40] vampirehunter: has joined #RubyOnRails
[05:02:13] itsgokul: has joined #RubyOnRails
[05:03:20] tenderlove: has joined #RubyOnRails
[05:08:53] flegent: has joined #RubyOnRails
[05:11:49] zeddan: has joined #RubyOnRails
[05:14:50] agent_white: has joined #RubyOnRails
[05:15:41] jenrzzz: has joined #RubyOnRails
[05:15:41] jenrzzz: has joined #RubyOnRails
[05:21:22] henry1: has joined #RubyOnRails
[05:21:42] spyder55: has joined #RubyOnRails
[05:21:42] henry1: hi is anyone here that doesnt mind helping me on a quick ruby on rails problem
[05:22:54] henry1: is anyone here?
[05:24:23] psethi: has joined #RubyOnRails
[05:30:11] spyder55: has joined #RubyOnRails
[05:32:47] LiquidInsect: has joined #RubyOnRails
[05:42:07] pickle_: has left #RubyOnRails: ()
[05:51:16] hive-mind: has joined #RubyOnRails
[05:53:03] Pumukel: has joined #RubyOnRails
[05:53:14] Rodya_: has joined #RubyOnRails
[05:53:19] srinidhi: has joined #RubyOnRails
[05:55:34] igniting: has joined #RubyOnRails
[06:04:56] Pumukel: has joined #RubyOnRails
[06:05:16] nyanz: has joined #RubyOnRails
[06:05:50] lightheaded: has joined #RubyOnRails
[06:12:32] antgel: has joined #RubyOnRails
[06:17:02] mooser: has joined #RubyOnRails
[06:18:01] Pumukel: has joined #RubyOnRails
[06:20:09] pLaTo0n: has joined #RubyOnRails
[06:22:22] ImmoveableOne: has joined #RubyOnRails
[06:23:23] jenrzzz: has joined #RubyOnRails
[06:23:24] jenrzzz: has joined #RubyOnRails
[06:27:53] pickle_: has joined #RubyOnRails
[06:31:09] rubyonrails966: has joined #RubyOnRails
[06:31:28] nyaa: has joined #RubyOnRails
[06:31:40] pLaToOn: has joined #RubyOnRails
[06:33:25] zero1one0: has joined #RubyOnRails
[06:35:23] darutoko: has joined #RubyOnRails
[06:37:01] lightheaded: has joined #RubyOnRails
[06:39:23] jenrzzz: has joined #RubyOnRails
[06:39:23] jenrzzz: has joined #RubyOnRails
[06:40:29] netzfisch: has joined #RubyOnRails
[06:43:30] roshanavand: has joined #RubyOnRails
[06:44:12] bronson: has joined #RubyOnRails
[06:44:36] fugee: has joined #RubyOnRails
[06:45:00] AzaToth: has joined #RubyOnRails
[06:54:07] roamingdog: has joined #RubyOnRails
[06:54:27] harfangk: has joined #RubyOnRails
[06:58:43] conta: has joined #RubyOnRails
[07:01:23] platoon23: has joined #RubyOnRails
[07:05:05] srinidhi: has joined #RubyOnRails
[07:06:17] nyanz: has joined #RubyOnRails
[07:09:20] fmartingr: has joined #RubyOnRails
[07:11:55] artto: has joined #RubyOnRails
[07:11:59] drale2k: has joined #RubyOnRails
[07:15:36] snickers: has joined #RubyOnRails
[07:15:41] zeddan: has joined #RubyOnRails
[07:16:19] fugee: devise for :users means devise won't be using the users controller?
[07:17:02] lightheaded: has joined #RubyOnRails
[07:17:20] dminuoso: matthewd: Question. When you do rel.includes(:others).others.count I get an extra query for count(*) tossed in my face. Why?
[07:17:42] dminuoso: I mean I just switched to using .length() for those cases, but I kind of did not expect that.
[07:17:49] matthewd: Because you're insisting on wanting a count
[07:18:12] dminuoso: matthewd: Can't rails know that it already has included the dataset and does not need to count() ?
[07:18:23] matthewd: Yes it does... in size / length
[07:20:06] jenrzzz: has joined #RubyOnRails
[07:20:06] jenrzzz: has joined #RubyOnRails
[07:21:02] fugee: if i wanna add a field i have to edit the form in the gem, afaik, but still have to whitelist in the users controller so devise is using the users controller at least that much right?
[07:21:36] keerthana: has joined #RubyOnRails
[07:21:40] Qchmqs: has joined #RubyOnRails
[07:22:03] arBmind: has joined #RubyOnRails
[07:22:51] mark_66: has joined #RubyOnRails
[07:25:33] lightheaded: has joined #RubyOnRails
[07:31:29] Andr3as: fugee: read the manual, devise has an "installer" to copy its forms into your view directory..
[07:36:33] jenrzzz: has joined #RubyOnRails
[07:38:38] aganov: has joined #RubyOnRails
[07:45:45] lightheaded: has joined #RubyOnRails
[07:47:09] fugee: Andr3as: thanks
[07:49:50] srinidhi: has joined #RubyOnRails
[07:50:36] lightheaded: has joined #RubyOnRails
[07:51:10] amperry: has joined #RubyOnRails
[07:53:48] artto: has joined #RubyOnRails
[07:53:49] jpterry: has joined #RubyOnRails
[07:55:16] amperry: hi folks; I'm using the best_in_place to create a grid of multiple apartments and a select dropdown for each, with options for non_revenue_status_id codes; these can be NULL for an apartment. When I select the blank option, it sets the non_revenue_status_id to NULL, but then I can't click in the same field to update it again without reloading the page. I can click when there's a non-NULL value, however. Anyone know why?
[07:55:22] Rodya_: has joined #RubyOnRails
[07:56:04] roamingdog: has joined #RubyOnRails
[07:58:31] amperry: The client would only need to do that if they clicked the wrong code and realized their mistake, but that's a common enough use case.
[08:00:54] fluxsource: has joined #RubyOnRails
[08:02:20] mikecmpbll: has joined #RubyOnRails
[08:02:43] jenrzzz: has joined #RubyOnRails
[08:02:43] jenrzzz: has joined #RubyOnRails
[08:05:33] antgel: has joined #RubyOnRails
[08:07:27] Andr3as: amperry: watch the browser console, you may get js error there
[08:07:46] Andr3as: this is the "usual" behavior of BIP when something went wrong
[08:07:47] artto: has joined #RubyOnRails
[08:07:55] Andr3as: experienced that in my app as well
[08:09:43] amperry: Andr3as: do you know what the 'proper' way to include a nil/NULL value is for best_in_place? I didn't see any errors.
[08:10:33] amperry: right now, before I loop through all the codes, I have: '@code_for[""] = nil'
[08:10:48] amperry: but I don't know if that plays well with the gem.
[08:11:06] Andr3as: amperry: see https://github.com/bernat/best_in_place/issues/6
[08:11:32] nyaa: has joined #RubyOnRails
[08:11:43] mooser: has joined #RubyOnRails
[08:12:26] jsrn_: has joined #RubyOnRails
[08:14:18] banisterfiend: has joined #RubyOnRails
[08:14:30] amperry: hrm... that's not unlike what I've done, which updates the value to be NULL in the db, but it still doesn't let me edit it again. Maybe I need to do some pre-processing in the update method
[08:16:43] dionysus69: has joined #RubyOnRails
[08:19:59] kristofferR: has joined #RubyOnRails
[08:22:54] bob_f: has joined #RubyOnRails
[08:27:58] amperry: Andr3as: well that's weird; the dropdown ordinarily only appears when you click the cell, but now I've got it so if you select the NULL option, it updates, but the dropdown persists; that's ugly, but works.
[08:29:12] Andr3as: does it need to be NULL? or cant it just be empty?
[08:30:23] amperry: I don't know how else to put an empty value into the params; if it's just empty, I think it doesn't get sent.
[08:30:32] amperry: but let me test that
[08:30:41] Andr3as: in that link above they propose ''
[08:31:11] amperry: that works too, but I get the same display issue.
[08:33:36] artto_: has joined #RubyOnRails
[08:33:40] nOwz: has joined #RubyOnRails
[08:33:47] Ergo: has joined #RubyOnRails
[08:33:47] drale2k: has joined #RubyOnRails
[08:33:56] Andr3as: interesting.. does an "include_blank" option help?
[08:34:51] amperry: nope. That leaves a blank, but selecting it doesn't send a nil/NULL value to the update method.
[08:38:26] amperry: the only thing that works is '@code_for[" "] = nil', which updates the record, but then the select display persists. Gonna have to live with that for a while.
[08:39:16] amperry: I wonder if I can pass :NULL as a value and if the db will see that I really mean NULL, and not the string 'NULL'
[08:40:31] artto: has joined #RubyOnRails
[08:45:07] bronson: has joined #RubyOnRails
[08:47:27] KorriX: has joined #RubyOnRails
[08:52:32] lxsameer: has joined #RubyOnRails
[08:54:22] dionysus69: has joined #RubyOnRails
[08:54:28] KorriX: has joined #RubyOnRails
[08:54:45] artto: has joined #RubyOnRails
[08:56:04] Rodya_: has joined #RubyOnRails
[08:57:48] KorriX: has joined #RubyOnRails
[09:00:49] KorriX: has joined #RubyOnRails
[09:02:28] KorriX: has joined #RubyOnRails
[09:04:48] blackmesa: has joined #RubyOnRails
[09:04:53] artto: has joined #RubyOnRails
[09:05:17] jenrzzz: has joined #RubyOnRails
[09:06:30] DaniG2k: has joined #RubyOnRails
[09:07:26] workmad3: has joined #RubyOnRails
[09:11:22] awc: has joined #RubyOnRails
[09:14:21] arBmind: has joined #RubyOnRails
[09:15:07] ferr1: has joined #RubyOnRails
[09:16:56] zeddan: has joined #RubyOnRails
[09:23:15] Sylario: has joined #RubyOnRails
[09:27:27] jenrzzz: has joined #RubyOnRails
[09:35:35] arBmind1: has joined #RubyOnRails
[09:43:56] nobitanobi: has joined #RubyOnRails
[09:44:25] nobitanobi: morning! Is there any way to set `active_support.encode_big_decimal_as_string` to false just on a specific endpoint?
[09:47:30] arBmind: has joined #RubyOnRails
[09:54:14] quazimodo: has joined #RubyOnRails
[09:56:13] dminuoso: nobitanobi: Not that I can think of.
[09:56:42] Rodya_: has joined #RubyOnRails
[09:57:04] dminuoso: nobitanobi: Besides, wasn't this option deprecated a while ago?.
[09:57:48] Sigyn: has joined #RubyOnRails
[09:59:24] artto: has joined #RubyOnRails
[10:00:00] nobitanobi: dminuoso: oh is it? Agh, ok
[10:00:25] ynonp: has joined #RubyOnRails
[10:00:33] gloscombe: has joined #RubyOnRails
[10:01:59] dminuoso: nobitanobi: You could do the conversion simply by hand..
[10:02:06] dminuoso: nobitanobi: Are you using jbuilder or AMS?
[10:02:28] ynonp: hi all. I'm trying to build a multi domain site in rails and not sure how to handle routes config and helpers- Here's the thing
[10:02:44] drale2k: has joined #RubyOnRails
[10:02:55] dminuoso: nobitanobi: And I checked, indeed it was deprecated.
[10:03:54] ynonp: The site needs to support both root paths and shorter domain paths. Imagine google.com/mail vs. gmail.com. We also have internal navigation, so messages_path should lead to google.com/mail/messages (if you're on one domain) or gmail.com/messages (on the other domain)
[10:04:18] mdw: has joined #RubyOnRails
[10:04:22] ynonp: Is there an easy way to take the current domain into account in path helpers throughout the app?
[10:04:51] ynonp: (I CAN use different route names, but that's just annoying)
[10:05:38] marr: has joined #RubyOnRails
[10:05:40] artto: has joined #RubyOnRails
[10:06:14] artto: has joined #RubyOnRails
[10:07:22] nobitanobi: @dminuoso I'm using Grape entity
[10:10:40] dionysus69: do I just remove Gemfile.lock if it has merge conflict and then do bundle?
[10:15:32] dminuoso: dionysus69: What?
[10:15:37] dminuoso: dionysus69: No. You fix the merge conflict.
[10:15:52] dionysus69: I have conflict in "bundled with" version numbers
[10:16:10] dminuoso: dionysus69: You either manually merge it, or you can use "git checkou Gemfile.lock"
[10:16:12] dionysus69: I assume usually people just .gitignore gemfile.lock right?
[10:16:15] dminuoso: and then rebuild it
[10:16:22] dminuoso: That would defeat the entire purpose of it.
[10:16:47] dminuoso: dionysus69: The idea of the Gemfile.lock is to ensure that all environments (development, testing, staging, production) are pinned to the exact same versions.
[10:16:57] dminuoso: This keeps things predictable.
[10:17:10] dionysus69: hmm so I need to manually merge it everytime I pull upstream?
[10:17:20] dionysus69: my teamate has different version of bundler, that's all :D
[10:17:34] dminuoso: dionysus69: It depends. It should be fine to just do "git checkout Gemfile.lock; bundle"
[10:17:49] dionysus69: ok will try that :)
[10:21:52] snickers: Can I set some attributes of Active Record model to not be visible?
[10:23:09] snickers: I try to set method as protected, but that give me no method error in rails console when i serch try to read modem from db
[10:24:48] Pathfinder_: has joined #RubyOnRails
[10:25:18] tbuehlmann: Snickers: with what intention do you want them to be "invisible"?
[10:28:08] snickers: I want to use different method name for access to data from this atributes, also I want to get some conversion on this data in my custom function. I know that some of this I can do with allias_attributes
[10:28:32] snickers: but I dont want to get public acces to not converted/orginal attributes
[10:29:04] snickers: and i want to have acces to this atributes in model class
[10:29:48] nyanz: has joined #RubyOnRails
[10:29:55] tbuehlmann: so this is for the internal API? you could then mark the methods as private, right?
[10:31:51] snickers: I try that, but if i set this attributes to private/protected i get this error ':NameError: undefined method' if I try to get model in rails console
[10:32:13] tedwing: has joined #RubyOnRails
[10:34:23] tbuehlmann: can you gist what you're trying?
[10:37:16] snickers: tbuehlmann https://gist.github.com/pwojcieszonek/7807805616424527bcbd7af35d3d028f for example b_modem_macaddr is a integer representation of device mac address, my function modem_macaddr convert it to string, readable format
[10:37:46] snickers: I don't need to have acces to b_modem_macaddr outside of the model
[10:38:30] pickle_: has joined #RubyOnRails
[10:40:26] tbuehlmann: okay, and making #b_modem_macaddr a private method doesn't work?
[10:40:31] GodFather: has joined #RubyOnRails
[10:41:33] snickers: yes if i set 'private :b_modem_macaddr' i get nameerror
[10:42:38] lightheaded: has joined #RubyOnRails
[10:42:44] tbuehlmann: I think the method is only defined when accessed/initialized first
[10:43:04] lightheaded: has joined #RubyOnRails
[10:43:34] tbuehlmann: this might work: http://stackoverflow.com/a/3765531
[10:43:54] jusa: has joined #RubyOnRails
[10:45:59] bronson: has joined #RubyOnRails
[10:46:34] artto: has joined #RubyOnRails
[10:46:35] keerthana: has joined #RubyOnRails
[10:51:14] pickle__: has joined #RubyOnRails
[10:59:34] handicraftsman: has joined #RubyOnRails
[10:59:34] handicraftsman: has joined #RubyOnRails
[11:00:18] pickle__: has joined #RubyOnRails
[11:00:37] drale2k: has joined #RubyOnRails
[11:01:13] artto: has joined #RubyOnRails
[11:01:47] rajat: has joined #RubyOnRails
[11:04:51] zeddan: has joined #RubyOnRails
[11:04:59] Fernando-Basso: has joined #RubyOnRails
[11:12:40] Pathfinder_: has joined #RubyOnRails
[11:13:08] gloscomb1: has joined #RubyOnRails
[11:19:49] artto: has joined #RubyOnRails
[11:24:03] artto_: has joined #RubyOnRails
[11:24:44] artto_: has joined #RubyOnRails
[11:28:56] Dbugger: has joined #RubyOnRails
[11:29:02] Dbugger: Hello everyone.
[11:30:42] Dbugger: I was wondering... when using translations, is it possible to go a level down on the tree? Something like... t("this.<level-down>.that")?
[11:32:59] nOwz: has joined #RubyOnRails
[11:35:03] Jameser: has joined #RubyOnRails
[11:35:29] srinidhi: has joined #RubyOnRails
[11:35:41] pickle_: has joined #RubyOnRails
[11:42:39] keerthana: has joined #RubyOnRails
[11:42:41] User458764: has joined #RubyOnRails
[11:42:46] mark_66: has joined #RubyOnRails
[11:43:13] User458764: has joined #RubyOnRails
[11:43:30] artto: has joined #RubyOnRails
[11:44:09] pickle_: has joined #RubyOnRails
[11:45:29] tvw: has joined #RubyOnRails
[11:46:19] drale2k: has joined #RubyOnRails
[11:48:46] rajat: has joined #RubyOnRails
[11:48:58] pickle_: has joined #RubyOnRails
[11:49:09] drale2k: has joined #RubyOnRails
[11:51:17] Rodya_: has joined #RubyOnRails
[11:51:19] ldnunes: has joined #RubyOnRails
[11:56:05] pickle_: has joined #RubyOnRails
[11:57:43] keerthana: has joined #RubyOnRails
[11:58:00] artto: has joined #RubyOnRails
[12:00:27] tedwing: has joined #RubyOnRails
[12:03:55] adlerdias__: has joined #RubyOnRails
[12:05:53] quazimodo: has joined #RubyOnRails
[12:06:05] Sidoniuns: has joined #RubyOnRails
[12:10:17] platoon23: I want to do something like this:
[12:10:19] platoon23: scope :filter_by_invoice_number, -> (start_num, end_num) { where :invoiceNumber.split("-")[1] => start_num..end_num }
[12:10:41] pmunt: has joined #RubyOnRails
[12:10:48] platoon23: the invoicenumber is for example "ABDC-123" and I just want to search the number behind the "-"
[12:10:53] Kilo`byte: ay, so yesterday time zone switched from CET to CEST (daylight saving stuff) and now my app crashes on start complaining the time zone 'CEST' does not exist
[12:10:58] Kilo`byte: how2fix/workaround
[12:11:03] platoon23: but the split is not working in this place
[12:12:05] pickle_: has joined #RubyOnRails
[12:15:10] workmad3: platoon23: that's because you're trying to write your check as an intermingling of SQL and Ruby
[12:15:44] workmad3: platoon23: you need to either spend some time digging into the SQL functions to do what you want, or pull away from SQL and write it as a ruby `select` or `find_all` style method
[12:16:08] buckrockwell: has joined #RubyOnRails
[12:16:41] drale2k: has joined #RubyOnRails
[12:17:16] workmad3: Kilo`byte: sounds like you're missing some timezone data...
[12:18:17] workmad3: Kilo`byte: you can check the available time zones that Rails understands with `rake time:zones:all` btw
[12:18:26] doublemalt_: has joined #RubyOnRails
[12:18:45] workmad3: Kilo`byte: and you might also want to check if you have `tzdata` in your Gemfile (and make sure it's updated)
[12:19:07] workmad3: oops, sorry, `tzinfo`, not `tzdata`
[12:19:26] Kilo`byte: tzinfo is there, rake time:zones:all throws the same exeption
[12:19:35] Kilo`byte: /home/stephan/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/core_ext/time/zones.rb:98:in `rescue in find_zone!': Invalid Timezone: CEST (ArgumentError)
[12:22:25] ahrs: has joined #RubyOnRails
[12:22:43] workmad3: Kilo`byte: hmm... how are you trying to set the timezone then?
[12:22:51] Kilo`byte: i don't set it at all
[12:22:58] pickle_: has joined #RubyOnRails
[12:23:03] Kilo`byte: i don't think i do anyways, let me grep my code
[12:23:34] workmad3: Kilo`byte: most common place would be in `config/application.rb`
[12:24:11] Kilo`byte: hmm i have this in my application.rb config.time_zone = Time.now.zone#
[12:24:53] dionysus70: has joined #RubyOnRails
[12:25:00] workmad3: ah, that's probably the source of it
[12:27:12] workmad3: 'time zone' is somewhat overloaded when it comes down to these things... `CET` and `CEST` can be seen as separate time zones, as they encode for different offsets from UTC... but there's also the rules around when a region changes offset that also gets called a 'time zone', and that's frequently something like `America/Chicago` or `Europe/London`
[12:28:14] workmad3: sometimes there'll be a mapping from something like `CET` to the appropriate region, but that isn't always possible, especially if there's multiple sets of rules in a region that encode different dates for historical or current changes of offsets...
[12:28:33] drale2k: has joined #RubyOnRails
[12:29:19] workmad3: and it looks like `Time.now.zone` is giving you essentially a 'named offset' timezone, while `config.time_zone` is likely to be needing something like `America/Kansas_City`...
[12:29:59] workmad3: (and yes, time zones are massively f****** annoying)
[12:31:33] tbuehlmann: TIL: when having `before_filter :foo, except: […], only: […]`, the except wins and only is ignored
[12:35:16] doodlehaus: has joined #RubyOnRails
[12:36:44] eclecticjohny: has joined #RubyOnRails
[12:42:15] artto_: has joined #RubyOnRails
[12:45:08] jusa: has joined #RubyOnRails
[12:46:56] bronson: has joined #RubyOnRails
[12:51:51] User458764: has joined #RubyOnRails
[12:52:31] Rodya_: has joined #RubyOnRails
[12:52:45] User458764: has joined #RubyOnRails
[12:53:07] zeddan: has joined #RubyOnRails
[12:53:17] cam27: has joined #RubyOnRails
[12:53:32] User458764: has joined #RubyOnRails
[12:59:35] nOwz: has joined #RubyOnRails
[13:02:11] ramortegui: has joined #RubyOnRails
[13:03:08] pankaj: has joined #RubyOnRails
[13:05:47] eclecticjohny: has joined #RubyOnRails
[13:06:32] artto: has joined #RubyOnRails
[13:08:49] artto_: has joined #RubyOnRails
[13:10:41] Shidash_: has joined #RubyOnRails
[13:11:21] doodlehaus: has joined #RubyOnRails
[13:14:22] Shidash: I've been converting something from a normal class to a Mongoid model (https://github.com/TransparencyToolkit/DocManager/blob/master/app/models/project.rb) and have been having a problem accessing the intial input params from inside the model
[13:15:38] Shidash: The initial object is generated from a JSON config file, so I need to read and parse the file. However, I can't seem to access the project_file input param to do that
[13:16:48] Pumukel: has joined #RubyOnRails
[13:17:31] Shidash: I'm calling the model with Project.new(project_file: "path/to/file.json") and it currently gives me an error on line 9 "undefined method 'project_file'". Is there any way to access the project_file variable from inside the model so that I can initialize the project_config variable?
[13:18:24] Shidash: I'm guessing that part of the issue is that the object isn't saved when that line of code is run. But is there really no way to access the parameters passed to the model before the object is saved?
[13:22:07] iamayam: has joined #RubyOnRails
[13:22:14] Shidash: one workaround I've found is to not pass project_file as an input parameter, but instead initialize the project with no parameters and then later call parse_config on the project object and pass the project_file as a param to that method. But this seems a bit messy to have to call both of those methods to initialize a project
[13:22:22] doodlehaus: has joined #RubyOnRails
[13:25:44] shinnya: has joined #RubyOnRails
[13:32:37] mecnun_c: has joined #RubyOnRails
[13:32:43] drale2k: has joined #RubyOnRails
[13:34:29] patarr: has joined #RubyOnRails
[13:35:16] bawsky: has joined #RubyOnRails
[13:35:36] silverdust: has joined #RubyOnRails
[13:37:39] artto: has joined #RubyOnRails
[13:41:27] armyriad: has joined #RubyOnRails
[13:41:53] bawsky: can anyone explain me this behaviour on rspec's "allow(:foo).to receive(:bar).and_return('john doe')":
[13:41:59] bawsky: https://gist.github.com/anonymous/18de2d48fb4dbb66abae5375768c9a13
[13:45:06] rogue_koder: has joined #RubyOnRails
[13:47:10] tbuehlmann: bawsky: sure, those are different objects
[13:47:11] rubyonrails878: has joined #RubyOnRails
[13:47:57] bawsky: but am I not mocking the both of them?
[13:48:12] Pumukel: has joined #RubyOnRails
[13:48:21] bawsky: tbuehlmann
[13:48:27] Jameser: has joined #RubyOnRails
[13:48:33] tbuehlmann: assign them to a variable and check the object_id
[13:50:55] armyriad: has joined #RubyOnRails
[13:51:07] mulander: has joined #RubyOnRails
[13:51:24] mulander: hi all, is there a way to access cookies from a view in rails 5? Looking at https://github.com/infinum/cookies_eu/blob/master/app/views/cookies_eu/_consent_banner.html.erb#L1 it was possible and worked at least in rails 3 (last I tested that gem) but fails in rails 5 as cookies is always nil in the scope of the view.
[13:52:15] byteflame: has joined #RubyOnRails
[13:53:13] Rodya_: has joined #RubyOnRails
[13:56:33] drale2k: has joined #RubyOnRails
[14:04:24] centrx: has joined #RubyOnRails
[14:04:45] centrx: How can I send a user in the controller to another page, with a POST value (i.e. can't use redirect with POST)
[14:04:56] centrx: Purpose is to show the temporary password after creating a user
[14:05:41] centrx: Is using Net::HTTP really the way?
[14:05:50] centrx: only/best way
[14:06:43] blackmesa: has joined #RubyOnRails
[14:08:06] mulander: centrx: form_for @user, url: url_for(controller: 'sessions', action: 'create')
[14:08:23] mulander: will send a @user to controller sessions action create even if the form is in another controller/view
[14:08:42] fugee: has joined #RubyOnRails
[14:08:57] centrx: hmm that's an interesting idea
[14:11:35] centrx: mulander: You're right, I saw all this guidance saying "create action should not show a view" but doubt it makes any difference
[14:12:29] mulander: well if it's accessed later on as .json then it doesn't matter
[14:13:07] mulander: and it's better to show the view then hacking up a redirect or a net::http request
[14:15:37] centrx: ok, let's do it!
[14:15:40] centrx: thanks mulander
[14:16:31] Binaerpilot: has joined #RubyOnRails
[14:16:54] artto: has joined #RubyOnRails
[14:18:23] jdm: has joined #RubyOnRails
[14:20:58] Faradome: has joined #RubyOnRails
[14:22:40] handicraftsman: has joined #RubyOnRails
[14:22:40] handicraftsman: has joined #RubyOnRails
[14:23:27] SteenJobs: has joined #RubyOnRails
[14:25:11] drale2k: has joined #RubyOnRails
[14:25:45] lubekpl: has joined #RubyOnRails
[14:25:49] mecnun_c: has joined #RubyOnRails
[14:25:52] envint: has joined #RubyOnRails
[14:26:37] artto: has joined #RubyOnRails
[14:28:56] zeddan: has joined #RubyOnRails
[14:30:13] User458764: has joined #RubyOnRails
[14:35:41] blackmesa: has joined #RubyOnRails
[14:36:25] Pumukel: has joined #RubyOnRails
[14:36:36] bga57: has joined #RubyOnRails
[14:43:08] eclecticjohny: has joined #RubyOnRails
[14:47:45] bronson: has joined #RubyOnRails
[14:48:50] Cohedrin: has joined #RubyOnRails
[14:51:36] lightheaded: has joined #RubyOnRails
[14:52:04] chouhoulis: has joined #RubyOnRails
[14:52:12] bronson: has joined #RubyOnRails
[14:53:58] Rodya_: has joined #RubyOnRails
[14:56:14] polishdub: has joined #RubyOnRails
[14:56:22] Jameser: has joined #RubyOnRails
[14:58:48] envint: has left #RubyOnRails: ()
[14:59:13] cpruitt: has joined #RubyOnRails
[14:59:34] spicerack: has joined #RubyOnRails
[15:02:55] Jameser: has joined #RubyOnRails
[15:04:22] mbertul: has joined #RubyOnRails
[15:05:08] daveomcd: has joined #RubyOnRails
[15:05:43] daveomcd: I'm getting a missing template error, but I think I have my file in the correct place. Can anyone peek at the error I'm getting here? https://gist.github.com/daveomcd/d00969ee5e44bdf4c2661ca355861d7c -- If you need me to include more information please let me know
[15:08:36] Qchmqs: daveomcd: your file should be named .html.erb
[15:08:38] bronson: the request is for html
[15:08:40] marahin: has joined #RubyOnRails
[15:08:51] marahin: Hello! def @file.content_type; 'image/png'; end - this throws a RuboCop warning that method definitions should not be nested.
[15:09:06] marahin: And that a lambda should be used; however, I never used lambdas. How would above code look with usage of lambda?
[15:09:28] Qchmqs: marahin: check the ruby documentation
[15:11:22] marahin: Qchmqs well I'm trying to, and I'm also exploring the guides. However I still can't imagine a way to define above code using lambdas.
[15:11:28] marahin: That's why I came here.
[15:12:38] Qchmqs: remove the ; and put in separate lines
[15:13:06] dionysus69: has joined #RubyOnRails
[15:13:10] marahin: Qchmqs and how does that help?
[15:13:20] treefrob: has joined #RubyOnRails
[15:13:37] Qchmqs: it removes the ambiguty
[15:13:47] Qchmqs: there is no need to write ruby code as if it was shell
[15:14:15] zeddan: has joined #RubyOnRails
[15:14:42] daveomcd: Qchmqs, how do i set the request for pdf then?
[15:14:49] marahin: Qchmqs I am well aware of that, it is just a line of code - I didn't think pasting that many characters on gist is optimal, and rather sticked it with ";blahblah".
[15:14:56] Qchmqs: why you're using a style guide if you'll just write your functions in the worst possible way to write a function in ruby ?
[15:15:04] marahin: Anyways, this is not an answer to my question - how can I translate that method definition to one with lambdas?
[15:15:20] Qchmqs: just translate it to a normal function
[15:15:28] Qchmqs: def @cunt.mccunt
[15:15:42] marahin: Qchmqs this is a "normal function" already!
[15:15:55] marahin: But it's throwing a RuboCop Ruby Style Guide warning!
[15:15:58] marahin: That's why I am here!
[15:16:08] marahin: :| exclamation mark
[15:16:31] marahin: This works, indeed, but I'd like it to be 100% complaint with Ruby style guide (e.g. so it doesn't throw a rubocop warning).
[15:16:33] Qchmqs: daveomcd: format.pdf
[15:16:37] Qchmqs: and return your file as it is
[15:16:47] marahin: It advices me to use lambdas, which I want to, but I have no idea how - and I can't imagine from the examples given.
[15:16:57] mbertul: has joined #RubyOnRails
[15:16:59] Qchmqs: man, are you writing it as I told you ?
[15:17:01] Jameser: has joined #RubyOnRails
[15:17:50] Qchmqs: marahin: I don't think it's actually telling you to use lambdas, it's telling you to use proper blocks
[15:17:57] Qchmqs: instead of shoving the thing as a one liner
[15:18:02] marahin: W: 37: 7: Lint/NestedMethodDefinition: Method definitions must not be nested. Use lambda instead.
[15:18:07] marahin: Yes, of course, it's not telling me to use lambdas.
[15:18:09] marahin: Holy hell dude.
[15:18:14] Qchmqs: daveomcd: you might have to return proper headers with it tho
[15:18:25] Qchmqs: marahin: man it's telling you to use blocks
[15:18:28] marahin: Qchmqs I am unsure why aren't you reading what I'm writing, but now I'm just tired of this conversation.
[15:18:52] marahin: Sorry for wasting your time.
[15:19:15] zeddan_: has joined #RubyOnRails
[15:19:47] Qchmqs: marahin: I just don't get why you're writting code like that in ruby
[15:19:53] marahin: Qchmqs code like what?
[15:19:59] Qchmqs: a one liner
[15:20:00] lightheaded: has joined #RubyOnRails
[15:20:01] marahin: def something.methodname
[15:20:02] marahin: do something
[15:20:07] marahin: I thought that's pretty standard!
[15:20:13] Qchmqs: that's pretty standard
[15:20:17] marahin: I'm annoyed by now. Have a nice evening.
[15:20:18] Qchmqs: but the on you posted was a one liner
[15:20:20] marahin: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[15:20:47] aajjbb: has joined #RubyOnRails
[15:22:44] marahin: has joined #RubyOnRails
[15:22:47] marahin: Actually, no!
[15:22:50] artto_: has joined #RubyOnRails
[15:22:50] marahin: Qchmqs let's give it another try
[15:23:37] envint: has joined #RubyOnRails
[15:23:49] marahin: https://gist.github.com/Marahin/5caf4be8aee428bc3d40c65e6d121088
[15:24:12] Jameser: has joined #RubyOnRails
[15:24:36] Qchmqs: oh I see now, you're acutally nesting definitions
[15:24:50] Qchmqs: why not just @file.content_type = 'image/png'
[15:25:01] marahin: Qchmqs because it does not allow to.
[15:25:03] marahin: There's no setter.
[15:25:16] marahin: And neither @file.instance_variable_set(:content_type, 'image/png') does work.
[15:25:20] Qchmqs: so you're declaring a getter ?
[15:25:35] marahin: Qchmqs I'm overwriting existing getter.
[15:25:47] Qchmqs: that's your actual issue then
[15:26:19] marahin: I really do not care how it's done, as long as it's done without warnings. It's warning me to use lambda.
[15:26:32] marahin: My initial question is: how can I use lambda to create an equal definition.
[15:27:21] Qchmqs: I'm reading throught the File class documentation
[15:27:32] Qchmqs: there should be a way to do what you want without monkey patching
[15:27:42] Qchmqs: what you're doing will lead to serious headaches down the road
[15:28:29] marahin: Qchmqs file != object of File
[15:28:36] marahin: file = an image in string.
[15:28:41] marahin: that's why I'm using StringIO
[15:28:43] Qchmqs: it's a StringIO
[15:28:46] marahin: StringIO.new(image_in_string)
[15:29:00] patarr1: has joined #RubyOnRails
[15:29:08] marahin: https://github.com/thoughtbot/paperclip/issues/1338 Qchmqs basicly.
[15:29:24] marahin: as you can see, author used the same method overwriting
[15:29:43] Qchmqs: he knows monkey patching stinks
[15:29:44] tercenya: has joined #RubyOnRails
[15:30:00] marahin: and I'm aware of that as well (although almost _everything_ is being monkey-patched these days)
[15:30:05] igniting: has joined #RubyOnRails
[15:30:07] Qchmqs: and since it's a bug in paperclip, I guess you'll have to live with this ugly code untill it's fixed ?
[15:31:09] gregf_: has joined #RubyOnRails
[15:31:30] Qchmqs: oh, you're using the same code as paperclip, not using it itself
[15:31:40] Qchmqs: so this is an issue in the StringIO itself ?
[15:32:36] marahin: I'm looking for a way to get this done _elegantly_
[15:32:42] Qchmqs: you basically can't
[15:32:44] tercenya: has joined #RubyOnRails
[15:32:51] Qchmqs: you can't use a lambda here, since you need this function to be named
[15:34:01] Qchmqs: the static analyser is assuming you're declaring a general use function
[15:34:30] marahin: Qchmqs so what I'm going to do is I'm going to define a class that inherits from StringIO and has static method .content_type returning 'image/png'
[15:34:55] Qchmqs: name that class IO_Image or something descriptive
[15:35:01] mulander: has left #RubyOnRails: ()
[15:35:06] marahin: Qchmqs png_string_io
[15:35:09] Qchmqs: and put a big note about monkey patching being needed, so you don't accidentally fix it later
[15:35:25] brent__: has joined #RubyOnRails
[15:35:34] Qchmqs: that would be a clean solution
[15:35:50] brent__: has joined #RubyOnRails
[15:38:56] ResidentBiscuit: has joined #RubyOnRails
[15:41:32] envint: has joined #RubyOnRails
[15:41:41] mecnun_c: has joined #RubyOnRails
[15:47:58] Cohedrin: has joined #RubyOnRails
[15:48:41] [Butch]: has joined #RubyOnRails
[15:50:54] Uranio: has joined #RubyOnRails
[15:51:37] cam27: has joined #RubyOnRails
[15:52:23] User458764: has joined #RubyOnRails
[15:53:37] Andr3as: could someone explain to me the "fields_for" with a symbol? i seem to somehow not understand it
[15:54:20] Omnilord: has joined #RubyOnRails
[15:54:21] Andr3as: i've a "domain.fields_for :action_fields do |actionfield|" in my view which shows all the actionfields of my domain (nested form)
[15:55:19] Andr3as: i also added a "domain.fields_for :achievements do |achievement|" into the same view, to show another nested model
[15:55:36] Andr3as: and it doesnt actually load the data.. i show the entry as an (empty) row
[15:56:08] Andr3as: why does it work for action_fields but not for achievements?
[15:56:43] keerthana: has joined #RubyOnRails
[15:58:30] buckrockwell: has joined #RubyOnRails
[15:58:55] mikecmpbll: anybody know what the data retention period is for sentry.io on 'Professional' plan?
[16:04:20] snickers: has joined #RubyOnRails
[16:05:39] spicerack: has joined #RubyOnRails
[16:10:54] DLSteve: has joined #RubyOnRails
[16:12:19] drale2k: has joined #RubyOnRails
[16:13:03] Circuit8: has joined #RubyOnRails
[16:16:53] envint: has joined #RubyOnRails
[16:17:57] roamingdog: has joined #RubyOnRails
[16:19:34] Circuit8: has left #RubyOnRails: ()
[16:20:03] jottr: has joined #RubyOnRails
[16:24:32] Andr3as: mikecmpbll: there was a tweet in back 2013 https://twitter.com/getsentry/status/322802245919993856
[16:25:31] Andr3as: if they'd have a plan with a higher amount of days, they'd proly advertised it
[16:28:01] gusrub: has joined #RubyOnRails
[16:29:30] Pumukel: has joined #RubyOnRails
[16:30:32] dcluna: has joined #RubyOnRails
[16:32:13] Andr3as: here's a gist from my fields_for issue.. i have no idea where else i could look... https://gist.github.com/awunder/4c97862f2b84ce1037c29a6e99ba2e2f#file-_form-html-erb-L63
[16:32:13] mikecmpbll: Andr3as : <3
[16:32:57] Andr3as: line 63 is the call which doesnt work, the one at row 20 works like a charme
[16:33:44] artto: has joined #RubyOnRails
[16:38:07] buckrockwell: has joined #RubyOnRails
[16:39:42] buckrockwell: has joined #RubyOnRails
[16:42:40] pulkit4tech: has joined #RubyOnRails
[16:43:43] Technodrome: has joined #RubyOnRails
[16:43:49] Rodya_: has joined #RubyOnRails
[16:48:54] Andr3as: found the issue.. man how stupid
[16:49:01] fugee: has joined #RubyOnRails
[16:49:13] Andr3as: without "accepts_nested_attributes_for" it does behave like this
[16:49:53] tercenya: has joined #RubyOnRails
[16:51:08] Spami: has joined #RubyOnRails
[16:51:08] Spami: has joined #RubyOnRails
[16:52:47] Spami: has joined #RubyOnRails
[16:52:47] Spami: has joined #RubyOnRails
[16:53:00] envint: has joined #RubyOnRails
[16:53:03] Pumukel: has joined #RubyOnRails
[16:53:50] Pumukel: has joined #RubyOnRails
[16:54:30] Pumukel: has joined #RubyOnRails
[16:54:50] djbkd: has joined #RubyOnRails
[16:58:50] gusrub: has joined #RubyOnRails
[17:01:13] jottr: has joined #RubyOnRails
[17:03:23] FLeiXiuS: has joined #RubyOnRails
[17:04:53] Cohedrin: has joined #RubyOnRails
[17:06:54] gusrub: has joined #RubyOnRails
[17:08:03] agent_white: has joined #RubyOnRails
[17:14:04] ravster: has joined #RubyOnRails
[17:15:01] agent_white: Mornin' folks
[17:16:15] ravster: I'm using activemodelserializers with the JSONAPI adapter, and I want to serialize a join-table model and have it list out the foreign keys of the records its pointing to. I have 'attributes :id, :user_id, foo_id', but only ':id' gets into the response body.
[17:16:32] mooser: has joined #RubyOnRails
[17:17:10] ravster: Do I have to do something special for other '_id' fields to show up as attributes when using the JSONAPI adapter? My user_serializer.rb serializes fields like 'email' and 'role' just fine.
[17:17:46] doublemalt_: has joined #RubyOnRails
[17:17:52] gloscombe: has joined #RubyOnRails
[17:19:03] roamingdog: has joined #RubyOnRails
[17:25:15] doodlehaus: has joined #RubyOnRails
[17:27:04] Guest96: has joined #RubyOnRails
[17:27:42] bawsky: has joined #RubyOnRails
[17:29:25] [Butch]_: has joined #RubyOnRails
[17:33:37] ramortegui: has joined #RubyOnRails
[17:41:33] mooser: has joined #RubyOnRails
[17:45:54] hahuang61: has joined #RubyOnRails
[17:48:52] pLaTo0n: has joined #RubyOnRails
[17:49:17] jonjoe: has joined #RubyOnRails
[17:49:37] jonjoe: hey guys, what is the best way to read cookie data from a model?
[17:50:48] tbuehlmann: jonjoe: not at all I guess
[17:51:34] SAGE__: has joined #RubyOnRails
[17:53:13] Jayson_Virissimo: has joined #RubyOnRails
[17:56:04] snguyen: has joined #RubyOnRails
[17:57:11] Aherin: has joined #RubyOnRails
[17:58:19] SAGE__: has joined #RubyOnRails
[18:02:16] g0d355__: has joined #RubyOnRails
[18:06:54] ahrs: has joined #RubyOnRails
[18:09:29] blackmesa: has joined #RubyOnRails
[18:10:09] Rodya_: has joined #RubyOnRails
[18:11:06] dionysus69: has joined #RubyOnRails
[18:13:48] zeddan: has joined #RubyOnRails
[18:15:34] tercenya: has joined #RubyOnRails
[18:16:42] Cohedrin: has joined #RubyOnRails
[18:18:20] mstashev: has joined #RubyOnRails
[18:19:52] jusa: has joined #RubyOnRails
[18:20:01] rubyonrails577: has joined #RubyOnRails
[18:20:20] Technodrome: has joined #RubyOnRails
[18:21:11] mstashev: Need some help with rbenv and ruby
[18:21:32] ravster: mstashev: don't ask to ask. Just ask
[18:22:04] User458764: has joined #RubyOnRails
[18:22:20] mstashev: When I type rbenv versions, it shows ruby 2.3.3 installed. When I type ruby -v, it shows 2.4.0.
[18:22:50] ravster: when you do 'rbenv versions', which listing has the '*' before it?
[18:22:53] mstashev: I need to be using 2.3.3 but haven't found any useful documentation on how to switch it back
[18:23:14] mstashev: Mac OSX El Captian
[18:23:26] ravster: and you are running both commands from the same directory?
[18:23:49] mstashev: username/Documents
[18:24:45] ravster: can you type in 'rbenv local 2.3.3' and then start another shell and go to the same directory and try again?
[18:25:33] mstashev: remains the same
[18:25:51] centrx: has joined #RubyOnRails
[18:25:58] centrx: has joined #RubyOnRails
[18:26:20] ravster: 'which ruby'
[18:27:57] mstashev: User / username / .rvm / rubies / ruby-2.4.0 / bin / ruby
[18:28:13] snickers: has joined #RubyOnRails
[18:28:15] mstashev: wouldn't let me type out the path for some reason
[18:30:37] User458764: has joined #RubyOnRails
[18:32:51] mstashev: So where would I set the PATH to change the version
[18:33:50] mstashev: Only 2.4 and 1.8.6 are available rubies
[18:38:47] mstashev: in /User/username/ .rvm /rubies
[18:40:07] brendan6: has joined #RubyOnRails
[18:43:24] defsdoor: has joined #RubyOnRails
[18:44:01] zeddan: has joined #RubyOnRails
[18:44:22] tvw: has joined #RubyOnRails
[18:45:00] mstashev: So I just ran rbenv install 2.3.3 and it errored out.
[18:45:43] mstashev: with ossl_ssl.c:95:5: error: use of undeclared identifier 'TLSv1_2_method' OSSL_SSL_METHOD_ENTRY(TLSv1_2), ^ ossl_ssl.c:89:69: note: expanded from macro 'OSSL_SSL_METHOD_ENTRY' #define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method } ^ <scratch space>:181:1: note: expanded from here TLSv1_2_method ^ ossl_ssl.c:96:5: error: u
[18:53:25] s2013: has joined #RubyOnRails
[18:54:07] ravster: mstashev: dude, why does that path include rvm? Do you have rvm installed?
[18:54:25] ravster: You'll need to pick one of either rvm or rbenv. Not both.
[18:55:43] mstashev: I used to work for a company that used rvm and I never could figure out at the time how to remove it
[18:56:08] mstashev: I am only using rbenv these days
[18:58:31] Pumukel: has joined #RubyOnRails
[18:58:42] ravster: Well, its getting in your way now. I'd look through ~/.bashrc and ~/.bash_profile to see where the '.rvm' is being added to your PATH, and remove that. I'd also try to get rid of that entire '.rvm' directory. My first suggestion was to just nuke your installation and do a clean install of your system, but I don't know how that works on macs.
[18:59:36] mstashev: Im not sure either
[19:02:58] blackmesa: has joined #RubyOnRails
[19:03:32] mstashev: ok well I deleted all of that and I hope it doesn't screw up everything haha
[19:04:54] cagomez: has joined #RubyOnRails
[19:07:25] skord: has joined #RubyOnRails
[19:07:53] cam27: has joined #RubyOnRails
[19:08:39] tenderlove: has joined #RubyOnRails
[19:11:36] apotry: has joined #RubyOnRails
[19:12:16] pLaTo0n: has joined #RubyOnRails
[19:12:48] srinidhi: has joined #RubyOnRails
[19:14:16] HoierM: has joined #RubyOnRails
[19:14:29] mooser: has joined #RubyOnRails
[19:17:22] Andr3as: i have a model where i have a domain which has_many actionfields and both (domain and actionfields) "has_many" actions - is there a preferred way to query all the actions of a particular domain plus all the actions of its actionfields?
[19:18:13] Andr3as: if this helps, both domains and actionfields have a polymorphal association to actions
[19:18:21] username1: has joined #RubyOnRails
[19:19:03] Andr3as: or better, actions has a polymorphic association to actionfields and domains
[19:21:12] mstashev: has joined #RubyOnRails
[19:21:30] mstashev: ok so ruby 2.3.3
[19:21:46] mstashev: has disappeared from /Users/username/
[19:22:43] envint: has joined #RubyOnRails
[19:23:29] mstashev: and I can't use rbenv install 2.3.3 because it errors out everytime
[19:23:36] dionysus69: has joined #RubyOnRails
[19:24:11] mstashev: Inspect or clean up the working tree at /var/folders/0m/nz3_4sj120d5tcjgyc_hg4g00000gn/T/ruby-build.20170327151656.52894
[19:24:55] cagomez: has joined #RubyOnRails
[19:26:25] Spami: has joined #RubyOnRails
[19:28:51] miah_: has joined #RubyOnRails
[19:32:15] gusrub: has joined #RubyOnRails
[19:36:21] Sirecote: has joined #RubyOnRails
[19:37:44] manveru: has joined #RubyOnRails
[19:38:59] Suslov: has joined #RubyOnRails
[19:40:16] blackmesa: has joined #RubyOnRails
[19:41:35] cagomez: say I have an office db and a local db. if I create a migration, use my local db, and run the migration, can I then connect to the office db and have it contain fields from that migration? or would I need to run the migration on the office db?
[19:41:59] fryguy: cagomez: no
[19:42:04] fryguy: separate databases are separate
[19:42:27] ekinmur: has joined #RubyOnRails
[19:44:30] zeddan: has joined #RubyOnRails
[19:45:35] arBmind: has joined #RubyOnRails
[19:45:39] chrisgopher: has joined #RubyOnRails
[19:45:45] HalcyonicStorm: has joined #RubyOnRails
[19:46:12] MasterAsia: has joined #RubyOnRails
[19:46:35] MasterAsia: Any ideas on how to setup a model that has_many other models
[19:46:40] MasterAsia: a polymorphic has_many if you will
[19:46:42] workmad3: has joined #RubyOnRails
[19:47:01] moogumbo: has joined #RubyOnRails
[19:47:01] fryguy: http://guides.rubyonrails.org/association_basics.html#polymorphic-associations
[19:47:20] MasterAsia: I don't think has_many/polymorphic is supported though, yeah?
[19:47:59] fryguy: it's literally right there in the examples
[19:48:17] MasterAsia: Like what if a specific picture can belong to an employee -and- a product
[19:48:27] wsmoak: has joined #RubyOnRails
[19:48:49] megan_: has joined #RubyOnRails
[19:48:57] sunya7a: Hi, I have the following model and controller code:https://gist.github.com/anonymous/1d90ae5cbfa1bbc76b8b4d466dc45dd8. When I update my profile and remove titles, the deleted_at is set properly on the join table. But when I re-add the title it creates a new record instead of removing the deleted_at value.
[19:49:04] centrx: masterasia: I guess you mean products and employees are in different tables?
[19:49:26] sunya7a: I would also appreciate if anyone could voice opinions as to the current behavior is actually better in the long run
[19:49:31] MasterAsia: yes that is correct
[19:49:48] megan_: I'm using Doorkeeper to create new OAuth applications. Now I'm wondering if anyone has tips or tutorials on how I can track the amount of access tokens an application has given. So that I can give the owner of each application some cool stats.
[19:50:03] centrx: masterasia: Make each have a different associations and make a method that combines them
[19:50:47] centrx: has joined #RubyOnRails
[19:57:21] cagomez: has joined #RubyOnRails
[19:58:16] megan_: Any advice?
[20:00:16] lxsameer: has joined #RubyOnRails
[20:00:20] cagomez: has joined #RubyOnRails
[20:00:29] matthewd: sunya7a: Which behaviour is better really depends on why you're using paranoid/paper_trail
[20:00:43] hahuang65: has joined #RubyOnRails
[20:01:02] NoGodDamnIdea: has joined #RubyOnRails
[20:01:03] NoGodDamnIdea: has joined #RubyOnRails
[20:02:31] patarr: has joined #RubyOnRails
[20:02:49] Technodrome: has joined #RubyOnRails
[20:03:11] GodFather: has joined #RubyOnRails
[20:06:11] cagomez: has joined #RubyOnRails
[20:07:24] username1: has joined #RubyOnRails
[20:12:12] henk_: has joined #RubyOnRails
[20:14:37] dionysus69: has joined #RubyOnRails
[20:14:51] cagomez: has joined #RubyOnRails
[20:15:14] envint: In one of my views, i have a call to `<%= javascript_include_tag(‘/assets/bundle’) %>` which works in development, but when I push this up to Circle my specs are failing with an InvalidCrossOriginRequest error. If I comment out the line, the specs pass again. I’ve ssh’d into circle and determined that the javascript_include_tag is indeed spitting out the markup that I would expect with a relative path i.e.
[20:15:15] envint: `/assets/bundle.js` with the appropriate hash appended so I’m having a difficult time reasoning about why this is blowing up
[20:15:45] fearoffish: has joined #RubyOnRails
[20:15:58] megan_: Does anyone have any advice on my question>?
[20:16:32] fearoffish: has left #RubyOnRails: ()
[20:17:18] envint: megan_: i wish i did - sorry
[20:17:21] chouhoulis: has joined #RubyOnRails
[20:19:46] blackmesa: has joined #RubyOnRails
[20:21:40] cagomez: has joined #RubyOnRails
[20:22:51] Rodya_: has joined #RubyOnRails
[20:23:53] cagomez: has joined #RubyOnRails
[20:28:06] Spami: has joined #RubyOnRails
[20:28:35] Rodya__: has joined #RubyOnRails
[20:31:55] Rith: has joined #RubyOnRails
[20:33:38] centrx: has joined #RubyOnRails
[20:33:38] centrx: has joined #RubyOnRails
[20:37:28] sagax: has joined #RubyOnRails
[20:38:51] centrx: has joined #RubyOnRails
[20:42:59] brent__: has joined #RubyOnRails
[20:45:52] Or1on: has joined #RubyOnRails
[20:46:49] megan_: I'm using Doorkeeper to create new OAuth applications. Now I'm wondering if anyone has tips or tutorials on how I can track the amount of access tokens an application has given. So that I can give the owner of each application some cool stats.
[20:51:06] Jayson_Virissimo: Anyone have any recommendations for books/tutorials for the data modeling side of ERP (enterprise resource planning)?
[20:52:08] centrx: has joined #RubyOnRails
[20:54:12] Andr3as: Jayson_Virissimo: no book but does this help? https://github.com/portablemind/compass_agile_enterprise
[20:55:46] sunya7a: matthewd: thank you. I gave it some more thought and I think I misunderstood some core concepts.
[20:56:29] gusrub: has joined #RubyOnRails
[20:56:50] Jayson_Virissimo: Andr3as: I'm still in the discovery phase, but that's another good option to consider rather than rolling my own.
[20:58:21] Spami: has joined #RubyOnRails
[20:58:21] Spami: has joined #RubyOnRails
[20:58:49] megan_: No one has any advice for my problem :/ ?
[20:59:33] Andr3as: Jayson_Virissimo: yeah.. it all depends, ofc... using a framework brings advantages... but also some issues if you need some stuf different
[21:00:16] Andr3as: megan_: is there no table for the tokens?
[21:01:43] megan_: @andr3as; I have this table: create_table "oauth_access_tokens", force: :cascade do |t|
[21:02:10] megan_: How could I use that to count the users for each application?
[21:02:11] Andr3as: so, i guess there's the associated user in it as well.. via a forign key
[21:02:53] MrPunkin: has joined #RubyOnRails
[21:03:34] Pumukel: has joined #RubyOnRails
[21:03:59] megan_: It has resource_owner_id as a column
[21:04:15] megan_: So I guess the resource owner is the user (owner) of the token
[21:04:48] Andr3as: could be.. you better check.. but if, then group by user id and count the number of tokes
[21:05:52] Jayson_Virissimo: Owner.oauth_access_tokens.count
[21:06:27] Jayson_Virissimo: Provided you have a join table and belongs_to and has_many through.
[21:08:19] megan_: @Jayson, would be nice if I could implement it that way ^^
[21:08:55] willardg: has joined #RubyOnRails
[21:08:57] megan_: Kind of want to do something like; DoorkeeperApplication.oauth_access_tokens.count
[21:09:02] MrPunkin: has left #RubyOnRails: ()
[21:09:34] Jayson_Virissimo: If this something that gets run continuously or infrequently as a background job?
[21:10:04] megan_: I'm not sure, I think infrequently in a bg job
[21:11:01] Jayson_Virissimo: Then just using SQL to COUNT(*) and GROUP BY owner ID should work?
[21:11:12] Jayson_Virissimo: Ah, someone already suggested that above.
[21:11:14] Androsfat: has joined #RubyOnRails
[21:11:41] Andr3as: re my question before.. here's a mockup of my issue (how to effectively query all actions) - any hint is highly appreciated..
[21:11:53] Andr3as: http://bit.ly/2ntKv6u
[21:11:53] Jayson_Virissimo: class OwnerOauthAccessTokens
[21:11:58] Jayson_Virissimo: belongs_to :owner
[21:12:06] Jayson_Virissimo: belongs_to :oauth_access_token
[21:12:26] Jayson_Virissimo: Is the problem that you can't change the DB schema?
[21:12:36] willardg: Can someone shed some light on the error I'm getting? I'm trying to get an object instead of an AR relation by using .first or .last and I'm not sure what the error is trying to say.
[21:12:37] willardg: https://gist.github.com/anonymous/9cacdfeb462b8dfda19def4e8c013c8b
[21:12:45] megan_: I can change it
[21:13:10] megan_: So if I put it in a class OwnerOauthAccessTokens
[21:13:59] kies: has joined #RubyOnRails
[21:14:11] Jayson_Virissimo: We, you'll need a new table the corresponds to that class.
[21:14:30] Jayson_Virissimo: It'll need owner_id, and oauth_access_token_id columns.
[21:15:05] megan_: Could we discuss a little further in a private chat?
[21:15:27] megan_: Can we do that with freenode?
[21:15:52] Suslov: has joined #RubyOnRails
[21:16:09] jobewan: has joined #RubyOnRails
[21:17:33] Suslov: has joined #RubyOnRails
[21:21:58] Androsfat: has left #RubyOnRails: ("Leaving")
[21:22:08] Radar: GOOD MORNING
[21:22:24] willardg: Good afternoon
[21:23:28] wkoszek: has joined #RubyOnRails
[21:26:03] choke: has joined #RubyOnRails
[21:28:37] hahuang65: has joined #RubyOnRails
[21:31:57] gusrub: has joined #RubyOnRails
[21:32:31] wkoszek: How many of you are installing > 1 Ruby version at one time in the production system? 2nd question would be: do you use RVM in production deployments, or only for your development flow?
[21:32:33] linoespinoza: has joined #RubyOnRails
[21:34:11] cagomez: has joined #RubyOnRails
[21:34:38] jenrzzz: has joined #RubyOnRails
[21:34:38] jenrzzz: has joined #RubyOnRails
[21:35:17] tercenya: has joined #RubyOnRails
[21:35:26] willardg: A project I'm working on has > 1 ruby version in it right now. Couldn't tell you for sure how they are handling production deployments. but I use rbenv in my dev flow
[21:35:51] willardg: They haven't had a prod push in 6+months
[21:36:17] Technodrome: has joined #RubyOnRails
[21:38:08] wkoszek: I've had a moment of frustration on my side, when I tried to marry Ansible to Rails and RVM caused me problems. Tried 2 ready-to-use playbooks, and they didn't work either, so I just went and did a reproducible Ruby 2.4.0 builds: https://github.com/wkoszek/ruby_packages And it seems to work for me, but to make it official, I'd like to push it to my own PPA.
[21:38:45] wkoszek: And just trying to think if what I have is enough (Ruby gets installed as 'ruby') or whether I should fuzzle with it a bit more and make it install as 'ruby-2.4.0' or something).
[21:39:20] wkoszek: But the idea is that I grab the .deb from https://github.com/wkoszek/ruby_packages/releases and I install it system-wide, and then just ask bundler to install dependencies locally.
[21:40:07] envint: has joined #RubyOnRails
[21:40:46] vikram__________: has joined #RubyOnRails
[21:45:08] willardg: has joined #RubyOnRails
[21:48:38] cagomez: has joined #RubyOnRails
[21:50:28] cagomez_: has joined #RubyOnRails
[21:50:53] wkoszek: ACTION is looking for testers; got no success/failure stories so far. he's the only tester.
[21:51:03] lupine: wkoszek: I would always, always try to keep 'bundle install' or 'gem install' off of production machines
[21:51:36] lupine: but deploying ruby is a mess, so whatever works
[21:55:58] Technodrome: has joined #RubyOnRails
[22:00:35] hahuang65: has joined #RubyOnRails
[22:01:17] br0d1n: has joined #RubyOnRails
[22:06:50] hahuang65: has joined #RubyOnRails
[22:08:05] cam27: has joined #RubyOnRails
[22:08:35] Arvik_: has joined #RubyOnRails
[22:17:24] wkoszek: lupine: I'm gravitating towards what you say, precisely. pkgr looks very interesting, so maybe I'll give it a shot too.
[22:19:32] mikecmpbll: has joined #RubyOnRails
[22:20:53] lupine: the pkgr approach (although not necessarily pkgr itself) is the best I've come across
[22:20:56] fernandomm: has joined #RubyOnRails
[22:21:27] lupine: at the last place, we used OS packages for everything. at the current place, we're using omnibus packages. talk about differences in approach :D
[22:22:34] aajjbb: has joined #RubyOnRails
[22:24:38] willardg: has joined #RubyOnRails
[22:31:59] User458764: has joined #RubyOnRails
[22:33:31] Pumukel: has joined #RubyOnRails
[22:36:19] wkoszek: I've also read many articles on: what can a Ruby on Rails hacker do to structure the migration in a way that DB and code don't blow up.
[22:37:07] wkoszek: But I can't seem to find good pieces on: how to seemlessly run the migration on a production database.
[22:37:48] wkoszek: I imagine people use Capistrano and just run rails db:migrate on the production system, but if there's an expensive operation, this basically ... locks your site for some time.
[22:40:22] lupine: capistrano :S
[22:40:46] lupine: wkoszek: ideally, your code will cope with the database in either state, and you can run the migrations independently of updating the code
[22:40:49] lupine: in practice, this is really, really hard
[22:41:20] lupine: e.g. http://docs.gitlab.com/ce/development/migration_style_guide.html
[22:41:30] Guest96: has joined #RubyOnRails
[22:42:44] Radar: I'm giving a talk at our local General Assembly today. Going to introduce them to testing by making them write code to make this test pass: https://gist.github.com/radar/aa2d09fe20a9572fbfe693714d165a0e
[22:42:53] Radar: Then I'm going to introduce a bug and make them write their own test.
[22:44:30] xnxq: has joined #RubyOnRails
[22:44:54] wkoszek: lupine: yes, it is. btw, great link, thanks for that.
[22:47:02] Radar: Does anyone have opinions about that exercise? Think it'll be too easy/hard for the students?
[22:47:20] wkoszek: I see it in my mind: I work in dev. and everything works OK, I test on my Vagrant closely mimicking the production, all tests pass, I'm ready to do migration in production. You do rails db:migrate remotely, and it gives you: "Sorry, can't do it. BTW, I made irreversible changes to your database, so your site may be broken now. Sorry"
[22:47:32] keerthana: has joined #RubyOnRails
[22:48:07] blackmesa: has joined #RubyOnRails
[22:48:22] wkoszek: lupine: I use PostgresSQL, but I think it's same for any database I think.
[22:48:37] lupine: postgresql allows DDLs in transactions, so it's a lot safer
[22:48:50] lupine: still not safe safe, though
[22:49:09] lupine: it's good to test migrations, and also run them against a *copy* of the prod database, but changing the data model is always going to be fraught
[22:49:45] am55: has joined #RubyOnRails
[22:50:12] wkoszek: I'm thinking exactly that. To have a database setup figured out, and do the migration by setting up a slave, syncing data to it, running migrations on it, and once everything owrks, that's your new master.
[22:50:19] lupine: really, it depends on how seamless you need the transitional period to be. if you're ok to take the whole thing down while you do the update - and a lot of people can totally get away with that - you don't need to go through many hoops
[22:50:43] lupine: you'd have to disable writes while you run the migration in that model, but it's not a bad model
[22:50:47] wkoszek: yeah. I'm not a unicorn yet, so I guess taking the site down for 10-20min isn't a big deal.
[22:51:43] wkoszek: ACTION dreams big: thousands of customers, millions of requests; but would like to get the dev. model figured out mostly becuase he doesn't trust himself
[22:51:54] Pumukel: has joined #RubyOnRails
[22:52:27] cam27: has joined #RubyOnRails
[22:53:47] lupine: yeah, you don't need to build that yet
[22:54:31] wkoszek: i need to measure how much it takes to just dump the 1-2GB database to a file; probably it's not that bad
[22:55:25] jusa: has joined #RubyOnRails
[22:55:32] lupine: eh, not long at all. pg_dump is quite efficient
[22:59:25] wkoszek: https://medium.com/g-adventures-engineering/speeding-up-postgres-restores-de575149d17a <- this was a cool post about this very topic.
[23:05:37] xnxq: has joined #RubyOnRails
[23:09:43] Velizar: has joined #RubyOnRails
[23:15:06] choke: has joined #RubyOnRails
[23:17:44] czerasz: has joined #RubyOnRails
[23:18:52] czerasz: has joined #RubyOnRails
[23:19:08] choke: has joined #RubyOnRails
[23:20:02] roamingdog: has joined #RubyOnRails
[23:28:20] rakm: has joined #RubyOnRails
[23:30:16] brendan6: has joined #RubyOnRails
[23:30:53] choke: has joined #RubyOnRails
[23:37:56] choke: has joined #RubyOnRails
[23:39:36] xnxq: has joined #RubyOnRails