« Back to channel list

#RubyOnRails - 24 July 2017

« Back 1 day Forward 1 day »
[00:02:22] supervolting: has joined #RubyOnRails
[00:06:00] mostlybadfly: has joined #RubyOnRails
[00:13:06] gusrub: has joined #RubyOnRails
[00:20:48] ariedler: has joined #RubyOnRails
[00:22:46] jhfisc: has joined #RubyOnRails
[00:29:15] jhfisc: has joined #RubyOnRails
[00:31:55] z0mbee: has joined #RubyOnRails
[00:33:58] gusrub: has joined #RubyOnRails
[00:34:51] codelahoma: has joined #RubyOnRails
[00:43:01] jhfisc: has joined #RubyOnRails
[00:44:05] veex: has joined #RubyOnRails
[00:56:16] sevenseacat: has joined #RubyOnRails
[01:00:21] quazimodo: has joined #RubyOnRails
[01:00:33] bronson: has joined #RubyOnRails
[01:00:38] HoierM: has joined #RubyOnRails
[01:06:48] jhfisc: has joined #RubyOnRails
[01:13:14] jhfisc: has joined #RubyOnRails
[01:19:14] jhfisc: has joined #RubyOnRails
[01:20:05] ar1a: has joined #RubyOnRails
[01:27:25] jhfisc: has joined #RubyOnRails
[01:33:06] daydream: has joined #RubyOnRails
[01:33:15] jhfisc: has joined #RubyOnRails
[01:38:21] duderonomy: has joined #RubyOnRails
[01:50:11] jhfisc: has joined #RubyOnRails
[01:54:27] jhfisc: has joined #RubyOnRails
[02:01:02] jhfisc: has joined #RubyOnRails
[02:01:20] bronson: has joined #RubyOnRails
[02:13:05] jhfisc: has joined #RubyOnRails
[02:17:07] irishfromua: has joined #RubyOnRails
[02:18:19] Jameser: has joined #RubyOnRails
[02:19:54] umaaji: has joined #RubyOnRails
[02:22:47] ariedler: has joined #RubyOnRails
[02:23:09] codelahoma: has joined #RubyOnRails
[02:31:36] ariedler: has joined #RubyOnRails
[02:32:58] muzik: has joined #RubyOnRails
[02:42:03] supervolting: has joined #RubyOnRails
[03:02:17] bronson: has joined #RubyOnRails
[03:14:13] veex: has joined #RubyOnRails
[03:14:56] Rodya_: has joined #RubyOnRails
[03:15:36] jhfisc: has joined #RubyOnRails
[03:20:45] irishfromua: has joined #RubyOnRails
[03:27:15] jhfisc: has joined #RubyOnRails
[03:29:22] mehwork: has left #RubyOnRails: ()
[03:33:15] jhfisc: has joined #RubyOnRails
[03:36:20] jhfisc: has joined #RubyOnRails
[03:54:55] ali_g: has joined #RubyOnRails
[04:05:31] jhfisc: has joined #RubyOnRails
[04:11:01] codelahoma: has joined #RubyOnRails
[04:11:28] LiamW: has left #RubyOnRails: ("WeeChat 1.8")
[04:12:27] jhfisc: has joined #RubyOnRails
[04:14:02] Aeyris: has joined #RubyOnRails
[04:14:51] Aeyris: has left #RubyOnRails: ()
[04:22:54] armyriad: has joined #RubyOnRails
[04:26:07] kanzure: has joined #RubyOnRails
[04:32:27] ar1a: has joined #RubyOnRails
[04:45:14] jhfisc: has joined #RubyOnRails
[04:46:07] gusrub: has joined #RubyOnRails
[04:49:05] ali_g: Hi there. I have a model that has a datetime column. I need to extract a list of the years only?- I can extract the year from the datetime column for a single instance ie. @modelname = modelname.last.column_with_datetime.year however @modelname = modelname.all.column_with_datetime.year i get undefined method 'column_with_datetime' for #<Model
[04:50:52] zacts: has joined #RubyOnRails
[04:51:16] jhfisc: has joined #RubyOnRails
[04:57:18] jhfisc: has joined #RubyOnRails
[04:58:12] cam27: I made a gist, cause I can’t figure this out. It’s getting so messy. All I was trying to do was add a reference on orders table to order status table. It should be a many orders has one status relationship. https://gist.github.com/cam271/f35899f05024050d3df0c98aff4d12d7
[05:00:05] jamal7: has joined #RubyOnRails
[05:00:08] cam27: I believe I want the 20170723192128 migration removed and keep the plural one
[05:00:41] sevenseacat: without seeing the contents of the migrations, its impossible to say
[05:00:46] sevenseacat: the names don't mean anything
[05:00:57] jhfisc: has joined #RubyOnRails
[05:01:16] muzik: ali_g, you can use select to only pull specific columns, so Model.all.select('yourDateTimeColumn')
[05:01:21] cam27: my migration gets to there roughly and then says duplicate column (reference) I just want all four of these files deleted so I can make the correct one
[05:01:57] cam27: THey are my latest migrations, so according to what I read, I could roll back and delete them?
[05:02:12] sevenseacat: you can do anything you want
[05:02:16] sevenseacat: its your codd
[05:03:06] cam27: I read that it’s not wise to do it to an earlier migration, but in this case it should be ok right? I mean I don’t want to make a mess
[05:03:49] sevenseacat: again, we can't know if what you're doing is what you actually want without seeing what the migrations have in them
[05:03:54] sevenseacat: if you havent run a migration, you can delete it sure
[05:03:57] bronson: has joined #RubyOnRails
[05:05:38] cam27: line 16 and 17’s files are both running before they remove the reference. So it is not acting before the second add migration
[05:06:15] sevenseacat: it doesnt sound like you're listening.
[05:06:16] cam27: And I believe I want 17’s migration to run cause I forgot to make the first one plural
[05:06:30] cam27: I just can’t stand these migrations
[05:06:54] cam27: why is it this complicated all of the time to work with the database
[05:07:21] cam27: sqlite doesn’t play nice with pg, pg never installs for anyone, etc, etc
[05:07:59] muzik: Its not complicated. Anything that you dont understand appears complicated. Maybe reading up on the active record gem might be a good idea
[05:08:13] sevenseacat: or the migrations guide
[05:08:18] cam27: I read it
[05:08:28] muzik: The problem with these web frameworks is that we jump in and try and get stuff done, while understanding very little about how they work.
[05:08:29] sevenseacat: http://guides.rubyonrails.org/active_record_migrations.html
[05:08:43] muzik: There have been many times when I have had to stop rails development, take a deep breath, and read up
[05:08:45] sevenseacat: cam27: so again, if you'd like us to help you with your migrations, you have to show us what they actually are.
[05:08:55] sevenseacat: the names are still meaningless.
[05:09:28] cam27: I’m jsut deleting the last four files, even though one of them is up and I can’t get it down
[05:09:44] sevenseacat: what can possibly go wrong
[05:09:49] sevenseacat: and then you wonder why its complicated
[05:10:46] cam27: what do you want to see in my file? the one that I want that won’t run?
[05:10:56] sevenseacat: the migrations that youre having problems with.
[05:10:58] cam27: or the one that I want gone, but can’t remove?
[05:11:03] sevenseacat: we still don't know yet what the issue is.
[05:11:22] cam27: I want one removed and one added, but the added one is getting ran before the one I want is removed
[05:11:33] sevenseacat: they run in the order you see there.
[05:11:44] sevenseacat: if you want to change the order, alter the timestamps on them.
[05:11:47] cam27: I just want line 16’s removed so that I can add line 17’s
[05:12:02] sevenseacat: roll it back, then delete it.
[05:12:58] cam27: can’t role it back, 8k errors
[05:13:15] sevenseacat: you're going to have to post the reason why you can't roll it back if you us to help you figure out why.
[05:13:20] sevenseacat: *if you want us
[05:13:35] sevenseacat: what error do you get?
[05:14:01] cam27: I didn’t know I could touch the file and change the timestamp, that will probably fix it
[05:15:15] jhfisc: has joined #RubyOnRails
[05:15:35] sevenseacat: how will renaming a file fix a migration that cant be rolled back?
[05:15:58] nahtnam: has joined #RubyOnRails
[05:19:07] cam27: I don’t know, but maybe I should call it a day, thanks for the help, but I’ve spent a week on this fn db shit and I just want to write code again
[05:19:20] cam27: So I’m at the end of my rope
[05:19:28] sevenseacat: well it could likely be resolved quickly if you answer the questions i ask instead of going off on tangents
[05:19:28] ali_g: muzik, I got the answer, Model.all returns an array so Model.all.collect {|e| e.created_at.year} did the job :)
[05:19:51] roshanavand: has joined #RubyOnRails
[05:19:58] cam27: What is the exact question, I’m tired, it’s 2 am here
[05:20:11] sevenseacat: what error do you get when you try and roll back the migration>
[05:20:24] sevenseacat: if you're tired, get some sleep, you'll be more productive afterwards
[05:20:57] rabajaj: has joined #RubyOnRails
[05:21:11] cam27: PG::DuplicateColumn: ERROR: column "order_status_id" of relation "orders" already exists
[05:21:12] cam27: : ALTER TABLE "orders" ADD "order_status_id" integer
[05:21:22] sevenseacat: thats not when rolling back a migration
[05:21:32] sevenseacat: unless you have a really bizarre migration
[05:21:38] sevenseacat: can you show the migration
[05:23:41] cam27: remove_reference :orders, :order_status, index: true
[05:23:55] cam27: in the change method on the file ending with 28
[05:24:17] cam27: oh, it says remove and it’s an add
[05:24:29] sevenseacat: adding is how you reverse a remove, yes
[05:24:58] sevenseacat: this is why I asked to see the migration - the migration is named "Add order status to order" and you say its actually removing a reference
[05:25:15] cam27: it is down now. I did that to try to get it removed an hour ago
[05:25:29] sevenseacat: great, now you can delete it if you dont want it anymore
[05:25:39] cam27: One of many things I was trying
[05:25:51] sevenseacat: and thats likely how you got into a mess.
[05:26:05] sevenseacat: what problem do you have now?
[05:26:48] sevenseacat: you likely didnt need to roll it back at all, it was likely just fine
[05:29:10] jhfisc: has joined #RubyOnRails
[05:32:24] cam27: Thank you sevenseacat it works, it finally works, now to get it up to product with heroku run rake db:migrate
[05:35:52] cam27: Well, not awesome yet, I have to get it onto Heroku, what could go wrong lol
[05:36:24] cam27: It was set up before, so I’m hoping it’s jsut a push, but it probably has old db info saved somewhere nad I will be tampering with it.
[05:36:25] muzik: If you are not familiar with heroku, you have a fun time ahead :)
[05:37:02] sevenseacat: well if it already has a database set up, I hope you havent edited any migrations already run and expect a good outcome
[05:38:03] cam27: Oh this guy who has money I met over the weekend wants me to develop a weed related app of some kind. HE thinks it’s going to be huge and says he can bank role a good idea if I can get some people to make something big. HE was thinking like a hub of information or a db for doctors to go into to know what to prescribe patients. I got a lot of free drinks out of the conversation at least :)
[05:42:31] muzik: A guy i met recently, thanks to my lovely drug using wondering brother, wants to create a simulation of the universe where anything you can imagine is possible. So i said a simple example. What about the seed of a tree, which requires macro and micro nutrients and organisms, water, wind, rain, the sun, and how a tree would interact with these objects. We would have to program the sedd/tree to do this wouldnt we and he said no. We didnt get much further
[05:42:31] muzik: than that :/
[05:44:00] cam27: lol, well this guy and his wife both own stores, he is a chemist, and his son is a doctor, and he says he has lots of friends who want to hit somethng big and they are willing to pay developers.
[05:44:12] cam27: But Usually they at least have the idea lol
[05:44:16] jhfisc: has joined #RubyOnRails
[05:44:17] muzik: I believe you are referring to an Rx system
[05:44:24] muzik: That i happen to be coding right now :)
[05:44:39] muzik: Well, an interface from an Rx system to an ERP
[05:45:20] cam27: Anyone that can spearhead what this guy wants, let me know and I’ll jsut code stuff, but I said we will need a team of programers that will charge big bucks, and he says he will get the money
[05:45:20] muzik: An Rx has a 1 to many relation from doctors to patients. Each on of those has a a to many to the Rx, which is a one to many to a mix of Rx's. It gets fun
[05:45:58] muzik: Coding that will take a weekend. Filling it with good data, thats what will cost
[05:48:33] cam27: Actually his son was a journalist for the NY TImes I beieve it was? Masters degrees in journalism. His wife is doctor, and they both want to beat the medical marijuana rush along with his dad, and get bought out. It’s a gig at least for us.
[05:49:58] cam27: I sent him an email today, he wants me to do some stuff at his shop and his wifes, but the app idea is just something he doesn’t know about, but he wants to do it.
[05:51:25] jamal7_: has joined #RubyOnRails
[05:55:38] alexday: has joined #RubyOnRails
[05:55:45] zacts: has joined #RubyOnRails
[05:57:14] jhfisc: has joined #RubyOnRails
[06:00:45] one_zero: has joined #RubyOnRails
[06:00:55] jhfisc: has joined #RubyOnRails
[06:02:18] gusrub: has joined #RubyOnRails
[06:04:46] bronson: has joined #RubyOnRails
[06:04:51] one_zero: has joined #RubyOnRails
[06:04:58] cam27: Halleluah, Halleluah, Hellaaallllluuuuuuaaauuuuaw
[06:05:46] cam27: and it’s on production
[06:05:56] jhfisc: has joined #RubyOnRails
[06:17:13] jhfisc: has joined #RubyOnRails
[06:22:09] Jameser: has joined #RubyOnRails
[06:23:15] jhfisc: has joined #RubyOnRails
[06:23:47] defsdoor: has joined #RubyOnRails
[06:29:11] jhfisc: has joined #RubyOnRails
[06:35:28] jhfisc: has joined #RubyOnRails
[06:37:50] apofis: has joined #RubyOnRails
[06:38:32] Radar: cam27: congratulations :)
[06:39:38] cam27: We’re coding now lol GOnna master this back end business and then get onto mastering the front end technologies.
[06:40:13] cam27: I could probably use a gem to manage payments, so I will check them out now and see how to integrate them with my functioning shopping cart
[06:44:17] cam27: Which is most popular? Braintree, Stripe, Active Merchant?
[06:44:37] Radar: Braintree = apple, stripe = apple, active merchant = orange
[06:44:50] Radar: active merchant is a gem that provides a common interface to payment services.
[06:44:54] jhfisc: has joined #RubyOnRails
[06:45:02] Radar: Braintree is my favourite because it supports all common payment methods (CC, Paypal and even Bitcoin)
[06:45:12] Radar: Stripe's interface + API is _slightly_ nicer though
[06:45:57] sevenseacat: stripe is awesome for the simple 'have order, make payment with CC, move on' workflow
[06:46:51] cam27: I’ll probably just use Braintree, that way I can do the Paypal payment setup to
[06:47:15] cam27: Just a fake online store that I think you guys got me started on a year ago lol
[06:47:21] Radar: Stripe's Checkout and Braintree's v.zero are pretty equivalent.
[06:47:22] sevenseacat: i get grumpy when i find online stores that dont support paypal
[06:47:36] sevenseacat: i have many USD sitting in a paypal account i like spending
[06:47:37] Radar: cam27: you mean this one? https://github.com/radar/guides/blob/master/what_next/02_online_store.md
[06:48:03] cam27: Yup, here it is https://t-shirt-store.herokuapp.com
[06:48:08] Radar: That's the one :)
[06:48:39] Radar: https://www.airpair.com/ruby/posts/using-braintrees-vzero-sdk-to-accept-payments
[06:48:42] Radar: Oh hey would you look at that.
[06:48:52] sevenseacat: heres something he prepared earlier
[06:49:10] cam27: The front end stuff is pretty generic for now, but I’m more focused on writing the back end code. But I went off of an out dated tutorial and ended up fixing most of it with Pry, another tip from you guys a year ago
[06:49:34] ariedler: has joined #RubyOnRails
[06:50:41] quazimodo: has joined #RubyOnRails
[06:51:39] cam27: don’t hack it, lol I still have a ways to go with stuff, but I figure if I can get the payment stuff done then I’ll get into user logins and stuff. and then the front end more
[06:52:41] Radar: cam27: Were you here under a different name back then?
[06:53:14] Radar: cam27: I only see messages from you since March this year. Here's the first thing you posted: http://logs.ryanbigg.com/RubyOnRails?date=2017-03-27#6120825
[06:56:31] jhfisc: has joined #RubyOnRails
[06:57:05] cam27: Well that’s not embarasing
[06:57:37] sevenseacat: you dont want to know the first thing I posted in here (good thing we had no logs back then)
[06:58:43] cam27: yeah, I was under a differnt account, but then set it up to mesh with my github profile
[06:59:18] Jameser: has joined #RubyOnRails
[06:59:57] jhfisc: has joined #RubyOnRails
[07:00:32] Jameser: has joined #RubyOnRails
[07:02:39] cam27: SO when people use pry, (I’ve been trying to get better with it) I run rescue rails s, and I add the bnding.pry into the file I’m working with, can I live edit and use the try-again command to fix it in the runtime?
[07:05:15] jhfisc: has joined #RubyOnRails
[07:05:35] cam27: I know this is a rails forum, but this Linkin Park song I’m listening to is really god on this new album, can’t believe this guy killed himself.
[07:05:37] bronson: has joined #RubyOnRails
[07:10:38] sevenseacat: my angsty teenage years, like many others around my age, were spent listening to Linkin Park
[07:12:52] cam27: I covered Chris Cornell’s “I am the Highway” and “Like a Stone” on my accoustic, and now I’m thinking about covering this “One More Light Song”
[07:14:52] muzik: Cornell's greatest track is "Shape of things to come"
[07:16:00] jhfisc: has joined #RubyOnRails
[07:16:54] xhoy: has joined #RubyOnRails
[07:20:04] Jameser: has joined #RubyOnRails
[07:23:29] cam27: Listening to it now, it’s good. I think the body guard did it, guy is shady. (Aussie cough cough) lol
[07:24:00] moei: has joined #RubyOnRails
[07:24:32] sevenseacat: those aussies are indeed a shady bunch
[07:25:16] cam27: I think his wife paid him to do it and he went back to Australia, and if he comes back he might be charged.
[07:28:43] Jameser: has joined #RubyOnRails
[07:32:39] jhfisc: has joined #RubyOnRails
[07:34:35] cam27: I’m out, sun will be coming up soon
[07:35:26] cam27: see ya, futuristic people
[07:35:49] cam27: What will are the winning lottery numbers?
[07:38:23] jhfisc: has joined #RubyOnRails
[07:44:01] jhfisc: has joined #RubyOnRails
[07:48:14] codelahoma: has joined #RubyOnRails
[07:50:27] mikecmpbll: has joined #RubyOnRails
[07:53:01] jhfisc: has joined #RubyOnRails
[07:53:08] srinidhi: has joined #RubyOnRails
[07:53:50] Jameser: has joined #RubyOnRails
[07:58:11] jhfisc: has joined #RubyOnRails
[08:05:27] jhfisc: has joined #RubyOnRails
[08:06:14] bronson: has joined #RubyOnRails
[08:08:20] Trynemjoel: has joined #RubyOnRails
[08:09:31] Ergo: has joined #RubyOnRails
[08:10:05] jhfisc: has joined #RubyOnRails
[08:14:14] one_zero: has joined #RubyOnRails
[08:15:17] jhfisc: has joined #RubyOnRails
[08:25:06] jhfisc: has joined #RubyOnRails
[08:42:58] DrYockel: has joined #RubyOnRails
[08:43:06] jhfisc: has joined #RubyOnRails
[08:50:03] jnillo: has joined #RubyOnRails
[08:51:25] ariedler: has joined #RubyOnRails
[08:55:12] jhfisc: has joined #RubyOnRails
[08:55:51] Tolnaiz: has joined #RubyOnRails
[09:02:01] jhfisc: has joined #RubyOnRails
[09:06:44] krmela: has joined #RubyOnRails
[09:07:16] bronson: has joined #RubyOnRails
[09:09:49] krmela: hello there , i have question exist way which make some fields protected from edit so i am set them in on creation and then i never able to edit them
[09:13:36] jhfisc: has joined #RubyOnRails
[09:15:51] muzik: Do you mean, your view sends the controller the new data, but it does not save?
[09:15:56] muzik: or the field is not in the view?
[09:17:13] jhfisc: has joined #RubyOnRails
[09:18:17] gil_: has joined #RubyOnRails
[09:18:45] marr: has joined #RubyOnRails
[09:24:01] mikecmpbll: has joined #RubyOnRails
[09:24:21] workmad3: has joined #RubyOnRails
[09:25:54] high_fiver: has joined #RubyOnRails
[09:28:07] jhfisc: has joined #RubyOnRails
[09:36:19] codelahoma: has joined #RubyOnRails
[09:39:04] jhfisc: has joined #RubyOnRails
[09:51:24] jhfisc: has joined #RubyOnRails
[09:57:19] jhfisc: has joined #RubyOnRails
[10:04:55] ahrs: has joined #RubyOnRails
[10:08:29] bronson: has joined #RubyOnRails
[10:18:40] Tolnaiz: has joined #RubyOnRails
[10:33:05] xall: has joined #RubyOnRails
[10:43:49] apparition: has joined #RubyOnRails
[11:00:56] Donkoko: has joined #RubyOnRails
[11:04:16] Chernobuk: has joined #RubyOnRails
[11:06:34] Donkoko: Hey everyone. I am struggling with some database errors when trying to run `rake db:migrate`. It all happened when trying to rename some tables. I had a table `licenses` but realized it should be `licences`. The rename seemed to work, but now whenever I run a `rake db:migrate` it fails because within `schema_migrations` it is still for some reason looking for `licenses`. I think I also made the mistake to delete some migration files in t
[11:06:34] Donkoko: he process and I expect this might also be the reason. Here is a gist with the error message(https://gist.github.com/DonKoko/4253b4fc6bf7985954e5c4629bb3a4ec). Any help would be appreciated.
[11:09:18] bronson: has joined #RubyOnRails
[11:25:07] codelahoma: has joined #RubyOnRails
[11:26:59] muzik: has joined #RubyOnRails
[11:31:44] muzik: has joined #RubyOnRails
[11:36:41] universal: Donkoko: how did you rename the table?
[11:38:18] Donkoko: i created a migration
[11:38:22] Donkoko: class RenameLicenses < ActiveRecord::Migration
[11:38:22] Donkoko: def change
[11:38:22] Donkoko: rename_table :licenses, :licences
[11:39:03] Donkoko: I did that for both tables I needed to rename. And then I did a few migrations to rename the fkeys
[11:39:39] universal: Donkoko: ok. and now which migration fails?
[11:40:59] Donkoko: the strange part is that the migration actually didnt fail. When I check my DB, the class and table are renamed. In schema.rb they are also renamed. But when I run rake db:migrate, i get an error because it tries to find `licenses` in `schema_migrations`
[11:41:08] Donkoko: https://gist.github.com/DonKoko/4253b4fc6bf7985954e5c4629bb3a4ec
[11:41:37] Donkoko: and you can see it is looking for `licenses` in that table, instead of `licences`
[11:45:00] universal: Donkoko: this is the full output from the rails db:migrate command?
[11:46:29] Donkoko: I have updated the gist with the full error
[11:47:24] universal: Donkoko: could you add the failing migration?
[11:49:30] Donkoko: I added the 3 renaming migration files
[11:50:41] universal: not seeing them ;)
[11:51:31] Defenestrate: has joined #RubyOnRails
[12:00:17] DoubleMalt: has joined #RubyOnRails
[12:03:35] rgr: has joined #RubyOnRails
[12:04:53] gusrub: has joined #RubyOnRails
[12:06:35] Saukk: has joined #RubyOnRails
[12:10:06] bronson: has joined #RubyOnRails
[12:12:47] Donkoko: Universal, sorry. They should be there now. For some reason gist was not saving.
[12:14:01] universal: Donkoko: https://gist.github.com/DonKoko/4253b4fc6bf7985954e5c4629bb3a4ec#file-migration-error-L4
[12:14:08] universal: this migration is failing, but is not in your gist.
[12:19:02] Donkoko: can you check now
[12:24:47] universal: Donkoko: looks ok'ish. have you tried disabling annotated rails?
[12:25:58] rgr: has joined #RubyOnRails
[12:32:54] Terens: has joined #RubyOnRails
[12:43:51] vedu: Hello. I am transitioning my html/css into a react. How can I decide should I go with a SPA with rails as an API, or, use HTML and the 'react_component' helper?
[12:54:06] planigan: has joined #RubyOnRails
[13:02:38] gheegh: has joined #RubyOnRails
[13:06:42] jhfisc: has joined #RubyOnRails
[13:10:26] jhfisc: has joined #RubyOnRails
[13:11:03] bronson: has joined #RubyOnRails
[13:12:56] codelahoma: has joined #RubyOnRails
[13:14:47] NoGodDamnIdea: has joined #RubyOnRails
[13:19:15] jhfisc: has joined #RubyOnRails
[13:30:39] Jameser: has joined #RubyOnRails
[13:31:44] jhfisc: has joined #RubyOnRails
[13:33:22] apofis: has joined #RubyOnRails
[13:40:13] banisterfiend: has joined #RubyOnRails
[13:51:08] mwlang: has joined #RubyOnRails
[13:55:03] mwlang: I’m working on a background job (activejob) that syncs tables/data between two ActiveRecord connections. My problem: The initializer that makes the second AR connection doesn’t run so the sync job references the primary connection for both sets of AR Models. I was able to “solve it” by copying the initializer code to establish the 2nd connection to the job’s perform method, but this is awfully hacky. What’s the correct way to fire the
[13:55:04] mwlang: initializer code before the job runs? FYI, here’s the gist of the working job: https://gist.github.com/mwlang/c954dfeeaf4656847c5b43b2d86004fb
[13:55:55] ariedler: has joined #RubyOnRails
[14:00:10] icedragon: has joined #RubyOnRails
[14:00:37] DoubleMalt: has joined #RubyOnRails
[14:02:54] jhfisc: has joined #RubyOnRails
[14:05:20] ResidentBiscuit: has joined #RubyOnRails
[14:09:30] ahrs: has joined #RubyOnRails
[14:11:36] bronson: has joined #RubyOnRails
[14:12:54] gremly: has joined #RubyOnRails
[14:13:51] danguita: has joined #RubyOnRails
[14:19:41] jhfisc: has joined #RubyOnRails
[14:21:35] danguita: has joined #RubyOnRails
[14:25:37] jhfisc: has joined #RubyOnRails
[14:27:54] dblessing: has joined #RubyOnRails
[14:31:55] jhfisc: has joined #RubyOnRails
[14:33:17] boykoc: has joined #RubyOnRails
[14:43:15] jhfisc: has joined #RubyOnRails
[14:47:10] danguita: has joined #RubyOnRails
[14:48:54] danguita: has joined #RubyOnRails
[14:54:13] jhfisc: has joined #RubyOnRails
[14:56:17] danguita: has joined #RubyOnRails
[15:01:45] codelahoma: has joined #RubyOnRails
[15:02:50] SteenJobs: has joined #RubyOnRails
[15:06:51] danguita: has joined #RubyOnRails
[15:08:13] jhfisc: has joined #RubyOnRails
[15:11:27] danguita: has joined #RubyOnRails
[15:12:46] bronson: has joined #RubyOnRails
[15:13:00] danguita: has joined #RubyOnRails
[15:23:59] ali_g: hi there! if I have a table with a column datetime and want to extract the year from it and put it to a new column, how do I go about doing it? so far I can extract the year by Model.all.collect { |e| e.column.year } and i get an array. How can I take that array and make the save relation of object per row in a column?
[15:30:41] cagomez: has joined #RubyOnRails
[15:31:30] ariedler: has joined #RubyOnRails
[15:32:18] jnillo: Model.all.collect { |e| e.update_attribute(year:e.column.year) }?
[15:33:25] jnillo: Model.all.each { |e| e.update_attribute(year:e.column.year) }?
[15:45:43] cagomez: has joined #RubyOnRails
[15:49:13] sloggerkhan: has joined #RubyOnRails
[15:56:17] mtkd: has joined #RubyOnRails
[16:11:02] nratter: has joined #RubyOnRails
[16:11:18] gusrub: has joined #RubyOnRails
[16:12:03] SteenJobs: has joined #RubyOnRails
[16:12:25] TvL2386: has joined #RubyOnRails
[16:13:36] bronson: has joined #RubyOnRails
[16:17:23] ali_g: Thanks!, jnillo, I did it with Model.all.collect { |e| e.update_attribute(:year, e.column.year) } (note change of syntax)
[16:17:45] AzaToth: has joined #RubyOnRails
[16:18:05] jhfisc: has joined #RubyOnRails
[16:19:18] theunraveler: has joined #RubyOnRails
[16:19:20] blackthor: has joined #RubyOnRails
[16:20:07] knight33: has joined #RubyOnRails
[16:24:02] jhfisc: has joined #RubyOnRails
[16:30:14] epochwolf: has joined #RubyOnRails
[16:31:51] v|sh: has joined #RubyOnRails
[16:31:56] jhfisc: has joined #RubyOnRails
[16:45:03] jhfisc: has joined #RubyOnRails
[16:49:58] one_zero: has joined #RubyOnRails
[16:50:07] codelahoma: has joined #RubyOnRails
[16:55:49] armyriad: has joined #RubyOnRails
[16:57:35] jhfisc: has joined #RubyOnRails
[17:07:58] jhfisc: has joined #RubyOnRails
[17:08:21] Rodya_: has joined #RubyOnRails
[17:13:17] jhfisc: has joined #RubyOnRails
[17:14:12] gusrub: has joined #RubyOnRails
[17:14:25] bronson: has joined #RubyOnRails
[17:18:10] dviola: has joined #RubyOnRails
[17:21:35] ali_g: How can I reject empty search :params from the controller? If I submit an empty search form the query goes SELECT "fiscals".* FROM "fiscals" WHERE (nombre LIKE '%%')
[17:21:35] ali_g: Here is my gist:
[17:21:35] ali_g: https://gist.github.com/ponentesincausa/8fc8fe0cfed74e7779ffc6e08d62e99a
[17:24:08] cagomez: has joined #RubyOnRails
[17:29:13] cagomez: has joined #RubyOnRails
[17:29:35] srinidhi: has joined #RubyOnRails
[17:41:21] cagomez: should I put `foreman` in my Gemfile? or is it possible to install globally and just run it on my bundle? I don't have much experience with Rails
[17:43:18] jhfisc: has joined #RubyOnRails
[17:45:56] tbuehlmann_: ali_g: check for search.present? instead of just search
[17:46:30] tbuehlmann_: cagomez: if you want the developers of your application to use forman, you should add it to the Gemfile
[17:49:36] ali_g: tbuehlmann_: thanks I passed it to the model:
[17:49:44] ali_g: https://www.irccloud.com/pastebin/oHUwW7w0/
[17:52:52] tbuehlmann_: a sidenote: last(...) will return an array, whereas where(...) will return a relation
[17:53:18] fryguy: cagomez: generally, you should try to put everything in your Gemfile that you can
[17:53:18] jhfisc: has joined #RubyOnRails
[17:59:15] jhfisc: has joined #RubyOnRails
[18:01:31] uks: has joined #RubyOnRails
[18:02:24] jhfisc: has joined #RubyOnRails
[18:09:00] ar1a_: has joined #RubyOnRails
[18:09:36] gusrub: has joined #RubyOnRails
[18:11:14] mwlang: has joined #RubyOnRails
[18:11:50] mwlang: cagomez: put foreman in your development group of your Gemfile
[18:14:24] jhfisc: has joined #RubyOnRails
[18:15:16] bronson: has joined #RubyOnRails
[18:16:42] ur5us: has joined #RubyOnRails
[18:20:01] jhfisc: has joined #RubyOnRails
[18:20:19] kies: has joined #RubyOnRails
[18:24:35] one_zero: has joined #RubyOnRails
[18:25:02] lacuna: has joined #RubyOnRails
[18:26:28] srinidhi: has joined #RubyOnRails
[18:27:00] knight33: has joined #RubyOnRails
[18:31:45] cagomez: has joined #RubyOnRails
[18:33:06] kies: has joined #RubyOnRails
[18:37:19] jhfisc: has joined #RubyOnRails
[18:38:22] codelahoma: has joined #RubyOnRails
[18:44:43] robert_learner: has joined #RubyOnRails
[18:44:59] jhfisc: has joined #RubyOnRails
[18:45:11] watersoul: has joined #RubyOnRails
[18:50:22] robert_learner: has joined #RubyOnRails
[18:50:36] jhfisc: has joined #RubyOnRails
[18:51:41] robert_learner: any idea why this would be returning false? - [nill, 'date'].all? &:blank?
[18:57:18] fryguy: robert_learner: what is nill here
[19:00:31] jscheel: has joined #RubyOnRails
[19:03:32] robert45: has joined #RubyOnRails
[19:03:59] jhfisc: has joined #RubyOnRails
[19:04:45] robert_learner: not sure if my messages are going through
[19:08:33] cagomez: has joined #RubyOnRails
[19:08:47] robert_learner: hi @fryguy, I was using the web chat interface and it kept locking, I saw in the logs you replied
[19:09:00] robert_learner: it's supposed to be one l : nil
[19:09:14] robert_learner: [nil, 'date'].all? &:blank?
[19:09:49] tbuehlmann_: well, 'date' is not blank?, that's why .all?(&:blank?) returns false
[19:10:10] robert_learner: as I understand, this should check each element in the array by applying the blank? function ok, and if any were blank I'd get true
[19:10:19] jhfisc: has joined #RubyOnRails
[19:10:35] tbuehlmann_: if you want any, then use .any?
[19:10:39] gusrub: is there a way to have the same name for a concern in both model and controller, say "Concerns::Authorizable" without name clashing?
[19:10:39] tbuehlmann_: .all? checks for _all_
[19:11:16] robert_learner: omg thanks, I've been racking my brain for the past hour or so on this
[19:11:43] robert_learner: I supposed all would apply the function to all the elements
[19:16:07] bronson: has joined #RubyOnRails
[19:16:14] jhfisc: has joined #RubyOnRails
[19:18:41] apofis: has joined #RubyOnRails
[19:20:21] jhfisc: has joined #RubyOnRails
[19:23:13] creature: has joined #RubyOnRails
[19:25:03] srinidhi: has joined #RubyOnRails
[19:26:05] robert_learner: so I have another question :D i have this in one of my models - validate :valid_date where valid_date is a custom function I wrote for validation
[19:26:42] jhfisc: has joined #RubyOnRails
[19:26:43] robert_learner: I'm trying to pass a parameter to the valid_date function, but not sure how to do it in this syntax
[19:29:03] linetrace: has left #RubyOnRails: ()
[19:29:59] jhfisc: has joined #RubyOnRails
[19:30:54] cagomez: has joined #RubyOnRails
[19:36:15] jhfisc: has joined #RubyOnRails
[19:42:20] jhfisc: has joined #RubyOnRails
[19:46:31] gusrub: has joined #RubyOnRails
[19:47:12] cagomez: has joined #RubyOnRails
[19:55:23] jhfisc: has joined #RubyOnRails
[19:55:40] lxsameer: has joined #RubyOnRails
[19:56:49] sloggerkhan: What's the term for something that has too many different meanings depending on context?
[20:02:53] cagomez: has joined #RubyOnRails
[20:04:04] w0rd-driven: has joined #RubyOnRails
[20:04:38] robert_learner: has joined #RubyOnRails
[20:06:22] NoGodDamnIdea: has joined #RubyOnRails
[20:06:28] jhfisc: has joined #RubyOnRails
[20:11:58] jhfisc: has joined #RubyOnRails
[20:16:19] jhfisc: has joined #RubyOnRails
[20:16:57] bronson: has joined #RubyOnRails
[20:17:28] gambl0re: has joined #RubyOnRails
[20:17:41] cam27: has joined #RubyOnRails
[20:18:59] arup_r: has joined #RubyOnRails
[20:22:21] cagomez: has joined #RubyOnRails
[20:26:40] codelahoma: has joined #RubyOnRails
[20:28:28] timdotrb: has joined #RubyOnRails
[20:35:48] Radar: GOOD MORNING
[20:36:04] roshanavand: has joined #RubyOnRails
[20:36:08] Papierkorb: OHAYO. Quite early actually
[20:36:56] Radar: yes about two hours earlier than usual
[20:37:13] Radar: The Child woke me up early so here I am
[20:47:23] Radar: SloggerKhan: confusing
[20:47:30] Radar: SloggerKhan: do you have an example?
[20:48:52] KeyJoo: has joined #RubyOnRails
[20:51:32] sloggerkhan: Radar: not really. I agree with "confusing," as a general descriptor, but I think there's a term for it. Maybe a bad example is the way the word "hash" is sometimes used in reference to the output of a cryptographic hash function and other times in reference to a hash table, or a data structure that uses keys, so if someone says "so I have a hash" pretty much you immediately ask for clarification unless you already know the context (which to be
[20:52:10] Radar: SloggerKhan: sentence was cut off at "which to be"
[20:52:20] Radar: contextual nomenclature?
[20:52:31] sloggerkhan: *... (which to be fair, is frequently known). But I'm looking for a word that describes something similar in non-technical situations and with regular words for situations where it's almost always a given that the meaning will be unclear without clarification.
[20:52:57] Radar: Sounds like a possible job for english.stackexchange.com
[20:55:11] sloggerkhan: I was considering "overly overloaded terminology," but feel kind of "meh" about it. I more or less finished having the conversation that inspired the question anyway, so it's not particularly important at this point.
[20:55:55] DrYockel1: has joined #RubyOnRails
[20:56:02] Radar: when I've had conversations like that when someone says "I have a hash" there's usually some code to go along with it to help disambiguate what that "hash" is.
[20:56:09] Radar: It could also mean # :P
[20:56:28] cagomez: what's the best way to send a JWT from my Rails app to a React client?
[20:57:41] sloggerkhan: Yeah, I don't think the hash example is that perfect of an example. It's just the first thing I can think of where there are quite a few different meanings. (Including the # symbol as you mention :p)
[21:04:00] HoierM: has joined #RubyOnRails
[21:05:30] codelahoma: has joined #RubyOnRails
[21:07:38] gusrub: has joined #RubyOnRails
[21:10:33] tofutoon: has joined #RubyOnRails
[21:10:47] tofutoon: has left #RubyOnRails: ()
[21:13:28] Rodya_: has joined #RubyOnRails
[21:18:07] bronson: has joined #RubyOnRails
[21:22:39] jarray52: has joined #RubyOnRails
[21:26:16] jarray52: I'm using the sunspot gem with my Rails app. When I try to write request specs for the search functionality, the specs fail because sunspot and solr are indexing items within solr after the spec completes. Is there any way to get sunspot/solr to index as they would in a real application? I tried setting transactional_fixtures to false.
[21:26:56] ur5us: has joined #RubyOnRails
[21:27:36] mwlang: has joined #RubyOnRails
[21:46:51] francuz: has joined #RubyOnRails
[21:49:50] apofis: has joined #RubyOnRails
[21:54:58] sloggerkhan: git reset --soft HEAD~5 && git commit
[21:58:19] nahtnam: has joined #RubyOnRails
[22:12:35] jhfisc: has joined #RubyOnRails
[22:18:18] gambl0re: has joined #RubyOnRails
[22:19:15] bronson: has joined #RubyOnRails
[22:20:08] gambl0re: has joined #RubyOnRails
[22:24:35] ur5us: has joined #RubyOnRails
[22:25:14] jhfisc: has joined #RubyOnRails
[22:28:24] gambl0re: has joined #RubyOnRails
[22:29:21] gambl0re: has joined #RubyOnRails
[22:30:21] gambl0re: has joined #RubyOnRails
[22:31:24] emers2n: has joined #RubyOnRails
[22:36:54] jhfisc: has joined #RubyOnRails
[22:39:40] irishfromua: has joined #RubyOnRails
[22:43:15] jhfisc: has joined #RubyOnRails
[22:51:58] emers2n: Hey y'all. Got a complicated query question I was hoping someone could point me in the right direction on. Snippet here: https://pastebin.com/raw/z7EvmV30
[22:52:17] duderonomy: has joined #RubyOnRails
[22:52:43] emers2n: Basically I want to group by both date and price
[22:52:46] Rodya_: has joined #RubyOnRails
[22:53:52] codelahoma: has joined #RubyOnRails
[22:58:01] timdotrb: Afternoon, all
[22:58:32] emers2n: Afternoon Tim
[23:11:14] jhfisc: has joined #RubyOnRails
[23:19:46] bronson: has joined #RubyOnRails
[23:23:07] duderonomy: has joined #RubyOnRails
[23:28:12] jhfisc: has joined #RubyOnRails
[23:34:16] KeyJoo: has joined #RubyOnRails
[23:34:21] zebird: has joined #RubyOnRails
[23:35:37] zebird: has left #RubyOnRails: ()
[23:37:14] sevenseacat: has joined #RubyOnRails
[23:37:56] planigan: has joined #RubyOnRails
[23:44:18] jhfisc: has joined #RubyOnRails
[23:54:17] Rodya_: has joined #RubyOnRails