« Back to channel list

#RubyOnRails - 15 April 2016

« Back 1 day Forward 1 day »
[00:00:30] Ropeney: good job dionysus69
[00:02:34] Graphettion: has joined #RubyOnRails
[00:03:18] triptec: has joined #RubyOnRails
[00:04:36] FailBit: https://paste.debian.net/plainh/3f694788
[00:04:42] FailBit: some days I wonder about the competency of our server admin
[00:05:42] cnk: He just likes the color yellow?
[00:09:40] _Sypheren: has joined #RubyOnRails
[00:13:42] d0nn1e: has joined #RubyOnRails
[00:13:42] gryftir: has joined #RubyOnRails
[00:16:29] gryftir: Hi, have any of you ever experienced an issue where model creation is failing with Field 'created_at' doesn't have a default value?
[00:16:40] jtong: has joined #RubyOnRails
[00:17:49] FailBit: oops, looks like he forgot how to use a database
[00:19:00] Sawbones: has joined #RubyOnRails
[00:19:17] gryftir: has joined #RubyOnRails
[00:19:26] xcesariox: has joined #RubyOnRails
[00:19:37] gryftir: sorry switched to wifi
[00:19:46] chagel: has joined #RubyOnRails
[00:19:57] FailBit: created_at doesn't have a default value but has a not-null constraint probably
[00:20:29] FailBit: what do your models look like
[00:21:35] macsteps: has joined #RubyOnRails
[00:23:51] DLSteve: has left #RubyOnRails: ("All rise, the honorable DLSteve has left the channel.")
[00:25:14] context: failbit: what is that? also.. seems on par with what id expect to see at my job also
[00:25:36] context: ahh elastic search
[00:27:38] triptec: has joined #RubyOnRails
[00:27:45] kadoppe: has joined #RubyOnRails
[00:28:02] mwlang: where is information logged when starting sunspot solr?
[00:28:31] mwlang: I run bundle exec rake sunspot:solr:start and it tells me it successfully started. yet, ps ax | grep solr => nothing
[00:29:53] context: i didnt know people still used solr
[00:30:03] joshkovach: has joined #RubyOnRails
[00:31:53] kirillzh: has joined #RubyOnRails
[00:31:55] mwlang: context: yeah, yeah, yeah…elastic search is king. vim sucks, use emacs. :-)
[00:32:16] jenrzzz: has joined #RubyOnRails
[00:32:17] jenrzzz: has joined #RubyOnRails
[00:33:54] gryftir: you want the db/schema.rb or the app/model?
[00:34:17] KensoDev: has joined #RubyOnRails
[00:34:51] gryftir: and I assume that under some conditions Rails doesn't put a value into created_at
[00:36:37] kadoppe: has joined #RubyOnRails
[00:37:11] kirillzh: Is it possible to use ActionCable server on native iOS/Android app?
[00:37:34] FailBit: ios, not really
[00:37:46] FailBit: android, yes, but you shouldn't or your app will suck power and memory worse than skype
[00:37:54] FailBit: use the push APIs for each platform instead
[00:37:59] FailBit: they work _much_ better
[00:38:31] kirillzh: @FailBit I want to implement chat on server side (never done it before)
[00:39:17] FailBit: https://developers.google.com/cloud-messaging/
[00:39:40] FailBit: https://developer.apple.com/notifications/
[00:39:47] FailBit: use both of these
[00:39:51] FailBit: _your users will thank you_
[00:42:13] kirillzh: I found this framework https://github.com/cloverstudio/Spika
[00:42:16] kirillzh: It works pretty good on iOS and Android
[00:42:17] kirillzh: But server side sucks
[00:42:20] kirillzh: Since my backend is already written on RoR, I thought about rewriting chat server side on Rails with ActionCable
[00:43:17] triptec: has joined #RubyOnRails
[00:44:09] Sawbones: has joined #RubyOnRails
[00:44:16] Arcaire: VS Code is nice.
[00:45:29] kirillzh: @Arcaire it supports Ruby/Rails?
[00:46:45] Arcaire: It supports everything.
[00:47:09] Arcaire: I use Atom right now but I was just kind of looking around at editors.
[00:47:32] kirillzh: I'm using RubyMine
[00:50:06] petor: has joined #RubyOnRails
[00:50:37] chouhoulis: has joined #RubyOnRails
[00:53:12] bronson: has joined #RubyOnRails
[00:54:15] Arcaire: One thing that shits me about Atom atm is how it updates
[00:54:25] Arcaire: I end up with my OS X context menu containing 2-3 versions of Atom.
[00:54:30] FailBit: >not using vim masterrace
[00:54:32] Arcaire: Only one works. I have to guess which. It's often not the latest.
[00:54:36] Arcaire: >using vim literally ever
[00:54:49] FailBit: mac's default copy of vim is completely ass
[00:54:54] FailBit: I don't know why anyone would ever use it
[00:54:59] FailBit: the debian vims are all sane
[00:55:04] Arcaire: vim in general is ass.
[00:55:17] Arcaire: I want to enjoy reading my code, not just look like I'm an extra in Mr. Robot.
[00:55:52] kirillzh_: has joined #RubyOnRails
[00:55:59] Arcaire: The amount I use my mouse for other things, I don't want to just go into macksimum keyboard mode for vim because that's the way the same person who gets someone else to print his emails out does it.
[00:56:27] FailBit: ACTION rolls eyes
[00:56:44] FailBit: I use my keyboard for pretty much everything except webpages
[00:56:52] Arcaire: And how much do you use webpages?
[00:57:08] FailBit: about 40% of the time I'm on a computer
[00:57:41] FailBit: now, if I was RMS I just wouldn't have a mouse
[00:58:23] Trynemjoel: has joined #RubyOnRails
[00:59:22] Arcaire: tfw my typing speed is up somewhere above 110wpm and i still use a mouse heavily like a normie
[00:59:40] alias-ls-to-rm: has joined #RubyOnRails
[00:59:57] Arcaire: that said i'm currently retraining my hands because i type weirdly so right now i'm nowhere near that speed :^)
[01:03:36] Trynemjoel: has joined #RubyOnRails
[01:03:41] wethu: has joined #RubyOnRails
[01:03:43] wethu: has joined #RubyOnRails
[01:07:08] ur5us: has joined #RubyOnRails
[01:07:12] FailBit: https://i.imgur.com/gzwxX0n.png
[01:07:37] triptec: has joined #RubyOnRails
[01:07:41] kadoppe: has joined #RubyOnRails
[01:08:04] ur5us_: has joined #RubyOnRails
[01:09:21] akshat: has joined #RubyOnRails
[01:11:04] FailBit: they're removing the errors page with no substitute unless you pony up money
[01:11:27] FailBit: maybe it's time to look at sematext seriously
[01:11:27] ekinmur: has joined #RubyOnRails
[01:13:06] sevenseacat: has joined #RubyOnRails
[01:13:08] Technodrome: has joined #RubyOnRails
[01:21:25] AliasLStoRM: has joined #RubyOnRails
[01:22:12] Arcaire: gotta make money i guess
[01:23:04] aloneintheworld: has joined #RubyOnRails
[01:23:16] triptec: has joined #RubyOnRails
[01:24:10] kadoppe: has joined #RubyOnRails
[01:27:10] Denart_: has joined #RubyOnRails
[01:28:59] quazimodo: has joined #RubyOnRails
[01:29:01] quazimod1: has joined #RubyOnRails
[01:36:07] Denart_: has joined #RubyOnRails
[01:36:36] triptec: has joined #RubyOnRails
[01:37:14] SteenJobs: has joined #RubyOnRails
[01:38:49] SteenJobs: has joined #RubyOnRails
[01:44:47] Radar: skylight.io
[01:45:10] FailBit: they bill for your RPM
[01:45:23] baweaver: has joined #RubyOnRails
[01:46:00] Arcaire: how many do you get p/mo?
[01:46:09] FailBit: in the range of 156816000
[01:46:24] lemur: has joined #RubyOnRails
[01:46:51] Arcaire: that's not a range
[01:47:30] Arcaire: 156m? wtf?
[01:47:46] huhwhathow: has joined #RubyOnRails
[01:48:26] Arcaire: FailBit: $526.00 lol
[01:48:53] FailBit: https://i.imgur.com/0wEwqPR.png
[01:48:57] FailBit: it's stupid
[01:50:00] fryguy9: haha we pay a lot more than that for new relic
[01:50:26] Ropeney: FailBit, you do 156m requests per month on 14 rails servers?
[01:50:34] FailBit: 14 app instances
[01:50:37] FailBit: not servers
[01:50:40] FailBit: just one server
[01:50:44] Arcaire: Ropeney: He has 14 nginx servers
[01:50:46] kadoppe: has joined #RubyOnRails
[01:50:48] Arcaire: lots of caching
[01:50:56] FailBit: there are a lot more than 14 nginx servers
[01:51:08] Arcaire: i meant 14 dedicated hardware instances hosting nothing but nginx
[01:51:12] Arcaire: lots of nginx
[01:51:16] FailBit: oh yes definitely
[01:51:19] Arcaire: also mongodb
[01:51:22] FailBit: reverse proxy all the things
[01:51:23] Arcaire: so there's only one database server
[01:51:27] Arcaire: running on a 512MB digitalocean
[01:51:29] FailBit: and use a meme database
[01:51:31] Arcaire: because it's WEB SCALED
[01:51:49] Ropeney: it started out serious, but don't know if trolling now lol
[01:51:53] huhwhathow: has left #RubyOnRails: ()
[01:51:56] Arcaire: I'm only half trolling
[01:52:02] FailBit: we used to use mongodb
[01:52:02] Arcaire: but he is actually using 512MB digitaloceans
[01:52:10] FailBit: no we aren't >:P
[01:52:12] triptec: has joined #RubyOnRails
[01:52:13] Arcaire: FailBit: host your VMs with me
[01:52:15] FailBit: that would be stupid expensive anyways
[01:52:17] Arcaire: I do cool shit
[01:52:25] FailBit: our server is decked out
[01:52:28] sevenseacat: Ropeney: my vote is for trolling, whenever FailBit talks
[01:52:45] FailBit: I'm trying not to reveal my inner /g/ at all times
[01:52:49] FailBit: it's so hard
[01:52:57] Arcaire: are you on the installgentoo net?
[01:53:08] FailBit: I have been installing gentoo for the past 7 years
[01:53:13] FailBit: it's still not done compiling the kernel
[01:53:14] Arcaire: i mean the irc
[01:53:25] Arcaire: we're currently talking about slither.io
[01:53:29] mwlang: well, an hour and a half of pain later…I never did find the actual sunspot solr log, but finally remembered that rake sunspot:solr:run existed and it dumps everything to console…
[01:53:35] FailBit: I'm only on 2 irc nets
[01:53:44] FailBit: this one, and another you can probably figure out with minimal guesswork
[01:53:53] Arcaire: it's a combination of this one canadian dude who does nothing but shout racial slurs at everyone else
[01:53:56] Arcaire: and shitposting
[01:54:04] FailBit: antisemitism included?
[01:54:15] FailBit: that's my >>>/pol/
[01:54:20] FailBit: ACTION finds details
[01:54:24] Arcaire: he's a /pol/lack through an dthrough
[01:54:42] Arcaire: the owner is a pretty cool guy but he's not around much
[01:54:44] mwlang: turns out “1gb” is an invalid value for setting heap size although “2gb” worked just fine. and “1gb” worked locally. Changed it to “1g” and it works. Go figure.
[01:55:22] Arcaire: FailBit: i didn't realise db had an irc
[01:55:42] sleungcy: has joined #RubyOnRails
[01:55:46] FailBit: well duh :V
[01:55:52] rafaelfranca: has joined #RubyOnRails
[01:55:52] rafaelfranca: has joined #RubyOnRails
[01:55:59] FailBit: there's an irc for everything
[01:56:08] Arcaire: i use an irc solely for hosting botnets
[01:56:15] Arcaire: s/use/run/
[01:58:46] cydrobolt: has joined #RubyOnRails
[01:58:46] cydrobolt: has joined #RubyOnRails
[02:02:28] Cohedrin: has joined #RubyOnRails
[02:04:02] aurum_infide: has joined #RubyOnRails
[02:06:09] creature: has joined #RubyOnRails
[02:06:09] creature: has joined #RubyOnRails
[02:07:11] Technodrome: has joined #RubyOnRails
[02:08:52] triptec: has joined #RubyOnRails
[02:11:26] IrishGringo: has joined #RubyOnRails
[02:13:29] sarink: has joined #RubyOnRails
[02:16:17] User458764: has joined #RubyOnRails
[02:19:55] workmad3: has joined #RubyOnRails
[02:21:00] hxegon: has joined #RubyOnRails
[02:23:41] rafaelfr_: has joined #RubyOnRails
[02:24:25] smathy_: has joined #RubyOnRails
[02:25:12] Pupeno: has joined #RubyOnRails
[02:26:48] neanderslob: has joined #RubyOnRails
[02:27:57] joshkovach: has joined #RubyOnRails
[02:32:44] sevenseacat: has joined #RubyOnRails
[02:34:51] ur5us: has joined #RubyOnRails
[02:35:40] rubyonrailed: has joined #RubyOnRails
[02:37:03] hxegon: has joined #RubyOnRails
[02:39:01] fedexo: has joined #RubyOnRails
[02:39:08] kies: has joined #RubyOnRails
[02:39:56] chagel: has joined #RubyOnRails
[02:41:15] malcolmva: has joined #RubyOnRails
[02:42:42] diegoaguilar: has joined #RubyOnRails
[02:43:29] RegulationD: has joined #RubyOnRails
[02:45:52] quazimodo: has joined #RubyOnRails
[02:45:53] quazimod1: has joined #RubyOnRails
[02:46:27] emachnic: has joined #RubyOnRails
[02:50:39] Arcaire: apparently i don't anymore, the server expired
[02:50:45] Arcaire: >i can't even host my honeypots correctly
[02:50:51] sleungcy: has joined #RubyOnRails
[02:51:12] Arcaire: Radar: UberEATS is coming to Melbourne
[02:51:14] petor: has joined #RubyOnRails
[02:51:22] Arcaire: if delivery on everything you can imagine is your thing.
[02:54:26] djbkd: has joined #RubyOnRails
[02:55:35] bronson: has joined #RubyOnRails
[02:58:07] emachnic: has joined #RubyOnRails
[02:58:41] eljimmy: has joined #RubyOnRails
[03:00:16] bruno-: has joined #RubyOnRails
[03:03:22] Radar: Arcaire: neat
[03:03:27] aloneintheworld: has joined #RubyOnRails
[03:03:30] Radar: Arcaire: I like walking to my regular take out joints. Easier.
[03:04:44] sevenseacat: those of us who live in the burbs do not have that luxury :P
[03:05:22] hxegon: has joined #RubyOnRails
[03:07:32] triptec: has joined #RubyOnRails
[03:07:56] kadoppe: has joined #RubyOnRails
[03:11:36] bruno-: has joined #RubyOnRails
[03:17:15] braincras: has joined #RubyOnRails
[03:17:42] ramfjord: has joined #RubyOnRails
[03:18:03] mwlang: sevenseacat: ‘burbinites have other luxuries, though. :-)
[03:21:04] Darmani: Hey Radar ^.^
[03:23:14] hervie_: has joined #RubyOnRails
[03:23:30] Synthead: has joined #RubyOnRails
[03:23:46] dopieee: has joined #RubyOnRails
[03:23:57] brainslug: has joined #RubyOnRails
[03:24:13] AntiSpamMeta2: has joined #RubyOnRails
[03:25:08] joelsmith: has joined #RubyOnRails
[03:25:49] robbkidd_: has joined #RubyOnRails
[03:25:52] Coldblackice: has joined #RubyOnRails
[03:26:20] aloneintheworld_: has joined #RubyOnRails
[03:26:25] yaewa: has joined #RubyOnRails
[03:26:27] Arcaire: sevenseacat: I live out of the CBD so i won't get it :(
[03:26:31] Arcaire: i can't even get a regular uber
[03:27:03] sevenseacat: out where you live, yeah I can imagine
[03:27:07] nodejunkie: has joined #RubyOnRails
[03:27:22] Arcaire: taxis are so shit though
[03:27:31] Arcaire: i called the night before to book a taxi for like 11am one time to take me to the airport
[03:27:34] Arcaire: he turns up at 11:40
[03:27:44] Arcaire: luckily i'd already given myself an extra hour of leeway time
[03:28:43] sevenseacat: they are indeed
[03:28:53] sevenseacat: is why i would rely on public transport more
[03:29:11] Arcaire: getting to the airport via pt would be hell on earth i think
[03:29:18] Arcaire: for me, anyway
[03:29:48] chagel: has joined #RubyOnRails
[03:30:25] fedexo_: has joined #RubyOnRails
[03:30:44] sevenseacat: likely same as it for most places in the burbs - bus,train,bus
[03:31:10] M-shine: has joined #RubyOnRails
[03:31:13] Spaceghost|work: has joined #RubyOnRails
[03:31:23] dopie2: has joined #RubyOnRails
[03:31:35] itkin: has joined #RubyOnRails
[03:32:04] Trynemjoel: has joined #RubyOnRails
[03:32:20] Ratler_: has joined #RubyOnRails
[03:32:46] coffeejunk: has joined #RubyOnRails
[03:33:17] braincrash: has joined #RubyOnRails
[03:33:24] martinbjeldbak: has joined #RubyOnRails
[03:33:43] nickenchuggets: has joined #RubyOnRails
[03:33:43] nickenchuggets: has joined #RubyOnRails
[03:33:44] ur5us: has joined #RubyOnRails
[03:34:10] hoodow: has joined #RubyOnRails
[03:34:10] hoodow: has joined #RubyOnRails
[03:35:34] Arcaire: #rubyonrails on another irc network when
[03:36:09] samuelkadolph: has joined #RubyOnRails
[03:37:32] theery: has joined #RubyOnRails
[03:38:36] funnel: has joined #RubyOnRails
[03:38:57] siaW: has joined #RubyOnRails
[03:39:44] patrick_star: has joined #RubyOnRails
[03:40:14] hightower3: has joined #RubyOnRails
[03:41:59] mdel: has joined #RubyOnRails
[03:44:50] sleungcy: has joined #RubyOnRails
[03:45:10] barajasfab: has joined #RubyOnRails
[03:45:13] baweaver: has joined #RubyOnRails
[03:45:43] FooBarWidget: has joined #RubyOnRails
[03:51:01] yfeldblum: has joined #RubyOnRails
[03:59:47] sarink: has joined #RubyOnRails
[04:01:52] context: has joined #RubyOnRails
[04:02:27] emchamp: has joined #RubyOnRails
[04:02:28] helpa: ¯\_(ツ)_/¯ Sorry, sevenseacat is not able to help you any further as they do not know.
[04:04:40] Ropeney: has joined #RubyOnRails
[04:06:00] rubyonrailed: has joined #RubyOnRails
[04:12:53] Criten: sevenseacat is my hero
[04:13:23] SteenJobs: has joined #RubyOnRails
[04:13:23] Criten: It has nothing to do with ruby
[04:13:25] Criten: http://tis-game.zmattor.me/game
[04:13:28] smoitra: has joined #RubyOnRails
[04:16:21] Ropeney: omg best game ever
[04:17:11] Criten: https://github.com/Arksaw/tis-server
[04:17:13] Criten: https://github.com/Arksaw/tis-client
[04:19:04] jtong: has joined #RubyOnRails
[04:20:21] Ropeney: todays productivity now gone
[04:20:37] Criten: where are all these people coming from
[04:20:43] Ropeney: thatd be my fault
[04:21:19] Criten: Ropeney: good stress test i guess
[04:21:33] Criten: press R to respawn if you get lost
[04:21:59] Criten: Ropeney: co-workers? lol
[04:22:22] Ropeney: keep killing myself :(
[04:22:29] Criten: i need to get a leaderboard and stuff
[04:22:33] Criten: and a win condition
[04:22:37] zz_timnovinger: has joined #RubyOnRails
[04:22:37] Criten: and names...
[04:23:09] wenchenx_: has joined #RubyOnRails
[04:24:44] ddv: has joined #RubyOnRails
[04:24:55] Criten: wwhat number are ytou
[04:24:57] Ropeney: ok im done lol
[04:25:07] rickmasta: has joined #RubyOnRails
[04:25:17] ctrlrsf: has joined #RubyOnRails
[04:26:16] Criten: well that was fun
[04:26:29] Criten: Ropeney: that was the most people i've ever had in there haha
[04:26:55] Criten: just got health and damage working like an hour ago
[04:26:58] Radar: Is anyone here running tests for their Rails app across multiple machines? I think that's gonna be the next step for us.
[04:27:12] Ropeney: Radar, that would be so awesome
[04:27:20] Criten: Radar: that's what the parallel tests in codeship does ;)
[04:27:21] IrishGringo: has joined #RubyOnRails
[04:27:21] Radar: Ropeney: Yes, yes it would.
[04:27:38] Radar: Criten: We're already quite happy with Buildkite and don't want to switch to an alternate CI setup.
[04:28:07] Criten: well all i know is that it's quite possible because i see them doing it
[04:29:05] Ropeney: beowulf cluster inc?
[04:30:27] pawnbox: has joined #RubyOnRails
[04:30:30] Criten: a server per test!
[04:30:40] Radar: There looks like there's a lot of building blocks out there, but no buildings.
[04:33:15] context: has joined #RubyOnRails
[04:36:57] ramfjord: has joined #RubyOnRails
[04:38:30] sleungcy: has joined #RubyOnRails
[04:39:41] bruno-: has joined #RubyOnRails
[04:40:57] emachnic: has joined #RubyOnRails
[04:43:49] tjbiddle: has joined #RubyOnRails
[04:43:51] pawnbox: has joined #RubyOnRails
[04:46:27] edwinvdgraaf: has joined #RubyOnRails
[04:52:23] petor: has joined #RubyOnRails
[04:53:39] wethu: has joined #RubyOnRails
[04:55:10] pawnbox_: has joined #RubyOnRails
[04:55:33] jetpack_joe: has joined #RubyOnRails
[04:56:55] hxegon: has joined #RubyOnRails
[04:57:22] bronson: has joined #RubyOnRails
[05:02:15] benlieb: has joined #RubyOnRails
[05:02:38] pawnbox: has joined #RubyOnRails
[05:03:28] Devalo: has joined #RubyOnRails
[05:04:56] IrishGringo: has joined #RubyOnRails
[05:07:43] sarink: has joined #RubyOnRails
[05:08:51] noodle: has joined #RubyOnRails
[05:10:33] pawnbox: has joined #RubyOnRails
[05:15:04] kadoppe: has joined #RubyOnRails
[05:15:15] pawnbox_: has joined #RubyOnRails
[05:17:30] theery: has joined #RubyOnRails
[05:22:21] pawnbox: has joined #RubyOnRails
[05:22:28] errakeshpd: has joined #RubyOnRails
[05:23:35] rubyonrailed: has joined #RubyOnRails
[05:24:44] stannard_: has joined #RubyOnRails
[05:25:15] axilla_: has joined #RubyOnRails
[05:27:21] ereslibre: has joined #RubyOnRails
[05:27:21] ereslibre: has joined #RubyOnRails
[05:27:36] siaw_: has joined #RubyOnRails
[05:28:16] pawnbox: has joined #RubyOnRails
[05:28:56] merida: has joined #RubyOnRails
[05:29:06] AntiSpamMeta: has joined #RubyOnRails
[05:29:12] SanguineAnomaly: has joined #RubyOnRails
[05:29:16] iamvery: has joined #RubyOnRails
[05:29:28] StaticVoid: has joined #RubyOnRails
[05:29:30] funnel: has joined #RubyOnRails
[05:30:00] noodle: has joined #RubyOnRails
[05:30:19] mdel: has joined #RubyOnRails
[05:31:05] Ratler: has joined #RubyOnRails
[05:32:31] sleungcy: has joined #RubyOnRails
[05:32:59] Haydos: has joined #RubyOnRails
[05:33:02] greenhat: has joined #RubyOnRails
[05:33:04] andatche: has joined #RubyOnRails
[05:33:05] dcope: has joined #RubyOnRails
[05:33:05] martinbjeldbak: has joined #RubyOnRails
[05:33:10] errakeshpd: => Thu, 07 Apr 2016 10:29:30 UTC +00:00
[05:33:10] errakeshpd: but in json respond
[05:33:10] errakeshpd: "created_at": "2016-04-15T05:09:34.556Z",, How to respond it in GMT mode
[05:33:12] Trynemjoel: has joined #RubyOnRails
[05:33:13] kadoppe: has joined #RubyOnRails
[05:33:30] IceBear: has joined #RubyOnRails
[05:33:32] errakeshpd: any configuration way ?
[05:33:34] Helheim: has joined #RubyOnRails
[05:33:39] IceBear: has joined #RubyOnRails
[05:34:48] vladr: has joined #RubyOnRails
[05:36:28] tweeeaks: has joined #RubyOnRails
[05:36:30] ur5us: has joined #RubyOnRails
[05:37:36] chagel: has joined #RubyOnRails
[05:37:56] krz: has joined #RubyOnRails
[05:38:25] Haydos: has joined #RubyOnRails
[05:39:03] merida_: has joined #RubyOnRails
[05:40:40] czerasz: has joined #RubyOnRails
[05:41:17] Pathfinder: has joined #RubyOnRails
[05:42:12] kies: has joined #RubyOnRails
[05:42:42] triptec: has joined #RubyOnRails
[05:42:48] Palsson: has joined #RubyOnRails
[05:43:29] tjbiddle: Am I the only one who struggles with assets literally every Rails project I deal with? Every time - I first start off; and it takes me ages to figure out why js/css files aren't loading in. Then I sort it. Then I have to deal with precompilation in production.
[05:44:33] moei: has joined #RubyOnRails
[05:45:45] malcolmva: has joined #RubyOnRails
[05:47:21] Ropeney: tjbiddle, do you try restarting the server?
[05:47:47] tjbiddle: Ropeney: Every time, I stop the server, destroy public/assets; re-precompile; and start the server again
[05:47:55] tjbiddle: My issue right now is specifically with fonts
[05:48:03] Ropeney: i never seem to have issues :(
[05:48:09] sevenseacat: i dont have issues typically either
[05:48:24] tjbiddle: ACTION facepalm
[05:48:24] Ropeney: unless i've done something wrong... of course
[05:48:37] sevenseacat: so whats the exacty problem?
[05:48:50] Ropeney: i think it's been worked out
[05:49:05] Ropeney: i took facepalm as that
[05:49:12] Radar: but what if it hasn't been
[05:49:12] Ropeney: "i see what i did"
[05:49:23] sevenseacat: the mystery deepends
[05:49:31] sevenseacat: i really cant type today.
[05:49:33] tjbiddle: I have customer js/css inside app/assets; and then I have a theme from wrapboostrap (Or something, can't remember) that's in vendor/assets - It has vendor/assets/[fonts,javascripts,stylesheets]
[05:49:34] Ropeney: then they are able to answer :o :O :-0
[05:49:36] Radar: I* can't*
[05:49:39] Radar: ACTION is helping?
[05:49:39] tjbiddle: JS and CSS work - but fonts are not
[05:49:53] tjbiddle: Nor images - but I'll get to that after; probably same solution as fonts
[05:50:05] sevenseacat: so how are you loading the fonts?
[05:50:11] tjbiddle: Do I want to compile fonts at all? Do I have to change my precompile path? Do I need to do something with the font-face url?
[05:50:25] sevenseacat: yes, no, and yes
[05:50:25] tjbiddle: sevenseacat: How do you mean? They're being reference in CSS files
[05:50:32] sevenseacat: thats what i mean, how
[05:50:54] tjbiddle: I have things like url('/assets/glyphicons-halflings-regular.eot?#iefix')
[05:51:02] Radar: not asset-url?
[05:51:04] Radar: as the guide recommends?
[05:51:05] tjbiddle: I've tried font-url and url(font-path('...'))
[05:51:07] Radar: The guide that I wrote?
[05:51:10] helpa: http://guides.rubyonrails.org/asset_pipeline.html - The Asset Pipeline Guide by Ryan Bigg, Richard Hulse & Mohammad Typaldos
[05:51:12] tjbiddle: But neither are adding the md5 that gets appended
[05:51:23] Radar: http://guides.rubyonrails.org/asset_pipeline.html section 2.3.2
[05:51:37] helpa: http://i.imgur.com/tyViD.gif
[05:51:56] Radar: ACTION tries not to be offended; fails cataclysmically. 
[05:52:13] Radar: (jk, not really offended at all)
[05:52:43] tjbiddle: Radar - I've done that =\ (Probably doing it incorrectly somewhere) but no effect. Does this need to be a .css or .scss file? I've tried both
[05:52:55] Radar: tjbiddle: steps to reproduce in a new app please.
[05:52:57] sevenseacat: can you gist your code?
[05:54:33] tjbiddle: Does it matter if I'm running rake assets:precompile standalone; but am running my server with RAILS_ENV=production ? I tried both and it looks like they go in the same spot
[05:56:27] tjbiddle: sevenseacat: Like I said - I struggle with assets for some reason, ahha. I'm putting together a gist.
[05:57:00] tjbiddle: Radar: It'd probably take me just as long to put together in a new app. But if it comes to that I will
[05:58:29] Ropeney: gist just your css, and tree your app directory ?
[05:59:23] aurum_infide: has joined #RubyOnRails
[06:01:28] tjbiddle: https://gist.github.com/thomasbiddle/e647db66bfb7b456b3eb9584a8e7059e
[06:02:22] sevenseacat: Radar: i will leave the smackdown to you
[06:02:40] tjbiddle: Did I fuck up that bad?
[06:02:45] tjbiddle: Ropeney: tree: https://gist.github.com/thomasbiddle/4b0e8d74b28f1309d5b5a895ad0c563a
[06:02:55] duncannz: has joined #RubyOnRails
[06:04:12] Radar: https://gist.github.com/thomasbiddle/e647db66bfb7b456b3eb9584a8e7059e#file-config-initializers-assets-rb-L14-L28
[06:04:13] Radar: What is this
[06:05:00] Radar: Where are you expecting these assets to be compiled from?
[06:05:05] tjbiddle: Radar: So that I can write individual JS files for each controller action (edit.js / new.js / etc.)
[06:05:24] Radar: tjbiddle: So that the user has to download each and every one of them individually? Yeah not a great idea.
[06:05:31] tjbiddle: I have custom assets in app/assets; and a theme of 3rd party stylesheets/js in vendor/assets
[06:05:38] Ropeney: is font-url a thing?
[06:05:39] Radar: tjbiddle: The asset pipeline is designed to compile them down into a single application.js file.
[06:05:39] tjbiddle: Radar: isn't that the point of precompilation?
[06:05:41] Radar: Ropeney: yes it is.
[06:05:47] tjbiddle: It will combine them in production?
[06:06:10] Radar: tjbiddle: Please show me an app which reproduces this issue and I'll give you the answer. Leave out `config/initializers/assets.rb` since it seems to be wanting to include everything.
[06:06:21] Radar: Yes, it will combine them in production AND development into application.js in the default Rails app.
[06:06:44] Ropeney: one says `src: font-url(` one is `src: url(` are they same?
[06:07:28] Radar: the second one won't work iirc.
[06:07:36] Radar: I think it just won't work in prod.
[06:07:42] rafaelfranca: has joined #RubyOnRails
[06:07:48] tjbiddle: Radar: Alright - Let's forget my current problem then and fix it from the bottom. It's possible to have separate JS files for each controller action, right? But then in both development and production, it will combine it into one and then it will work?
[06:08:24] tjbiddle: Radar: Is this supposed to happen automatiaclly? Because I remember jumping through hoops months ago to get it to work - hence my current solution
[06:08:26] sevenseacat: i would not recommend having separate js files for each controller action
[06:08:32] sevenseacat: it doesnt make sense to do so
[06:08:35] Radar: tjbiddle: Yes it will happen automatically.
[06:08:39] tjbiddle: sevenseacat: How would you go about it? And why not?
[06:08:53] Radar: tjbiddle: Any assets created in app/assets/javascripts will be compiled down into application.js.
[06:08:56] sevenseacat: because you're very very rarely going to be writing JS specific to one action
[06:09:02] ramfjord: has joined #RubyOnRails
[06:09:02] Radar: tjbiddle: You will have to manually require any assets outside of that directory into that file.
[06:09:07] tjbiddle: sevenseacat: I do that all the time
[06:09:09] brt: has joined #RubyOnRails
[06:09:18] sevenseacat: why make life so much harder for yourself?
[06:09:20] Radar: sevenseacat is right. You would typically do it on a per-resource, not an action.
[06:09:21] tjbiddle: My edit customer page is much different than my index or show page
[06:09:25] sarink: has joined #RubyOnRails
[06:09:33] Radar: tjbiddle: and the edit page is different from new too?
[06:09:36] sevenseacat: tjbiddle: right, but your update customer page can also render the edit page
[06:09:40] sevenseacat: different actions :o :o :o
[06:10:02] sevenseacat: plus what Radar said
[06:10:05] tjbiddle: Radar: It would be if I had one - but I don't have any new pages; just modal windows which make an ajax request to api endpoints
[06:10:18] tjbiddle: sevenseacat: All CRUD events are done to different api endpoints
[06:10:26] tjbiddle: So it's just index / edit / show for the most part
[06:10:30] sevenseacat: i fail to see how that is relevant
[06:10:51] tjbiddle: On my document.ready() in my edit page; I want to do a bunch of crap
[06:10:54] tjbiddle: And I don't want to do that on my index page
[06:11:03] tjbiddle: At the simplest level - shouldn't that even be enough to justify it?
[06:11:17] Ropeney: I think I see why you have hassles with asset pipeline
[06:11:27] Radar: ACTION leaves this to sevenseacat and Ropeney 
[06:11:28] sevenseacat: tjbiddle: have you heard of a thing called a 'conditional'
[06:11:30] tjbiddle: I suck at front end dev
[06:11:37] tjbiddle: So yes Ropeney haha
[06:11:41] Radar: I've gotta setup for a demo soon, so I'll be ignoring the channel for a while. Sorry tjbiddle.
[06:11:49] tjbiddle: Thanks for your help Radar
[06:11:56] sevenseacat: its like you can 'do a bunch of crap' only if some condition is true
[06:12:18] tjbiddle: sevenseacat: How would I do a conditional based on a controller action
[06:12:27] sevenseacat: because the controller action is irrelevant
[06:13:01] tjbiddle: Okay... So if I want to render a bunch of <divs> on an index page dynamically on the index page; and a bunch of other ones on the edit page
[06:13:11] tjbiddle: How would I do that without checking where I actually am
[06:13:51] sevenseacat: you check for the content of the page you're working on - if you have a div you want to later add ten other elements inside, you check for the presence of that div
[06:14:18] tjbiddle: And that seems cleaner to you?
[06:14:25] tjbiddle: That seems messy and disorganized to me personally
[06:14:46] sevenseacat: whats the alternative? you try to add divs inside an element that might not even exist?
[06:14:51] Radar: Use React
[06:14:52] Radar: ACTION runs 
[06:15:03] sevenseacat: javascript operates on HTML, not on controller actions
[06:16:09] sevenseacat: your way seems fraught with danger - someone comes along and changes a little bit of the view, and all of a sudden you have JS errors everywhere
[06:16:25] sevenseacat: because the only link they had was through a controller action
[06:17:06] emchamp-dt: has joined #RubyOnRails
[06:18:55] rafaelfr_: has joined #RubyOnRails
[06:19:36] rafaelfr_: has joined #RubyOnRails
[06:22:21] tjbiddle: sevenseacat: If things were compiling all into one application.js file later on - all of my document.ready() methods would be intertwined anyhow, right?
[06:22:53] sp1rs: has joined #RubyOnRails
[06:24:05] Tempesta_: has joined #RubyOnRails
[06:26:33] sleungcy: has joined #RubyOnRails
[06:26:47] aganov: has joined #RubyOnRails
[06:28:06] kadoppe: has joined #RubyOnRails
[06:29:37] solars: has joined #RubyOnRails
[06:29:41] arup_r: has joined #RubyOnRails
[06:29:46] arup_r: Ropeney: Hi.
[06:33:46] edwinvdgraaf: has joined #RubyOnRails
[06:35:03] ur5us: has joined #RubyOnRails
[06:35:19] sarink: has joined #RubyOnRails
[06:35:52] dionysus69: has joined #RubyOnRails
[06:36:50] kirillzh: has joined #RubyOnRails
[06:36:50] Ropeney: hello arup_r
[06:37:07] siaw_: good morning
[06:37:23] Ropeney: good evening
[06:37:26] siaw_: would i be wrong to store svg in the db as a string value type?
[06:38:13] tetraktys: has joined #RubyOnRails
[06:38:24] DoubleMalt: has joined #RubyOnRails
[06:39:34] Ropeney: siaw_ I'm not a fan of images in databases, so I don't have an answer for that
[06:40:12] siaw_: hm! why do i have an underscore after my username? i never had it :D
[06:40:30] zpe: has joined #RubyOnRails
[06:40:30] djbkd: has joined #RubyOnRails
[06:41:08] tildes: has joined #RubyOnRails
[06:41:21] bruno-: has joined #RubyOnRails
[06:45:04] User458764: has joined #RubyOnRails
[06:45:04] Lumia930: has joined #RubyOnRails
[06:45:44] petor: has joined #RubyOnRails
[06:45:58] j3r0: has joined #RubyOnRails
[06:46:02] triptec_: has joined #RubyOnRails
[06:46:24] atian_: has joined #RubyOnRails
[06:48:59] mentero: has joined #RubyOnRails
[06:50:27] michael_mbp: o/ Radar sevenseacat
[06:50:35] lxsameer: has joined #RubyOnRails
[06:50:56] Dreamer3: [god why is rails inflection still so broken
[06:51:09] michael_mbp: anyone had trouble with rspec-rails and Rails 5, I'm getting a strange dependency error with rspec-expectations. I'll gist the config I've got now
[06:51:20] arup_r: has joined #RubyOnRails
[06:51:37] kadoppe: has joined #RubyOnRails
[06:51:39] Dreamer3: how can I tell rails [:raw, @pastie] should be singular, not plural? it wants to call raw_pasties_path which does not exist
[06:53:35] michael_mbp: https://gist.github.com/bsodmike/1a7d635dcb687f6dd01d70d712ede50d
[06:53:42] michael_mbp: Appreciate any help re ^^
[06:54:49] stannard: has joined #RubyOnRails
[06:54:51] tjbiddle: Should I be precompiling in development?
[06:54:57] michael_mbp: tjbiddle: fudge
[06:55:10] emchamp-dt2: has joined #RubyOnRails
[06:55:11] michael_mbp: there is no 3.2.0.pre in github (a tag for the release that is)
[06:55:13] petor_: has joined #RubyOnRails
[06:55:18] michael_mbp: re. rspec-expectations
[06:56:10] Pathfinder_: has joined #RubyOnRails
[06:56:16] michael_mbp: I'll post an issue for this https://github.com/rspec/rspec-rails/blob/rails-5-support/rspec-rails.gemspec#L33..L39
[06:56:34] siaW: has joined #RubyOnRails
[06:56:45] yaewa: has joined #RubyOnRails
[06:56:53] michael_mbp: https://github.com/rspec/rspec-expectations/releases < no 3.2.0.pre which is strange!
[06:57:03] arup_r: Dreamer3: read http://stackoverflow.com/a/16229154/2767755
[06:57:22] Dreamer3: i figured it out
[06:57:25] Dreamer3: dug int source
[06:57:30] michael_mbp: none here either tjbiddle https://rubygems.org/gems/rspec-expectations/versions
[06:57:31] Dreamer3: needed to define persisted
[06:57:37] kirillzh_: has joined #RubyOnRails
[06:57:38] arup_r: michael_mbp: here
[06:57:42] Dreamer3: god love opensource
[06:57:58] arup_r: Dreamer3: that answer, explained why though :D
[06:58:43] mdel_: has joined #RubyOnRails
[06:59:01] arup_r: Ropeney: I need your advises again.. :) So, now all is working. My current thought it should I create PR now from my fork to their branch?
[06:59:08] bronson: has joined #RubyOnRails
[06:59:20] artto: has joined #RubyOnRails
[06:59:39] Ropeney: arup_r, i'd check their contributing guidelines if they have some, run specs and if all pass then do a PR
[06:59:51] tjbiddle: has joined #RubyOnRails
[07:00:05] sevenseacat: tjbiddle: no, you should not be precompiling in development.
[07:00:06] Ratler_: has joined #RubyOnRails
[07:00:07] rickmasta: has joined #RubyOnRails
[07:00:13] michael_mbp: I'll post a fix shortly
[07:00:15] arup_r: but that gem has like 5-6 forks, my fork is from the last one..
[07:00:18] bmf: has joined #RubyOnRails
[07:00:21] arup_r: ok, doing a PR..
[07:00:37] atian__: has joined #RubyOnRails
[07:00:48] arup_r: michael_mbp: https://gist.github.com/bsodmike/1a7d635dcb687f6dd01d70d712ede50d#file-gemfile-L3 should grab all, why you mention all others gems there?
[07:01:27] michael_mbp: arup_r: strangely, it wasn't.
[07:01:50] arup_r: in my projects I have only.. that line
[07:01:59] arBmind: has joined #RubyOnRails
[07:02:04] michael_mbp: hang on removing those, trying again
[07:02:16] michael_mbp: could have been my Gemfile.lock being stale
[07:02:20] michael_mbp: Aha yeah it was.
[07:02:59] michael_mbp: off to fix rspec-expectations
[07:03:09] Pupeno: has joined #RubyOnRails
[07:03:25] srinidhi: has joined #RubyOnRails
[07:03:34] lyoshajapan: has joined #RubyOnRails
[07:06:26] brt: has joined #RubyOnRails
[07:06:30] AntiSpamMeta: has joined #RubyOnRails
[07:06:52] lyoshajapan: Is there is a helper in the rails thats the opposite of include?("str")
[07:06:58] ur5us: has joined #RubyOnRails
[07:07:38] rafaelfranca: has joined #RubyOnRails
[07:09:49] arup_r: lyoshajapan: opposite means?
[07:10:05] mark2: has joined #RubyOnRails
[07:10:23] errakeshpd: has joined #RubyOnRails
[07:10:24] DoubleMalt: has joined #RubyOnRails
[07:10:25] SanguineAnomaly: has joined #RubyOnRails
[07:10:32] noodle: has joined #RubyOnRails
[07:10:37] kirillzh_: https://github.com/rails/rails/blob/c703c39ae7f5f5e72f0458383a80395d773aed5c/activesupport/lib/active_support/core_ext/enumerable.rb#L60
[07:10:47] moep: has joined #RubyOnRails
[07:10:50] arup_r: yeah http://api.rubyonrails.org/classes/Enumerable.html#method-i-exclude-3F :D
[07:10:53] j3r0: has joined #RubyOnRails
[07:11:03] arup_r: kirillzh_: you are so fast!!!!!
[07:11:13] kirillzh_: That's not me, that's Dash :)
[07:11:40] arup_r: Dash is ?
[07:12:14] kirillzh_: Great tool for accessing docs
[07:12:22] kirillzh_: https://kapeli.com/dash
[07:12:44] baweaver: putting a ! in front of it.
[07:14:18] arup_r: let me see.. I heard about devdoc
[07:14:31] sevenseacat: baweaver: shhhhh
[07:16:15] Pupeno: has joined #RubyOnRails
[07:17:33] chagel: has joined #RubyOnRails
[07:17:43] malcolmva: has joined #RubyOnRails
[07:19:56] yfeldblum: has joined #RubyOnRails
[07:20:11] artto: has joined #RubyOnRails
[07:20:49] sleungcy: has joined #RubyOnRails
[07:22:44] tjbiddle: has joined #RubyOnRails
[07:24:18] artmann: has joined #RubyOnRails
[07:25:09] arup_r: kirillzh_: i am downloading, it auto upgrades doc, right? I hope so :D
[07:25:17] SteenJobs: has joined #RubyOnRails
[07:26:21] kirillzh_: There is extension for alfred if you're using it.
[07:26:40] merida: has joined #RubyOnRails
[07:27:26] merida: has joined #RubyOnRails
[07:29:26] arup_r: I am using mac like 3 months.. so not many things I still don't know about it. what is Alfred?
[07:30:59] kirillzh_: Alternative to spotlight
[07:31:12] kirillzh_: alfredapp.com
[07:33:26] baweaver: has joined #RubyOnRails
[07:34:52] Pupeno: has joined #RubyOnRails
[07:35:14] noodle: has joined #RubyOnRails
[07:35:45] Scient: has joined #RubyOnRails
[07:36:02] sarink: has joined #RubyOnRails
[07:39:47] camilasan: has joined #RubyOnRails
[07:40:15] edwinvdgraaf: has joined #RubyOnRails
[07:42:51] michael_mbp: arup_r: finally! https://github.com/rspec/rspec-rails/pull/1601
[07:42:54] michael_mbp: just fixed it
[07:43:08] michael_mbp: pointing my app at my fork for the time being.
[07:44:05] artmann: has joined #RubyOnRails
[07:45:50] artto: has joined #RubyOnRails
[07:50:22] diegoaguilar: has joined #RubyOnRails
[07:51:09] darutoko: has joined #RubyOnRails
[07:53:18] edwinvdgraaf: has joined #RubyOnRails
[07:53:36] zpe: has joined #RubyOnRails
[07:56:11] mikecmpbll: has joined #RubyOnRails
[07:56:49] ddv: has joined #RubyOnRails
[07:57:01] triptec: has joined #RubyOnRails
[07:57:38] ctrlrsf: has joined #RubyOnRails
[07:58:04] artto: has joined #RubyOnRails
[07:59:07] arup_r: has joined #RubyOnRails
[08:02:34] marr: has joined #RubyOnRails
[08:02:36] triptec: has joined #RubyOnRails
[08:03:11] Sylario: has joined #RubyOnRails
[08:04:12] solars: hi, can anyone tell me why calling Channels::Mychan.fu returns 'NoMethodError: undefined method `fu' for Channels::Mychan:Class' with https://gist.github.com/solars/2d850d61e25005208c9a4d75d1c43964
[08:04:49] kadoppe: has joined #RubyOnRails
[08:07:56] ferr: has joined #RubyOnRails
[08:08:21] User458764: has joined #RubyOnRails
[08:08:31] arBmind: has joined #RubyOnRails
[08:08:42] pawnbox: has joined #RubyOnRails
[08:09:27] ur5us: has joined #RubyOnRails
[08:10:50] phredus: has joined #RubyOnRails
[08:12:27] Gabriel403: has joined #RubyOnRails
[08:12:27] Gabriel403: has joined #RubyOnRails
[08:12:28] Megamos: has joined #RubyOnRails
[08:14:53] sleungcy: has joined #RubyOnRails
[08:15:09] kadoppe: has joined #RubyOnRails
[08:16:42] jsrn: has joined #RubyOnRails
[08:16:57] artto: has joined #RubyOnRails
[08:17:25] tildes: solars: No, works for me. Channels::MyChan.fu # => bar
[08:17:48] solars: tildes, it seems to be a load order problem
[08:18:12] tildes: solars: Channels::Mychan.fu # => NameError: uninitialized constant Channels::Mychan # as per your error message
[08:18:16] solars: if I debug in the definition of class::MyChan, it seems to use some top level Base class
[08:18:34] Ratler_: has joined #RubyOnRails
[08:18:36] solars: probably base is loaded only after the subclass
[08:18:42] solars: so it uses a different Base class
[08:18:52] solars: is there any way I can ensure load order is correct here?
[08:19:00] tildes: solars: maybe try inherit Channels::Base then?
[08:19:19] Ratler: has joined #RubyOnRails
[08:19:32] solars: yeah that works, but it looks messy :)
[08:19:42] solars: just wondered if I could fix that
[08:21:07] emachnic: has joined #RubyOnRails
[08:24:46] tildes: has joined #RubyOnRails
[08:25:02] lyoshajapan: has joined #RubyOnRails
[08:25:03] shaman42: has joined #RubyOnRails
[08:25:22] lyoshajapan: has joined #RubyOnRails
[08:26:13] mdw: has joined #RubyOnRails
[08:26:27] lyoshajapan: kirillzh_: We have a winner!
[08:28:50] artto_: has joined #RubyOnRails
[08:28:51] srinidhi: has joined #RubyOnRails
[08:29:14] alias-ls-to-rm: has joined #RubyOnRails
[08:29:36] sarink: has joined #RubyOnRails
[08:31:26] pawnbox: has joined #RubyOnRails
[08:38:30] n008f4g_: has joined #RubyOnRails
[08:39:28] dgncn: has joined #RubyOnRails
[08:39:32] Ratler: has joined #RubyOnRails
[08:40:45] pawnbox: has joined #RubyOnRails
[08:44:59] mozzarella: has joined #RubyOnRails
[08:45:41] tetraktys: has joined #RubyOnRails
[08:45:45] Cohedrin: has joined #RubyOnRails
[08:46:46] triptec: has joined #RubyOnRails
[08:48:01] Nuck: has joined #RubyOnRails
[08:50:20] baweaver: has joined #RubyOnRails
[08:50:42] iamvery: has joined #RubyOnRails
[08:51:22] artto: has joined #RubyOnRails
[08:51:29] arup_r: has joined #RubyOnRails
[08:51:29] crameth: has joined #RubyOnRails
[08:51:33] noodle: has joined #RubyOnRails
[08:51:34] M-shine: has joined #RubyOnRails
[08:52:40] artto: has joined #RubyOnRails
[08:53:35] triptec: has joined #RubyOnRails
[08:53:37] krz: has joined #RubyOnRails
[08:53:47] tildes: solars: in my opinion, being explicit seldom looks messy :) I'm not an expert in load order, but relying on load order sounds brittle
[08:55:18] WebDevB: has joined #RubyOnRails
[08:55:58] WebDevB: Hey guys, we've looking for a Ruby on rails dev to take on some ad hoc work... do you know of anyone?
[08:56:42] solars: tildes, that makes sense indeed
[08:57:35] one_zero: has joined #RubyOnRails
[08:58:42] tildes: WebDevB: the channel is full of rails developers, and everyone knows dozens. would be helpful if you could get more specific
[08:59:19] srinidhi: has joined #RubyOnRails
[09:00:02] WebDevB: Sorry tildes, we have a client that is wanting some changes to their system e.g price changes for their products and some other changes at the moment it's ad hoc but could possibly change to having a contract in place.
[09:00:26] Ergo: has joined #RubyOnRails
[09:00:37] malcolmva: has joined #RubyOnRails
[09:00:56] bronson: has joined #RubyOnRails
[09:02:00] tildes: WebDevB: how would you describe an ideal candidate?
[09:02:28] edwinvdg_: has joined #RubyOnRails
[09:03:39] Ropeney: has joined #RubyOnRails
[09:03:51] quazimodo: has joined #RubyOnRails
[09:03:52] quazimod1: has joined #RubyOnRails
[09:04:02] WebDevB: tildes: someone who is contactable, remote and good at Ruby. haha
[09:04:30] arup_r: has joined #RubyOnRails
[09:05:45] chridal: Can a counter cache in Rails become negative somehow or are there guards against this?
[09:06:16] tildes: WebDevB: ok. how about the client stack?
[09:06:31] tildes: and what does contactable mean? specific hours?
[09:07:10] WebDevB: Doesn't have to be specific hours just when we email / skype they respond in a timely fashion.
[09:07:16] Pupeno: has joined #RubyOnRails
[09:07:58] blackhuey: has joined #RubyOnRails
[09:08:01] WebDevB: tildes, client stack -> simple Apache2 server with MySQL.
[09:08:32] emachnic: has joined #RubyOnRails
[09:08:47] sleungcy: has joined #RubyOnRails
[09:08:56] tildes: WebDevB: How would you estimate the weekly/monthly workload?
[09:09:18] WebDevB: tildes, monthly -> 2 / 3 hours a month.
[09:10:08] lyoshajapan: has joined #RubyOnRails
[09:10:45] tildes: WebDevB: what timezone is the client in?
[09:13:59] arup_r: ropeney: created a PR, I hope they will accept it, :)
[09:14:07] arup_r: till then finger crossed
[09:15:30] acosonic: has joined #RubyOnRails
[09:16:20] Ropeney: goodluck :D
[09:16:33] chridal: Anyone have experience with counter caches becoming stale in Rails?
[09:16:49] chridal: We're really dependent on a counter cache, and I'm really afraid of it becoming stale
[09:16:58] acosonic: Hi all if I do bobo = custom_values[:bobo] and I say puts bobo I see value in console, but if in view I try <%= @data[:bobo] %> I get different object… ?
[09:17:22] chridal: I tried reading some of the source of AR, but I can't find all the cases where it might happen
[09:17:51] chridal: acosonic: are you setting @data = custom_values[:bobo]?
[09:18:12] ql6wlld: has joined #RubyOnRails
[09:18:25] acosonic: chirdal: I’m setting @data = custom_values
[09:19:04] chridal: acosonic: And if you do "puts @data[:bobo]" that shows the same information as puts bobo?
[09:19:47] chridal: Also, try using another name than @data to see if something else is writing to that variable
[09:20:09] chridal: I'd also suggest using https://github.com/pry/pry to poke around
[09:20:30] sarink: has joined #RubyOnRails
[09:21:14] acosonic: chridal: I’m developing a plugin for Redmine which sends email, and I’m trying to stick with Redmine’s default stuff…
[09:21:57] acosonic: chridal: @data is somehow automatically assigned, not by my code
[09:22:13] acosonic: :) will fix it now probably
[09:22:30] tetraktys: has joined #RubyOnRails
[09:23:51] bmf: has joined #RubyOnRails
[09:24:06] srinidhi: has joined #RubyOnRails
[09:24:08] sar1nk: has joined #RubyOnRails
[09:26:04] acosonic: chridal: hm, same problem, need to extract @value somehow from this structure https://gist.github.com/acosonic/a366a70724ab153caaa1d7fd84a5e0d7
[09:26:20] renegadeandy: has joined #RubyOnRails
[09:27:11] failasLStoRM: has joined #RubyOnRails
[09:28:26] snowy: has joined #RubyOnRails
[09:28:33] lyoshaja_: has joined #RubyOnRails
[09:29:54] mozzarella: has joined #RubyOnRails
[09:33:24] wethu: has joined #RubyOnRails
[09:34:32] phredus_: has joined #RubyOnRails
[09:35:18] workmad3: has joined #RubyOnRails
[09:38:09] noodle: has joined #RubyOnRails
[09:39:56] universa1: acosonic: [not_readable_string].first.value ?
[09:40:10] hervie: has joined #RubyOnRails
[09:41:00] acosonic: universa1: I’ll test that now
[09:41:31] bmf: has joined #RubyOnRails
[09:41:42] drPoggs: has joined #RubyOnRails
[09:41:53] ql6wlld: has joined #RubyOnRails
[09:43:06] hervie_: has joined #RubyOnRails
[09:43:18] Linuus: has joined #RubyOnRails
[09:44:44] Linuus: When using ActiveModel::Model, is it possible to fetch all attributes from the object? Like, if I do foo = Foo.new(attrs) and then I want to implement a save instance method foo.save. The save method needs to get all the attributes of the object.
[09:45:04] malcolmva: has joined #RubyOnRails
[09:45:18] universa1: Linuus: you are in the instance... so you have access to everything the instance knows.
[09:45:46] acosonic: universa1: you are the smartes ruby developer there is… Please PM me your contact details
[09:45:57] universa1: acosonic: ?!
[09:46:13] workmad3: Linuus: if you're asking if it's possible without hard-coding... that depends on how the ActiveModel::Model has been implemented
[09:46:35] acosonic: and paypal :) I want to give you $20 since I was trying to figure this out asking around and getting crazy responses like use attr_reader etc…
[09:47:21] workmad3: Linuus: it's quite common to follow rails' example in ActiveModel::Model based objects and store attributes in an internal `@attributes` hash rather than separate ivars for each attribute... but if you don't do that, then you'll need to maintain a list somewhere so you know which ivars to access
[09:47:46] universa1: acosonic: ohh, that is not necessary :-) if you want to give money to someone, find a charitable organization of your liking like the red cross and donate somethign there
[09:47:49] c355E3B: has joined #RubyOnRails
[09:48:23] merida: has joined #RubyOnRails
[09:48:48] Linuus: workmad3: Yes, I thought ActiveModel::Model did that already :-/
[09:49:26] acosonic: universa1: sure, I’ll pay then to some kickstarter project, hah! I wrote a book on Redmine and people ask me to develop all kinds of crazy plugins if somebody wants to work on such stuff they can share contact details I’ll add them to my database and ping them if/when soembody pings me… Right now I’m doing some crazy email notification plugin for a company from Czech Republic…
[09:50:21] universa1: acosonic: :-) busy with my phd ;)
[09:50:48] universa1: Linuus: am::model does suprisingly little: https://github.com/rails/rails/blob/097ca3f1f84bb9a2d3cda3f2cce7974a874efdf4/activemodel/lib/active_model/model.rb
[09:51:28] acosonic: universa1: I wrote master thesis on Redmine… How to use it to execute business processes of university, where business process is daily teaching etc...
[09:52:07] artto: has joined #RubyOnRails
[09:52:10] workmad3: Linuus: ActiveModel::Model doesn't make many assumptions about your model implementation... it provides interfaces and you hook them up
[09:52:59] arup_r: has joined #RubyOnRails
[09:52:59] workmad3: Linuus: some features may require something similar to the `attributes` hash (or a method that fills that need) but even then that usually just means if you want to do something different then you've just got a bit more work to do
[09:53:21] artto: has joined #RubyOnRails
[09:54:11] AlexJakeGreen: has joined #RubyOnRails
[09:57:24] merida_: has joined #RubyOnRails
[09:58:08] Pupeno: has joined #RubyOnRails
[09:58:37] quazimodo: has joined #RubyOnRails
[09:58:37] quazimod1: has joined #RubyOnRails
[09:59:20] Linuus: workmad3: I guess. I was mainly sanity checking so I didn't miss anything. I thought I had used it like this before. But maybe I implemented it myself back then :) Thanks
[10:01:40] Linuus: Actually I think I got mixed up with something like Virtus.
[10:02:07] Pupeno: has joined #RubyOnRails
[10:02:53] krz: has joined #RubyOnRails
[10:03:58] pyemkey: has joined #RubyOnRails
[10:04:42] duderonomy: has joined #RubyOnRails
[10:05:42] AntiSpamMeta: has joined #RubyOnRails
[10:05:58] triptec: has joined #RubyOnRails
[10:05:58] ctrlrsf: has joined #RubyOnRails
[10:05:59] ctrlrsf: has joined #RubyOnRails
[10:06:15] yfeldblum: has joined #RubyOnRails
[10:06:41] Nuck: has joined #RubyOnRails
[10:06:46] ddv: has joined #RubyOnRails
[10:10:42] brunto: has joined #RubyOnRails
[10:13:17] norc: has joined #RubyOnRails
[10:13:36] norc: Hi. From the looks of it I do not get the sinatra web application for sidekiq without buying the pro version, is that correct?
[10:17:28] Ropeney: norc, https://github.com/mperham/sidekiq/wiki/Monitoring
[10:17:48] tildes: WebDevB: I am interested, if you're still looking, please send me a private message
[10:18:06] renegadeandy: has joined #RubyOnRails
[10:18:20] skislak: has joined #RubyOnRails
[10:18:30] norc: sevenseacat, ropeney. Ill just give sidekiq a try, it is time to throw this ugly delayed_job out of the window.
[10:19:35] malcolmva: has joined #RubyOnRails
[10:19:48] universa1: hmm... depending on what you're doing delayed_job might be a better fit :p
[10:20:25] rodfersou: has joined #RubyOnRails
[10:20:35] jtong: has joined #RubyOnRails
[10:21:23] norc: universa1: The reason for wanting to switch might seem so trivial, but delayed_job is just cluttering up my application log with regular SQL queries. Since I just switched from unicorn to puma, my previous solution no longer works (because it is not thread safe)
[10:22:01] universa1: norc: you could also just have delayed_job write to it's own logs?
[10:22:18] norc: universa1: The problem is the regular polling of the database to see if there are jobs available.
[10:22:36] tvw: has joined #RubyOnRails
[10:22:37] norc: universa1: Which causes queries on the database, which is basically ActiveRecord doing its logging.
[10:22:38] kadoppe: has joined #RubyOnRails
[10:23:10] norc: Besides, sidekiq looks cool, and has some features available (like throttling)
[10:23:37] universa1: norc: i know... ...that is how it works. but imho that is not a problem. just saying, that depending on what you do, sidekiq might work better or worse than delayed_job/....
[10:24:02] Ropeney: universa1, where would you say it works worse?
[10:26:05] norc: Plus having redis has that fancy upside of being able to do some message brokering with my rails application
[10:26:13] norc: If I wanted to.. :)
[10:26:47] universa1: ropeney: doing cpu intensive stuff in ruby -> no gain from the threaded model in sidekiq
[10:27:04] universa1: ropeney: you ahve an additional dependency on redis ;)
[10:28:55] norc: universa1: If I had a suitable solution to prevent those specific logs from popping up...
[10:29:04] norc: Though. I could simply monkey patch AR to not log for that particular table...
[10:29:20] universa1: norc: why not have a seperate log for delayed job?!
[10:29:32] lyoshajapan: has joined #RubyOnRails
[10:29:36] norc: universa1: The SQL log is still the same...
[10:29:48] norc: Unless you can tell me a way how to separate log files based on table names.
[10:30:10] universa1: what? so your development env and production env write to the same "sql log" ?!
[10:30:17] norc: universa1: What?
[10:30:39] norc: universa1: You miss the point. I have a separate delayed_job log, but whenever the delayed_job causes an SQL query, that query is logged in my application log.
[10:30:41] Ropeney: pretty sure it is better for "cpu intensive stuff in ruby" universa1
[10:31:53] universa1: norc: the dev and prod env write to different logs, correct? you could do something similar for your workers.
[10:32:18] universa1: norc: or just have the run-script change the logger.
[10:32:44] norc: universa1: The problem is still the same. If the Delayed::Backend:ActiveRecord::Job queries the jobs table, it will log in my application log (which means it gets utterly messy).
[10:32:49] aloneintheworld: has joined #RubyOnRails
[10:33:05] universa1: norc: o0 -- off to lunch.
[10:37:56] njero: has joined #RubyOnRails
[10:41:00] ishamo: has joined #RubyOnRails
[10:43:35] armatechnicos: has joined #RubyOnRails
[10:43:46] norc: universa1: Oh! I just figured it out. Turns out you can simply supply loggers to ActiveRecord::Base instances, which they will use instead.
[10:45:01] bruno-: has joined #RubyOnRails
[10:45:16] sarink: has joined #RubyOnRails
[10:47:35] n008f4g_: has joined #RubyOnRails
[10:47:38] Coldblackice_: has joined #RubyOnRails
[10:47:45] sar1nk: has joined #RubyOnRails
[10:49:29] User458764: has joined #RubyOnRails
[10:52:00] Pupeno: has joined #RubyOnRails
[10:54:01] wenchenx_: has joined #RubyOnRails
[10:54:08] jgt1: has joined #RubyOnRails
[10:56:38] sleungcy: has joined #RubyOnRails
[10:57:06] arup_r: has joined #RubyOnRails
[11:00:24] artto_: has joined #RubyOnRails
[11:01:14] Fernando-Basso: has joined #RubyOnRails
[11:02:18] workmad3: norc: or set up `ActiveRecord::Base.logger` separately in the startup code for your delayed job processes
[11:02:25] merida: has joined #RubyOnRails
[11:03:02] norc: workmad3: Mmm, that might work. Actually it seems overriding it for models does not work anymore since Rails 3.
[11:03:13] norc: (Overriding it on one model changes it for all models)
[11:04:52] sarink: has joined #RubyOnRails
[11:11:00] artto: has joined #RubyOnRails
[11:12:26] rvanlieshout: has joined #RubyOnRails
[11:12:48] merida: has joined #RubyOnRails
[11:13:00] Linuus: has joined #RubyOnRails
[11:14:11] Tempesta: has joined #RubyOnRails
[11:16:21] artto: has joined #RubyOnRails
[11:20:40] qhp: has joined #RubyOnRails
[11:21:28] theery: has joined #RubyOnRails
[11:27:24] trinaldi: has joined #RubyOnRails
[11:29:10] tagaulap: has joined #RubyOnRails
[11:30:34] mosez: has joined #RubyOnRails
[11:32:50] smoitra_: has joined #RubyOnRails
[11:33:39] IrishGringo: has joined #RubyOnRails
[11:36:04] Moeh: has joined #RubyOnRails
[11:40:33] Jasaka: has joined #RubyOnRails
[11:41:27] sp1rs: has joined #RubyOnRails
[11:41:28] User458764: has joined #RubyOnRails
[11:45:58] bruno-: has joined #RubyOnRails
[11:46:11] ldnunes: has joined #RubyOnRails
[11:46:22] duderonomy: has joined #RubyOnRails
[11:46:54] iamvery: has joined #RubyOnRails
[11:47:15] theery: has joined #RubyOnRails
[11:48:19] Olipro: has joined #RubyOnRails
[11:48:37] tildes: norc: you could also create a new logger instace like so http://pastie.org/private/rd2sk1hd1zmwtgey23yakg
[11:50:00] vladster: has joined #RubyOnRails
[11:50:56] vladster: Hey guys, has anyone, successfully, used closure_tree with cocoon? I want to add some nested fields with STI but I can't get it to work
[11:51:07] King_Rex: has joined #RubyOnRails
[11:51:15] sleungcy: has joined #RubyOnRails
[11:56:08] universa1: Vlad____: what works? what does not work? code? ...
[11:56:35] rvanlieshout: this makes people using STI with problems well over 110%
[11:57:07] artto: has joined #RubyOnRails
[11:57:23] FailBit: but in many cases the alternative is unions
[11:57:27] FailBit: which also suck
[11:57:30] universa1: yeah, hop on the band wagon :p
[11:57:35] rvanlieshout: in many cases the alternative is to add columns
[11:57:37] rvanlieshout: which is way better
[11:57:52] rvanlieshout: cause most of us don't really know what the downside of extra columns is
[11:58:02] rvanlieshout: and assume having a single table is better
[11:59:08] sevenseacat: i use STI every now and then. i put in an app a couple of days ago, for different types of resources in a knowledge base
[11:59:24] sevenseacat: but yes, it can cause problems
[11:59:37] sevenseacat: usually when its used inappropriately
[12:02:14] fox_mulder_cp: hi. i need raise exeption in before_save model hook and raise exeption in user's flash. how to to it?
[12:02:41] srinidhi: has joined #RubyOnRails
[12:02:53] fox_mulder_cp: user.where(root: true).empty ? true : raise 'only one user can be root' ?
[12:04:39] tbuehlmann: STI is a poor person's solution to the missing class table inheritance. will work great for the right usecases, though
[12:04:57] tbuehlmann: fox_mulder_cp: you want a validation instead, aye?
[12:05:15] rvanlieshout: tbuehlmann: true, but there are not that many right usecases
[12:05:34] rvanlieshout: and leaving out a couple of duplicate columns isn't one of them
[12:07:16] fox_mulder_cp: tbuehlmann: yes, thanks for code word :)
[12:08:34] norc: tildes: The problem is not creating a new logger.
[12:08:53] norc: tildes: The problem is separate ActiveRecord::Base instances using different loggers, which by design seems to be impossible now.
[12:08:55] tbuehlmann: rvanlieshout: yup!
[12:09:22] tildes: norc: well... is a separate file enough?
[12:09:45] norc: tildes: Sure, except I do not see how this would work without modifying the way AR does its logging.
[12:09:46] tildes: http://www.tonyamoyal.com/2009/09/24/specific-logging-for-your-rails-models-the-easy-way/ (this is old, but if it's still working, might do?)
[12:10:17] norc: tildes: Nope. Im talking about the callback logs that occur when for example SQL queries are triggered.
[12:11:08] rvanlieshout: there is no callback when sql queries are triggered
[12:11:21] merida_: has joined #RubyOnRails
[12:12:37] norc: rvanlieshout: That was bad phrasing on my part, sorry.
[12:13:59] newjersey: has joined #RubyOnRails
[12:16:49] tildes: norc: you could turn the logger off and then back on
[12:17:08] lxsameer: has joined #RubyOnRails
[12:17:39] AntiSpamMeta: has joined #RubyOnRails
[12:17:45] norc: tildes: I did something similar (cranking up the log level up and down), but that is not thread safe.
[12:18:04] norc: Since I just switched from unicorn (multi process) to puma (multi threaded) it no longer is a viable option.
[12:18:08] quazimodo: has joined #RubyOnRails
[12:18:10] quazimod1: has joined #RubyOnRails
[12:18:18] tildes: norc: why is changing the log file for your activerecord instance not working?
[12:18:40] norc: tildes: Because the objects do not have their own instance. It is just an accessor method for the global logger on ActiveRecord::Base.
[12:19:32] vladster: universa1: sorry, forgot about this for a minute..
[12:19:46] vladster: Really, no code but the default one from the cocoon gitub description
[12:20:10] norc: tildes: i.e. Model.logger and ActiveRecord::Base.logger point to the same object.
[12:20:12] vladster: I think ( 80% sure ) my problem lies with not knowing what should location ( my model ) should use for accepts_nested_attributes_for
[12:20:39] vladster: setting that to :children will cause a NoMethod error nil for new_record? when trying to add a new Location
[12:20:45] norc: tildes: And the more I look at the implementation it cannot work any differently.
[12:21:03] vladster: I mean, if it's easy, I can add all the code I have.. but it really is a new app and all the code that's already on the coocon page
[12:21:09] n008f4g_: has joined #RubyOnRails
[12:23:04] vladster: FailBit: I'm open to suggestions if you have alternatives to 20+ something children .. Location has_many :location_children; LocationChildren has_many :location_children_childre; LocationChildrenChildre .. catch my drift?
[12:23:42] tildes: "separate ActiveRecord::Base instances" sounded like objects having their own instances, so I figured you have an a model than inherits ActiveRecord::Base but perhaps not
[12:23:54] rvanlieshout: Vlad____: location has_many :child_locations, class_name: 'Location'
[12:24:30] kuro: has joined #RubyOnRails
[12:24:33] FailBit: Vlad____, many-to-many relations
[12:24:33] duderonomy: has joined #RubyOnRails
[12:24:52] merida: has joined #RubyOnRails
[12:25:36] epochwolf: ACTION dies laughing
[12:26:45] vladster: rvanlieshout: that looks good, doing has_many :children_location, class_name: 'Location', foreign_key: 'parent_id' already gives me the first level
[12:26:58] vladster: I'm assuming with a couple more lines I could easily get the whole ancestry
[12:27:23] vladster: Thanks for the info, but for my MVP cocoon does the job, maybe when refactoring time comes, I might look into this.
[12:27:49] hervie: has joined #RubyOnRails
[12:27:49] vladster: Knowing that, I still need a yes or no to my original problem :D does anyone tried that?
[12:28:04] Tempesta_: has joined #RubyOnRails
[12:29:27] norc: tildes: Except Model.logger is not an instance variable of the Model class.
[12:29:32] norc: tildes: It just points to ActiveRecord::Base.
[12:29:40] norc: ActiveRecord::Base.logger I meant.
[12:29:50] AntiSpamMeta: has joined #RubyOnRails
[12:30:13] lxsameer: has joined #RubyOnRails
[12:30:57] epochwolf: kuro: behave.
[12:31:04] vladster: rvanlieshout: that actually fixed my problem
[12:31:11] norc: tildes: Think "def logger; ActiveRecord::Base.logger; end" (that is what the actual code does)
[12:31:18] norc: Though I guess I could simply replace the LogSubscriber...
[12:31:18] vladster: cocoon works now :D
[12:32:39] rickmasta: has joined #RubyOnRails
[12:32:41] Coldblackice: has joined #RubyOnRails
[12:33:18] tagaulap: has joined #RubyOnRails
[12:33:18] c355E3B: has joined #RubyOnRails
[12:34:08] phredus: has joined #RubyOnRails
[12:37:00] dgncn: has joined #RubyOnRails
[12:38:32] EXCHGR: has joined #RubyOnRails
[12:40:48] bbrowning: has joined #RubyOnRails
[12:40:56] lxsameer: has joined #RubyOnRails
[12:42:29] GodFather: has joined #RubyOnRails
[12:42:56] kuro: has left #RubyOnRails: ()
[12:43:04] ldnunes: has joined #RubyOnRails
[12:43:15] Fernando-Basso: has joined #RubyOnRails
[12:43:26] tildes: has joined #RubyOnRails
[12:43:36] DoubleMalt: has joined #RubyOnRails
[12:44:47] sarink: has joined #RubyOnRails
[12:45:13] sleungcy: has joined #RubyOnRails
[12:45:33] solars: has joined #RubyOnRails
[12:45:44] jgt2: has joined #RubyOnRails
[12:46:30] mentero: has joined #RubyOnRails
[12:47:00] bruno-: has joined #RubyOnRails
[12:50:22] dionysus69: has joined #RubyOnRails
[12:51:00] chouhoulis: has joined #RubyOnRails
[12:53:09] baweaver: has joined #RubyOnRails
[12:58:07] CodaBrink: has joined #RubyOnRails
[12:58:25] moei: has joined #RubyOnRails
[12:58:31] context: has joined #RubyOnRails
[12:59:15] ramortegui: has joined #RubyOnRails
[13:01:58] PedramT: has joined #RubyOnRails
[13:02:16] pawnbox: has joined #RubyOnRails
[13:04:38] aegis3121: has joined #RubyOnRails
[13:04:39] ekinmur: has joined #RubyOnRails
[13:06:28] Palsson: has joined #RubyOnRails
[13:07:18] fox_mulder_cp: how to add before_destroy validation? https://gist.github.com/foxmuldercp/09ab28b3468921ceb4ce485f23535df5
[13:07:33] fox_mulder_cp: my root can be dropped now (
[13:08:05] joshkovach: has joined #RubyOnRails
[13:10:35] armatechnicos: has joined #RubyOnRails
[13:14:12] artto: has joined #RubyOnRails
[13:15:02] j3r0: has joined #RubyOnRails
[13:18:16] workmad3: fox_mulder_cp: validations aren't run on destroy, only callbacks
[13:18:43] renegadeandy: Hi. If i run a new migration to add a new field to my User model, in production - and I want to write a migration of data to run after the new column is added….where would i do that? is that a task? Is it in the migration code itself?
[13:19:47] universa1: renegadeandy: i prefer to keep that outside of the migrations.
[13:20:55] renegadeandy: universa1: where would you do it?
[13:21:07] universa1: renegadeandy: task
[13:21:24] renegadeandy: so you would write an explicit task which would carry out the migration of data
[13:21:28] renegadeandy: yeah i think i agree with that
[13:21:29] krz: has joined #RubyOnRails
[13:21:42] universa1: renegadeandy: yeah, there is also a gem for data migrations iirc
[13:22:02] drbayer: has joined #RubyOnRails
[13:22:38] renegadeandy: but wasnt that impressed....
[13:22:57] renegadeandy: prefer the task approach
[13:24:07] fox_mulder_cp: workmad3: def before_destroy can't work too ((
[13:24:48] tildes: fox_mulder_cp: what do you mean with 'my root can be dropped now'?
[13:25:08] workmad3: fox_mulder_cp: the other thing to keep in mind - calling `delete` doesn't trigger callbacks
[13:25:23] workmad3: fox_mulder_cp: so check where you're destroying objects to make sure you're not bypassing your protection
[13:26:08] fox_mulder_cp: tildes: one of user has upper, than other privileges
[13:26:22] fox_mulder_cp: it can't be dropped from system
[13:26:46] tildes: fox_mulder_cp I assume you have a user/user_account object (or both), and login is different from that?
[13:26:54] tildes: or do you mean root should always be logged in?
[13:27:06] vladr: has joined #RubyOnRails
[13:27:25] VeryBewitching: has joined #RubyOnRails
[13:27:58] chitech: has joined #RubyOnRails
[13:28:17] fox_mulder_cp: tildes: no. it's a root object, which has access to all application functions
[13:28:33] dblessing: has joined #RubyOnRails
[13:28:52] fox_mulder_cp: i want block to destroy this user with .root = true property
[13:29:24] universa1: fox_mulder_cp: database trigger?
[13:29:55] fox_mulder_cp: universa1: plain sql? ooh, i want do it by active record
[13:30:17] tildes: fox_mulder_cp: again, old link, but seems legit: http://stackoverflow.com/questions/123078/how-do-i-validate-on-destroy-in-rails
[13:30:19] universa1: fox_mulder_cp: and then your rookie sys admin comes along and gets this task by his boss, here can you quickly delete this user...
[13:30:26] universa1: fox_mulder_cp: and boom, gone!
[13:30:39] tildes: you would overwrite your User def destroy (and perhaps delete too), raise an exception if needed, otherwise call super
[13:31:22] IrishGringo: has joined #RubyOnRails
[13:31:29] fox_mulder_cp: universa1: hm. in *nix system u can destroy root user too? ^)
[13:31:35] fox_mulder_cp: or administrator in windows
[13:31:51] renegadeandy: universa1: Can i put tasks inside of folders in side of the tasks folder?
[13:31:59] tildes: you can destroy the database if you wish
[13:32:04] renegadeandy: and if i do, how do name them when i do rake
[13:32:22] universa1: renegadeandy: you should be able, and no clue of how to actually ;)
[13:33:23] fox_mulder_cp: tildes: i do by that qa, but nothing (
[13:35:01] tildes: fox_mulder_cp: code + how you run it + errors?
[13:35:53] Palsson: has joined #RubyOnRails
[13:38:08] hxegon: has joined #RubyOnRails
[13:38:33] chouhoulis: has joined #RubyOnRails
[13:38:57] lxsameer: has joined #RubyOnRails
[13:39:13] sleungcy: has joined #RubyOnRails
[13:39:40] Dbugger: has joined #RubyOnRails
[13:39:48] Dbugger: Hello everyone!
[13:39:49] Dbugger: I was wondering if someone could help me with a small problem. In my new organization they sell "tyres" and "rims". Sometimes they mount it together, (the used term for it is "wheel"). so they have tables Tires and Rims. For Sales, they have a table sale_articles, that has_many sale_products. Sale Products have a 1:1 polymorphic relationship with Tyres and Rims. But if they sell a whole Wheel, what they make is a they set a foreign key to the sold
[13:39:49] Dbugger: Tyre, which points to the Sale Product holding the sold Rim... Isn't this too convoluted? Is there a better way to do it?
[13:40:11] fox_mulder_cp: tildes: thanks. fixit
[13:40:14] PedramT_: has joined #RubyOnRails
[13:40:38] tildes: fox_mulder_cp: np, good to hear
[13:42:33] fox_mulder_cp: hm, bub some elses
[13:42:38] rrawlins: has joined #RubyOnRails
[13:45:34] sarink: has joined #RubyOnRails
[13:47:57] Pupeno: has joined #RubyOnRails
[13:50:52] bruno-: has joined #RubyOnRails
[13:51:59] akshat: has joined #RubyOnRails
[13:52:50] PedramT: has joined #RubyOnRails
[13:53:48] dcope: is there a way to abort a long running task other than using Timeout::timeout
[13:54:34] myntcake: has joined #RubyOnRails
[13:56:40] Fernando-Basso: has joined #RubyOnRails
[14:00:07] rrawlins_: has joined #RubyOnRails
[14:01:32] Pupeno: has joined #RubyOnRails
[14:03:11] krz: has joined #RubyOnRails
[14:04:38] arup_r: has joined #RubyOnRails
[14:05:05] SPYGAME: has joined #RubyOnRails
[14:05:41] bronson: has joined #RubyOnRails
[14:07:18] akshat: has joined #RubyOnRails
[14:07:38] fox_mulder_cp: RuntimeError: Can't destroy Operator
[14:07:44] iamvery: has joined #RubyOnRails
[14:07:55] fox_mulder_cp: but how to move this error to views..
[14:08:55] fox_mulder_cp: RuntimeError in ResellersController#destroy - bad idea...
[14:09:08] michael_mbp: anyone run into devise's before_action returning nil `authenticate_<devise model in question>!`?
[14:09:13] rubyonrailed: has joined #RubyOnRails
[14:09:16] michael_mbp: I'm calling the right helper
[14:09:22] michael_mbp: but it's returning nil
[14:09:35] michael_mbp: about to check gem source
[14:10:28] rickmasta: has joined #RubyOnRails
[14:10:49] sevenseacat: michael_mbp: !debug
[14:10:49] helpa: michael_mbp: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[14:11:28] sp1rs: has joined #RubyOnRails
[14:12:07] jhack: has joined #RubyOnRails
[14:12:07] jtong: has joined #RubyOnRails
[14:12:20] merida: has joined #RubyOnRails
[14:12:34] eljimmy: has joined #RubyOnRails
[14:16:04] arup_r: has joined #RubyOnRails
[14:19:03] barajasfab: has joined #RubyOnRails
[14:19:23] treehug88: has joined #RubyOnRails
[14:20:23] rubyonra_: has joined #RubyOnRails
[14:22:39] srinidhi: has joined #RubyOnRails
[14:23:15] drbayer: has joined #RubyOnRails
[14:25:47] Pupeno: has joined #RubyOnRails
[14:28:18] emachnic: has joined #RubyOnRails
[14:28:38] rasalghul: has joined #RubyOnRails
[14:29:05] IrishGringo: has joined #RubyOnRails
[14:29:13] malcolmva: has joined #RubyOnRails
[14:29:40] hxegon: has joined #RubyOnRails
[14:30:43] pawnbox: has joined #RubyOnRails
[14:31:08] idefine: has joined #RubyOnRails
[14:31:58] Pupeno: has joined #RubyOnRails
[14:32:55] sypheren: has joined #RubyOnRails
[14:33:03] lxsameer: has joined #RubyOnRails
[14:33:18] sleungcy: has joined #RubyOnRails
[14:34:20] chagel: has joined #RubyOnRails
[14:36:14] stannard_: has joined #RubyOnRails
[14:38:46] michael_mbp: ah no worries, it _is_ working
[14:38:56] michael_mbp: just hooked devise up locally and pried in.
[14:39:08] michael_mbp: thanks becca/
[14:40:02] Disavowed: has joined #RubyOnRails
[14:40:47] Pupeno: has joined #RubyOnRails
[14:41:11] tildes: fox_mulder_cp: you can put a rescue-block in your controller action, then if exception is caught, you could add the error to the object you pass to the view, and display it in the view like so: http://guides.rubyonrails.org/active_record_validations.html#displaying-validation-errors-in-views
[14:41:21] tildes: fox_mulder_cp: hope this helps
[14:42:46] fedexo: has joined #RubyOnRails
[14:44:16] yellow5: has joined #RubyOnRails
[14:47:54] sarink: has joined #RubyOnRails
[14:49:46] stannard: has joined #RubyOnRails
[14:51:33] Pupeno: has joined #RubyOnRails
[14:52:20] new_dev: has joined #RubyOnRails
[14:52:56] nettoweb: has joined #RubyOnRails
[14:54:15] nettoweb: hey guys, I have this string in my db: "2.000,00" it's a price. How to multiple this string to 0.1? To get 10% of this value. This price follow this structure: "1,00", "10,00", "100,00", 1.000,00" an so on
[14:54:38] nettoweb: [value]*0.1 is not workings
[14:55:13] nettoweb: "2.000,00".to_i*0.1 # 0.2
[14:55:40] nettoweb: I'm wonder how to get 10% of this value
[14:55:45] rsl: has joined #RubyOnRails
[14:56:00] rsl: has joined #RubyOnRails
[14:56:30] tildes: nettoweb: '2.000,00'.gsub('.', '').to_d * 0.1
[14:57:30] tildes: Radar: can you please introduce me to helpa?
[14:57:38] Devalo: has joined #RubyOnRails
[14:58:03] adavia: has joined #RubyOnRails
[14:58:05] tildes: nettoweb: if any of your prices have decimals, to_i will just drop them. please don't use to_i with prices
[14:58:15] FailBit: a human/bot love affair
[14:58:53] pawnbox: has joined #RubyOnRails
[14:59:05] rsl: i'm trying to use devise_saml_authenticatable for SAML authentication and took the idp certificate value from the idp provider's metadata's X509Certificate node. having some issues and want to make sure it's formatted correctly. this is a question kinda specific to this one gem [not the ruby-saml implementation].
[14:59:08] nettoweb: tildes thanks man
[14:59:54] AzaToth: has joined #RubyOnRails
[15:00:09] Pupeno: has joined #RubyOnRails
[15:01:09] idefine: has joined #RubyOnRails
[15:01:22] ekinmur: has joined #RubyOnRails
[15:01:52] dionysus69: has joined #RubyOnRails
[15:03:47] new_dev: Hey, I'm working on a legacy application, and it would be nice to hear some advices about testing,
[15:03:56] pawnbox: has joined #RubyOnRails
[15:04:17] macsteps: has joined #RubyOnRails
[15:05:08] new_dev: currently the test suite for features is not mainted, so I'm not sure if I should start by fixing it (around 90 file to fix :/ )
[15:07:12] idefine: has joined #RubyOnRails
[15:10:04] pwnd_nsfw`: has joined #RubyOnRails
[15:11:08] stannard: has joined #RubyOnRails
[15:11:24] rafaelfranca: has joined #RubyOnRails
[15:11:25] rafaelfranca: has joined #RubyOnRails
[15:12:28] pwnd_nsfw`: has left #RubyOnRails: ()
[15:12:30] czerasz2: has joined #RubyOnRails
[15:12:59] d1plo1d: has joined #RubyOnRails
[15:13:05] Quintasan_: has joined #RubyOnRails
[15:13:38] differentreality: has joined #RubyOnRails
[15:13:49] pwnd_nsfw: has joined #RubyOnRails
[15:14:17] idefine: has joined #RubyOnRails
[15:14:22] d1plo1d: Why does ActiveRecord make 2 queries for .eager_load .first queries? (eg. Post.eager_load(:comments).first)
[15:14:23] djbkd: has joined #RubyOnRails
[15:15:23] d1plo1d: and is it a bug that 2 SQL queries are being generated instead of 1?
[15:16:30] helpa-bot: has joined #RubyOnRails
[15:16:45] _Sypheren: has joined #RubyOnRails
[15:17:47] wenchenx_: has joined #RubyOnRails
[15:18:03] RegulationD: has joined #RubyOnRails
[15:18:07] pawnbox: has joined #RubyOnRails
[15:18:47] dustinm`: has joined #RubyOnRails
[15:18:48] SuppliedRelic_: has joined #RubyOnRails
[15:18:49] alxndr: has joined #RubyOnRails
[15:18:54] nyandoge: has joined #RubyOnRails
[15:18:59] thomasfedb: has joined #RubyOnRails
[15:19:00] thomasfedb: has joined #RubyOnRails
[15:19:32] ELCALOR: has joined #RubyOnRails
[15:19:37] joaomdmoura__: has joined #RubyOnRails
[15:19:59] Fire-Dragon-DoL: has joined #RubyOnRails
[15:20:09] Gkj8899_: has joined #RubyOnRails
[15:20:10] todd: has joined #RubyOnRails
[15:20:16] rafaelfr_: has joined #RubyOnRails
[15:20:32] jsrn: has joined #RubyOnRails
[15:20:38] Pro|_: has joined #RubyOnRails
[15:20:38] Majadon: has joined #RubyOnRails
[15:20:40] mentero_: has joined #RubyOnRails
[15:20:49] PedramT: has joined #RubyOnRails
[15:20:51] tw1sted_: has joined #RubyOnRails
[15:20:53] reaVer_: has joined #RubyOnRails
[15:20:54] ngr_: has joined #RubyOnRails
[15:20:58] rubyonrailed: has joined #RubyOnRails
[15:21:13] stannard: has joined #RubyOnRails
[15:21:21] funnel_: has joined #RubyOnRails
[15:21:23] Gabriel413: has joined #RubyOnRails
[15:21:34] iamvery_: has joined #RubyOnRails
[15:21:51] deavid: has joined #RubyOnRails
[15:21:53] speaking1ode: has joined #RubyOnRails
[15:21:53] yellow5: has joined #RubyOnRails
[15:22:07] bruno-: has joined #RubyOnRails
[15:22:08] algernop_k: has joined #RubyOnRails
[15:22:29] AliasLStoRM: has joined #RubyOnRails
[15:22:48] n1lo: has joined #RubyOnRails
[15:22:49] phredus_: has joined #RubyOnRails
[15:22:54] ekinmur_: has joined #RubyOnRails
[15:23:31] eggoez: has joined #RubyOnRails
[15:23:45] renanoronfle: has joined #RubyOnRails
[15:23:57] Coldblackice_: has joined #RubyOnRails
[15:24:04] podman: has joined #RubyOnRails
[15:24:52] hoodow_: has joined #RubyOnRails
[15:24:52] hoodow_: has joined #RubyOnRails
[15:24:59] mdel_: has joined #RubyOnRails
[15:25:05] idefine: has joined #RubyOnRails
[15:25:43] Frem: has joined #RubyOnRails
[15:25:46] Obi_obi: has joined #RubyOnRails
[15:25:54] martinbjeldbak_: has joined #RubyOnRails
[15:26:35] masscrx: has joined #RubyOnRails
[15:26:36] M-shine: has joined #RubyOnRails
[15:26:38] russt: has joined #RubyOnRails
[15:26:54] nickenchuggets: has joined #RubyOnRails
[15:26:55] nickenchuggets: has joined #RubyOnRails
[15:27:08] camilasan: has joined #RubyOnRails
[15:27:16] Nuck: has joined #RubyOnRails
[15:27:16] zz_timnovinger: has joined #RubyOnRails
[15:27:23] sleungcy: has joined #RubyOnRails
[15:27:48] artto: has joined #RubyOnRails
[15:28:13] aegis3121: has joined #RubyOnRails
[15:28:14] jgrevich: has joined #RubyOnRails
[15:28:39] helpa: has joined #RubyOnRails
[15:28:49] Haydos: has joined #RubyOnRails
[15:28:54] itkin: has joined #RubyOnRails
[15:28:59] siaW: has joined #RubyOnRails
[15:29:40] siaW: i am storing an image in my db using paperclip
[15:29:54] siaW: please let not talk about how much of a bad idea it is :P
[15:30:05] epochwolf: d1plo1d: eager loading uses one to load the objcet, then one query per assocation eager loaded.
[15:30:15] d0nn1e: has joined #RubyOnRails
[15:30:20] epochwolf: siaw: unforgivable.
[15:30:26] siaW: the image is stored in the db alright and looks like this from my console, it’s a string. i want to ask how to display it in view :)
[15:30:35] siaW: it’s looks like this: https://gist.github.com/siaw23/b6cc477eeb0ae060a89100f9067b347b
[15:30:44] MaienM: has joined #RubyOnRails
[15:30:49] barajasfab: has joined #RubyOnRails
[15:30:49] njero: has joined #RubyOnRails
[15:30:53] siaW: with attribute name “avatar_file_name”
[15:31:00] funnel_: has joined #RubyOnRails
[15:31:06] siaW: how do i display the image in my view? :)
[15:31:32] epochwolf: siaw: you put a link to the image in the view and the browser makes a request to that link, which returns the image.
[15:31:57] rafaelfranca: has joined #RubyOnRails
[15:31:57] rafaelfranca: has joined #RubyOnRails
[15:32:11] siaW: epochwolf: sorry but getting the link to the image is what i need help with
[15:32:22] siaW: i know i have to get a “link” somehow, but how do i do it? :)
[15:32:33] siaW: i tried this: <%= image_tag("#{ developer.avatar_file_name } ") %>
[15:32:48] daxroc: has joined #RubyOnRails
[15:32:52] epochwolf: siaw: you need a route in your application that serves the image. :P
[15:32:55] siaW: in my view, stupid way, but obviously i don’t know what i’m doing :D
[15:33:10] AckZ: has joined #RubyOnRails
[15:33:11] aujt74: has joined #RubyOnRails
[15:33:16] epochwolf: Since you stored the image in your database, you can't link to it directly.
[15:33:37] epochwolf: You'll need to build a controller action that responses with image files.
[15:33:39] raenk: has joined #RubyOnRails
[15:34:01] hjdivad: has joined #RubyOnRails
[15:34:04] siaW: ok i’m trying
[15:34:07] spastorino: has joined #RubyOnRails
[15:34:24] rasalghul: has joined #RubyOnRails
[15:34:28] lxsameer: has joined #RubyOnRails
[15:34:28] lxsameer: has joined #RubyOnRails
[15:35:58] barajasfab: has joined #RubyOnRails
[15:36:24] Arcaire: has joined #RubyOnRails
[15:36:29] merida: has joined #RubyOnRails
[15:37:11] stannard_: has joined #RubyOnRails
[15:37:27] nyandoge: has joined #RubyOnRails
[15:37:53] dmcc: has joined #RubyOnRails
[15:37:56] sdn90: has joined #RubyOnRails
[15:38:29] bedouin: has joined #RubyOnRails
[15:38:36] MissionCritical: has joined #RubyOnRails
[15:38:53] borkdude: has joined #RubyOnRails
[15:38:54] ruurd: has joined #RubyOnRails
[15:40:04] jeffleeismyhero: has joined #RubyOnRails
[15:40:23] tagaulap: has joined #RubyOnRails
[15:40:29] kumavis: has joined #RubyOnRails
[15:40:45] deeprave: has joined #RubyOnRails
[15:42:36] zrl: has joined #RubyOnRails
[15:43:02] agent_white: has joined #RubyOnRails
[15:43:37] bauruine: has joined #RubyOnRails
[15:44:16] agent_white: Mornin' folks
[15:44:20] LiamW: has joined #RubyOnRails
[15:45:44] c355E3B: has joined #RubyOnRails
[15:45:48] joaomdmoura__: has joined #RubyOnRails
[15:46:05] shibly: has joined #RubyOnRails
[15:46:08] soahccc: has joined #RubyOnRails
[15:46:10] phrozen77: has joined #RubyOnRails
[15:46:22] shibly: has left #RubyOnRails: ()
[15:46:56] pawnbox: has joined #RubyOnRails
[15:47:19] CornishPasty: has joined #RubyOnRails
[15:48:19] Axilla: has joined #RubyOnRails
[15:50:26] LiamW: Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo
[15:50:49] roelof: has joined #RubyOnRails
[15:50:51] yellow5: has joined #RubyOnRails
[15:51:21] siaW: epochwolf: i didn’t have to create a route but it worked using #url metho from paperclip :)
[15:51:24] siaW: thanks :)
[15:53:43] roelof: Is it possible to make a model schema which can do both of this : https://gist.github.com/anonymous/c90fa52618adac736381b5227e943272
[15:53:48] d1plo1d: epochwolf: re: eagerload: cool, so it sounds like expected behaviour. Why does rails do that instead of a SQL limit?
[15:54:50] dopie: has joined #RubyOnRails
[15:55:01] Disavowed: has joined #RubyOnRails
[15:55:48] brent__: has joined #RubyOnRails
[15:56:17] epochwolf: d1plo1d: you can't just load 1 record from one table and an unlimited amount from the other table in the same query without doing something crazy
[15:56:51] epochwolf: Maybe postgres could with the json datatype but msyql and mssql can't.
[15:57:28] merida: has joined #RubyOnRails
[15:58:47] rickmasta: has joined #RubyOnRails
[15:59:52] sarink: has joined #RubyOnRails
[15:59:58] Regulati_: has joined #RubyOnRails
[16:00:17] d1plo1d: epochwolf: ohhhh. I see. Yes, that was where I was missing something. The limit isn't just on that parent table it's on the rows returned. Cool. Thanks for helping me understand this!
[16:02:14] lxsameer: has joined #RubyOnRails
[16:03:50] davidw: has joined #RubyOnRails
[16:04:03] fryguy: has joined #RubyOnRails
[16:04:29] G: has joined #RubyOnRails
[16:04:56] drbayer: has joined #RubyOnRails
[16:06:12] idefine: has joined #RubyOnRails
[16:06:44] idefine: has joined #RubyOnRails
[16:06:48] Megamos: has joined #RubyOnRails
[16:07:43] arup_r: has joined #RubyOnRails
[16:07:53] zpe: has joined #RubyOnRails
[16:09:51] baweaver: has joined #RubyOnRails
[16:10:31] shinnya: has joined #RubyOnRails
[16:11:37] roelof: Is it possible to make a model schema which can do both of this : https://gist.github.com/anonymous/c90fa52618adac736381b5227e943272 ?
[16:11:41] dangerousdave: has joined #RubyOnRails
[16:11:48] Timberwo|f: has joined #RubyOnRails
[16:12:42] smathy: has joined #RubyOnRails
[16:13:34] dustint: has joined #RubyOnRails
[16:13:42] Detch: has joined #RubyOnRails
[16:14:18] Palsson: has joined #RubyOnRails
[16:14:21] brent__: has joined #RubyOnRails
[16:14:23] pawnbox: has joined #RubyOnRails
[16:16:03] JesseH: has joined #RubyOnRails
[16:20:07] shwoodard_: has joined #RubyOnRails
[16:20:09] dmcc: has joined #RubyOnRails
[16:20:10] sdn90: has joined #RubyOnRails
[16:20:25] hobodave: has joined #RubyOnRails
[16:21:00] kumavis: has joined #RubyOnRails
[16:21:58] sleungcy: has joined #RubyOnRails
[16:22:35] Arcaire: has joined #RubyOnRails
[16:22:45] manfrin: has joined #RubyOnRails
[16:23:20] Disavowed: has joined #RubyOnRails
[16:24:08] jtong: has joined #RubyOnRails
[16:24:26] Lingos: has joined #RubyOnRails
[16:25:03] n008f4g_: has joined #RubyOnRails
[16:25:04] benlieb: has joined #RubyOnRails
[16:27:13] Guest15756: has joined #RubyOnRails
[16:27:53] yellow5: has joined #RubyOnRails
[16:28:18] DragonPunch: has joined #RubyOnRails
[16:29:04] Maletor: has joined #RubyOnRails
[16:29:10] smathy: roelof, !dry
[16:29:10] helpa: roelof: Don't repeat yourself. Asking the same question repeatedly will not give you more answers.
[16:29:45] Timberwo|f: has joined #RubyOnRails
[16:29:52] smathy: roelof, instead, maybe try to take a total lack of response as a hint that your question makes no sense to anyone.
[16:29:55] shtirlic: has joined #RubyOnRails
[16:30:08] PedramT: has joined #RubyOnRails
[16:30:14] spastorino: has joined #RubyOnRails
[16:30:29] roelof: oke, then I have to think how to make it a better question
[16:30:33] aujt74: has joined #RubyOnRails
[16:31:28] triptec: has joined #RubyOnRails
[16:31:40] roelof: what I trying to do is make a model for financial account. Now you can make a lot of accounts and another way some people do is group them together . I try to find a model so both can be working
[16:32:38] dopie: has joined #RubyOnRails
[16:37:29] blackmesa: has joined #RubyOnRails
[16:38:11] Maletor: Did I find a bug in Rack? https://github.com/rack/rack/issues/1049
[16:39:09] rbr: has joined #RubyOnRails
[16:42:19] djbkd: has joined #RubyOnRails
[16:42:26] shtirlic: has joined #RubyOnRails
[16:42:52] steve0hh: has joined #RubyOnRails
[16:43:57] Guest68974: hey guys i have a quick question about strong params
[16:44:00] smathy: maletor, not only that, but the preference for REMOTE_ADDR over HTTP_X_FORWARDED_FOR is also an error.
[16:44:15] Maletor: smathy: so i'm correct then! it should be leftmost.
[16:44:34] smathy: maletor, yeah, but it should also prefer HTTP_X_FORWARDED_FOR over REMOTE_ADDR.
[16:44:44] Maletor: not necessarily....
[16:45:00] adamsilver: has joined #RubyOnRails
[16:45:00] Guest68974: im using rails 4 with mongoid and i need to change the value of a parameter before i save it
[16:45:01] Maletor: it's filter remote_addr with proxies it trusts. i.e. 127.0.0.1
[16:45:02] smathy: That's a far bigger issue than interpreting HTTP_X_FORWARDED_FOR correctly AFAIC.
[16:45:28] smathy: maletor, right, but any other proxy that sets REMOTE_ADDR will mean you get the proxy and not the real source/client IP.
[16:45:31] adamsilver: kHi guys. Is it okay to run Passenger/Nginx under a user with sudo permission?
[16:45:39] siaW: i have an app on heroku, now i made new migrations. which adds a new column called “snapcode_content_type” to a “Developer” model. when i run “heroku run rake db:migrate”, i get “NoMethodError (undefined method `snapcode_content_type' for #<Developer:0x007f12517d3948>” what am i doing wrong? how can i make the app pick up the new migration without deleting old data?
[16:45:47] Maletor: smathy: sure but you can add that proxy to a list of trusted proxies i believe
[16:46:04] pawnbox: has joined #RubyOnRails
[16:46:11] smathy: maletor, umm, which doesn't help if it's a proxy at the client's end.
[16:46:23] stannard: has joined #RubyOnRails
[16:46:33] smathy: maletor, truth is that IF an HTTP_X_FORWARDED_FOR is set then that is far more likely to be the client's IP than anything else.
[16:46:36] Maletor: i'm not totally convinced that's a bug yet but if you think so i would totally open a bug on rack if i were you
[16:47:43] SteenJobs: has joined #RubyOnRails
[16:48:41] tildes: has joined #RubyOnRails
[16:49:02] mikecmpbll: has joined #RubyOnRails
[16:49:34] FooMunki: has joined #RubyOnRails
[16:50:01] Shidash: so I'm having a problem that seems a bit stupid- I'm trying to generate html for a link and save it in a string variable so I can use it later. To do this, I'm doing- '<a href="'+url+'">'
[16:50:19] roelof: has left #RubyOnRails: ()
[16:50:25] Shidash: hm,wrong channel- think this needs to be in ruby as this would be a solved problem if I was doing it in rails
[16:50:26] Maletor: smathy: shit
[16:50:37] Maletor: actiondispatch reverses it https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/remote_ip.rb#L116
[16:51:12] Palsson: has joined #RubyOnRails
[16:53:01] smathy: maletor, you mean it's .first is really getting the last one in the list too?
[16:53:25] Maletor: so they are both pulling the rightmost value from XFF.
[16:53:29] pawnbox: has joined #RubyOnRails
[16:54:07] Maletor: presumably because it's the first "trusted" ip
[16:54:32] smathy: Right, and my understanding is that it's basically the standard for a proxy to add itself onto the end.
[16:54:39] njero: has joined #RubyOnRails
[16:54:44] smathy: ...sorry, add the source onto the end.
[16:54:53] smathy: (itself into REMOTE_ADDR)
[16:55:15] smathy: It's not the first trusted IP, it's the last trusted IP.
[16:57:35] njero: smathy: maletor hey aws load-balancer is setting X-Forwarded-For as remote ip, does the above discussion mention that rails mess with order of X-Forwarded-For list?
[16:57:35] njero: i'm currently using first entry as remote ip
[16:57:40] iamayam: has joined #RubyOnRails
[16:57:59] Maletor: no it doens't touch it except to erase loclahost trusted proxies
[16:59:04] Maletor: smathy if you have XFF: X, trusted, trusted, Y, Z, trusted, trusted you would want Z returned
[16:59:08] smathy: n_e_o, it's just reversing it on an internal assignment, before it pulls the `request.ip`
[16:59:29] smathy: maletor, for the client IP?
[16:59:49] smathy: maletor, no you wouldn't, the first ip in XFF is the oldest, ie. the original client IP.
[16:59:56] Maletor: but it's untrusted
[17:00:01] Maletor: we don't wanna get spoofed
[17:00:22] Maletor: i'm going back on what i said earlier but mostly because i've now confused myself
[17:00:43] merida_: has joined #RubyOnRails
[17:00:50] sarink: has joined #RubyOnRails
[17:01:09] smathy: maletor, the trusted check is to get rid of local IPs, like if you're in a LAN with a 192.168 address and your border router puts that address into XFF and puts its own public IP into REMOTE_ADDR
[17:01:22] Maletor: ya i get that
[17:01:56] smathy: maletor, "trusted" doesn't mean it's trusted, the method should be called `private_ip?`
[17:02:03] njero: maletor: so the first entry will be remote ip. thnk god, it scared shit out of me.. my visitor ip address table would have been a waste :P
[17:02:06] njero: smathy: cool. Thnks :)
[17:02:23] smathy: maletor, there's never a way to tell if an HTTP header has been spoofed, any header.
[17:02:28] chagel: has joined #RubyOnRails
[17:02:57] smathy: n_e_o, unless it's a local IP, that's the only time you should ignroe it.
[17:03:04] smathy: s/local/private/
[17:03:12] Maletor: what if your proxy is external
[17:03:16] siaW: : i have an app on heroku, now i made new migrations. which adds a new column called “snapcode_content_type” to a “Developer” model. when i run “heroku run rake db:migrate”, i get “NoMethodError (undefined method `snapcode_content_type' for #<Developer:0x007f12517d3948>” what am i doing wrong? how can i make the app pick up the new migration without deleting old data?
[17:03:27] Maletor: so it's XFF: CLIENT, CF
[17:03:38] smathy: The logic should be: take XFF (and Client-IP), remove private IPs, if there are any IPs left then take the first one, otherwise take REMOTE_ADDR
[17:03:39] Maletor: you would want client right so that's why it should be leftmost not rightmost?
[17:04:08] smathy: maletor, yes.
[17:04:12] Maletor: what's the point of removing the private ips if you're just gonna take the leftmost one. seems like you could do that right away
[17:04:16] smathy: maletor, you never want some intermediate proxy.
[17:04:30] sleungcy: has joined #RubyOnRails
[17:06:56] Maletor: smathy: maybe you can add some thoughts to https://github.com/rack/rack/issues/1049
[17:07:03] smathy: maletor, not sure I understand your confusion. Here's the use case: Browser (src: 10.something) -> Proxy at border router (src: 120.something) -> Some other public proxy (src: 130.something) -> Your website. In that case the request will arrive with REMOTE_ADDR: 130.something and XFF: 10.something, 120.something
[17:07:12] KensoDev: has joined #RubyOnRails
[17:07:23] smathy: You want the 120.something - ie. their public IP from their ISP.
[17:08:04] alevy: has joined #RubyOnRails
[17:08:22] IrishGringo: has joined #RubyOnRails
[17:08:23] smathy: ...if you add more proxies in between then you just get more IPs added to the END of XFF, so say there's also 140.something and 150.something then you'll end up with: REMOTE_ADDR: 150.something and XFF: 10.something, 120.something, 130.something, 140.something
[17:08:32] bronson: has joined #RubyOnRails
[17:08:43] smathy: ...so you always want the first non-private IP from XFF or if that's blank the REMOTE_ADDR
[17:08:43] stannard: has joined #RubyOnRails
[17:08:58] jhn: has joined #RubyOnRails
[17:09:00] unCork: has joined #RubyOnRails
[17:09:07] Maletor: right and private_ip? reves 10.something and then we *should* get 120.someting from Rails request.ip but we are instead getting 140.something
[17:09:17] Maletor: s/reves/removes
[17:09:19] maxx88: has joined #RubyOnRails
[17:09:30] Maletor: it could also look like
[17:09:37] smathy: ...well, actually, we're getting REMOTE_ADDR :)
[17:09:47] smathy: If the final proxy is public we're always getting that.
[17:09:53] Maletor: XFF: 10.something, 120.something, 130.something, 140.something, loclalhost, 10.something
[17:09:59] Maletor: and we'd still want 120.soemthing
[17:10:11] smathy: ...the only time we're not getting that is if it's an internal proxy in our web-host's network, a so-called "trusted_proxy?"
[17:10:16] SteenJobs: has joined #RubyOnRails
[17:10:36] smathy: ...see, the code has been focused on proxies in the webhost's own network only.
[17:10:39] jhn: has left #RubyOnRails: ()
[17:10:52] matthew0: has joined #RubyOnRails
[17:10:54] smathy: Yes, you always want 120.something.
[17:11:06] smathy: ...unless I've really misunderstood the purpose of request.ip
[17:11:13] Maletor: alright, would be helpful if you added your 2 cents on the issue. i think you and i see eye to eye on this
[17:11:29] smathy: I just think that when they wrote the code they were only thinking of proxies within the host's network.
[17:11:44] Maletor: even if they did they were wrong
[17:12:00] Maletor: let's say XFF comes in as 120.something, 130.something, 140.something, localhost, 10.something
[17:12:04] PedramT: has joined #RubyOnRails
[17:12:06] Maletor: we'd still want 120.something
[17:12:09] Maletor: not 140.something
[17:12:13] nettoweb: has joined #RubyOnRails
[17:13:01] rbr: has joined #RubyOnRails
[17:13:04] maxx88: interesting article, i wonder if someone will make it a gem: https://www.inverse.com/article/14333-mit-has-developed-a-new-bug-finder-for-popular-web-framework-ruby-on-the-rails
[17:14:00] djbkd: has joined #RubyOnRails
[17:14:15] ramfjord: has joined #RubyOnRails
[17:15:01] maxx88: https://news.mit.edu/2016/patching-web-applications-0415, article from MIT site
[17:17:12] arup_r: has joined #RubyOnRails
[17:17:57] merida: has joined #RubyOnRails
[17:17:58] RegulationD: has joined #RubyOnRails
[17:18:09] AntiSpamMeta_: has joined #RubyOnRails
[17:18:14] bruno-_: has joined #RubyOnRails
[17:18:23] jtong_: has joined #RubyOnRails
[17:18:46] smathy_: has joined #RubyOnRails
[17:18:46] SteenJobs_: has joined #RubyOnRails
[17:18:54] mozzarel1: has joined #RubyOnRails
[17:18:59] smathy_: maletor, yes we would, they've not thought about public proxies at all.
[17:19:29] akshat_: has joined #RubyOnRails
[17:19:39] Gkj8899: has joined #RubyOnRails
[17:19:39] tildes: has joined #RubyOnRails
[17:19:49] iamvery: has joined #RubyOnRails
[17:20:03] jtong__: has joined #RubyOnRails
[17:20:04] smathy: maletor, that's why their method is called `trusted_proxy?` because they were thinking of proxies within the host's network, ie. trusted proxies :)
[17:20:06] Maletor: smathy_: except to say, maybe, that you can added trusted public proxies to an array
[17:20:32] ereslibre_laptop: has joined #RubyOnRails
[17:20:32] ereslibre_laptop: has joined #RubyOnRails
[17:20:37] Maletor: still, that seems redonculous. just use the leftmost, non local ip.
[17:20:37] _djbkd: has joined #RubyOnRails
[17:20:48] blackmes1: has joined #RubyOnRails
[17:21:04] smathy: maletor, the only way it makes sense is if the actual purpose of `request.ip` is meant to be to just give the last public host.
[17:21:09] IrishGringo_: has joined #RubyOnRails
[17:21:14] pwnd_nsfw`: has joined #RubyOnRails
[17:21:25] Maletor: that's not valuable to anybody though.
[17:21:29] frem_: has joined #RubyOnRails
[17:21:34] Maletor: the real value is the client's ip.
[17:21:39] smathy: maletor, right, but the only trusted proxies you'll ever know about are you own, ie. on your end of the chain, proxies you control.
[17:21:52] smathy: maletor, yeah I agree.
[17:22:24] mosez_: has joined #RubyOnRails
[17:22:30] Maletor: and since the header can be "spoofed" to say even "10.0.0.1" the argument about it being "trusted" is without merit
[17:22:37] Sanguine1nomaly: has joined #RubyOnRails
[17:22:50] maxx88_: has joined #RubyOnRails
[17:23:03] phredus: has joined #RubyOnRails
[17:23:45] SteenJobs_: has joined #RubyOnRails
[17:23:46] benlieb_: has joined #RubyOnRails
[17:23:50] Maletor: say i pass X-Forwarded-For with "10.0.0.1" to Cloudflare. CF would then pass XFF: "10.0.0.1, CLIENT IP" would it not?
[17:23:53] smathy: Right, it's a poorly named method.
[17:24:16] smathy: It means "known_proxy?" or "my_proxy?"
[17:24:22] ELCALOR: has joined #RubyOnRails
[17:24:24] daxroc: has joined #RubyOnRails
[17:24:29] AliasLStoRM: has joined #RubyOnRails
[17:24:33] smathy: I actually just updated my comment to speak specifically about unknown proxies.
[17:24:40] kumavis_: has joined #RubyOnRails
[17:24:42] smathy: Unknown proxies on public IPs is the problem.
[17:25:23] alxndr_: has joined #RubyOnRails
[17:25:29] smathy: If there are any unknown public proxies (ie. that you haven't added to the trusted list and that have public IPs so won't be stripped by the trusted strip method) then request.ip will report the wrong thing.
[17:25:55] samuelkadolph1: has joined #RubyOnRails
[17:26:05] Scientz: has joined #RubyOnRails
[17:26:11] Nuck: has joined #RubyOnRails
[17:26:29] d0nn1e_: has joined #RubyOnRails
[17:27:04] alevy-: has joined #RubyOnRails
[17:27:17] hoodow_: has joined #RubyOnRails
[17:27:17] hoodow_: has joined #RubyOnRails
[17:27:20] braincra-: has joined #RubyOnRails
[17:27:31] Palsson_: has joined #RubyOnRails
[17:27:42] deavid: has joined #RubyOnRails
[17:28:17] tw1sted: has joined #RubyOnRails
[17:30:36] helpa: has joined #RubyOnRails
[17:31:09] renanoronfle: has joined #RubyOnRails
[17:31:31] smathy: maletor, even *this* comment doesn't really explain what they're trying to get: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/remote_ip.rb#L92-L94
[17:31:34] algernop_k: has joined #RubyOnRails
[17:31:50] smathy: maletor, and then this: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/remote_ip.rb#L103-L109 seems to suggest that they're actively trying to avoid the original IP set by the client.
[17:32:03] Maletor: because they are
[17:32:15] Maletor: remote-addr cannot be spoofed so that's the one they want
[17:32:22] akshat: has joined #RubyOnRails
[17:32:28] Maletor: you must explicitly trust public proxies by passing custom proxies
[17:32:30] smathy: Heh, of course it can.
[17:32:39] Maletor: how do you spoof a connecting ip
[17:32:40] chouhoulis: has joined #RubyOnRails
[17:33:07] Megamos: has joined #RubyOnRails
[17:33:27] smathy: maletor, same way you spoof any IP.
[17:33:29] Maletor: it can't be done. not without a vpn/proxy.
[17:33:59] darutoko: has joined #RubyOnRails
[17:34:09] dopieee: has joined #RubyOnRails
[17:34:17] solars: has joined #RubyOnRails
[17:34:29] Maletor: the tl;dr; works well here: http://blog.gingerlime.com/2012/rails-ip-spoofing-vulnerabilities-and-protection/
[17:34:44] Ratler: has joined #RubyOnRails
[17:34:45] Ratler: has joined #RubyOnRails
[17:34:51] Maletor: if you run curl -H "X-Forwarded-For: 5.5.5.5" http://your.website.com you could spoof your ip to 5.5.5.5 IF you did leftmost on XFF
[17:35:04] Maletor: but with rightmost (and explicit list of trusted public proxies) it all works
[17:35:18] tfitts: I'm trying to log to STDOUT as well as my default log file. if I set config.logger = Logger.new(STDOUT) then I lose file logging. I see that you can do Rails.logger.extend but if I leave the default logger and then do Rails.logger.extend(ActiveSupport::Logger.broadcast(STDOUT)) then I get logs in neither.
[17:36:29] rasalghul: has joined #RubyOnRails
[17:36:29] smathy: maletor, if "works" means gives you the public IP of the last proxy between the client and you.
[17:36:47] smathy: maletor, re "can't be done": an IP packet is just the same as an HTTP request, just at a different OSI layer. The same trust exists there. The only functional difference is that you can't do it without also waving any response goodbye.
[17:37:16] smathy: Ie. spoofing your IP address is as simple as constructing an IP packet with a fake `src` header.
[17:37:48] yellow5: has joined #RubyOnRails
[17:38:27] Maletor: smathy: good to know :)
[17:38:36] Maletor: well security comes in layers. it's not all or nothing.
[17:38:43] FailBit: I just got a list of open DNS resolvers
[17:38:55] FailBit: there's 600 of them
[17:39:03] rubyonrailed: has joined #RubyOnRails
[17:39:09] smathy: maletor, sure, it's much more widely known how to spoof an XFF.
[17:39:29] smathy: maletor, I'm just saying that if Rails is trying to make an insecure piece of data reliable then they're failing.
[17:39:38] davidw: has joined #RubyOnRails
[17:39:42] Maletor: that's a fact
[17:39:43] brent__: has joined #RubyOnRails
[17:39:43] sandelius: has joined #RubyOnRails
[17:40:00] smathy: maletor, ie. if your app is going to depend on any of that information verbatim, then you're gonna have a bad day.
[17:40:03] MaienM: has joined #RubyOnRails
[17:40:16] smathy: ...it's kinda why we invented authentication.
[17:40:55] Rixius: has joined #RubyOnRails
[17:40:58] aujt74: has joined #RubyOnRails
[17:41:19] smathy: ...so, with it being a given that you can't rely on that information anyway, you'd think that `request.ip` would give you the most useful piece of the unreliable data available.
[17:41:23] Axilla: has joined #RubyOnRails
[17:41:41] SteenJobs: has joined #RubyOnRails
[17:42:16] sbarg: has joined #RubyOnRails
[17:42:19] eljimmy: has joined #RubyOnRails
[17:42:29] dopie: has joined #RubyOnRails
[17:42:31] Maletor: smathy: wouldn't the ACK fail.
[17:42:32] smathy: Anyway, it's a very nasty bug, one of those "works most of the time and fails invisibly" things.
[17:42:41] Maletor: if you construct your fake ip packet
[17:42:51] smathy: maletor, you just send ack floods.
[17:43:16] King_Rex: has joined #RubyOnRails
[17:43:40] smathy: maletor, my point is that it's fairly trivial to hack anything that relies on IP, if this wasn't the case the SSL wouldn't need to exist.
[17:44:04] rafaelfr_: has joined #RubyOnRails
[17:44:25] smathy: ...and the actual client IPs wouldn't be X headers :)
[17:45:03] duderonomy: has joined #RubyOnRails
[17:45:41] dangerousdave: has joined #RubyOnRails
[17:46:27] rodfersou: has joined #RubyOnRails
[17:46:33] context: http://robotatertot.tumblr.com/
[17:46:35] dmcc: has joined #RubyOnRails
[17:46:51] lucianosousa: has joined #RubyOnRails
[17:47:23] FailBit: do isp firewalls still not do egress filtering
[17:47:48] njero: smathy: is there a way to try ip spoofing? any tool? Not asking in open how can i try spoofing.. :P
[17:48:15] Palsson: has joined #RubyOnRails
[17:48:52] kadoppe: has joined #RubyOnRails
[17:48:59] FailBit: you can write a tool to spoof packet headers in c, not terribly hard iirc
[17:49:04] sbarg: has left #RubyOnRails: ()
[17:49:11] baweaver: has joined #RubyOnRails
[17:49:16] FailBit: I just doubt they will work outside your local network
[17:49:31] podman: has joined #RubyOnRails
[17:50:29] arup_r: has joined #RubyOnRails
[17:50:40] tweeeaks: has joined #RubyOnRails
[17:50:41] malcolmva: has joined #RubyOnRails
[17:50:47] Cohedrin: has joined #RubyOnRails
[17:50:47] sdn90: has joined #RubyOnRails
[17:50:58] njero: FailBit: interesting let me try. But don't think my isp allow me to :(
[17:51:22] mentero_: has joined #RubyOnRails
[17:51:26] FailBit: which is why I'm saying do it in your local network between 2 devices
[17:52:10] njero: that's whole point though :P ..
[17:52:21] akshat: has joined #RubyOnRails
[17:53:29] speakingcode: has joined #RubyOnRails
[17:53:42] FooMunki: has joined #RubyOnRails
[17:53:53] webdestroya: has joined #RubyOnRails
[17:54:00] zrl_: has joined #RubyOnRails
[17:54:43] smathy: n_e_o, yeah, you want to be careful of your ISP's T&Cs. This stuff was much better to do while on the university's network ;)
[17:55:36] njero: smathy: :P
[17:56:08] Arcaire: has joined #RubyOnRails
[17:56:17] Obi_obi: has joined #RubyOnRails
[17:56:39] smathy: ...it was also much better to do back in the late 80s - when the knowledge gap between hackers and govt officials was much wider.
[17:56:41] merida: has joined #RubyOnRails
[17:56:42] frem_: has joined #RubyOnRails
[17:57:18] jgt2: has joined #RubyOnRails
[17:57:29] nettoweb: has joined #RubyOnRails
[17:57:35] FailBit: I used to work next to a hosting provider
[17:57:56] ankhers: has joined #RubyOnRails
[17:57:56] FailBit: they didn't give a shit about our traffic, it seems
[17:58:07] hobodave: has joined #RubyOnRails
[17:58:18] mdel: has joined #RubyOnRails
[17:58:23] jalcine: has joined #RubyOnRails
[17:58:42] fumduq: has joined #RubyOnRails
[17:58:52] tagaulap: has joined #RubyOnRails
[17:58:52] baweaver: has joined #RubyOnRails
[17:58:54] PedramT: has joined #RubyOnRails
[17:59:21] kies: has joined #RubyOnRails
[17:59:29] spastorino: has joined #RubyOnRails
[17:59:44] arpegius: has joined #RubyOnRails
[17:59:49] shwoodard_: has joined #RubyOnRails
[17:59:54] ramfjord: has joined #RubyOnRails
[18:00:54] arpegius: i have a few arrays of objects. i want a controller to return a single array of those combined objects based on some role data.
[18:01:07] deeprave: has joined #RubyOnRails
[18:01:11] hjdivad: has joined #RubyOnRails
[18:01:15] aegis3121: has joined #RubyOnRails
[18:01:23] sarink: has joined #RubyOnRails
[18:01:28] Thai_: has joined #RubyOnRails
[18:01:44] Gabriel403: has joined #RubyOnRails
[18:01:53] arpegius: i’m not sure the best way to 1) store the objects, 2) combine them, 3) tell the controller how to return them, in the most rails-ish way possible
[18:02:13] FailBit: [ (array 1 if can access), (array 2 if can access), ...].compact.flatten
[18:02:19] maqr: has joined #RubyOnRails
[18:02:25] pipework: has joined #RubyOnRails
[18:02:52] manfrin: has joined #RubyOnRails
[18:03:23] arpegius: i think what i’m looking for is adjacent to http://stackoverflow.com/questions/2088280/in-rails-how-do-you-render-json-using-a-view
[18:03:55] Cohedrin: has joined #RubyOnRails
[18:04:12] tubbo: arpegius: so first of all...you're trying to return json here right?
[18:04:37] fryguy: has joined #RubyOnRails
[18:04:50] FailBit: views are generally used for creating presentational data
[18:04:56] FailBit: you're... just returning data.
[18:04:56] daxroc: has joined #RubyOnRails
[18:05:10] tubbo: arpegius: ok, well ruby's json library allows you to just render the object directly to the browser as json by doing `render json: @whatever_you_want`
[18:05:18] arpegius: @tubbo my json needs some ruby in it. @FailBit it’s effectively a view.
[18:05:22] tubbo: because `render json:` calls a method known as `to_json` onit
[18:05:39] arpegius: oh sure. so those objects have some rails in them.
[18:05:41] Palsson: has joined #RubyOnRails
[18:05:44] arpegius: for example:
[18:05:45] FailBit: I just showed you how to do it, arpegius
[18:06:02] tubbo: arpegius: actually, the to_json method is available on *all* objects if you `require 'json'`, which rails does for you. it's part of ruby itself.
[18:06:02] arpegius: { datasource: '<%= refer_to_cm_datatable_path %>', }
[18:06:36] tubbo: arpegius: ah, and i assume that method is defined in a helper module somewhere.
[18:06:44] apeiros: has joined #RubyOnRails
[18:06:52] FailBit: the parenthesized conditonals will create nil values if they are not satisfied; compact removes the nils and flatten flattens the array structure
[18:06:55] arpegius: is it bad form to store these objects in the controller itself? because i can then do render json: [obj1, obj2]
[18:07:07] dici: has joined #RubyOnRails
[18:07:08] FailBit: ACTION ducks out
[18:07:09] chagel: has joined #RubyOnRails
[18:07:58] tubbo: arpegius: it sorta depends on how complicated those objects are to build. like if it takes a hundred or so lines to get what you need together in order to return out and that's all being done in one method in the controller...might be time to extract that logic to a PORO.
[18:08:28] arpegius: @tubbo poro?
[18:08:34] helpa: PORO stands for Plain Old Ruby Object, usually means a non-activerecord model (Yes, models work without activerecord!)
[18:09:17] arpegius: tubbo: that’s probably the right thing to do. i’ll just need to include some rails helpers with it
[18:09:21] arpegius: i need some routes from rails
[18:09:40] tubbo: yeah like if you're doing that stuff there's actually another way. i'll set up an example gist for you.
[18:10:38] baweaver: has joined #RubyOnRails
[18:11:26] G: has joined #RubyOnRails
[18:11:38] tubbo: arpegius: https://gist.github.com/tubbo/f265f5b6d3b69fde618f0e6dcbc53e59 is similar to how we structure our json api
[18:12:25] tubbo: by default we'd just `render json: [@things, @gadgets]`, but in the event you'd want both combined in the same array, you can define a file called app/views/foos/index.json.ruby which is a little-known ruby templating engine :)
[18:12:47] jgpawletko: has joined #RubyOnRails
[18:12:50] arpegius: @tubbo i think this can get me all the way. hold on a sec :)
[18:12:56] arup_r: didn't know .ruby
[18:13:01] tubbo: basically it evaluates the file as ruby and takes its return value (a string) as the body of the response, so in this case we're iterating over the @things and doing a .to_json on the end
[18:14:03] arpegius: tubbo: index.json.ruby maybe?
[18:14:50] Synthead: has joined #RubyOnRails
[18:15:24] arpegius: just can’t get the controller to find the template
[18:15:32] tubbo: arpegius: yeah that's what the filename is supposed to be.
[18:16:00] tubbo: arpegius: what's your controller name? like if its PagesController and your action is 'index' the template should be named app/views/pages/index.json.ruby
[18:16:13] arpegius: @tubbo of course
[18:18:42] ctrlrsf: has joined #RubyOnRails
[18:18:43] ctrlrsf: has joined #RubyOnRails
[18:19:30] ddv: has joined #RubyOnRails
[18:20:01] joelsmith: has joined #RubyOnRails
[18:20:56] arpegius: tubbo: sweet. i’m on my way. thanks for the help.
[18:21:50] someish: has joined #RubyOnRails
[18:24:10] brainslug: has joined #RubyOnRails
[18:24:25] Cache_Money: has joined #RubyOnRails
[18:27:09] Cache_Money: I'm using Devise on my User model. I've added a `username` attribute to User and I've added `configure_permitted_parameters` method in my ApplicationController but I'm getting this error when I try to load the view "NoMethodError in Devise::RegistrationsController#new": https://github.com/plataformatec/devise#strong-parameters
[18:28:42] sleungcy: has joined #RubyOnRails
[18:29:05] tubbo: Cache_Money: !gist the full error
[18:29:05] helpa: Cache_Money: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[18:30:00] alias-ls-to-rm: has joined #RubyOnRails
[18:31:56] Cache_Money: tubbo: Here's the code and error message: https://gist.github.com/anonymous/ecc62f0c894d19dad148b69ad2edaa75
[18:32:53] nettoweb: has joined #RubyOnRails
[18:34:53] tubbo: Cache_Money: what version of devise are you running? looking at the source for Devise::ParameterSanitizer, it seems that permit() is a public method. if that's the error you're getting, it's possible you're not using the most up-to-date version or the documentation is not for the correct version.
[18:35:12] tubbo: Cache_Money: to find out which version is installed, you can do `cat Gemfile.lock | grep "devise ("`
[18:35:39] Cache_Money: tubbo: devise 3.5.6
[18:36:36] sthns: has joined #RubyOnRails
[18:37:00] tubbo: Cache_Money: you're looking at the wrong docs https://github.com/plataformatec/devise/tree/3-stable#strong-parameters
[18:38:55] Cache_Money: tubbo: Thanks, that fixed it! How'd you know to look at at that branch?
[18:39:23] tubbo: Cache_Money: there was a giant warning above the documentation you linked saying that was docs for v4 and the gave a link to the v3 docs :D
[18:39:31] tubbo: and then*
[18:41:09] Cache_Money: ahh, I guess I need to read a little more carefully :)
[18:41:49] kristofferR: has joined #RubyOnRails
[18:43:22] dezull: has joined #RubyOnRails
[18:43:47] jhn: has joined #RubyOnRails
[18:45:31] aegis3121: has joined #RubyOnRails
[18:46:08] yellow51: has joined #RubyOnRails
[18:49:48] stannard: has joined #RubyOnRails
[18:52:10] chouhoulis: has joined #RubyOnRails
[18:54:27] dcope: if i set a read_timeout and an open_timeout on Net::HTTP will the request cancel if it times out?
[18:56:59] stannard: has joined #RubyOnRails
[18:57:19] FooMunki: has joined #RubyOnRails
[18:58:26] triptec: has joined #RubyOnRails
[18:58:55] context: dcope: try it ?
[19:00:02] dcope: context: it seems to in dev but in production i have logs showing http requests taking longer than the timeout
[19:01:21] context: Im personally not a big fan of Net::HTTP. its kind of garbage. from what i understand is all the timeouts are separate. and very possibly dont mean what you think :-/
[19:02:17] sarink: has joined #RubyOnRails
[19:02:29] dcope: context: what's the better alternative?
[19:02:42] dcope: i just need to ensure an HTTP post does not take longer than N seconds. it's being sent to a server i do not control.
[19:02:43] context: dont know. if you find one tell me ;)
[19:03:53] Megamos: has joined #RubyOnRails
[19:04:06] context: dcope: do what i did, keep playing around. if it works in dev i dont see why it wouldn't in prod
[19:04:29] nettoweb: has joined #RubyOnRails
[19:04:57] dcope: there's no telling
[19:05:04] ponzii: has joined #RubyOnRails
[19:05:19] dcope: my monitoring software is just showing http requests taking well over the timeout
[19:05:31] dcope: so im wondering if the http requests continue to run until they finish or the server times out... or what
[19:05:33] context: incoming? or a request you are making ?
[19:05:41] dcope: a request im making
[19:05:55] zpe: has joined #RubyOnRails
[19:05:55] dcope: i'm posting to a 3rd party server
[19:06:06] context: yeah, it should obide by the timeouts but again, wouldnt be surprised
[19:06:16] context: you can always take the durastic approach and use Timeout
[19:06:20] \13k: has joined #RubyOnRails
[19:06:45] dcope: tried that too
[19:06:52] context: Timeout is a scary spawn of hell also
[19:07:08] dcope: haha yeah, i've been reading up on it. pretty much everyone opposes it :P
[19:08:37] ponzii_: has joined #RubyOnRails
[19:09:25] ponzii_: How do pass the name of a table/model as a variable when creating a <table/model>.update ... query?
[19:10:18] bronson: has joined #RubyOnRails
[19:10:32] Fire-Dragon-DoL: has joined #RubyOnRails
[19:10:44] yfeldblum: has joined #RubyOnRails
[19:11:09] arup_r: ponzii_: didn't get you
[19:11:45] ponzii_: arup_r: As in something like #{Table}.update ...
[19:12:15] apeiros: ponzii_: as always - x = MyModel; x.update(…)
[19:12:21] apeiros: simply assign it to a variable
[19:12:48] arup_r: is it a String? i'm confused
[19:12:59] ponzii_: It's a strig
[19:13:04] apeiros: oh, the *name*, sorry
[19:13:11] apeiros: x.constantize.update(…)
[19:13:15] Cohedrin: has joined #RubyOnRails
[19:13:21] arup_r: http://api.rubyonrails.org/classes/String.html#method-i-constantize
[19:13:25] arup_r: oh.. done.
[19:14:00] MrPunkin: has joined #RubyOnRails
[19:14:06] ponzii_: So model names are constants?
[19:14:19] apeiros: no. names are strings.
[19:14:23] apeiros: constants are constants :)
[19:14:30] apeiros: hurray for tautologies
[19:14:50] context: class 'names' are constants.
[19:15:04] apeiros: variables starting with an uppercase letter are constants
[19:15:25] apeiros: classes are usually assigned to constants. and `class Foo` and `module Foo` syntax will assign to a constant too.
[19:15:57] apeiros: there's no requirement for that, though:
[19:15:59] apeiros: >> x = Class.new
[19:16:00] loglaunch: has joined #RubyOnRails
[19:16:05] apeiros: oh, right, no eval-bot
[19:16:11] arup_r: we don't have ^
[19:16:27] Cohedrin: has joined #RubyOnRails
[19:17:22] manfrin: has joined #RubyOnRails
[19:18:55] helpa: has joined #RubyOnRails
[19:18:59] Regulati_: has joined #RubyOnRails
[19:19:01] Robtop__: has joined #RubyOnRails
[19:19:12] chouhoul_: has joined #RubyOnRails
[19:19:12] akshat_: has joined #RubyOnRails
[19:19:19] jtong: has joined #RubyOnRails
[19:19:26] pawnbox_: has joined #RubyOnRails
[19:19:35] smathy_: has joined #RubyOnRails
[19:19:35] rubyonra_: has joined #RubyOnRails
[19:19:51] iamvery_: has joined #RubyOnRails
[19:19:56] mozzarella: has joined #RubyOnRails
[19:19:59] tubbo: apeiros: => #<Class:0x007fc20b924918>
[19:20:04] eggoez: has joined #RubyOnRails
[19:20:06] i: has joined #RubyOnRails
[19:20:18] sbarg1: has joined #RubyOnRails
[19:20:19] apeiros: yaaay, an eval-hoooman!
[19:20:26] tubbo: evil-hooman*
[19:21:23] apeiros: by the power of eval, he's got the power?
[19:21:39] tubbo: this is getting into a whole weird area
[19:21:50] sbarg1: has left #RubyOnRails: ()
[19:21:57] MaienM_: has joined #RubyOnRails
[19:22:08] smathy_: Stop outputting without input!
[19:22:14] ELCALOR_: has joined #RubyOnRails
[19:22:17] Brent___: has joined #RubyOnRails
[19:22:19] stannard: has joined #RubyOnRails
[19:22:40] d0nn1e: has joined #RubyOnRails
[19:22:41] rspec_question: has joined #RubyOnRails
[19:22:47] rspec_question: hey im having an issue where rspec is not doing relative module paths the same way as Rails.... so for exameple, in Foo::Bar I call Baz, Rails gets ::Baz, but rspec looks for Foo::Bar::Baz
[19:22:52] fumduq: has joined #RubyOnRails
[19:23:00] FailBit: I bet it's rspec
[19:23:04] FailBit: ACTION shoops
[19:23:22] deavid: has joined #RubyOnRails
[19:23:37] smathy: rspec_question, !code
[19:23:37] helpa: rspec_question: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[19:23:38] context: rspec_question: uhh. the search path all depends on how your class is deinfed
[19:23:57] baweaver: has joined #RubyOnRails
[19:23:58] nettoweb: has joined #RubyOnRails
[19:24:12] context: class Some::Embedded::Class is NOT == to: module Some ; module Embedded ; class Class ; end ; end; end
[19:24:16] arup_r1: has joined #RubyOnRails
[19:24:45] rspec_question: https://gist.github.com/noam87/e03a7d0dccd3121cfb38e64872520e0f -- works fine in rails console and rails server, but not in rspec.
[19:24:47] Axilla: has joined #RubyOnRails
[19:25:15] context: "doesnt work"
[19:25:29] context: error / log... try gisting that next
[19:25:44] rspec_question: doesn't work as in rspec looks for Response::Onboarding::OnboardingJob
[19:25:51] rspec_question: not for ::OnboardingJob
[19:26:01] context: it "looks" for both
[19:26:14] rspec_question: NameError: uninitialized constant Response::Onboarding::OnboardingJob
[19:26:17] context: are your rspecs loading your rails envoironment.
[19:26:37] rspec_question: yes require 'rails_helper'
[19:27:32] rspec_question: oy, i gues it's not loading the full env. just binding.pryed it
[19:27:34] mdw: has joined #RubyOnRails
[19:28:44] ponzii_: Sorry, wrong terminal :)
[19:29:05] rspec_question: rails_helper calls config/environment though. wouldn't that load rails etc.?
[19:29:54] sdn90: has joined #RubyOnRails
[19:30:07] sarink: has joined #RubyOnRails
[19:30:39] M-shine: has joined #RubyOnRails
[19:31:02] drbayer: has joined #RubyOnRails
[19:31:22] rspec_question: "require File.expand_path("../../config/environment", __FILE__)" what else do I need?
[19:33:22] MrPunkin: has left #RubyOnRails: ()
[19:33:22] context: should, i thought
[19:35:56] maxx88: has joined #RubyOnRails
[19:36:12] tweeeaks: has joined #RubyOnRails
[19:36:19] PedramT: has joined #RubyOnRails
[19:36:22] King_Rex: has joined #RubyOnRails
[19:36:41] lxsameer: has joined #RubyOnRails
[19:37:02] kirillzh: has joined #RubyOnRails
[19:37:24] rspec_question: so the problem seems to be rspec is not loading stuff in app/jobs/subdirectory
[19:37:55] rubyonrails699: has joined #RubyOnRails
[19:41:35] solars: has joined #RubyOnRails
[19:43:49] akshat: has joined #RubyOnRails
[19:47:57] cesarstafe: has joined #RubyOnRails
[19:48:00] rspec_question: like, I have to add config.autoload_paths << Rails.root.join('app/jobs/response_jobs') to rspec.rb manually for Rspec to see it, even though it loads by default in console/server
[19:48:05] chocoelho: has joined #RubyOnRails
[19:48:11] rspec_question: to application.rb i mean
[19:48:23] cesarstafe: hi ppl, a question here, what can be happening if 2 features tests pass in green on my localhost and fails in CircleCI? somebody has been there?
[19:49:10] tubbo: cesarstafe: what's the reason for the failure?
[19:49:22] cesarstafe: I am using Rails 4.2.6 with Ruby 2.2.3
[19:49:31] tubbo: rspec_question: sounds wrong to me. are you running spring or anything?
[19:49:32] cesarstafe: let me paste here
[19:49:39] tubbo: cesarstafe: !gist it, don't paste
[19:49:39] helpa: cesarstafe: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[19:50:18] lemur: has joined #RubyOnRails
[19:50:41] chagel: has joined #RubyOnRails
[19:50:52] rspec_question: @tubbo vanilla rails 5 install as far as I know (I didn't do the initial setup)
[19:51:23] cesarstafe: https://gist.github.com/cesarediaz/3f2fb4ea9183adc2cf9f6d306b69e655
[19:51:28] tubbo: rspec_question: that would have spring in it. type `bin/spring stop` and try running `rspec` again.
[19:53:25] rspec_question: @tubbo there's no spring in bin :/
[19:53:39] cesarstafe: the failure in Circle http://pastie.org/10799196
[19:53:41] FailBit: published my first ruby gem
[19:54:00] cesarstafe: there you can see
[19:54:02] FailBit: helpa is a bot
[19:54:52] cesarstafe: the line that fails in CircleCI is this .... find('.clickable-row', match: :first).click
[19:55:08] cesarstafe: weird.. in my machine it works and pass in green
[19:56:03] tubbo: cesarstafe: ahh yeah sometimes find().click can be a little non-deterministic. any reason why you can't do click_button('.clickable-row:first')?
[19:56:20] tubbo: rspec_question: you might need bundle exec spring stop
[19:56:34] tubbo: rspec_question: you can find out if spring is installed by searching Gemfile, it's just another gem
[19:57:01] sarink: has joined #RubyOnRails
[19:57:20] Devalo: has joined #RubyOnRails
[19:57:28] leftpad: has joined #RubyOnRails
[19:57:59] leftpad: why is there so much controversy over ActionCable needing Redis?
[19:58:09] rspec_question: @tubbo yeah grepped for it, it's not. confirmed bundle exec doesn't find it
[19:58:17] FailBit: wait, it needs redis?
[19:58:21] FailBit: ACTION becomes controversial
[19:58:43] FailBit: (we already use redis so it doesn't actually matter)
[19:58:52] tubbo: leftpad: some people don't use redis
[19:59:07] tubbo: rspec_question: hmm, not sure then
[19:59:19] tubbo: rspec_question: are you running rspec within `bundle exec`?
[19:59:37] baweaver: has joined #RubyOnRails
[19:59:49] gmas: has joined #RubyOnRails
[20:00:36] cesarstafe: tubbo: .clickable-row is in every row of a table.. can I use a click_button there?
[20:00:37] rspec_question: @tubbo yeah that doesn't work either. no clue :( mauybe the guy who set it up changed something in the vanilla install. I'll load them manually for now. -- thanks for the help.
[20:01:05] MuffinPimp: has joined #RubyOnRails
[20:01:54] srinidhi: has joined #RubyOnRails
[20:01:56] hobodave_: has joined #RubyOnRails
[20:01:58] Paradox: has joined #RubyOnRails
[20:02:41] FailBit: who here uses bem (just a survey, not asking for help)
[20:03:49] dionysus69: has joined #RubyOnRails
[20:06:29] moei: has joined #RubyOnRails
[20:07:28] tubbo: FailBit: \o
[20:07:41] tubbo: i mean, my company does...but i don't write frontend code here
[20:07:44] tubbo: all backend
[20:11:16] context: lucky duckling right there
[20:12:08] rickmasta: has joined #RubyOnRails
[20:14:11] emachnic: has joined #RubyOnRails
[20:15:15] hxegon: has joined #RubyOnRails
[20:15:47] FailBit: some days frontend is preferable to backend
[20:15:49] FailBit: at least for me
[20:16:08] baweaver: want to know why I don't like frontend?
[20:16:30] baweaver: testing JS is a continual battle.
[20:16:32] context: oh come on. i bet she is a nice lady
[20:18:28] FailBit: >testing JS
[20:18:56] tubbo: ^ doesn't use enough JS
[20:19:28] helpa: has joined #RubyOnRails
[20:19:41] ql6wlld: has joined #RubyOnRails
[20:20:09] RegulationD: has joined #RubyOnRails
[20:20:14] hobodave: has joined #RubyOnRails
[20:20:28] Devalo_: has joined #RubyOnRails
[20:20:35] zpe: has joined #RubyOnRails
[20:20:54] nettoweb: has joined #RubyOnRails
[20:20:55] mozzarel1: has joined #RubyOnRails
[20:21:21] djellemah: has joined #RubyOnRails
[20:21:27] rightpad: has joined #RubyOnRails
[20:21:30] noah256: has joined #RubyOnRails
[20:21:41] FooMunki: has joined #RubyOnRails
[20:22:19] levifig: has joined #RubyOnRails
[20:23:29] rafaelfranca: has joined #RubyOnRails
[20:23:29] rafaelfranca: has joined #RubyOnRails
[20:24:15] PedramT: has joined #RubyOnRails
[20:24:17] greenhat: has joined #RubyOnRails
[20:24:23] mdel: has joined #RubyOnRails
[20:24:57] blackmes1: has joined #RubyOnRails
[20:25:01] deeprave: has joined #RubyOnRails
[20:25:30] Obi_obi: has joined #RubyOnRails
[20:25:51] daxroc: has joined #RubyOnRails
[20:26:14] ziggles: has joined #RubyOnRails
[20:26:21] adavia: has joined #RubyOnRails
[20:26:47] ziggles: When using accepts_nested_attributes_for how can i allow the value of a nested form to be blank during an update?
[20:27:40] tfitts: ziggles: like you want to not create a nested element?
[20:28:03] tfitts: you can disable the form elements before submitting if they're empty.
[20:28:11] M-shine: has joined #RubyOnRails
[20:28:12] webdestroya: has joined #RubyOnRails
[20:28:48] AntiSpamMeta: has joined #RubyOnRails
[20:28:58] Paradox: has joined #RubyOnRails
[20:29:13] ziggles: tfitts: I'm editing a Page that has many (nested) Projects. I'm trying to set one of the project's title's to "" and the form post looks like "projects_attributes"=>{"0"=>{"description"=>"whatever!", "_destroy"=>"false", "id"=>"9"}}}}
[20:29:29] ziggles: the title attribute is totally missing so it's never updated in the database... I'd like to set it to "" in the db
[20:29:33] ankhers: has joined #RubyOnRails
[20:30:10] ziggles: i could manually set this in the controller action but it seems like it's something rails might take care of for me?
[20:31:41] tfitts: if you have a value there does it post it?
[20:32:37] tfitts: does your nested model required a title? Usualy if you create a record and attributes are missing the record will be created and those fields that are missing from the attributes hash are set to the defaults
[20:32:55] arpegius: has joined #RubyOnRails
[20:33:36] ziggles: My record does not require a title. And i am able to create w/ blank titles fine. it's only when i try and update a record that has a title to a blank title... it's like because the form doesn't post a value for title to the server... Rails by default does nothing to the attribute
[20:34:03] ziggles: im not really sure what to google to look for help
[20:34:12] jgpawletko: has joined #RubyOnRails
[20:34:22] ziggles: 1 moment, switching networks.
[20:36:08] dezull: has joined #RubyOnRails
[20:38:05] tfitts: anyone here running on puma? I'm trying to get it setup and I have a config that allows puma to start and say it is listening but no requests ever show up. clients just hang when they try to access the server
[20:39:36] ziggles: has joined #RubyOnRails
[20:40:02] diegoaguilar: has joined #RubyOnRails
[20:41:10] nettoweb: has joined #RubyOnRails
[20:41:13] ziggles: tfitts: if you responded i missed it, sorry.
[20:41:41] IrishGringo: has joined #RubyOnRails
[20:42:06] rubyonrails149: has joined #RubyOnRails
[20:42:40] tfitts: I didn't. Can you look at the header of the request to see if that param is being sent? I have several nested forms and I can erase existing values without any problem.
[20:42:58] clayreed: has joined #RubyOnRails
[20:43:27] clayreed: Hi there, I'm working on a project where we have a table of records.
[20:43:38] tfitts: haha, no kidding?
[20:43:51] clayreed: This table contains a certain record which we copy many times to populate the table.
[20:43:55] newjersey: has joined #RubyOnRails
[20:44:00] th0m: has joined #RubyOnRails
[20:44:14] clayreed: We are trying to think of the best way to fetch the "master record" when we need to make a copy of it.
[20:44:33] clayreed: Do you understand what I mean and is this a pattern you've seen before?
[20:44:51] triptec: has joined #RubyOnRails
[20:44:51] tfitts: it's not a common pattern that's for sure. Can you just store it as a hash or does the "master record" change?
[20:45:35] speakingcode: has joined #RubyOnRails
[20:45:47] tfitts: does the table get dumped regularly and you start over or what do you mean populate the table?
[20:45:54] clayreed: It also has may associated records.
[20:46:35] clayreed: To be concrete, Clients have many Questionaires.
[20:46:49] clayreed: When a Client signs up, we give them two questionaires by default.
[20:47:33] clayreed: These we store also in the Questionare table. They have Questions and Answers and all sorts of other stuff.
[20:47:44] Tempesta: has joined #RubyOnRails
[20:48:12] tfitts: and each questionaire has_many questions and each question has_many answers?
[20:48:28] clayreed: Yeah, I'm simplifying a bit but that's about the size of it.
[20:50:08] clayreed: We're actually using Amoeba to handle the associations.
[20:52:23] tfitts: that's kinda weird. I'd probably make a yml file or something with the defaults and then have a job that creates the records from the yml when a new user is created
[20:52:32] ziggles: tfitts: good call on checking the form's submission... http://pastie.org/private/qnskatvzurqdjuda6grva
[20:52:34] tfitts: it's like seed data for each user
[20:52:52] ziggles: for some reason that damn title attribute is missing when i clear the field out and submit
[20:53:08] clayreed: One of my coworkers has a notion to create a table MasterRecord which uses polymorphism to mark certain Questionaires as being originals. One would then do the appropriate JOIN on MasterRecord to get the original Questionaire.
[20:53:32] aegis3121: has joined #RubyOnRails
[20:53:34] tfitts: ziggles, what about in the browser itself, can you look at the headers and see if it's even there when the request is created?
[20:54:14] tfitts: clayreed: it's kinda weird to have a table for such a unique piece of data
[20:54:32] stannard: has joined #RubyOnRails
[20:55:18] ziggles: tfitts: yeah i do see it in the form headers... it's empty, as expected: http://pastie.org/private/lq0sc636b5jyxjre3rr5w
[20:56:18] clayreed: tfitts So the code smell is coming from the fact that this is in a table at all... The only remaining concern is... what if somebody wants to edit the original?
[20:56:49] clayreed: They shouldn't need a developer to do that.
[20:57:13] ereslibre: has joined #RubyOnRails
[20:57:43] flav: has joined #RubyOnRails
[20:57:47] tfitts: so right now do you have a seed client or something?
[20:58:02] mrmist: has joined #RubyOnRails
[20:58:16] clayreed: I don't believe I've actually heard of a seed client before.
[20:58:39] tfitts: sorry, I mean are you selecting the seed data by ids or by their relation to a default client?
[20:59:51] clayreed: Oh, I understand what you mean.
[21:00:01] clayreed: I believe right now this is unimplemented.
[21:00:25] clayreed: I recommended just storing the id in the code base, but a default Client might be interesting.
[21:00:33] mrmist: has left #RubyOnRails: ()
[21:00:45] tfitts: I'd do that, then you can add additional ones if you need to
[21:00:47] tfitts: or remove them
[21:01:05] tfitts: and also have an easy association to access them.
[21:01:28] clayreed: Do the default client or do ids?
[21:01:33] tfitts: default client
[21:01:50] clayreed: I like that idea.
[21:01:53] tfitts: otherwise if you have a questionaire with ids 1 and 2 and you want to add one later you have to do 1 and 2 and 3545235235 etc
[21:02:24] tfitts: if it's just the seed client then you can have a route that pulls open that clients questionaires to edit them
[21:02:42] tfitts: and no matter how many you add or remove it is easy to reference them without code changes.
[21:02:45] n008f4g_: has joined #RubyOnRails
[21:03:25] flav: hey guys anyone able to help me figure out where I'm going wrong. I'm trying to edit a nested resource but when I submit instead of editing it just adds another one, code here: https://gist.github.com/anonymous/d9a55d06431fcfd60197532eac2a913c
[21:03:58] tfitts: flav: you need to permid :id in the ilists_attributes
[21:04:09] clayreed: Thank you tfitts, this has been most helpful.
[21:04:21] ur5us: has joined #RubyOnRails
[21:04:25] tfitts: no problem
[21:06:53] flav: tfitts: oh my god thank you so much, spent days on this.
[21:06:57] ziggles: has joined #RubyOnRails
[21:07:13] triptec: has joined #RubyOnRails
[21:07:14] tfitts: flav: I've had that before, I knew it without even looking at your code, but double checked anyway
[21:07:25] PedramT: has joined #RubyOnRails
[21:08:24] tfitts: ziggles: where is your name from? I was going to start a company with that name like 10 years ago but changed it because ziggles.com was already taken.
[21:09:32] ziggles_: has joined #RubyOnRails
[21:09:40] flav: tfitts: it always kills me when a fix is so simple
[21:11:02] tfitts: flav: if you check your dev logs you'd see that (id) was an unpermitted parameter. do you use pry?
[21:12:01] bronson: has joined #RubyOnRails
[21:12:10] flav: whats pry?
[21:12:23] FailBit: a better ruby repl
[21:12:28] FailBit: ACTION rippers flav
[21:12:34] flav: im stupidly using rails and mongoid with windows
[21:12:45] FailBit: theres your problem
[21:12:59] FailBit: https://i.imgur.com/lFo0tlE.png
[21:13:03] FailBit: here's what happens when you remove mongodb
[21:13:55] tfitts: flav: why not code in linux?
[21:14:43] tfitts: either through vagrant or just in the cloud?
[21:15:35] flav: its for college, currently learning 10 different languages and just cant take figuring out how to use linux right now
[21:15:53] FailBit: >10 different languages
[21:16:18] arBmind: has joined #RubyOnRails
[21:16:33] pvertenten: has joined #RubyOnRails
[21:17:01] tfitts: flav: like javascript, html, css, coffesscript, scss, ruby, and rails? are these all languages?
[21:17:37] tfitts: anyway, sign up for cloud9 or something. you can write rails on linux in 5 minutes.
[21:17:56] FailBit: coffeescript *shudders*
[21:18:04] tfitts: FailBit: it was a joke though
[21:18:14] tfitts: just throwing out everyhing associated with rails like it's a language
[21:18:20] FailBit: coffee is like "how can we take JS and make it look more like ruby while not at all actually improving anything"
[21:18:21] tfitts: cuz how do you honestly learn 10 languages at the same time.
[21:18:41] arup_r1: oh I lost my _r again.. let me take it back
[21:18:42] tfitts: arup___: I know, some people love it but I haven't ever bothered to try so I don't judge too much.
[21:19:16] flav: tfitts: javascript( react js, meteor js, angular js), java( android ), rails and plain ruby, with html and css as i go using mean stack. also studying oracle
[21:19:37] tfitts: those are really mostly more frameworks than actual languages
[21:20:05] flav: and some business intelligence software. i got enough going on
[21:20:27] flav: yeah, learning all the different syntax is confusing though
[21:21:03] FailBit: as someone who has been programming for 10 years and just "got it" from the start, "lol what do you mean"
[21:21:35] flav: FailBit: give me your knoledge! :P
[21:21:53] FailBit: I'm an autist
[21:22:23] FailBit: my knowledge from when I grew up was basically "everyone else is stupid" and I just intrinsically got concepts much faster than all my peers
[21:22:42] tfitts: Failbit: you never try using .first instead of .first() in js/jquery or try putting your try writing var = !var if whatever in JS after doing tons of ruby?
[21:23:17] flav: i really do love it just tough sometimes
[21:23:17] tfitts: not actually executing it, but just out of habbit before you gotta go fix it?
[21:23:18] manfrin: has joined #RubyOnRails
[21:23:22] FailBit: I don't use jquery
[21:23:29] Aherin: has joined #RubyOnRails
[21:23:30] FailBit: I have gone out of my way to not use jquery
[21:23:49] yfeldblum: has joined #RubyOnRails
[21:24:22] ziggles: has joined #RubyOnRails
[21:24:29] FailBit: because my app's browser target is IE10+
[21:25:27] lacrosse: has joined #RubyOnRails
[21:25:55] flav: at this point in my learning i dont pay any attention to browser targets i just want things to work
[21:26:06] tfitts: anyway, I'll just ask again. Anyone running their app on puma? I'm trying to set it up for the first time and the server says it is listening but no requests ever show up when I hit the port, even from localhost
[21:26:47] FailBit: things "just work" fine
[21:26:50] FailBit: in vanilla js
[21:26:51] adaedra: Are you sure nothing else could listen on the port, tfitts?
[21:27:11] FailBit: tfitts, what port is it listening on
[21:27:14] tfitts: adaedra: yeah, I've tried different ports as well, and also when trying on a conflicting port it errors and says the port is already in use and couldn't bind
[21:27:24] zpe: has joined #RubyOnRails
[21:27:29] tfitts: I've tried 3000 and 3030 and a couple others
[21:28:06] zpe: has joined #RubyOnRails
[21:28:46] tfitts: I'm trying to do it as a staging environment rather than development or production, so that's a bit different than the tutorials, but I have db credentials for staging.
[21:29:00] tfitts: I'd think I'd at least see an error so I could chase down the problem but it's just nothing.
[21:29:42] FailBit: curl localhost:3000
[21:30:04] adaedra: (Or you could use two terms)
[21:30:13] someish: has joined #RubyOnRails
[21:31:18] FailBit: I like to keep puma backgrounded
[21:31:24] FailBit: so I can just usr2/kill it when I need
[21:31:45] tfitts: curl just hangs
[21:31:55] tfitts: no request shows in the logs either
[21:32:31] FailBit: try using webrick for a sec
[21:32:48] stannard: has joined #RubyOnRails
[21:33:02] stannard: has joined #RubyOnRails
[21:34:55] triptec: has joined #RubyOnRails
[21:35:02] tfitts: webrick loaded it fine
[21:35:14] Sirecote: has joined #RubyOnRails
[21:35:17] bronson: has joined #RubyOnRails
[21:39:15] bronson: has joined #RubyOnRails
[21:46:03] jtong: has joined #RubyOnRails
[21:47:33] workmad3: has joined #RubyOnRails
[21:51:54] kadoppe: has joined #RubyOnRails
[21:52:56] SuppliedRelic_: has joined #RubyOnRails
[21:56:50] SteenJobs: has joined #RubyOnRails
[21:57:27] edwinvdgraaf: has joined #RubyOnRails
[22:00:42] maletor_: has joined #RubyOnRails
[22:00:53] benlieb: anyone care to share their feelings on whether RoR will still be a popular framework in 5 years? 10 years?
[22:01:07] adaedra: no one can tell.
[22:04:29] apeiros: skynet will prefer technology beyond the grasp of humans
[22:04:38] solars: has joined #RubyOnRails
[22:04:54] havenwood: made to be preferred by the plurality
[22:05:16] tfitts: benlieb: looking at Elixir?
[22:05:27] FailBit: probably it will have been replaced by phoenix masterrace
[22:06:08] SuppliedRelic_: has joined #RubyOnRails
[22:06:55] SuppliedRelic_: has joined #RubyOnRails
[22:07:21] benlieb: tfitts: no, just finished updating an old 3.2 app to most recent rails, and wondering if if I'll have to completely change frameworks one day. this is a business I'd like to have indefinitely
[22:07:34] benlieb: Rails has been good for the last 8 years for me
[22:07:56] SuppliedRelic: has joined #RubyOnRails
[22:08:06] yfeldblum: has joined #RubyOnRails
[22:09:19] tfitts: I'm sure it'll still be around. It's popularity already seems to be diminishing a bit.
[22:15:20] baweaver: has joined #RubyOnRails
[22:15:37] Radar: benlieb: hold on let me get my crystal ball
[22:15:55] Radar: tfitts: [citation needed]
[22:16:33] drbayer: has joined #RubyOnRails
[22:16:36] triptec: has joined #RubyOnRails
[22:16:58] siaw_: has joined #RubyOnRails
[22:19:28] benlieb: I think it's legitimate to share a an impression of where things are going without hard data. Also certainty of the future is rarely an option but neither do I think we can know "nothing" about it. We all often are forced to use intuition when choosing options, tools included
[22:19:45] Radar: benlieb: imo it's FUD
[22:20:00] Radar: and that's crap. If you're going to make such bold claims, make them and have them backed up with actual data.
[22:20:32] Radar: In Melbourne, the Rails community is bigger than it's ever been.
[22:23:10] smathy: benlieb, I have no doubt Rails will still be popular in 5 years.
[22:23:53] smathy: ...unless Trump makes no-US technologies illegal.
[22:24:01] tfitts: radar: http://www.merriam-webster.com/dictionary/seems means I have that impression, not that it's factual. I'm would guess pure # of users or applications but maybe % of them or even leading edge of new apps are at least looking at other things. https://www.amberbit.com/blog/2015/12/22/when-choose-elixir-over-ruby-for-2016-projects/ I didn't see this type of article a few years ago
[22:24:01] tfitts: swaying people from rails to something new. I still liek rails and don't plan to move on any time soon.
[22:24:37] baweaver: then you really weren't looking very hard
[22:24:39] tfitts: granted a few years ago was just when I was starting rails so I probably wasn't very aware of people looking elseware after having used it.
[22:24:39] Takumo: has joined #RubyOnRails
[22:24:39] Takumo: has joined #RubyOnRails
[22:24:49] baweaver: there are _always_ when to switch from x to y articles
[22:25:09] itkin: has joined #RubyOnRails
[22:25:22] funnel: has joined #RubyOnRails
[22:25:27] baweaver: two years ago it was NodeJS
[22:25:31] tfitts: benlieb: I take it back. Rails will be the most popular framework for at least 20 years, it's popularity is never likely to diminish.
[22:25:56] workmad3: has joined #RubyOnRails
[22:25:58] baweaver: pro tip: popularity doesn't count for anything
[22:26:17] tfitts: baweaver: except all he asked is if it will still be popular
[22:26:27] diegoaguilar: has joined #RubyOnRails
[22:26:29] tfitts: but radar's comment about the crystal ball is probably the best answer of all
[22:26:34] tfitts: who the crap knows 5-10 years from now.
[22:26:37] baweaver: doesn't make it a less true answer
[22:26:43] smathy: #protip news/blog sites thrive on controversy
[22:27:08] baweaver: use the right tool for the job, simple as that.
[22:27:26] baweaver: or as notoriously complicated and involved as that
[22:27:31] baweaver: ACTION shrugs
[22:28:09] smathy: If you're using Rails because it's popular then I have no idea whether *you'll* still be using Rails, you might be programming in Tamagochi in 5 years.
[22:28:49] Darmani: Hi everyone
[22:29:05] benlieb: tfitts: interesting article. Ouch on point 7. When you need smart, experienced developers
[22:29:13] Darmani: Is there a Github tutorial anyone could recommend to me?
[22:29:45] martinbjeldbak: has joined #RubyOnRails
[22:30:25] Darmani: Nvm think I found one.
[22:32:47] benlieb: I think popularity is a useful indicator for certain things, some good some bad. I started using the Ember framework before it was ver "popular" for lack of a better term. There's definitely blood on the bleeding edge.
[22:34:18] rubyonrailed: has joined #RubyOnRails
[22:34:28] tfitts: benlieb: I dont't know how true that is but I'm sure people made the same arguments regarding ruby/php
[22:34:30] smathy: Popularity is a useful indicator for popularity.
[22:35:03] tfitts: benlieb: the first comment on that article brings up a pretty huge point that was left out.
[22:35:17] manfrin: has joined #RubyOnRails
[22:36:49] benlieb: For example it's reasonable to expect more libraries and people writing about common problems with popular tools
[22:37:17] smathy: ...and quantity of libraries is valuable why?
[22:37:21] smathy: Ahem, npm.
[22:38:08] emachnic: has joined #RubyOnRails
[22:38:59] smathy: If you don't have a clue then more libs and write ups could be worse for you, there's too much to choose from, and without any underlying skill - no way to differentiate good from bad. If you *do* have a clue then popularity is irrelevant.
[22:40:39] pawnbox: has joined #RubyOnRails
[22:41:07] benlieb: Another thing I've noticed about new tools is their communities are usually welcoming and friendly
[22:41:26] benlieb: and that's cool
[22:41:50] smathy: Yeah, because all the early adopters are desperate for other people to reinforce their coolness.
[22:42:31] smathy: All the grumpy old bastards keep just being productive with whatever has always made the most sense for a given task.
[22:43:41] FailBit: pheonix is still sucky
[22:43:47] FailBit: phoenix, that is
[22:43:51] bronson: has joined #RubyOnRails
[22:45:21] superlou: has joined #RubyOnRails
[22:45:49] Devalo: has joined #RubyOnRails
[22:45:56] eljimmy: has joined #RubyOnRails
[22:48:41] Darmani: Radar: Are you around?
[22:49:31] mwlang: having been with Rails since 0.10 days, abandoning it around 2.2 days when Merb arose to challenge Rails and 3.0 future was unclear only to return with Rails 4.x, I think I’ve seen plenty of articles about moving away from Rails over the years, including to Python, PHP, and even new Java frameworks that attempted to adopt the best concepts Rails introduced. The biggest argument always made is Ruby is too slow, but when all’s said an
[22:49:32] mwlang: done, for most web projects, its proven it’s mettle over and over. It’s the exceedingly rare and extreme explosive cases (i.e. Twitter) that warrant a port to another framework.
[22:49:37] workmad3: has joined #RubyOnRails
[22:50:03] rubyonrailed: has joined #RubyOnRails
[22:50:54] mwlang: as far as choosing what to use today vs. Rails…in my realm, it will be Rails or Sinatra simply because Ruby is what I know. When a client needs something done and it absolutely has to work first go around,there’s no time to just grab another shiny new framework and language and “just build”
[22:53:08] chagel: has joined #RubyOnRails
[22:54:55] mwlang: and another thing, I’ll choose Goliath for non-blocking streaming Ruby based servers before choosing Node.js. it’s just what I know. I know how to set ‘em up, know how to deploy, inow where the performance ceilings are and how to scale it, know how to find just about any answer in a Ruby based project…grab Elixir or Clojure, or any other language and it’s darling framework and the whole game starts all over again with 2006.
[22:54:56] mwlang: the end of the day it always comes down to doing what you love to do in the language you most love with employers who embrace your point of view because you get stuff done for them.
[22:55:37] triptec: has joined #RubyOnRails
[22:55:49] mwlang: ACTION hops off soapbox
[22:57:02] tfitts: mwlang: I agree with all of that except the bit about being with rails and moving on and coming back. I just started at 3.x
[22:57:29] KensoDev: has joined #RubyOnRails
[22:57:58] Darmani: Hi guys, I have a simple app I'm working on to practice Rails. I'm using Pundit for restrictions, but even though I'm an Admin I can't see the some of the pages from my app.
[22:58:06] Darmani: https://github.com/mfifth/ticketee
[22:58:14] Darmani: if someone could look at it I would be most grateful.
[23:00:04] mwlang: tfitts: yeah, that was some dark times for the Rails framework. :-) The pain of upgrading from 0.x to 1.x to 2.x was painful each step of the way and when yet more was coming for 3.0, I just kind of threw in the towel and went with Sinatra and Sequel which had non-breaking api policies in place — or at least Sequel did and that’s what mattered most to me since more of my work at the time was DB intensive.
[23:01:32] pvertenten: has joined #RubyOnRails
[23:03:19] ziggles: has joined #RubyOnRails
[23:04:49] bronson: has joined #RubyOnRails
[23:04:57] n008f4g_: has joined #RubyOnRails
[23:04:58] mwlang: Darmani: the policies themselves seem good. Do you have a page it works correctly for and a page it doesn't?
[23:05:48] Darmani: mwlang: No have a seed for my admin account and when I go to the projects page I can't see any buttons or projects available.
[23:05:55] Darmani: But my RSpec tests still pass for some reason.
[23:09:14] mwlang: Darmani: where/how are you setting your user? because I don’t see you setting a current_user or otherwise in Application and Project controllers.
[23:10:07] mwlang: ah, wait…I missed the admin sub-folder.
[23:10:19] Darmani: yeah right there lol
[23:11:30] adavia: has joined #RubyOnRails
[23:11:41] pawnbox: has joined #RubyOnRails
[23:12:58] KensoDev: has joined #RubyOnRails
[23:14:21] mwlang: Darmani: I’m not seeing anything obvious just scanning through the code.
[23:14:37] Darmani: Right??? I've looked it over like 5 or 6 times
[23:14:40] mwlang: fairly straightforward stuff.
[23:14:46] felltir: has joined #RubyOnRails
[23:14:49] Darmani: But if you launch the server and look at the main page you won't be able to see anything.
[23:14:58] Darmani: lameness :[
[23:15:31] mwlang: Try raise policy_scope(Project).all.inspect in your controller where you’re setting @projects
[23:16:07] mwlang: or dump to console, etc. just to see if you really have what you think you should have there.
[23:17:21] Darmani: Okay for sure, I gtg but I'll bbl
[23:17:35] benlieb: mwlang: thanks for sharing. It didn't sound like a soapbox to me! I enjoyed hearing about your experience, and it seems like you owned all your decisions and kept the right values in mind. And you even avoided Carnegie's 3 C's while doing it :)
[23:17:48] SteenJobs: has joined #RubyOnRails
[23:18:48] michael_mbp: hi all, could someone confirm that %{} is equivalent to %Q{}?
[23:19:07] FailBit: the first one is a dict, the second is a struct
[23:19:13] FailBit: and this is #rubyonrails not #elixironrails
[23:19:33] duncannz: has joined #RubyOnRails
[23:19:55] ereslibre: has joined #RubyOnRails
[23:20:02] michael_mbp: I'm on about string literals.
[23:20:37] michael_mbp: http://ruby-doc.org/core-2.1.1/doc/syntax/literals_rdoc.html#label-Percent+Strings
[23:21:29] michael_mbp: "As with strings, an uppercase letter allows interpolation", as does %!...!
[23:21:56] michael_mbp: noting that any non-alphanumeric delimiter may be used.
[23:22:18] smathy: michael_mbp, yes, equivalent.
[23:27:39] Dreamer3: has joined #RubyOnRails
[23:27:54] mwlang: benlieb: Thanks. I had to look up them three C’s.
[23:29:07] zpe: has joined #RubyOnRails
[23:33:10] rafaelfranca: has joined #RubyOnRails
[23:33:10] rafaelfranca: has joined #RubyOnRails
[23:34:16] brent__: has joined #RubyOnRails
[23:34:40] Puffball: has joined #RubyOnRails
[23:37:40] Puffball: has joined #RubyOnRails
[23:39:47] patrick_star: has joined #RubyOnRails
[23:41:27] pawnbox: has joined #RubyOnRails
[23:42:25] Technodrome: has joined #RubyOnRails
[23:47:03] FCser: has joined #RubyOnRails
[23:47:32] Devalo: has joined #RubyOnRails
[23:48:59] rubyonrailed: has joined #RubyOnRails
[23:51:20] n008f4g_: has joined #RubyOnRails
[23:51:49] lemur: has joined #RubyOnRails
[23:53:32] bronson: has joined #RubyOnRails
[23:54:16] rubyonra_: has joined #RubyOnRails
[23:54:27] Puffball: has joined #RubyOnRails
[23:55:19] jetpack_joe: has joined #RubyOnRails
[23:56:36] Graphettion: has joined #RubyOnRails
[23:58:44] felltir: has joined #RubyOnRails