« Back to channel list

#RubyOnRails - 05 January 2016

« Back 1 day Forward 1 day »
[00:02:19] ur5us: has joined #RubyOnRails
[00:03:04] sarink: has joined #RubyOnRails
[00:04:43] kies^: has joined #RubyOnRails
[00:06:23] fox_mulder_cp: Radar: ook. i start it and go sleep. i get some intresting feattures for knows. thanks. go sleep
[00:06:32] Radar: fox_mulder_cp: goodnight
[00:07:32] sarink: has joined #RubyOnRails
[00:07:32] Dbugger: Papierkorb, rememner this thing you told me? def total; transactions.map(&:total).inject(:+); end
[00:08:25] Dbugger: It does not give you a "0" if there are no transactions
[00:08:40] Dbugger: I changed it with this: def total; transactions.map(&:total).inject(:+) || 0 ; end
[00:08:44] Papierkorb: dbugger: inject(0, &:+)
[00:08:47] Dbugger: But not sure if this is prone to error
[00:08:56] Dbugger: Wow, you guys know everything
[00:09:09] Papierkorb: dbugger: Read about Enumerable#inject in the ruby docs for explanation
[00:09:10] Dbugger: Im amazed :O
[00:09:17] Dbugger: Thanks mate
[00:09:50] Papierkorb: dbugger: that basically becomes "0 + first + second +...", but if the array is empty, it's just "0", so the result is "0" too
[00:10:21] Sawbones: has joined #RubyOnRails
[00:10:54] Papierkorb: dbugger: in your case though, your solution will also work. I'd still prefer using the 0 as argument, but if you look past that, it is a valid solution
[00:12:01] nyaa: has joined #RubyOnRails
[00:12:28] ruid: has joined #RubyOnRails
[00:15:30] sar1nk: has joined #RubyOnRails
[00:16:57] pyemkey: has joined #RubyOnRails
[00:18:48] brycesenz: has joined #RubyOnRails
[00:19:25] brycesenz: Hi all! Has anyone used Paperclip with AWS? I'm confused on how to make the Paperclip storage endpoint dependent on an environment setting.
[00:19:37] judetucker: has joined #RubyOnRails
[00:20:46] Radar: You're the first person! Congratulations.
[00:21:40] quazimodo: Is it possible to stop rails from using <whatever>_count columns automatically for counter caching?
[00:23:07] brycesenz: Haha, fair. Basically, I'm trying to set up the model such that it uses AWS if there ENV['AWS_STORAGE'] is true, but uses local storage otherwise. But I'm not sure of the best way to pass a conditional hash to "has_attached_file". Is there a best practice for that?
[00:23:50] Radar: brycesenz: You could use an `if` statement.
[00:24:07] Radar: if ENV['AWS_STORAGE']; has_attached_file :s3_config; else ...
[00:24:23] guacamole: has joined #RubyOnRails
[00:25:39] Palsson: has joined #RubyOnRails
[00:26:15] Hans267: has joined #RubyOnRails
[00:27:56] matthewd: quazimodo: counter_cache: false, or counter_cache: 'something_that_doesnt_exist'... one of those should probably do it
[00:28:02] pawnbox: has joined #RubyOnRails
[00:30:21] mary5030: has joined #RubyOnRails
[00:34:52] quazimodo: matthewd: hrm
[00:34:58] quazimodo: i didn't really try it
[00:39:02] brycesenz: has joined #RubyOnRails
[00:39:54] brycesenz: sorry, I think i got kicked off the channel
[00:40:08] brycesenz: Radar - did you have any tips/best practices?
[00:40:20] Radar: [11:23:50] <Radar> brycesenz: You could use an `if` statement.
[00:40:21] Radar: [11:24:07] <Radar> if ENV['AWS_STORAGE']; has_attached_file :s3_config; else ...
[00:41:11] brycesenz: Radar - oh, so put that whole class method in a conditional? That makes sense.
[00:43:12] Papierkorb: Radar: (??????????????????? ?????????
[00:43:22] Radar: Papierkorb: hi.
[00:43:34] Papierkorb: Radar: OOOOHHHAAAAYYYOOOO???
[00:43:43] Radar: Papierkorb: :)
[00:43:51] vegan: has joined #RubyOnRails
[00:47:08] doodlehaus: has joined #RubyOnRails
[00:49:28] sarink: has joined #RubyOnRails
[00:57:08] DrShoggoth: has joined #RubyOnRails
[00:59:40] safety_cut: has joined #RubyOnRails
[01:03:13] xnp70: has joined #RubyOnRails
[01:04:16] nyaa: has joined #RubyOnRails
[01:04:58] Denommus`: has left #RubyOnRails: ("ERC Version 5.3 (IRC client for Emacs)")
[01:05:46] sarink: has joined #RubyOnRails
[01:06:24] gambl0re: has joined #RubyOnRails
[01:07:41] _Tariq: has joined #RubyOnRails
[01:08:04] sevenseacat: has joined #RubyOnRails
[01:08:17] guacamole: has joined #RubyOnRails
[01:10:55] drale2k: has joined #RubyOnRails
[01:11:19] duncannz: has joined #RubyOnRails
[01:12:15] guacamole: has joined #RubyOnRails
[01:14:23] paradisaeidae: has joined #RubyOnRails
[01:16:01] roshanavand: has joined #RubyOnRails
[01:20:36] superlou: has joined #RubyOnRails
[01:21:57] mag42c: has joined #RubyOnRails
[01:22:03] mag42c: has left #RubyOnRails: ()
[01:22:45] ur5us_: has joined #RubyOnRails
[01:23:19] arBmind1: has joined #RubyOnRails
[01:24:18] shibabu: has joined #RubyOnRails
[01:28:09] dextertzu: has joined #RubyOnRails
[01:32:06] kp666: has joined #RubyOnRails
[01:44:49] hahuang65: has joined #RubyOnRails
[01:46:10] guacamole: has joined #RubyOnRails
[01:46:13] lastk: has joined #RubyOnRails
[01:47:08] ElFerna: has joined #RubyOnRails
[01:47:47] vit1251: has joined #RubyOnRails
[01:48:29] guacamole: has joined #RubyOnRails
[01:50:02] threeminutemonta: has joined #RubyOnRails
[01:50:03] Scripore: has joined #RubyOnRails
[01:51:13] crystalmaiden: has joined #RubyOnRails
[01:52:04] barriommx: has joined #RubyOnRails
[01:52:43] lacuna: has joined #RubyOnRails
[01:52:44] lacuna: has joined #RubyOnRails
[01:53:48] mary5030: has joined #RubyOnRails
[01:53:54] brycesenz: has joined #RubyOnRails
[01:54:21] baweaver: has joined #RubyOnRails
[01:54:50] sashagilberg: has joined #RubyOnRails
[01:57:12] stellarchariot: has joined #RubyOnRails
[01:57:58] drale2k: has joined #RubyOnRails
[01:59:38] mices: <%= form_tag ("/search", controller: "world", action: "search", method: "get") do %>
[01:59:57] Graphettion: has joined #RubyOnRails
[02:01:12] hahuang65: has joined #RubyOnRails
[02:01:38] mices: syntax error unexpected ',' expecting ')'
[02:02:15] mices: is that haml syntax or something
[02:03:23] Bloomer: has joined #RubyOnRails
[02:03:31] sevenseacat: remove the space between form_tag and ( ?
[02:04:15] _Tariq: has joined #RubyOnRails
[02:05:15] mices: sevenseacat: ty
[02:08:39] pawnbox: has joined #RubyOnRails
[02:15:45] teaearlgraycold: has joined #RubyOnRails
[02:18:51] teaearlgraycold: has joined #RubyOnRails
[02:20:15] RegulationD: has joined #RubyOnRails
[02:20:16] _Tariq: has joined #RubyOnRails
[02:20:16] pyemkey: has joined #RubyOnRails
[02:21:14] mary5030: has joined #RubyOnRails
[02:22:14] mices: if my site has no link to the index action of a controller should i leave it alone, comment it out?
[02:22:25] mices: the controller is for a resource
[02:22:31] mices: i mean a model
[02:24:08] ur5us: has joined #RubyOnRails
[02:26:07] shibabu: has joined #RubyOnRails
[02:28:26] teaearlgraycold: has joined #RubyOnRails
[02:29:57] matthewhadley: has joined #RubyOnRails
[02:31:27] mag42c_: has joined #RubyOnRails
[02:31:49] mices: nevermind sorry i see, just let it be blank action
[02:32:07] xnp70: has left #RubyOnRails: ()
[02:32:24] sevenseacat: if you dont want an index action, you should remove the route/action/view/etc.
[02:32:57] teaearlgraycold: has joined #RubyOnRails
[02:33:09] rubyonrails175: has joined #RubyOnRails
[02:36:10] matthewhadley: has left #RubyOnRails: ()
[02:38:29] NoTroutAboutIt: has joined #RubyOnRails
[02:40:08] stellarchariot: has joined #RubyOnRails
[02:40:34] Radar: Time for my monthly "I wish I had a time machine to go back in time and kill Sprockets" brooding.
[02:41:12] sevenseacat: i told you before christmas you wouldnt get that upgrade done
[02:41:32] Radar: I will it to happen.
[02:48:17] ur5us: has joined #RubyOnRails
[02:48:18] nyaa: has joined #RubyOnRails
[02:49:57] vit1251: has joined #RubyOnRails
[02:55:05] Grundell: has joined #RubyOnRails
[02:55:09] NoTroutAboutIt_: has joined #RubyOnRails
[02:55:12] joshkovach: has joined #RubyOnRails
[02:55:18] rubyonrailed: has joined #RubyOnRails
[02:55:37] hangtime21: has joined #RubyOnRails
[02:56:51] foucist: has joined #RubyOnRails
[02:58:16] pawnbox: has joined #RubyOnRails
[02:58:40] drale2k: has joined #RubyOnRails
[03:05:27] ur5us: has joined #RubyOnRails
[03:05:48] stellarchariot: has joined #RubyOnRails
[03:06:20] lacuna: has joined #RubyOnRails
[03:06:20] lacuna: has joined #RubyOnRails
[03:07:14] lyoshajapan: has joined #RubyOnRails
[03:07:34] lyoshajapan: Happy new year everybody!
[03:08:04] FailBit: ACTION brushes dirt off shoulder
[03:08:14] lyoshajapan: speaking of happy new year, my tests are failing because there are too many "1"s in my calendar pickers
[03:08:37] lyoshajapan: anybody knows how to make capybara match 1 rather then 11
[03:08:57] MLUKE__: has joined #RubyOnRails
[03:11:00] lyoshajapan: because my calendar picker I have multiple matches for a month, because when capybara is finding "1" for january, 10 for october, 11, 12.. :-(
[03:11:15] uris: has joined #RubyOnRails
[03:11:22] lyoshajapan: they are all in the option tag
[03:13:16] lyoshajapan: I guess I can match now.month first
[03:16:25] brunoalano: has joined #RubyOnRails
[03:17:04] penne12: has joined #RubyOnRails
[03:17:06] mices: is there a simple way to vertical align divs
[03:17:16] mices: or time to build a menu
[03:17:42] mices: i guess i made like a makeshift menu of 3 divs
[03:18:17] mices: floating the all right they line up alongside each other but no vertical alignment
[03:18:38] mices: s/the/them/
[03:18:54] ElFerna: has joined #RubyOnRails
[03:23:41] brycesenz: has joined #RubyOnRails
[03:24:20] Radar: lyoshajapan: exact: true
[03:24:24] Radar: as an option
[03:26:29] lyoshajapan: Radar: What are some other ways of doing it? because what would I do if I'll get stuck in a similar problem in the future without having the now.month as an option?
[03:26:52] Radar: lyoshajapan: That's the only way I can think of at the moment.
[03:28:30] shibabu: has joined #RubyOnRails
[03:29:36] SteenJobs: has joined #RubyOnRails
[03:30:15] rubyonrailed: has joined #RubyOnRails
[03:30:39] nerium: has joined #RubyOnRails
[03:31:02] roshanavand: has joined #RubyOnRails
[03:31:25] nerium: Is there a gem for using async views in rails? I guess that should be possible with action cable in rails 5.
[03:38:45] chipotle: has joined #RubyOnRails
[03:39:17] lacuna: has joined #RubyOnRails
[03:39:17] lacuna: has joined #RubyOnRails
[03:46:34] foucist: has joined #RubyOnRails
[03:46:59] mary5030: has joined #RubyOnRails
[03:48:23] ur5us: has joined #RubyOnRails
[03:52:22] _Tariq: has joined #RubyOnRails
[03:52:44] Parker0: has joined #RubyOnRails
[03:53:25] lyoshajapan: has joined #RubyOnRails
[03:55:29] brycesenz: has joined #RubyOnRails
[03:56:37] akshat: has joined #RubyOnRails
[03:57:13] sankaber: has joined #RubyOnRails
[03:59:48] C0r3: has joined #RubyOnRails
[03:59:52] C0r3: Hey guys... I have used 'rails new something -d mysql' command to create a new rails project but my prompt isn't back and taking a lot of time..?? Does 'rails new' command has to download any dependancies from internet??
[04:00:22] ur5us: has joined #RubyOnRails
[04:04:50] brycesenz: has joined #RubyOnRails
[04:06:10] arup_r: has joined #RubyOnRails
[04:06:26] SteenJobs: has joined #RubyOnRails
[04:07:25] brycesenz: has joined #RubyOnRails
[04:09:49] Gmi: has joined #RubyOnRails
[04:10:13] lyoshajapan: has joined #RubyOnRails
[04:10:57] nyaa: has joined #RubyOnRails
[04:12:18] pawnbox: has joined #RubyOnRails
[04:12:25] speaking1ode: has joined #RubyOnRails
[04:12:55] drale2k: has joined #RubyOnRails
[04:15:30] C0r3: has left #RubyOnRails: ()
[04:17:20] FailBit: it runs bundle install
[04:21:05] ElFerna: has joined #RubyOnRails
[04:22:14] pyemkey: has joined #RubyOnRails
[04:22:34] iateadonut: has joined #RubyOnRails
[04:22:57] pwnd_nsfw: has joined #RubyOnRails
[04:23:42] d0nn1e: has joined #RubyOnRails
[04:24:05] rubyonrails175: what would you recommend to fix this line of code destroyedTownIDs = oldTowns.select(:town_id).where(currentTowns.select(:town_id)).collect { |d| d[:town_id] } (i am using a Mysql database)
[04:24:13] Radar: and lots of it
[04:24:15] bePolite: has joined #RubyOnRails
[04:24:16] bePolite: has joined #RubyOnRails
[04:25:23] Radar: destroyed_town_ids = oldTowns.where(current_towns.pluck(:town_id)).pluck(:town_id)
[04:29:55] sarink: has joined #RubyOnRails
[04:30:32] lethjakman: has joined #RubyOnRails
[04:31:08] lyoshajapan: has joined #RubyOnRails
[04:35:48] ziggy: has joined #RubyOnRails
[04:35:48] ziggy: has joined #RubyOnRails
[04:36:00] pawnbox: has joined #RubyOnRails
[04:42:32] nerium: has joined #RubyOnRails
[04:42:33] nyaa: has joined #RubyOnRails
[04:42:52] SteenJobs: has joined #RubyOnRails
[04:44:00] Radar: rubyonrails175: ^
[04:45:43] lacuna: has joined #RubyOnRails
[04:47:57] atmosx: has joined #RubyOnRails
[04:49:14] tkiel: has joined #RubyOnRails
[04:49:27] atmosx: has left #RubyOnRails: ()
[04:50:52] pawnbox: has joined #RubyOnRails
[04:53:12] djbkd: has joined #RubyOnRails
[04:54:31] Tref: has joined #RubyOnRails
[04:54:52] Tref: is active_model_serializers not included in Rails 5 API ?
[04:55:19] Tref: the active_model_serializers readme says its included in rails >= 5 but doesnt specify if that includes the API version
[04:55:37] Tref: I would assume so since its more relevant in API than the core dist
[04:57:06] SteenJobs: has joined #RubyOnRails
[05:01:36] pawnbox: has joined #RubyOnRails
[05:03:00] djbkd: has joined #RubyOnRails
[05:06:24] xnp70: has joined #RubyOnRails
[05:07:01] baweaver: has joined #RubyOnRails
[05:10:17] romdi`: has joined #RubyOnRails
[05:10:21] n00bDev: has joined #RubyOnRails
[05:10:42] raunicolae: has joined #RubyOnRails
[05:13:44] Sawbones: has joined #RubyOnRails
[05:13:48] raunico3: has joined #RubyOnRails
[05:14:00] pawnbox: has joined #RubyOnRails
[05:14:02] raunicolae: has left #RubyOnRails: ()
[05:14:56] thezanke: has joined #RubyOnRails
[05:17:15] kknight: has joined #RubyOnRails
[05:18:41] kknight: i want to make all app now using mysql instead of sqlite, how to do that, my sql has been installed
[05:20:50] waseem_: kknight: When creating a new application, you can pass a --database option to the `rails new` command. See `rails new --help`.
[05:22:03] ElFerna: has joined #RubyOnRails
[05:22:08] lyoshajapan: has joined #RubyOnRails
[05:30:19] srinidhi: has joined #RubyOnRails
[05:30:21] Parker0: has joined #RubyOnRails
[05:31:01] shibabu: has joined #RubyOnRails
[05:31:05] djbkd: has joined #RubyOnRails
[05:31:19] sarink: has joined #RubyOnRails
[05:31:41] lyoshajapan: has joined #RubyOnRails
[05:32:44] srinidhi1: has joined #RubyOnRails
[05:35:33] lyoshaja_: has joined #RubyOnRails
[05:36:30] sarink: has joined #RubyOnRails
[05:37:14] yfeldblum: has joined #RubyOnRails
[05:45:39] tibra: has joined #RubyOnRails
[05:45:47] ewnd9: has joined #RubyOnRails
[05:47:20] SteenJobs: has joined #RubyOnRails
[05:50:41] tibra: has joined #RubyOnRails
[05:52:46] tetraktys: has joined #RubyOnRails
[05:54:07] dideler: has joined #RubyOnRails
[05:57:46] lolktnxbye: has joined #RubyOnRails
[05:57:56] lolktnxbye: has left #RubyOnRails: ()
[05:58:48] speakingcode: has joined #RubyOnRails
[05:59:41] vedu: Hello. How can I add headers to minitest? Trying this in vain: https://gist.github.com/vedant1811/d73e23b21e4ae0e91593
[06:02:44] lacuna: has joined #RubyOnRails
[06:03:27] IFrank00: has joined #RubyOnRails
[06:06:58] shevy: has joined #RubyOnRails
[06:08:00] melonstorm: has joined #RubyOnRails
[06:11:07] DavidDudson: has joined #RubyOnRails
[06:20:04] foucist: has joined #RubyOnRails
[06:21:00] foucist: has left #RubyOnRails: ()
[06:22:49] ElFerna: has joined #RubyOnRails
[06:24:06] pyemkey: has joined #RubyOnRails
[06:25:59] tkiel: has joined #RubyOnRails
[06:27:33] rubyonrailed: has joined #RubyOnRails
[06:31:20] techsethi: has joined #RubyOnRails
[06:31:50] chouhoul_: has joined #RubyOnRails
[06:33:35] shibabu: has joined #RubyOnRails
[06:35:04] lxsameer: has joined #RubyOnRails
[06:36:32] ziyadb: has joined #RubyOnRails
[06:37:31] aganov: has joined #RubyOnRails
[06:38:33] johnflux: has joined #RubyOnRails
[06:38:34] johnflux: has joined #RubyOnRails
[06:40:58] DonOtreply: has joined #RubyOnRails
[06:43:23] sevenseacat: has joined #RubyOnRails
[06:43:24] krz: has joined #RubyOnRails
[06:43:40] nyanz: has joined #RubyOnRails
[06:44:07] webdestroya: has joined #RubyOnRails
[06:47:16] mices: do i have to create an elasticsearch.rake file
[06:47:32] mices: i dunno where to put it
[06:47:44] mices: Elasticsearch::Transport::Transport::Errors::NotFound in Devise::SessionsController#create
[06:48:39] norc: has joined #RubyOnRails
[06:48:49] ur5us_: has joined #RubyOnRails
[06:49:23] dionysus69: has joined #RubyOnRails
[06:49:45] norc: has joined #RubyOnRails
[06:50:04] norc: Hi. Does Rails work fine with Ruby 2.3?
[06:50:05] rhizome: has joined #RubyOnRails
[06:51:03] norc: Well, Im just wondering whether people could tell me I shouldn't be wasting my time yet. :)
[06:51:22] norc: Alright sweet, thank you.
[06:55:28] ewnd9: has joined #RubyOnRails
[06:55:57] jerry_tao: has joined #RubyOnRails
[06:56:30] jerry_tao: has left #RubyOnRails: ()
[06:56:51] jerry_tao: has joined #RubyOnRails
[06:57:23] shahidbscs: has joined #RubyOnRails
[06:57:50] mices: Don't know how to build task 'elasticsearch:import:model'
[06:58:27] sp1rs1: has joined #RubyOnRails
[06:59:07] yardenbar: has joined #RubyOnRails
[07:02:03] irfanfadilah: has joined #RubyOnRails
[07:04:16] pawnbox: has joined #RubyOnRails
[07:06:04] irfanfadilah: has joined #RubyOnRails
[07:06:30] arup_r: has joined #RubyOnRails
[07:07:16] irfanfadilah: hi everyone..
[07:07:23] sarink: has joined #RubyOnRails
[07:07:51] irfanfadilah: I've a question regarding ActionCable in Rails 5 Beta..
[07:08:04] d0nn1e: has joined #RubyOnRails
[07:08:10] sarink: has joined #RubyOnRails
[07:09:23] irfanfadilah: How can we determine the data received for each actions in channel.coffee?
[07:10:00] SteenJobs: has joined #RubyOnRails
[07:10:13] sarink: has joined #RubyOnRails
[07:11:04] sarink: has joined #RubyOnRails
[07:14:51] solars: has joined #RubyOnRails
[07:15:21] sarink: has joined #RubyOnRails
[07:17:34] d0nn1e: has joined #RubyOnRails
[07:19:22] jerry_tao: has joined #RubyOnRails
[07:20:44] lacuna: has joined #RubyOnRails
[07:21:40] Pazician: has joined #RubyOnRails
[07:23:07] nyaa: has joined #RubyOnRails
[07:23:35] ElFerna: has joined #RubyOnRails
[07:26:57] Megamos: has joined #RubyOnRails
[07:28:14] user083: has joined #RubyOnRails
[07:29:26] guiNoobie: has joined #RubyOnRails
[07:29:45] guiNoobie: has left #RubyOnRails: ()
[07:30:09] ubiks: has joined #RubyOnRails
[07:30:42] ur5us: has joined #RubyOnRails
[07:30:47] Sawbones: has joined #RubyOnRails
[07:33:07] Megamosaren: has joined #RubyOnRails
[07:33:17] mdw: has joined #RubyOnRails
[07:35:04] jerry_tao: has joined #RubyOnRails
[07:36:39] AimlessRAven: has joined #RubyOnRails
[07:37:05] AimlessRAven: Hello all, i have variable in my controller to contain all orders only for today
[07:37:07] AimlessRAven: @todayOrders = Order.where(:created_at => Date.today.beginning_of_day..Date.today.end_of_day)
[07:37:18] AimlessRAven: how can i contain orders for week
[07:37:32] sevenseacat: AimlessRaven: by changing the dates you filter by?
[07:38:04] AimlessRAven: yea but i need to capture the start of week and the end of week and i dont know how
[07:38:33] sevenseacat: http://api.rubyonrails.org/classes/Date.html might help you out
[07:38:44] sevenseacat: check out the available methods and find one thats appropriate
[07:39:42] cornerma1: has joined #RubyOnRails
[07:40:16] rvanlieshout: has joined #RubyOnRails
[07:42:50] mdw: has joined #RubyOnRails
[07:43:41] nyaa: has joined #RubyOnRails
[07:50:34] BradenBraden: has joined #RubyOnRails
[07:51:39] Palsson: has joined #RubyOnRails
[07:55:58] Palsson: has joined #RubyOnRails
[07:58:21] SteenJobs: has joined #RubyOnRails
[07:59:49] shahidbscs: has joined #RubyOnRails
[08:00:43] sandstrom: has joined #RubyOnRails
[08:02:03] krz: has joined #RubyOnRails
[08:04:09] pyemkey: has joined #RubyOnRails
[08:05:27] djbkd: has joined #RubyOnRails
[08:07:41] Zamerick: has joined #RubyOnRails
[08:09:10] pawnbox: has joined #RubyOnRails
[08:10:12] Megamos: has joined #RubyOnRails
[08:11:20] pawnbox_: has joined #RubyOnRails
[08:12:19] arup_r: has joined #RubyOnRails
[08:13:38] pawnbox_: has joined #RubyOnRails
[08:17:01] darutoko: has joined #RubyOnRails
[08:18:33] nyaa: has joined #RubyOnRails
[08:18:37] quazimodo: has joined #RubyOnRails
[08:19:39] duncannz: has joined #RubyOnRails
[08:20:24] duncannz: has joined #RubyOnRails
[08:20:28] zpe: has joined #RubyOnRails
[08:21:25] qejk: has joined #RubyOnRails
[08:21:59] mices: where is the elasticsearch.rake file on linux?
[08:23:19] triptec: has joined #RubyOnRails
[08:24:30] El3ktra: has joined #RubyOnRails
[08:24:36] ElFerna: has joined #RubyOnRails
[08:24:40] El3ktra: has left #RubyOnRails: ()
[08:25:04] craysiii: has joined #RubyOnRails
[08:25:22] AimlessRAven: @weeklyOrders = Order.where(:created_at => Date.today.beginning_of_week..Date.today.end_of_week)
[08:25:28] AimlessRAven: is this is good for show weekly stats for orders?
[08:25:42] roshanavand: has joined #RubyOnRails
[08:28:26] craysiii: has joined #RubyOnRails
[08:28:52] one_zero: has joined #RubyOnRails
[08:29:18] mices: never mind i found it
[08:32:09] AimlessRAven: can anyone tell me how to set some rails variable in haml brackets?
[08:32:55] pawnbox: has joined #RubyOnRails
[08:33:33] sarink: has joined #RubyOnRails
[08:34:46] ddv: AimlessRaven: - somevariable = 1
[08:35:22] Palsson: has joined #RubyOnRails
[08:35:35] shibabu: has joined #RubyOnRails
[08:36:01] krz: has joined #RubyOnRails
[08:36:55] AimlessRAven: no i dont mean value of variable
[08:37:06] AimlessRAven: i want this value to set i haml view in braackets
[08:37:10] johnflux: has joined #RubyOnRails
[08:37:11] johnflux: has joined #RubyOnRails
[08:37:15] steffkes: has joined #RubyOnRails
[08:37:15] steffkes: has joined #RubyOnRails
[08:38:50] AimlessRAven: if i have somevariable = 1
[08:39:02] AimlessRAven: i want to put (=variable)
[08:39:10] AimlessRAven: ti display in view with brackets...
[08:39:36] roshanav_: has joined #RubyOnRails
[08:40:21] johnflux: has joined #RubyOnRails
[08:40:21] johnflux: has joined #RubyOnRails
[08:40:24] zpe_: has joined #RubyOnRails
[08:40:30] mdw: has joined #RubyOnRails
[08:43:34] mark2: has joined #RubyOnRails
[08:43:42] krzkrz: has joined #RubyOnRails
[08:43:47] futilegames: has joined #RubyOnRails
[08:45:28] brahmana: has joined #RubyOnRails
[08:46:12] brahmana: I have a typical mailer setup in my Rails app with two views (.text.erb and .html.erb) for each method.
[08:46:40] brahmana: These views are in the app/views/<mailer_name> directory and they are being properly rendered.
[08:46:49] antgel: has joined #RubyOnRails
[08:47:03] AimlessRAven: how to put variable in haml brackets ?
[08:47:19] brahmana: Now instead of rendering views which are in files in the app/views/* directory can I render a view whose markup is in a string variable?
[08:49:07] brahmana: Something like this : http://pastie.org/10670697 ?
[08:50:34] dionysus69: is there a point to setup varnish in front of a web server if I am already using something like cloudflare?
[08:50:45] ddv: AimlessRaven: I really don't understand you
[08:51:08] ddv: what do you mean with haml brackets?
[08:51:17] ddv: provide some examples
[08:52:58] riddled: has joined #RubyOnRails
[08:53:03] AimlessRAven: i have variable a = 2
[08:53:12] AimlessRAven: and i want in my vie to set this variable in brackets
[08:53:25] AimlessRAven: i cant write (=a)
[08:53:30] ddv: AimlessRaven: you mean parantheses?
[08:53:52] ddv: AimlessRaven: "(#{variable})"
[08:56:05] artto: has joined #RubyOnRails
[08:56:38] pydave6367: has joined #RubyOnRails
[08:57:24] AimlessRAven: @weeklyOrders = Order.where(:created_at => Date.today.beginning_of_week..Date.today.end_of_week)
[08:57:51] AimlessRAven: is this a good code to display weekly statistic of orders ? and is this start with 0 every week ?
[09:02:27] Ergo: has joined #RubyOnRails
[09:05:06] ur5us: has joined #RubyOnRails
[09:07:07] DoubleMalt: has joined #RubyOnRails
[09:08:49] defsdoor: has joined #RubyOnRails
[09:08:56] tomjoro: has joined #RubyOnRails
[09:09:27] yashinbasement: has joined #RubyOnRails
[09:13:47] AimlessRAven: has joined #RubyOnRails
[09:14:46] AimlessRAven: hi all i have @todayUsers = User.where(:created_at => Date.today.beginning_of_day..Date.today.end_of_day) this display me statistic of registered user for today but i want to limit only users without guest users
[09:14:47] startupality: has joined #RubyOnRails
[09:14:48] Elion: has joined #RubyOnRails
[09:14:48] AimlessRAven: how to do that
[09:14:49] Elion: has joined #RubyOnRails
[09:15:09] sandstrom: has joined #RubyOnRails
[09:19:34] dashedstripes: has joined #RubyOnRails
[09:20:54] blackhuey: has joined #RubyOnRails
[09:21:05] silverdust: Does anyone use magnumCI as their CI? All my tests pass when run locally but it always returns failed test
[09:21:14] drale2k: has joined #RubyOnRails
[09:21:28] techsethi: has joined #RubyOnRails
[09:21:50] AimlessRAven: @todayUsers = User.where(:created_at => Date.today.beginning_of_day..Date.today.end_of_day) this display me all users registered today, but i want to display only users without guest users
[09:21:52] AimlessRAven: how to do that
[09:23:27] ddv: AimlessRaven: create a scope?
[09:23:55] drptbl: has joined #RubyOnRails
[09:24:14] AimlessRAven: yea but how to do this in code
[09:25:05] qasim: has joined #RubyOnRails
[09:25:28] tibra: AimlessRaven: all in the docs http://guides.rubyonrails.org/active_record_querying.html#scopes
[09:25:37] ElFerna: has joined #RubyOnRails
[09:25:43] rhizome: has joined #RubyOnRails
[09:27:59] roshanavand: has joined #RubyOnRails
[09:28:45] waka: has joined #RubyOnRails
[09:29:19] mdw: has joined #RubyOnRails
[09:30:02] dashedstripes: I want to build multiple models from one form, I???ve tried using nested_atrributes_for but as there are 4 models in the form it quickly gets confusing / difficult to maintain. The model I would like to build from is a belongs to association. What are the best ways to achieve this?
[09:31:47] Xentil: has joined #RubyOnRails
[09:33:32] quazimodo: has joined #RubyOnRails
[09:34:07] ddv: dashedstripes: what is confusing about it?
[09:35:28] yfeldblum: has joined #RubyOnRails
[09:37:02] dashedstripes: ddv: I think it's more it would be useful to see how other people approach it as I've made a submissions controller to handle the form and building the models and i can't find examples that build more than one associated model
[09:37:42] sevenseacat: has joined #RubyOnRails
[09:38:51] waka: has joined #RubyOnRails
[09:41:34] rhizome: has joined #RubyOnRails
[09:42:42] antgel: has joined #RubyOnRails
[09:45:50] startupality: has joined #RubyOnRails
[09:46:12] pawnbox: has joined #RubyOnRails
[09:48:16] pawnbox: has joined #RubyOnRails
[09:50:11] futilegames: has joined #RubyOnRails
[09:53:08] elaptics: dashedstripes: I tend to build form objects to collect and validate exactly the information needed and then let it take that and create the actual models as necessary to persist them to the db
[09:54:12] comrad: has joined #RubyOnRails
[09:56:45] bePolite: has joined #RubyOnRails
[09:57:33] marr: has joined #RubyOnRails
[09:58:01] bePolite: has joined #RubyOnRails
[10:01:39] waka: has joined #RubyOnRails
[10:02:18] trautwein: has joined #RubyOnRails
[10:03:38] Elion: has joined #RubyOnRails
[10:03:38] Elion: has joined #RubyOnRails
[10:03:54] roshanavand: has joined #RubyOnRails
[10:05:58] rodfersou: has joined #RubyOnRails
[10:07:47] arBmind: has joined #RubyOnRails
[10:10:44] Emplitz: has joined #RubyOnRails
[10:11:48] tvw: has joined #RubyOnRails
[10:13:17] cmolenda: has joined #RubyOnRails
[10:14:07] NodeNagant: has joined #RubyOnRails
[10:14:43] zpe: has joined #RubyOnRails
[10:17:18] Megamosaren: has joined #RubyOnRails
[10:17:55] NodeNaga_: has joined #RubyOnRails
[10:19:12] tvw: has joined #RubyOnRails
[10:19:43] antgel: has joined #RubyOnRails
[10:19:47] jsrn_: has joined #RubyOnRails
[10:22:46] pawnbox: has joined #RubyOnRails
[10:23:48] roshanav_: has joined #RubyOnRails
[10:24:06] pawnbox: has joined #RubyOnRails
[10:24:22] AzaToth: has joined #RubyOnRails
[10:25:34] pawnbox: has joined #RubyOnRails
[10:25:56] rhizome: has joined #RubyOnRails
[10:26:38] ElFerna: has joined #RubyOnRails
[10:26:44] arup_r: has joined #RubyOnRails
[10:27:15] blackmesa: has joined #RubyOnRails
[10:29:24] FernandoBasso: has joined #RubyOnRails
[10:29:47] mdw: has joined #RubyOnRails
[10:31:47] ur5us: has joined #RubyOnRails
[10:37:03] lastk: has joined #RubyOnRails
[10:37:43] rhizome: has joined #RubyOnRails
[10:38:31] shibabu: has joined #RubyOnRails
[10:39:29] FernandoBasso: When will someone activate my account?
[10:39:35] techsethi: has joined #RubyOnRails
[10:40:12] sevenseacat: what account?
[10:40:16] FernandoBasso: Ah, wrong channel. Sorry.
[10:40:29] FernandoBasso: I thought I was in #openshells.
[10:41:13] FernandoBasso: I am considering two approaches: bribe someone to activate it, or threaten their lives :p
[10:41:36] antgel: has joined #RubyOnRails
[10:44:10] rhizome: proven winners
[10:51:35] startupality: has joined #RubyOnRails
[10:53:46] Palsson: has joined #RubyOnRails
[10:54:18] trautwein: has joined #RubyOnRails
[10:55:46] roshanavand: has joined #RubyOnRails
[10:56:15] roshanavand: has joined #RubyOnRails
[10:56:38] snowy: has joined #RubyOnRails
[11:01:08] pawnbox: has joined #RubyOnRails
[11:04:26] shibabu: has joined #RubyOnRails
[11:05:48] Elion: has joined #RubyOnRails
[11:05:48] Elion: has joined #RubyOnRails
[11:08:46] pawnbox: has joined #RubyOnRails
[11:08:57] Dbugger: has joined #RubyOnRails
[11:08:59] Dbugger: Hello everyone!
[11:12:37] Dbugger: I have a small problem. I was wondering if anyone could help me. It has to do with complex requests between polymorphic associations: http://pastie.org/10670914
[11:13:28] universa1: dbugger: can you please fix your questions, i don't understand them...
[11:14:24] arup_r: humm.. question is not clear..
[11:15:16] arup_r: I understood only products and services are sellable ..rest the question is confusing
[11:15:25] universa1: anyways - fake pseudo code! -- Transactions.group_by("sellable_type, sellable_id").select("sum(amount) as whoop").order("whoop desc").limit(5)
[11:15:50] Dbugger: universa1, what is that you do not understand?
[11:16:16] universa1: dbugger: your questions are syntactically invalid ;)
[11:17:32] universa1: dbugger: what you probably wanted to ask is: how do i get the top 5 producty by amount sold and the actual amount? --- not a native speaker myself and don't want to come across as some kind of grammar-nazi... ...your questions are just "incredibly hard" to read
[11:18:23] Dbugger: universa1, sorry I forgot the models. I put just the migrations: http://pastie.org/10670939
[11:18:39] Dbugger: ok, let me rephrase them..
[11:18:53] Ropeney_: has joined #RubyOnRails
[11:19:49] teclator: has joined #RubyOnRails
[11:20:04] Dbugger: universa1, is this better? http://pastie.org/10670945
[11:20:40] rickmasta: has joined #RubyOnRails
[11:20:43] universa1: dbugger: http://guides.rubyonrails.org/active_record_querying.html#group
[11:21:12] shevy: has left #RubyOnRails: ("I'll be back ... maybe")
[11:22:17] universa1: dbugger: Transaction.group(:sellable_type, :sellable_id).sum(:amount)
[11:22:35] universa1: dbugger: Transaction.group(:sellable_type, :sellable_id).sum(:amount).order(amount: :desc).limit(5)
[11:23:37] universa1: dbugger: Transaction.group(:sellable_type, :sellable_id).sum(:amount).order(amount: :desc).limit(5).each_with_object({}) |(k, v), res|; res[k.sellable] = v; end (guess coding in irc)
[11:24:16] Dbugger: Wouldnt that give you both Products AND services?
[11:24:50] universa1: dbugger: Transaction.where(sellable_type: "Product").group(:sellable_id).sum(:amount) ...
[11:25:16] universa1: dbugger: just guess-coding here in irc... open a rails console and try it.
[11:25:32] Dbugger: I see. And how about the second question?
[11:25:41] Dbugger: the money brought in?
[11:25:47] universa1: dbugger: very similar... adopt the code.
[11:26:01] universa1: dbugger: look at the docs for the sum function.
[11:27:06] Detch: has joined #RubyOnRails
[11:27:07] universa1: sum("amount * price") or alike...
[11:27:22] ElFerna: has joined #RubyOnRails
[11:29:23] Dbugger: can that be done?
[11:29:46] lacrymology: has joined #RubyOnRails
[11:30:09] Dbugger: I dont think that a multyplication can be done inside SUM
[11:32:23] ibouvousaime: has joined #RubyOnRails
[11:34:26] nertzy: has joined #RubyOnRails
[11:35:39] f3ttX]: has joined #RubyOnRails
[11:36:05] roshanavand: has joined #RubyOnRails
[11:36:37] zpe: has joined #RubyOnRails
[11:37:46] cmolenda: has joined #RubyOnRails
[11:38:32] Dbugger: sevenseacat, I did. It did not work
[11:38:41] Dbugger: It told me I was trying to access a fishy column name
[11:39:26] Dbugger: I mispelled something!
[11:41:56] shahidbscs: has joined #RubyOnRails
[11:42:42] blackmesa: has joined #RubyOnRails
[11:48:14] mdw: has joined #RubyOnRails
[11:49:35] quazimod1: has joined #RubyOnRails
[11:50:49] tetraktys: has joined #RubyOnRails
[11:51:25] zpe: has joined #RubyOnRails
[11:56:47] roshanavand: has joined #RubyOnRails
[12:01:05] ruid: has joined #RubyOnRails
[12:01:05] ruid: has joined #RubyOnRails
[12:04:54] artto: has joined #RubyOnRails
[12:05:57] Grundell: has joined #RubyOnRails
[12:05:59] rarruda: has joined #RubyOnRails
[12:07:00] NodeNagant: has joined #RubyOnRails
[12:07:01] NodeNaga_: has joined #RubyOnRails
[12:12:23] roshanavand: has joined #RubyOnRails
[12:15:17] StaticVoid: has joined #RubyOnRails
[12:15:57] NodeNagant: has joined #RubyOnRails
[12:16:47] NodeNaga_: has joined #RubyOnRails
[12:20:09] techsethi: has joined #RubyOnRails
[12:23:03] noodman: has joined #RubyOnRails
[12:27:53] MahaDev: has joined #RubyOnRails
[12:28:07] snowy: has joined #RubyOnRails
[12:28:19] ruid: has joined #RubyOnRails
[12:28:19] ruid: has joined #RubyOnRails
[12:28:32] ElFerna: has joined #RubyOnRails
[12:33:48] tvw: has joined #RubyOnRails
[12:35:29] antgel: Hi good people. Question about minitests. We recently moved from rails 3 to 4 and suffer because the tests (correctly) now run randomly. Lots of them are because of queries to redis leaving things in an uncertain state. Can anyone point me to a best practice here? So much info out there, I'm overwhelmed
[12:35:49] antgel: Should we mock redis and not include it in tests (perhaps making redis integration tests a separate job)?
[12:36:09] antgel: Or should we leave it in and do a better job of cleaning up
[12:36:16] Depili: there are numerous fake-redis gems available
[12:36:18] universa1: write an after filter that cleans out redis
[12:36:22] antgel: I know I'm vague here but grateful for a shove in the right direction
[12:36:37] Depili: and yeah, the other way is to just use teardown to clean the redis
[12:36:37] universa1: but tbh, haven't used redis much... ...and not at all in tests...
[12:36:56] Depili: also use different redis db in the test environment than in development
[12:37:02] d0nn1e: has joined #RubyOnRails
[12:37:13] antgel: We do, every time our CI runs, it runs on pristine redis instance
[12:37:59] antgel: I guess you mean something like https://github.com/guilleiguaran/fakeredis
[12:38:36] antgel: But I don't see how faking redis will help. It's for environments where there is no real redis - not our use case
[12:39:07] antgel: Our problem is that our tests affect each other by virtue of their individual interactions with redis
[12:39:31] jnillo: has joined #RubyOnRails
[12:39:39] speakingcode: has joined #RubyOnRails
[12:40:14] universa1: antgel: make sure your tests clean up / reset redis in the after / teardown stage.
[12:40:23] universa1: antgel: the fake stuff might do that automatically.
[12:42:35] silverdust: Anyone uses magnumCI? My Rspec tests pass but it fails on CI
[12:43:28] mdw: has joined #RubyOnRails
[12:43:38] universa1: silverdust: !anyone
[12:43:38] helpa: silverdust: Nope. No one. Ever. In the history of the world.
[12:45:00] Papierkorb: antgel: That's exactly why I too use fakeredi
[12:45:26] Papierkorb: antgel: You could however do a FLUSHALL in a after{} block
[12:45:47] Papierkorb: As long you don't need redis pub/sub, fakeredis should do what you need though
[12:47:44] krz: has joined #RubyOnRails
[12:47:55] Mediogre: has joined #RubyOnRails
[12:49:12] ubiks: has joined #RubyOnRails
[12:50:09] penne12: has joined #RubyOnRails
[12:50:23] chridal: I have a `has_one :x, through: y` but I need it to respect a scope that sits on a whole other model z
[12:50:47] chridal: Tried something like this: https://gist.github.com/17ce4f4060c1689e6406
[12:50:51] chridal: But that does not seem to work
[12:51:21] chridal: I worded that a bit incorrectly. It doesn't sit on a "whole other model" it sits on y.
[12:51:33] universa1: chridal: actual code? actual error? what does not work? ...
[12:51:35] chridal: Residency has a scope that is called active
[12:51:43] blackmesa: has joined #RubyOnRails
[12:52:18] chridal: universa1: There's no error. It's just that when I call Room.user is will return one where the Residency has `terminated_at` set
[12:52:41] chridal: Room.user should only return a residency where terminated_at is not set. I have a scope for that on Residency called `active`
[12:53:10] chridal: The code that you're seeing there sits on the Room model which has a User through a Residency, but only if the Residency does not have terminated_at set
[12:53:30] chridal: It's hard to post all the code because the models are nested quite deep
[12:54:29] universa1: without having used the block to define new methods... what happens if you do Room.user.active
[12:55:15] universa1: there are only two models involved... ...what is complicated at gisting two files?
[12:55:20] chridal: user_network.access_point.room.residency.user
[12:55:44] chridal: That's the whole chain. The issue is when resolving the user of the user_network which right now returns a user which has a terminated_residency
[12:56:15] ishamo: has joined #RubyOnRails
[12:56:34] universa1: chridal: so copying an example from the docs: has_one :project_manager, -> { where role: 'project_manager' }, class_name: "Person"
[12:56:42] universa1: what happens if you do it the same?
[12:56:45] chridal: universa1: https://gist.github.com/christiandalsvaag/17ce4f4060c1689e6406
[12:57:27] sandstrom: has joined #RubyOnRails
[12:57:46] chridal: universa1: But can I use that syntax with `through: `?
[12:58:07] universa1: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-has_one
[12:58:15] chridal: Gonna be honest with you here; I'm doing some testing on prod.. That's why I am hesitant
[12:58:29] chridal: Haven't got a staging env up right now, and we've got a nasty bug in a running system
[12:58:32] universa1: then copy the code and db to local and try it there...
[13:00:45] chridal: Well that would obviously be better indeed.
[13:01:24] snowy: has joined #RubyOnRails
[13:03:20] antgel: Papierkorb: fakeredis flushes automatically? that's cool!
[13:03:40] Papierkorb: antgel: no, fake redis fakes a redis instance. it's all in-ruby-memory, no real redis running
[13:04:04] antgel: Papierkorb: Is it faster?
[13:04:18] pawnbox: has joined #RubyOnRails
[13:04:25] Papierkorb: antgel: No idea. It just works though. require the file and you're all set up
[13:04:55] antgel: Anyway, continuing our interesting discussion above, people don't want to flush redis after every test because it "contains environment stuff that all our tests need in order to work and to set this up every test would be inefficient"
[13:05:00] antgel: ACTION holds head in hands
[13:05:27] universa1: you can also set up your tests to not run in random order
[13:05:28] Papierkorb: antgel: I'm sorry. Just throw it in a before{} block. Make it a shared example if you need it in multiple examples.
[13:06:08] Papierkorb: antgel: Redis is /fast/. The last thing I'd think about is "is redis fast enough to store this 1KiB of data?"
[13:06:47] pawnbox: has joined #RubyOnRails
[13:07:19] antgel: Papierkorb: Thanks. I'll pass it on. I'm more the devops guy, app devs should be making this work, but I'm getting involved because it's spoiling my quality of life ;)
[13:07:25] arup_r: has joined #RubyOnRails
[13:08:11] riddled: has joined #RubyOnRails
[13:08:17] roshanavand: has joined #RubyOnRails
[13:09:36] pydave6367: has joined #RubyOnRails
[13:11:47] quazimod1: has joined #RubyOnRails
[13:12:07] arup_r: has joined #RubyOnRails
[13:12:11] StaticVoid: all, somewhat off-topic question: I was wondering if I could talk to someone who makes a living as a Rails developer. I'm considering a career change and would like some input. I realize this is not the right forum for this, so if you could msg me with a way I can contact you outside of IRC then that would be greatly appreciated.
[13:15:26] techsethi: has joined #RubyOnRails
[13:16:31] ddv: keep the discussion here, StaticVoid
[13:16:44] ddv: tho it is a bit offtopic
[13:16:52] norc: I think it is relatively on topic.
[13:17:19] norc: Far more rails related than some of the external gem related questions we get here. :-P
[13:17:43] Papierkorb: There's always /query too if not wanting to discuss something publicly
[13:18:05] nyaa: has joined #RubyOnRails
[13:18:09] StaticVoid: ddv: ok - sure. Here's the long and short of it: I'm turning 49 this week (UGH). I've been an ERP developer for 20+ years (business software)
[13:18:21] StaticVoid: Microsoft Dynamics AX. yeah, I know
[13:18:44] StaticVoid: I'm getting frustrated with the garbage I need to work with, and started looking into RoR
[13:19:11] StaticVoid: Did some tutorials, started to try and write some very basic 'apps'
[13:19:59] ddv: StaticVoid: You can easily find a Rails job but don't expect a senior level salary if you're just starting out
[13:20:10] StaticVoid: So the key question is: what would be the best way to get into Rais? I realize I'm not nearly ready yet for any paid work, but how did you guys get into a professional rais job?
[13:20:50] mary5030: has joined #RubyOnRails
[13:21:00] StaticVoid: ddv: absolutely - understand that. Was thinking about some contract work on the side until to get some real experience
[13:21:04] ddv: StaticVoid: I'm 31 but my CS degree got a foot between the door, from there I learned Rails on the job
[13:21:12] rickmasta: has joined #RubyOnRails
[13:21:17] universa1: StaticVoid: hmm... even though i'm not in a professional rails job right now my feeling is, that rails devs are rare and wanted... ...why not simply apply for some job/position and they will teach you ;)
[13:21:42] ddv: StaticVoid: But somelike you as plenty of experience and probably a lot of domain knowledge
[13:22:34] StaticVoid: good points... little side note: I have no formal CS education :) All 'by doing', and yes, It's my domain knowledge that currrently allows me to keep my (well paid) job
[13:22:52] ddv: StaticVoid: so I would just apply for some Rails jobs
[13:23:00] Bloomer: has joined #RubyOnRails
[13:23:08] norc: StaticVoid: Any decent company will be willing to invest into potential candidates. If you have decent programming skills in general - then it just boils down to your soft skills, communication etc.
[13:23:08] ddv: StaticVoid: just be honest that you are not very experienced with Rails but you are with other technologies
[13:23:23] solars: hi, if I've got a Statistics table with associated Properties, is it possible to do a right join starting from the Statistic model? Meaning that there are results if the row in statistics is null?
[13:24:00] roshanav_: has joined #RubyOnRails
[13:24:04] solars: I'm unsure how the result would look like
[13:24:06] norc: StaticVoid: Ive seen so many people change careers completely without an issue. The key factor is usually the ability to communicate, adapt, communicate - and communication.
[13:24:06] StaticVoid: ddv: norc: Much appreciated. That makes sense.
[13:24:54] StaticVoid: norc: Good stuff, I will not have any problems there I'm sure. 20 years of consulting will teach you a thing or 2 about communication :)
[13:26:51] norc: StaticVoid: Which city/area are you from if you dont mind my asking?
[13:27:28] StaticVoid: I live in Canada, about 40 miles west of Toronto. Grew up in Europe though (Netherlands)
[13:27:51] norc: No idea how things are on that entire continent, sorry. :-)
[13:28:05] ddv: StaticVoid: funny I live in the Netherlands and we can't find any Rails developers
[13:28:24] norc: ddv: Any decent ones, or any at all?
[13:28:37] StaticVoid: ddv: Really? Grappig ;) What company do you work for ?
[13:29:25] ElFerna: has joined #RubyOnRails
[13:29:42] ddv: norc: just no one seriously
[13:29:57] atomical: has joined #RubyOnRails
[13:30:05] ddv: StaticVoid: I work for a company that makes software for the agricultural sector
[13:30:29] artto: has joined #RubyOnRails
[13:31:27] rickmasta: has joined #RubyOnRails
[13:31:32] ddv: We hired a junior last year but we need more seniors
[13:31:40] ddv: Almost impossible to find
[13:31:42] StaticVoid: ddv: That's interesting. Any chance they are interested in a very junior, part time developer :)
[13:31:58] sevenseacat: everyone says they want more seniors but few places want to turn the juniors into the seniors
[13:32:15] StaticVoid: sevenseacat: That's what my worry is.....
[13:32:40] Papierkorb: sevenseacat: and/or pay for one?
[13:32:54] sevenseacat: and/or offer proper mentorship for one
[13:33:11] jnillo: has joined #RubyOnRails
[13:33:56] ddv: StaticVoid: http://rovecom.nl/nl/rovecom/vacatures/ontwikkelaar-ruby-on-rails
[13:33:57] pydave6367: has joined #RubyOnRails
[13:34:24] StaticVoid: ddv: Bedankt! I'll check that out for sure.
[13:34:32] ddv: StaticVoid: ok np
[13:34:43] sevenseacat: i have a friend in the Netherlands, he does microsoft stuff though afaik
[13:35:34] StaticVoid: sevenseacat: The MS Dyncamics AX stuff is pretty hot right now. But in my opinion the quality of the software has taken a nose dive
[13:37:02] tibra: has joined #RubyOnRails
[13:37:53] bensarz: has joined #RubyOnRails
[13:39:08] ubiks: has left #RubyOnRails: ()
[13:39:38] ubiks: has joined #RubyOnRails
[13:39:40] ubiks: ddv, NO WAY! It is full! I am amazed how well paid Rails is and still how few of us are (I include myself but just started less than a year ago)
[13:40:22] ubiks: sevenseacat, I liven in The NL for 2,5 years. To me it was surprising most of the ppl ignored who Richard Stallman is and did tons of .Net
[13:41:14] jkamenik: has joined #RubyOnRails
[13:41:44] symbole: has joined #RubyOnRails
[13:41:59] Frem: has joined #RubyOnRails
[13:42:16] doodlehaus: has joined #RubyOnRails
[13:43:04] rvanlieshout: ubiks: hi fellow NL-er :)
[13:43:21] ramortegui: has joined #RubyOnRails
[13:43:26] ddv: invasion of the cheese heads
[13:43:33] Elion: has joined #RubyOnRails
[13:43:34] Elion: has joined #RubyOnRails
[13:43:42] ubiks: rvanlieshout, :D althoug I am back to Spain now. Valencia is the new Silicon Valley, but cheap as hell haha
[13:43:52] StaticVoid: Het barst hier van de Nederlanders! (translation: Tons of Dutch here!)
[13:44:14] rvanlieshout: and finding good rails dev (or rather any) is really hard indeed
[13:44:22] rvanlieshout: hmm. so it seems
[13:44:43] rvanlieshout: ah. so it makes sense i wasn't really aware of that :)
[13:45:01] arup_r: do run it for me.. Let me count my days
[13:45:15] ddv: your days are numbered, arup_r
[13:45:17] ubiks: ACTION turns back to work ;)
[13:45:23] rvanlieshout: !cince Papierkorb
[13:46:21] rvanlieshout: i think i need to stop developing with all those errors
[13:46:26] arup_r: yes my days are acceptable.. may 20 days (minus) .. but all is well
[13:46:58] rubyonrailed: has joined #RubyOnRails
[13:47:20] StaticVoid: rvanlieshout: yup, yup, I'm definitely a n00b here ;)
[13:47:32] arup_r: Papierkorb: yeah, that is why I asked to run it for me. You can't use those weapons for yourself :p
[13:47:43] rvanlieshout: that's ok :) been using rails since then too?
[13:47:47] arup_r: someone else have to do it for you.. hehe
[13:48:10] mdw: has joined #RubyOnRails
[13:48:10] ddv: We still have a few Rails 1.2.3 applications
[13:48:20] ddv: Ruby 1.8.7
[13:48:30] ElFerna: has joined #RubyOnRails
[13:48:30] ddv: I will not touch them :-)
[13:48:39] dstarh: has joined #RubyOnRails
[13:48:43] rvanlieshout: yeah. we only still have those in the hosting-part of our business
[13:48:56] rvanlieshout: gladly not in own management :)
[13:49:19] rvanlieshout: although it boots really fast
[13:50:27] solars: question: having a query like this: https://gist.github.com/solars/64ff476e9ef085006ce5 is it somehow possible to include ar_properties as an actual object instead of only the id?
[13:51:24] rvanlieshout: ooh.. a right join :) tasty
[13:51:43] rvanlieshout: but wouldn't it then be a ArProperty.includes(:statistics)?
[13:52:09] rvanlieshout: or what do you want to fetch here?
[13:52:40] silverdust: MagnumCI fails all my commits even as they pass with RSpec locally. If there's anyone else here that uses magnum please help me know what I'm doing wrong
[13:52:52] solars: well that's basically my question, if rails supports right joins so I get a meaningful result when the model I'm calling it on, is null
[13:53:09] solars: it generates the right queries
[13:53:19] solars: but does not really seem to parse it in a meaningful way
[13:53:20] universa1: silverdust: without using magnumci: error message / trace, failing code -> gist
[13:53:28] rvanlieshout: a right join would be weird here. you're requesting a Statistic, but can have a nil result in that query
[13:53:44] solars: rvanlieshout, well that's what right joins are made for :)
[13:53:48] solars: rvanlieshout, but I thought so.. yes
[13:53:57] roshanavand: has joined #RubyOnRails
[13:54:06] RTG`: H??, mede-NL'ers ;)
[13:54:10] solars: rvanlieshout, I guess I have to reverse it then
[13:54:15] sankaber: has joined #RubyOnRails
[13:54:29] rvanlieshout: in order to select ar properties yes
[13:55:55] solars: rvanlieshout, let me describe what I want to do, I'm unsure if it even works in reverse
[13:56:31] solars: rvanlieshout, this is the query I need to translate: https://gist.github.com/solars/e8c81786fd13e904142f
[13:56:44] thezanke: has joined #RubyOnRails
[13:56:46] rvanlieshout: well.. that query is kinda weird
[13:56:55] rvanlieshout: why start with statistics and right join if you're not even selecting it
[13:57:04] rvanlieshout: AND allowing it to be nil
[13:57:13] solars: I am, impressions is a field of statistics
[13:57:26] solars: it's just a narrowed down example of that query
[13:58:10] rvanlieshout: so ArProperty.includes(:statistics).where('statistics.date < and >, other where').select('ar_properties.*, statistics.impressions')
[13:58:11] solars: it started with a query on statistics only where I just includes(:ar_properties)
[13:58:14] Dreamer3: has joined #RubyOnRails
[13:58:18] rvanlieshout: your arproperty-object then should have a impressions property
[13:58:28] solars: now the requirement is that I have to include ar_properties that do not have statistics
[13:58:41] rvanlieshout: hence the includes and not .joins
[13:58:42] solars: so I thought I can append it with a right join, but I think it only works if I reverse it
[13:59:00] rvanlieshout: it could work with both, but it won't be a arproperty object
[13:59:05] rvanlieshout: it would be a statistics object
[13:59:10] rvanlieshout: with the id from ar_properties
[13:59:14] rvanlieshout: if selected like that
[13:59:37] solars: yes that's what I did in the initial gist
[13:59:46] solars: https://gist.github.com/solars/64ff476e9ef085006ce5
[14:00:03] rvanlieshout: yeah. but you wrote you want the ar property object, right?
[14:00:12] solars: but I could not find out how to get result.first.ar_property to work
[14:00:22] rvanlieshout: then start with ArProperty :)
[14:00:36] sankaber: has joined #RubyOnRails
[14:00:37] solars: well I need both objects in any case haha :)
[14:00:45] solars: I just thought it would work if I append include somehow
[14:00:47] solars: but doesn't
[14:00:50] solars: but on the other hand
[14:00:52] rvanlieshout: if you select('ar_properties.*, statistics.impressions') you could select object.impressions
[14:01:07] rvanlieshout: 1 object can't be both, it can hold both attributes
[14:01:09] solars: I can just use the id as is
[14:01:17] silverdust: universa1: nothing fails without magnumCI
[14:01:20] tetraktys: has joined #RubyOnRails
[14:01:20] solars: it doesn't really matter if it's an object or not I think
[14:01:30] solars: rvanlieshout, yep that's what I figured out
[14:01:33] solars: I will try it like that
[14:01:40] solars: maybe renaming attributes
[14:01:46] silverdust: That's why I'm confused on why it fails
[14:01:47] rvanlieshout: you could also use pluck if you just want an array
[14:02:04] solars: rvanlieshout, I noticed, but then sticked to select for some reason
[14:02:18] rvanlieshout: pluck is fatser and uses less memory if you want an array
[14:02:23] solars: rvanlieshout, thanks for the help meanwhile :) I'll get back to you if I have more problems :)
[14:02:36] solars: hmm yes, in this case, with right joins etc, pluck might be easier
[14:02:45] solars: to just get an array
[14:03:06] solars: they are messing up my whole ORM haha
[14:06:05] blackmesa: has joined #RubyOnRails
[14:09:45] sagui: has joined #RubyOnRails
[14:10:48] joshkovach: has joined #RubyOnRails
[14:14:27] dionysus69: has joined #RubyOnRails
[14:14:55] Ergo: has joined #RubyOnRails
[14:15:21] krz: has joined #RubyOnRails
[14:15:42] Axilla: has joined #RubyOnRails
[14:15:59] ibouvousaime: has joined #RubyOnRails
[14:16:03] Elion: has joined #RubyOnRails
[14:16:27] Axilla: morning all, I'm using monologue blog engine in my rails app to handle our blog and I'm wondering can I add a gem to an engines dependencies without forking it and adding em in the gemspec file?
[14:17:14] Axilla: since the engine itslef is treated like a gem, inside of the app directory i'm able to over write existing controllers and such, but can't seem to do the same to the Gemfile
[14:17:28] universa1: axilla: why don't you add it to whatever app that requires the engine?
[14:17:42] Axilla: how can I make it accessible to the engine?
[14:18:01] universa1: what are you actually trying to do?
[14:18:08] solars: rvanlieshout, one more quick thing, does where('x > ?', 3) also work in .joins?
[14:18:11] Axilla: trying to add boostrap-sass to monologue blog engine
[14:18:28] Axilla: right now i'm having to add bootstrap via CDN
[14:18:33] universa1: axilla: you're overwriting the views of monologue of your app?
[14:18:37] universa1: *in your app
[14:18:40] rvanlieshout: solars: it does, but it means something different
[14:18:47] universa1: axilla: so why can't you use your apps assets?
[14:18:50] rvanlieshout: euh. wait. the ' ?', 4 doesn't
[14:18:55] rvanlieshout: you can use the helper methods for that if you want
[14:18:57] jsrn_: has joined #RubyOnRails
[14:18:57] Axilla: doesn't seem to affect the engine
[14:19:02] solars: rvanlieshout, ah yes I meant the ?
[14:19:03] nyaa: has joined #RubyOnRails
[14:19:09] rvanlieshout: http://api.rubyonrails.org/classes/ActiveRecord/Sanitization/ClassMethods.html#method-i-sanitize_sql_array
[14:19:11] Axilla: i did discover using main_app. to have access to routes
[14:19:16] solars: rvanlieshout, thanks a lot!
[14:19:18] Axilla: i'm probably missing something though.
[14:19:19] universa1: axilla: !code
[14:19:19] helpa: axilla: 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.
[14:19:33] Axilla: there isn't code.. its Gem files.
[14:20:06] Axilla: https://gist.github.com/travisdmathis/0f1174f7773b3ce1238f
[14:20:06] universa1: axilla: https://github.com/jipiboily/monologue/wiki/Customizations#css
[14:20:08] Axilla: here's my gemfile
[14:20:15] Axilla: yea i can do all that no problem
[14:20:25] sevenseacat: you said you've overridden a view and that it cant references your app's assets
[14:20:29] sevenseacat: let's see some evidence of that
[14:20:29] universa1: axilla: so?
[14:20:48] sevenseacat: a view also sounds suspiciously like code
[14:20:59] Axilla: it has nothing to do w/ my views or code..
[14:21:09] Axilla: i want monologue engine to have access to bootstrap-sass gem
[14:21:15] sevenseacat: and given you dont know what it does have to do with, how do you know?
[14:21:21] Axilla: which is installed in my main app, or add bootstrap-sass as a gem to monologues gemfile
[14:21:42] universa1: axilla: how and where are you overwriting the views?
[14:22:20] Axilla: app/views/monologue(then follow their folder structure)
[14:22:22] n1lo: has joined #RubyOnRails
[14:22:28] universa1: axilla: and given the wiki link, a simple require comment at the top of the custom css file seems like all it needs, given that bootstrap-sass is in your main apps gems.
[14:22:31] Axilla: or adding routes to my own views/controllers
[14:22:46] Axilla: thanks, didn't realize i could do that.
[14:22:49] Axilla: that's what I was looking for.
[14:23:32] penne12: has joined #RubyOnRails
[14:24:13] solars: rvanlieshout, ah I just found out, if I use :includes(:ar_properties) and in the select change it to select('ar_properties.id as ar_property_id ... it seems to work
[14:24:16] solars: the initial thing
[14:24:45] cmolenda: has joined #RubyOnRails
[14:25:35] solars: you probably lost track though by now :)
[14:25:38] vasilakisFiL: has joined #RubyOnRails
[14:25:53] vasilakisFiL: what is a good idea to use as etag of a record/collection of records ?
[14:26:29] rvanlieshout: solars: awesome
[14:26:52] Axilla: blech i'm terrible dumb sometimes thanks seven
[14:26:57] Axilla: terribly*
[14:30:28] gaustin: has joined #RubyOnRails
[14:31:09] Elion: has joined #RubyOnRails
[14:31:10] Elion: has joined #RubyOnRails
[14:31:26] gaustin: has joined #RubyOnRails
[14:31:57] jmignault: has joined #RubyOnRails
[14:32:38] blackmesa: has joined #RubyOnRails
[14:33:14] FooMunki: has joined #RubyOnRails
[14:33:52] ubiks: halp! I am getting 'undefined method' with ActiveRecord but the column seems to be there. Error, columns, partial & helper: https://gist.github.com/UbikTransmedia/95d9f976651d4023fd5d
[14:35:16] sevenseacat: ubiks: because you're calling it on a relation, not an instance of your model
[14:35:24] tibra: ubiks: seems like you're calling it on a relation
[14:35:32] sevenseacat: https://gist.github.com/UbikTransmedia/95d9f976651d4023fd5d#file-gistfile1-txt-L4 you have a relation of memberships
[14:36:45] rvanlieshout: no need to be sorry about helping somebody :)
[14:37:42] ubiks: excuse my newbieness
[14:37:55] Parker0: has joined #RubyOnRails
[14:38:12] ubiks: I got a Membership model, wouldn't that be enough?
[14:38:47] rvanlieshout: ubiks: it's not a membership instance, it's a collection of
[14:38:52] ubiks: so I should call Membership.user_status instead, right?
[14:38:54] rvanlieshout: try .first.user_status
[14:39:11] ubiks: oh allright!
[14:39:41] ElFerna: has joined #RubyOnRails
[14:39:48] tibra: ubiks: does your user have the following relation? has_many :clans, through: memberships
[14:40:08] nertzy: has joined #RubyOnRails
[14:40:09] c0defeed: has joined #RubyOnRails
[14:40:16] rvanlieshout: or .first.try(:user_status) or .first.?user_status (ruby 2.3)
[14:40:22] Megamos: has joined #RubyOnRails
[14:40:24] ubiks: where returns a collection, where find_by returns a single match
[14:40:26] rvanlieshout: if that collection could be empty
[14:40:55] ubiks: going to try .where...first now, cause for some reason the helper works now but not properly
[14:40:59] tibra: ubiks: then do user.clans.find(clan).user_statis
[14:41:15] Papierkorb: rvanlieshout: did you mean &. instead of .? ?
[14:41:16] tibra: ubiks: ah wait???sorry
[14:41:36] rvanlieshout: Papierkorb: hmm. could be. the original request was for .?
[14:41:44] rvanlieshout: it's &. indeed
[14:42:36] ubiks: tibra, rvanlieshout, sevenseacat: clan.memberships.where(user_id: user.id).first.user_status works now! Although it should return 3 and it is returning 0. Going to check that...
[14:42:56] rvanlieshout: ubiks: check clan.memberships.where(user_id: user.id).count
[14:42:58] ubiks: clan.memberships.find_by(user_id: user.id).user_status works the same
[14:43:08] rvanlieshout: raise clan.memberships.where(user_id: user.id).count.inspect
[14:43:14] jas02: has joined #RubyOnRails
[14:43:32] tvon: has joined #RubyOnRails
[14:43:54] jnillo: has joined #RubyOnRails
[14:44:45] Elion: has joined #RubyOnRails
[14:44:45] Elion: has joined #RubyOnRails
[14:45:01] ubiks: clan.memberships.find_by(user_id: user.id).inspect raises #<Membership id: 11, user_id: 5, clan_id: 2, user_status: 0, created_at: "2015-12-23 09:34:51", updated_at: "2015-12-23 09:34:51">
[14:45:15] sevenseacat: sounds correct
[14:45:15] ubiks: there it is, am making the wrong question ^___^ clan.id should be 5
[14:45:32] tibra: ubiks: just make sure your instance memberships.where(???).first will always return a record. if its nil and you call user_status it'll blow up
[14:45:48] ubiks: tibra, thanks!
[14:45:54] ubiks: ~from a newbie
[14:47:05] rvanlieshout: ubiks: that's why you could use the .try(:user_status) or &.user_status if you use ruby 2.3
[14:47:11] rvanlieshout: and raise clan.inspect
[14:47:48] pydave6367: has joined #RubyOnRails
[14:48:34] ubiks: allright it is working! I was looking at clan with id #2
[14:48:45] ubiks: ACTION gets ready for the bombing
[14:48:58] ubiks: thanks for the 'raise' lesson
[14:48:59] mdw: has joined #RubyOnRails
[14:50:06] rvanlieshout: a must-know-about tool
[14:50:36] ddv: raise and puts are my favorite tools
[14:50:38] Papierkorb: > must-know-about tool
[14:50:42] Papierkorb: did anyone just mention 'pry' ?
[14:50:49] rvanlieshout: pry isn't one of them :)
[14:50:52] ubiks: yup, yesterdday xD
[14:51:06] ddv: byebug, pry, puts, raise <3
[14:51:31] atmosx: has joined #RubyOnRails
[14:54:20] uris: has joined #RubyOnRails
[14:54:59] peeja: has joined #RubyOnRails
[14:55:07] mag42c: has joined #RubyOnRails
[14:55:23] doodlehaus: has joined #RubyOnRails
[14:55:48] stannard: has joined #RubyOnRails
[14:56:42] ubiks: I use rails c so far
[14:57:09] FailBit: I fail when I raise
[14:57:36] rvanlieshout: a rails with a web console puts you at the right context
[14:57:45] Papierkorb: rails console with pry. binding.pry for debugging stuff
[14:57:57] rvanlieshout: web console or something like better_errors
[14:58:00] FailBit: why do people insist on using binding.pry
[14:58:09] FailBit: just write pry, it's shorter
[14:58:16] ubiks: for some reason the web console does nothing for me
[14:58:20] ubiks: i haven look at it yet
[14:58:24] ubiks: at the reason why
[14:58:40] rvanlieshout: ubiks: yeah. i kind keep using better_errors. i really like that one
[14:58:48] Papierkorb: FailBit: ... You just saved me typing those extra characters each time. Great!
[14:58:50] rvanlieshout: with binding_or_caller gem
[14:59:05] FailBit: Papierkorb: do you know what Kernel#binding is
[14:59:22] Papierkorb: an attribute reader for a Binding object
[14:59:44] FailBit: do you know what binding.pry does?
[14:59:58] Papierkorb: gets the Binding object and calls #pry on it
[15:00:07] voker57: has joined #RubyOnRails
[15:00:07] voker57: has joined #RubyOnRails
[15:00:16] FailBit: binding.eval("pry")
[15:00:21] FailBit: fuck phone keyboards
[15:00:28] rvanlieshout: Papierkorb: i think he (or she) ment what 'binding' is
[15:00:33] ubiks: rvanlieshout, woha... gem "better_errors" gem "better_errors" gem "better_errors" gem "better_errors" gem "better_errors" NOW!!
[15:01:05] rvanlieshout: ubiks: it's awesome, no?
[15:01:44] ubiks: it looks really great
[15:01:50] rvanlieshout: did you add binding_or_caller?
[15:02:01] Papierkorb: FailBit: Ah. It's Object#pry. Is that new?
[15:02:05] ubiks: I am seriosly surprised how there are so many RoR jobs but so few devs xD
[15:02:39] FailBit: I don't think so Papierkorb
[15:02:47] reber: has joined #RubyOnRails
[15:02:56] rubyonrailed: has joined #RubyOnRails
[15:03:24] rvanlieshout: Papierkorb: run binding.method(:pry).source_location
[15:03:29] rvanlieshout: and just method(:pry).source_location
[15:04:17] rvanlieshout: it's Object#pry
[15:04:24] Sylario: has joined #RubyOnRails
[15:04:28] rvanlieshout: # If `self` is a Binding then that will be used to evaluate expressions;
[15:04:29] rvanlieshout: # otherwise a new binding will be created.
[15:04:58] ubiks: rvanlieshout, I am just breaking the project on purpouse. Thank you very much, seriously. I already love better_errors!
[15:05:29] ubiks: and it has an integrated console
[15:05:34] ubiks: motherofdog
[15:05:46] speaking1ode: has joined #RubyOnRails
[15:05:49] rvanlieshout: ubiks: also note that if you click on some point in the stack trace the console context switches to there
[15:05:58] rvanlieshout: Papierkorb: binding is the context in which your expressions are executed
[15:06:03] mary5030: has joined #RubyOnRails
[15:06:25] FailBit: what happens if you execute a return inside a binding?
[15:06:26] rvanlieshout: and i'm not sure if creating a new binding will use the existing avilable vars, but i would assume so since FailBit just uses pry
[15:06:35] ubiks: this seems like a part of the bundle in Rails 5
[15:06:41] ubiks: or something like that
[15:06:46] FailBit: do you get a non-local jump to the defining context?
[15:06:56] rvanlieshout: ubiks: don't they use web_console?
[15:07:28] rvanlieshout: ubiks: anyway. the console really helps in just poking around at the point where just placed that raise.. just to see what you have
[15:07:28] ubiks: rvanlieshout, I mean they should switch to better_errors xD
[15:07:32] PedramT: has joined #RubyOnRails
[15:08:21] Sylario: I am trying to understand a strange way to do routes and controller concerns look at the tickets namespace and this is the controllers : https://github.com/ivaldi/brimir/blob/master/config/routes.rb
[15:08:28] Sylario: https://github.com/ivaldi/brimir/tree/master/app/controllers/tickets
[15:08:35] Flipez: has joined #RubyOnRails
[15:08:45] blackmesa: has joined #RubyOnRails
[15:08:59] Sylario: The destroy action is extractted, but is it really necessary?
[15:09:19] rvanlieshout: no. this feels over complicated
[15:10:26] pydave6367: has joined #RubyOnRails
[15:10:50] rvanlieshout: time to go. back tomorrow
[15:13:53] hobodave: has joined #RubyOnRails
[15:14:27] tubbo: lol free work-from-home day since the building is chock full of CO2
[15:14:41] ql6wlld: has joined #RubyOnRails
[15:15:00] mrfoto: has joined #RubyOnRails
[15:16:25] sarink: has joined #RubyOnRails
[15:16:58] speakingcode: has joined #RubyOnRails
[15:17:12] ddv: how is that free
[15:17:25] ddv: also what did you do tubbo
[15:17:45] tubbo: ddv: because i don't have to be at the office?
[15:17:57] tubbo: underground fires in old buildings ftw
[15:17:59] ddv: yeah but you still have to work
[15:18:06] tubbo: yeah, barely
[15:18:33] ddv: well I was working from home too
[15:23:22] mary5030: has joined #RubyOnRails
[15:23:46] norc: I have a m:n join table "loop_connections_telephone_numbers" - Oracle won't let me use more than 30 characters. Suggestions?
[15:23:49] atomical_: has joined #RubyOnRails
[15:24:11] sandstrom: has joined #RubyOnRails
[15:25:16] fryguy: lp_cnnctns_tlphn_nmbrs
[15:26:11] norc: On a serious note, I have a feeling this just forces me to use another name and then has_many :through
[15:26:53] norc: Oh nevermind, seems like habtm has class_name too.
[15:26:53] reckoner: has joined #RubyOnRails
[15:27:03] aadam21: has joined #RubyOnRails
[15:27:07] tubbo: norc: you can also use has_many :through to control the name of the table a little easier
[15:27:14] jvanbaarsen: has joined #RubyOnRails
[15:27:26] tubbo: HABTM is really just a "shortcut" for what HMT already provides, just less code.
[15:27:43] jobewan: has joined #RubyOnRails
[15:28:35] adavia: has joined #RubyOnRails
[15:29:52] ddv: the style guide recommends using has_many :through anyways
[15:29:57] ddv: so use it
[15:30:01] Bloomer: has joined #RubyOnRails
[15:31:01] tubbo: ddv: really? where?
[15:31:22] roshanavand: has joined #RubyOnRails
[15:31:48] ddv: tubbo: https://github.com/bbatsov/rails-style-guide#has-many-through
[15:32:03] mrtomme: has joined #RubyOnRails
[15:32:20] sevenseacat: I dislike people that make lots of little HMT models for no reason
[15:32:34] sevenseacat: I would use the appropriate association type for the job
[15:33:01] tubbo: sevenseacat: yeah fuck those people for paying attention to people like you and me ;)
[15:33:20] tubbo: problem with HABTM is it's somewhat difficult (in my experience) to refactor to HMT when you need to
[15:33:22] twilling: has joined #RubyOnRails
[15:33:32] sevenseacat: I once refactored a single app and removed 11 of those little models
[15:33:41] crystalmaiden: has joined #RubyOnRails
[15:33:45] sevenseacat: just cluttering up space
[15:33:46] akshat: has joined #RubyOnRails
[15:33:46] f3ttX]: has joined #RubyOnRails
[15:34:37] crystalmaiden: has joined #RubyOnRails
[15:34:49] rory096: has joined #RubyOnRails
[15:35:03] jnylen: has joined #RubyOnRails
[15:35:33] crystalmaiden: has joined #RubyOnRails
[15:36:04] atomical: has joined #RubyOnRails
[15:36:35] crystalmaiden: has joined #RubyOnRails
[15:36:44] stannard_: has joined #RubyOnRails
[15:37:30] Megamos: has joined #RubyOnRails
[15:37:43] crystalmaiden: has joined #RubyOnRails
[15:38:43] alex88: has joined #RubyOnRails
[15:38:43] tubbo: ddv: oh *that* style guide
[15:38:45] crystalmaiden: has joined #RubyOnRails
[15:38:59] tubbo: thought you were talking about the rails guides for some reason haha
[15:39:13] tubbo: didn't even know that part of the style guide existed, hmm
[15:39:52] crystalmaiden: has joined #RubyOnRails
[15:40:12] atm: has joined #RubyOnRails
[15:40:50] crystalmaiden: has joined #RubyOnRails
[15:42:06] crystalmaiden: has joined #RubyOnRails
[15:43:22] crystalmaiden: has joined #RubyOnRails
[15:44:28] crystalmaiden: has joined #RubyOnRails
[15:45:12] chadhs: has joined #RubyOnRails
[15:45:22] Sawbones: has joined #RubyOnRails
[15:45:46] crystalmaiden: has joined #RubyOnRails
[15:46:47] robbyoconnor: has joined #RubyOnRails
[15:46:49] crystalmaiden: has joined #RubyOnRails
[15:46:56] robbyoconnor: has joined #RubyOnRails
[15:47:31] Megamos: has joined #RubyOnRails
[15:47:56] crystalmaiden: has joined #RubyOnRails
[15:49:06] crystalmaiden: has joined #RubyOnRails
[15:50:07] crystalmaiden: has joined #RubyOnRails
[15:50:49] FailBit: TIL rails style guide
[15:51:17] pydave6367: has joined #RubyOnRails
[15:52:12] sarink: has joined #RubyOnRails
[15:52:18] FailBit: I already do all this...
[15:52:34] arup_r: has joined #RubyOnRails
[15:53:19] rdavila: has joined #RubyOnRails
[15:53:28] FailBit: the routes stuff is crap
[15:53:36] FailBit: you should use match for 404 pages
[15:53:54] FailBit: deep is fine for ???3 levels
[15:53:54] tubbo: FailBit: match is deprecated, so you're wrong.
[15:54:44] tubbo: and an exceptions/errors app to catch 404s
[15:54:48] snowy: has joined #RubyOnRails
[15:55:14] FailBit: I'll patch the routes helper to re-add it because that's stupid
[15:55:26] centrx: has joined #RubyOnRails
[15:57:04] ornerymoose: has joined #RubyOnRails
[15:58:31] tubbo: FailBit: the style guide is mostly for teams, you're a lone wolf (horse?), so it doesn't really matter for you.
[15:58:43] FailBit: I'm on a team of 3 people
[15:58:44] tubbo: but when you're on a team, it's a pain in the dick to have to constantly be chasing people's shitty code around
[15:59:08] FailBit: the other 2 people come from C++/Java backgrounds
[15:59:18] FailBit: so they write clusterfucks in ruby
[15:59:28] gregf_: has joined #RubyOnRails
[15:59:40] tubbo: FailBit: then you *definitely* should implement this style guide. what most teams do is fork it and edit it to what they want
[15:59:42] atomical_: has joined #RubyOnRails
[15:59:49] tubbo: FailBit: but FWIW, you should read it a little more carefully. it says: "Don't use match to define any routes unless there is need to map multiple request types among [:get, :post, :patch, :put, :delete] to a single action using :via option."
[15:59:54] Grundell: has joined #RubyOnRails
[15:59:55] tubbo: so you *can* use match if you need to, but try not to.
[16:00:05] FailBit: it's the only match in the routes file
[16:00:17] FailBit: unspecified => 404
[16:00:19] tubbo: in your case (catching 404s or other errors on all http verbs), seems like the best approach
[16:01:00] tubbo: FailBit: don't you wish there was a way to "export" entire error pages, so you could just let the web server handle them?
[16:01:01] tubbo: i kinda do
[16:01:19] tvw: has joined #RubyOnRails
[16:01:34] tubbo: because you either have to choose between letting the rails app handle errors (bleh!) or basically render a page and copy the HTML out yourself, then paste it into a 404.html file and make sure to keep it up-to-date when your CSS changes
[16:05:29] riddled: has joined #RubyOnRails
[16:05:36] RegulationD: has joined #RubyOnRails
[16:07:40] chadhs: has joined #RubyOnRails
[16:08:01] _Tariq: has joined #RubyOnRails
[16:08:12] aegis3121: has joined #RubyOnRails
[16:08:52] jnillo: has joined #RubyOnRails
[16:10:10] pydave6367: has joined #RubyOnRails
[16:10:22] _Tariq: has joined #RubyOnRails
[16:13:39] jnillo: has joined #RubyOnRails
[16:13:49] FailBit: tubbo: we actually can't... not really
[16:14:05] FailBit: unless we change our 404 page drastically
[16:14:14] tubbo: you can't what?
[16:14:16] arup_r: has joined #RubyOnRails
[16:14:23] FailBit: right now it fits inside the app layout
[16:14:33] FailBit: and the app layout speicifes the css theme
[16:14:37] mdw: has joined #RubyOnRails
[16:14:38] FailBit: (light or dark)
[16:15:29] tubbo: makes sense
[16:16:04] FailBit: https://derpibooru.org/pages/404
[16:16:17] codepete: has joined #RubyOnRails
[16:17:08] tubbo: FailBit: agreed :P i was about to rail on you for it
[16:17:16] tubbo: how u gon take 8ms to show me a 404 page
[16:17:26] tubbo: it was actually way more than that
[16:17:34] tubbo: 8ms is just the appserver time, the browser time was worse
[16:17:49] momomomomo: has joined #RubyOnRails
[16:17:50] tubbo: but that's probably because i'm on a VPN and in a coffeeshop, so my internet isn't that great.
[16:18:14] tubbo: FailBit: why isn't derpibooru open-source?
[16:18:47] chipotle: has joined #RubyOnRails
[16:19:27] disgrntld: has joined #RubyOnRails
[16:20:19] arup_r: My rails views/pages are loading very slowly in development and production environment very slowly.. I tried http://stackoverflow.com/a/15336299 .. but nothing improved.. In such cases from where I need to start debuging.. ?
[16:20:30] build22: has joined #RubyOnRails
[16:20:40] arup_r: What could be the reasons..?
[16:20:42] dopie: has joined #RubyOnRails
[16:20:49] build22: has left #RubyOnRails: ()
[16:20:57] solars: is there a way in rails to add conditions to joins via .includes or .joins? e.g. for sql like join a on a.id=b.id AND COND=VALUE?
[16:21:41] jvanbaarsen: has joined #RubyOnRails
[16:22:15] tubbo: arup_r: config.assets.debug shouldn't be set to true in dev...
[16:23:42] arup_r: ok. there are many SO answers asked to do so.. but I tried and no luck!
[16:24:41] arup_r: solars: http://api.rubyonrails.org/classes/ActiveRecord/SpawnMethods.html#method-i-merge
[16:25:42] jvanbaarsen: has joined #RubyOnRails
[16:26:15] solars: arup_r, I'm not sure if I see how it is related
[16:27:35] Nikke: has joined #RubyOnRails
[16:27:38] solars: arup_r, when using it with join in this example, you mean that it restrics the join table through the merged query?
[16:28:18] smathy: has joined #RubyOnRails
[16:28:20] tubbo: arup_r: you restarted your server, right?
[16:28:32] arup_r: ok, I thought you have a scope already and you want to merge some more with it.. if it is not what you asked, ignore the link
[16:28:35] arup_r: tubbo: yes..
[16:28:40] momomomomo_: has joined #RubyOnRails
[16:28:41] solars: arup_r, I'm not sure :)
[16:28:59] arup_r: solars: then show the actual code..
[16:29:09] solars: I mean the difference between a condition in .where vs appended to join, in sql
[16:30:32] arup_r: where is for filtering, and joins is for cross-product.. both are different thing.. so you can ofcourse filters your join queries..
[16:30:55] arup_r: tubbo: What do you use for such performance fixing thing.. I got to know https://www.nateberkopec.com/2015/08/05/rack-mini-profiler-the-secret-weapon.html
[16:31:04] tubbo: solars: i think the way you do that is e.g. joins(:foos).where(foos: { bar: true })
[16:31:07] arup_r: may be I should use it to find out the placea
[16:31:10] tubbo: in that case you may not actually need the joins()
[16:31:55] tubbo: arup_r: NewRelic. can't be bothered to do performance tuning in development..
[16:31:57] chelbs: has joined #RubyOnRails
[16:31:58] solars: tubbo, that doesn't work, it results in a where conditions
[16:31:59] tubbo: so it's only for staging/prod
[16:32:20] dideler: has joined #RubyOnRails
[16:32:20] tubbo: solars: wait how does that turn into SQL for you?
[16:32:34] arup_r: ahh.. my both are slow.. so something I have in my app only..
[16:32:43] solars: tubbo, if you do it like this, it joins, and then does a restriction on the overall result
[16:32:44] ubiks: a link does not respond when I click, but it does when I do open it in a new tab -__- wtf?
[16:32:57] solars: tubbo, but if you use the condition on join, it does it on the joined table
[16:33:01] solars: if that is understandable
[16:33:11] tubbo: solars: ahhh i see what you mean, ok
[16:33:24] arup_r: ubiks: how did you create the link code.. may be some JS .. etc
[16:33:36] tubbo: solars: yeah what i did was a simple Model.where(joined_model: { attribute: 'value' }) and didn't bother with the joins() last time i tried this.
[16:33:56] ubiks: arup_r, link_to 'Stop aiming', unlock_user_path(:id => current_user.id, :aimed_id => params[:id], :type => @item_type), data: { confirm: "Are you sure you want to stop aiming #{@user.name}?" }
[16:34:25] arup_r: oh,, nothing fancy..:) dunno then
[16:34:25] tubbo: arup_r: probably. you got a lot of like ERb-compiled JS or something?
[16:35:06] arup_r: yes, I do have.. My vendors/ folder are overwhelmed..
[16:35:22] tubbo: arup_r: you ever think that might be the issue? :P
[16:35:33] arup_r: no they are not ERb.. but plaing .js or .coffee
[16:35:43] arup_r: tubbo: I didn't ..
[16:36:07] tubbo: arup_r: well first of all, the way rails loads assets in dev is not by way of the single application.{js|css}, rather, it loads each individual JS in a <script> tag
[16:36:07] solars: tubbo, jep, the difference is basically: select * from fu <join> where A and B vs select * from fu <join> and B where A
[16:36:17] tubbo: so if you have like 300 scripts in there, it's gonna take a minute to request each one individually and load the files.
[16:36:18] solars: not sure how to do this in rails though
[16:36:53] tubbo: solars: if you can't do it with AR syntax, you can always drop down to SQL in the joins() method
[16:37:07] arup_r: tubbo: hmm.. but I am kinda sad, because my production/dev both slow loads each view..
[16:37:17] ornerymoose: I have a form partial, one for creating tickets and one for deleting tickets. What would be the best way to add a different CSS class for each?
[16:37:28] ornerymoose: (for the submit button, that is)
[16:37:34] Detch: has joined #RubyOnRails
[16:37:43] tubbo: solars: so where that <join> is you can just manually do joins('whatever ON something WHERE thing = something_else') and that interpolates the string into where <join> is in your example up there.
[16:37:50] solars: tubbo, of course, but then I lose nice helpers like (date: (startdate..enddate)) to check for ranges.. :) or do you know if I can somehow use this in strings as well?
[16:37:51] arup_r: tubbo: The app is underwork .. just 1 month.. and it is started slowing.. So. I probably injected some slow thing, which I didn't know
[16:38:36] stannard: has joined #RubyOnRails
[16:38:37] tubbo: solars: Squeel extends AR's DSL for situations like this, but it's a little error-prone and it does too much monkey-patching for me. way i see it, it's much easier to debug hardcore SQL when you are actually writing SQL
[16:38:47] arup_r: the same form for both, 2 forms for 2 actions.. ornerymoose ?
[16:39:08] Grundell: has joined #RubyOnRails
[16:39:09] solars: tubbo, yes of course, I'm just curious how far I could get with the AR orm
[16:39:25] solars: tubbo, it would be a lot easier to do it with a plain sql query btw :)
[16:39:29] arup_r: solars: As far as you want
[16:39:46] solars: arup_r, well if there is no other way :)
[16:39:47] ornerymoose: well, its one form (ie, views/tickets_form.html.erb). Currently im using en.yml to change the text on each submit button, ie ???Create a Ticket??? and ???Update Ticket???
[16:39:49] tubbo: arup_r: i mean do you even know what is causing the page to load slowly? have you looked at the logs to see how long it takes for assets to come back?
[16:39:49] arup_r: If AR stopping you.. then look Arel ( I still don't get it )
[16:39:58] tubbo: Arel isn't going to help you here
[16:40:05] ornerymoose: and sorry i meant tickets/_form.html.erb
[16:40:11] arup_r: saying generally :)
[16:40:40] tubbo: solars: AR definitely does a lot for you, but it's not a complete representation of SQL and it's not supposed to be. AR assumes that your app isn't chock full of complex joins, basically.
[16:41:12] tubbo: ornerymoose: in theory you could set the class to controller.controller_name
[16:41:34] solars: arup_r, never used arel, but it seems it can do much more than rails for joins, will give it a try
[16:41:43] solars: tubbo, of course, yeah
[16:42:09] tubbo: pretty sure Arel is baked into AR
[16:42:41] tubbo: so i think you can just start using those methods
[16:42:52] arup_r: tubbo: I saw, only devtool inspections.. request time were too much.. I will check logs again and get back to you..
[16:42:54] solars: tubbo, arup_r does anyone of you know if I can use helpers like where(fu: array) that generate sql IN (array) outside a relation? so I can just append it to the joins() string?
[16:42:54] disgrntld: has left #RubyOnRails: ()
[16:43:02] solars: tubbo, yeah
[16:43:02] pydave6367: has joined #RubyOnRails
[16:43:06] solars: tubbo, that would be nice
[16:43:12] tubbo: solars: yes you can
[16:43:28] xardion: has joined #RubyOnRails
[16:43:30] tubbo: solars: where(something: [1,2,3]) becomes "WHERE something IN (1,2,3)"
[16:43:31] arup_r: solars: you need to use `.scope` and then chain those scopes..
[16:43:36] _HombreTepic: has joined #RubyOnRails
[16:43:39] matthewd: solars: I'm still unclear on why you need to do it at all... I'd expect putting it in the where clause to be fine
[16:44:13] solars: tubbo, I meant only the contents of the where(), I cannot use the where itself
[16:45:20] solars: matthewd, as said, there is a difference between select * from a join b on a.id=b.id where A and B vs select * from a join b AND B where A
[16:45:36] The_Phoenix: has joined #RubyOnRails
[16:45:40] solars: the join clause itself acts like a where
[16:45:59] solars: I don't know how it is called though, which complicates things a bit
[16:47:06] ubiks: i am passing 3 parameters to a link_to path but it only seems to send two.. hurm? why?
[16:47:36] matthewd: solars: For an inner join? That doesn't sound right to me.
[16:49:15] solars: matthewd, I'm using left/right joins here, an example for what I'm talking about: http://www.sqlteam.com/article/additional-criteria-in-the-join-clause
[16:49:52] jtperreault: ubiks: what does the link_to code look like?
[16:52:03] celly: has joined #RubyOnRails
[16:52:55] matthewd: solars: Well, as you've managed to carefully keep that secret for the entire conversation so far, I'll leave you to it.
[16:54:28] solars: matthewd, it does not really make a difference for my question
[16:54:32] celly: has joined #RubyOnRails
[16:56:05] IFrank00: has joined #RubyOnRails
[16:57:51] ubiks: jtperreault, link_to 'Stop aiming', unlock_user_path(:id => current_user.id, :aimed_id => params[:id], :type => @item_type), data: { confirm: "Are you sure you want to stop aiming #{@user.name}?"
[16:58:12] ubiks: it just seems to take the 1st two
[16:58:33] tubbo: you didn't override link_to in like a helper did you?
[16:58:43] tubbo: i did that once when i was starting out lol...got me so mad
[16:59:36] Elion: has joined #RubyOnRails
[16:59:36] Elion: has joined #RubyOnRails
[16:59:38] yardenbar: has joined #RubyOnRails
[16:59:39] ubiks: how could I do that? there are some helpers that use @item_type but none of them uses link_to
[17:00:53] ubiks: but when I check the logs...
[17:00:53] ubiks: Started GET "/users/5/lock/7" for 127.0.0.1 at 2016-01-05 17:46:13 +0100
[17:00:54] ubiks: Processing by UsersController#lock_user as HTML
[17:00:54] ubiks: Parameters: {"id"=>"5", "aimed_id"=>"7"}
[17:00:54] ubiks: User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT
[17:00:54] ubiks: 1 [["id", 5]]
[17:01:17] matthewd: ubiks: !gist
[17:01:17] helpa: ubiks: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[17:01:44] ubiks: ^^!!!!!!!!!
[17:02:05] centrx: You can't have my codes!!!
[17:02:29] adre: has joined #RubyOnRails
[17:03:55] FailBit: <tubbo> FailBit: why isn't derpibooru open-source?
[17:04:00] FailBit: because lead coder guy said no
[17:04:05] Scripore: has joined #RubyOnRails
[17:04:07] tubbo: FailBit: lame
[17:04:14] FailBit: I keep telling him "f**k you when will we be open source"
[17:04:38] Jamo_: has joined #RubyOnRails
[17:05:04] ubiks: https://gist.github.com/UbikTransmedia/eb8397f046674fc29e2a
[17:05:07] p|p: has joined #RubyOnRails
[17:05:08] tubbo: usually projects like that are, just to encourage open collaboration
[17:05:09] FailBit: but since I didn't sign an NDA or anything
[17:05:13] FailBit: feel free to ask me for code
[17:05:18] ubiks: gisted it all, sorry; the thing is that it does not seem to take 3 params but only two
[17:05:26] ubiks: hence it does not write to the db
[17:05:27] tubbo: FailBit: i've never signed an NDA for a project that actually paid me/got started.
[17:05:33] tubbo: so an NDA is a huge red flag to me
[17:05:50] tubbo: NDA: Never Deployed Application
[17:06:52] vasilakisFiL: tubbo could you elaborate ?
[17:07:43] polishdub_: has joined #RubyOnRails
[17:08:59] centrx: Lawyers tend to drag down projects and delay them for months
[17:10:43] FailBit: huh, kiwiirc got a makeover
[17:11:07] FailBit: don't sign NDAs
[17:11:15] ElFerna: has joined #RubyOnRails
[17:11:29] FailBit: for me, past NDAs have been pain and failed projects
[17:11:34] trautwein: has joined #RubyOnRails
[17:12:10] lacuna: has joined #RubyOnRails
[17:12:32] momomomomo: has joined #RubyOnRails
[17:13:14] build22: has joined #RubyOnRails
[17:13:26] fox_mulder_cp: oh.. nda. me smile
[17:13:50] polishdub: has joined #RubyOnRails
[17:13:59] fox_mulder_cp: all project, where HR needs nda for me was crazy, idiotic and failed too (
[17:14:11] jtperreault: ubiks: what about that link in the routes file, what does that look like?
[17:14:46] ubiks: jtperreault, i am testing a new thing... it happened i was passing the param only to the destroy link
[17:14:49] ubiks: demn i feel so noob
[17:15:16] fox_mulder_cp: exept PKI infrastructure, personal certificates center for electronic government, but its infrasturicture is very unsecure and dab
[17:15:42] nertzy: has joined #RubyOnRails
[17:15:55] FailBit: the infrastructure should be public, the keys should be private
[17:16:44] ascarter: has joined #RubyOnRails
[17:16:46] jtperreault: ubiks: ok, sounds good.
[17:16:51] FailBit: example: https://github.com/cloudflare/cfssl
[17:18:05] fox_mulder_cp: FailBit: hw and soft infrastructure. NDA, yep. becouse signink keys, etc
[17:19:36] ubiks: jtperreault, nope... it was already there. This is strange...
[17:20:20] ubiks: and this is how my routes look like: https://gist.github.com/UbikTransmedia/81ccaddac23d39de1384
[17:21:11] jtperreault: ubiks: ok, so looks like that route is not expecting the third param you are trying to pass in.
[17:21:45] jtperreault: ubiks: it's not set up to in the routes file
[17:22:07] El3ktra: has joined #RubyOnRails
[17:22:08] El3ktra: has joined #RubyOnRails
[17:22:12] ubiks: oh allright, i must make it explicit
[17:22:18] jtperreault: ubiks: correct
[17:22:18] ubiks: in the url
[17:22:26] mdw: has joined #RubyOnRails
[17:22:34] ubiks: it is not handled like ?a=1
[17:23:29] loren: has joined #RubyOnRails
[17:24:06] reckoner: anyone ever heard of unit testing controllers re: rspec?
[17:24:15] reckoner: isn't this just a functional spec.
[17:24:26] FailBit: why would you unit test a controller
[17:24:30] FailBit: that is utterly bizarre
[17:24:41] reckoner: yeah, i found it in a post form pivotal.
[17:24:43] jtperreault: ubiks: you're using the rails helper "unlock_user_path()" to construct the URL, and that path right now is only setup to take those 2 params
[17:24:47] ashishsingh173: has joined #RubyOnRails
[17:25:22] jtperreault: ubiks: so, no, it does not pass it in like ?a=1. it creates the URL like you have in your routes file, users/:id/unlock/:aimed_id
[17:26:19] polishdub_: has joined #RubyOnRails
[17:28:29] jtperreault: ubiks: you can add the query string though, if needed
[17:28:49] ubiks: jtperreault, i think i have solved it although i need to repair some names
[17:28:51] lacuna: has joined #RubyOnRails
[17:28:55] peeja: has joined #RubyOnRails
[17:28:55] ubiks: but i think it will work now :)
[17:29:39] sol: has joined #RubyOnRails
[17:29:49] yardenbar: has joined #RubyOnRails
[17:30:31] jtperreault: ubiks: ok, sounds good. full link_to docs are here: http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to
[17:31:00] jtperreault: ubiks: there is a bit on passing query params like ?a=1 in
[17:31:01] ubiks: jtperreault, thanks!
[17:31:13] jtperreault: ubiks: sure, you're welcome
[17:31:14] mary5030: has joined #RubyOnRails
[17:31:15] peeja: has joined #RubyOnRails
[17:31:19] ubiks: although :this_way is pretty eleganto
[17:37:44] momomomomo: has joined #RubyOnRails
[17:39:25] sininen: has joined #RubyOnRails
[17:43:30] trautwein: has joined #RubyOnRails
[17:43:30] daivyk: has joined #RubyOnRails
[17:45:07] fwaokda: is it possible to specify a "NO LOCK" on a active query?
[17:45:56] tubbo: vasilakisfil: i just mean that i've never signed an NDA for a project, and then had that project complete.
[17:46:21] vasilakisFiL: but have you ever signed an NDA for a project at all? :P
[17:46:49] vasilakisFiL: I guess you have, it's just isn't clear from your sentence
[17:46:59] treehug88: has joined #RubyOnRails
[17:47:08] stannard: has joined #RubyOnRails
[17:48:33] chipotle: has joined #RubyOnRails
[17:48:58] safety_cut: has joined #RubyOnRails
[17:50:15] tubbo: vasilakisfil: the context afterwards indicates that i have, otherwise how would i know that an NDA never amounts to anything?
[17:51:21] djbkd: has joined #RubyOnRails
[17:52:02] srinidhi: has joined #RubyOnRails
[17:53:42] build22: has joined #RubyOnRails
[17:55:29] greengriminal: has joined #RubyOnRails
[17:57:58] kzsh: has joined #RubyOnRails
[17:58:02] shibabu: has joined #RubyOnRails
[17:59:26] reckoner: has left #RubyOnRails: ()
[18:00:49] shahidbscs: has joined #RubyOnRails
[18:02:03] chadhs: has joined #RubyOnRails
[18:03:08] lacuna: has joined #RubyOnRails
[18:03:09] lacuna: has joined #RubyOnRails
[18:03:14] aegis3121: has joined #RubyOnRails
[18:05:13] roshanavand: has joined #RubyOnRails
[18:06:17] celly: has joined #RubyOnRails
[18:08:35] aadam21: has joined #RubyOnRails
[18:11:45] sleungcy: has joined #RubyOnRails
[18:13:10] chouhoulis: has joined #RubyOnRails
[18:14:30] brendan-: has joined #RubyOnRails
[18:16:33] dbugger_: has joined #RubyOnRails
[18:21:47] ornerymoose: has joined #RubyOnRails
[18:22:23] guacamole: has joined #RubyOnRails
[18:22:56] ascarter: has joined #RubyOnRails
[18:25:22] Grundell: has joined #RubyOnRails
[18:28:11] arBmind: has joined #RubyOnRails
[18:29:02] PedramT: has joined #RubyOnRails
[18:30:19] Encapsulation: has joined #RubyOnRails
[18:31:17] Grundell_: has joined #RubyOnRails
[18:31:36] safety_cut: has joined #RubyOnRails
[18:32:19] RegulationD: has joined #RubyOnRails
[18:32:32] rogue_koder: has joined #RubyOnRails
[18:35:17] Grundell: has joined #RubyOnRails
[18:38:00] ror15: has joined #RubyOnRails
[18:38:22] baweaver: has joined #RubyOnRails
[18:38:58] lemur: has joined #RubyOnRails
[18:39:41] juddey: has joined #RubyOnRails
[18:40:01] lemur: has joined #RubyOnRails
[18:40:37] Grundell: Im having some trouble with a wpdb query and was woundering if someone is able to help me with it ?
[18:42:12] FooMunki: has joined #RubyOnRails
[18:42:19] Gmi: has joined #RubyOnRails
[18:42:37] Macaveli: has joined #RubyOnRails
[18:42:56] tubbo: Grundell: what, like a wpdb?
[18:44:29] tubbo: Grundell: sorry, like a wordpress db*
[18:44:35] mary5030: has joined #RubyOnRails
[18:45:20] Grundell: has joined #RubyOnRails
[18:46:57] Grundell: has joined #RubyOnRails
[18:48:48] Pazician: has joined #RubyOnRails
[18:48:49] pipework: Grundell: Gist up what you got.
[18:48:52] pipework: Grundell: !gist-usage
[18:48:52] helpa: Grundell: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[18:50:01] momomomomo: has joined #RubyOnRails
[18:51:29] craysiii: has joined #RubyOnRails
[18:52:02] akshat: has joined #RubyOnRails
[18:52:17] build22: has joined #RubyOnRails
[18:54:18] baweaver: has joined #RubyOnRails
[18:55:57] guacamole: has joined #RubyOnRails
[18:57:23] blackmesa: has joined #RubyOnRails
[18:58:08] Hans267: has joined #RubyOnRails
[18:59:03] manfrin: has joined #RubyOnRails
[19:00:00] toydestroyer: has joined #RubyOnRails
[19:00:49] Pazician: has joined #RubyOnRails
[19:05:55] meoblast001: has joined #RubyOnRails
[19:07:40] lacrymol1gy: has joined #RubyOnRails
[19:07:58] tvw: has joined #RubyOnRails
[19:08:56] nertzy: has joined #RubyOnRails
[19:12:41] lacrymology: has joined #RubyOnRails
[19:13:35] nunchuck: has joined #RubyOnRails
[19:14:34] ornerymoose_: has joined #RubyOnRails
[19:15:02] pawnbox: has joined #RubyOnRails
[19:17:10] manfrin_: has joined #RubyOnRails
[19:17:40] pawnbox: has joined #RubyOnRails
[19:20:06] chipotle: has joined #RubyOnRails
[19:20:18] solars: has joined #RubyOnRails
[19:21:23] solars: does anyone know how the feature that allows me to use array as condition params, like in .where(id: [1,2,3]) is called?
[19:23:29] cmolenda: has joined #RubyOnRails
[19:24:10] guacamole: has joined #RubyOnRails
[19:24:38] stannard: has joined #RubyOnRails
[19:24:54] cmolenda_: has joined #RubyOnRails
[19:25:12] stannard: has joined #RubyOnRails
[19:26:30] NodeNaga_: has joined #RubyOnRails
[19:26:31] NodeNagant: has joined #RubyOnRails
[19:27:23] centrx: solars, how it's called? what do you mena
[19:27:39] solars: the name of that feature so I can ask/look up things, haha
[19:27:54] solars: I'd like to find a way to simplify this: arr = [1,2,3,4,5]; User.joins("LEFT JOIN app ON app.id = user.id and user.app IN( #{arr.join(',') ) ")
[19:28:10] solars: here I cannot use the shorthand I can use in .where() mentioned above
[19:28:30] solars: so I wondered if there is a way to use this feature outside of where()
[19:28:53] infinitone: has joined #RubyOnRails
[19:28:58] centrx: solars, What the where does is use a case statement to detect the type of the object (Array) and use different logic for that
[19:29:30] solars: I assume this is not possible to be used in joins(), right?
[19:29:39] arup_r: has joined #RubyOnRails
[19:29:40] Yomero2: has joined #RubyOnRails
[19:31:21] chouhoul_: has joined #RubyOnRails
[19:31:55] centrx: solars, I think not, joins is more basic logic
[19:32:40] chouhoul_: has joined #RubyOnRails
[19:33:37] centrx: solars, although it looks like you could just use a where clause for what you are doing
[19:33:41] centrx: solars, not clear why it has to be in the join
[19:34:15] solars: it's a difference whether or not you have it in the join or where, in results
[19:34:36] solars: the above snippet is just a basic example to illustrate what I want to do
[19:34:48] p|p: has joined #RubyOnRails
[19:35:03] centrx: given the example, the constraint is on user, which is on the left side
[19:36:16] solars: right, doesnt make too much sense :)
[19:36:35] solars: but you understood what I want to achieve :)
[19:36:46] centrx: you can do it with Arel
[19:36:50] centrx: but may not really be simpler
[19:37:04] centrx: User.arel_table[:app].in(arr)
[19:37:14] centrx: e.g. http://stackoverflow.com/questions/11982545/searching-in-where-in-rails-with-or-clause-for-in
[19:37:27] centrx: solars, ^
[19:37:35] nickjj: has joined #RubyOnRails
[19:38:18] solars: ah I didn't see that arel supports arrays there
[19:38:28] solars: I think I can just use arel inside the joins() as far as I saw
[19:42:46] solars: centrx, I think I'll create a shortcut for that and use arel
[19:42:52] solars: thanks a lot!
[19:44:00] chipotle: has joined #RubyOnRails
[19:44:39] mary5030: has joined #RubyOnRails
[19:46:28] pawnbox_: has joined #RubyOnRails
[19:46:50] DonOtreply: has joined #RubyOnRails
[19:47:35] bensarz: has joined #RubyOnRails
[19:52:23] nyaa: has joined #RubyOnRails
[19:52:59] ur5us: has joined #RubyOnRails
[19:53:02] jvanbaarsen: has joined #RubyOnRails
[19:53:22] ur5us: has joined #RubyOnRails
[19:54:55] ur5us_: has joined #RubyOnRails
[19:55:00] FailBit: I am working with a friend to start up a Rails site that we believe might have a high potential of being DDoSed (possibly even by legitimate user traffic)
[19:55:15] FailBit: so far we have most of the stops pulled out (CF, heavy caching, cheapish VPS provider)
[19:55:35] FailBit: can I get ActionMailer to route our email through a scapegoat AWS instance?
[19:56:10] FailBit: (sending email leaks the server IP, AWS doesn't charge for inbound traffic and has decent DDoS mitigation)
[19:57:26] _Tariq: has joined #RubyOnRails
[19:57:58] mices: how does rails know to render to id main of the application layout
[19:58:33] mices: is that a default
[19:58:37] mices: to render to "main"
[19:58:51] diggitydane: has joined #RubyOnRails
[19:59:28] DoubleMalt: has joined #RubyOnRails
[19:59:30] speakingcode: has joined #RubyOnRails
[19:59:57] diggitydane: I'd like to run tests continually as I'm developing. Is guard still relevant, or is there a better option?
[20:00:19] tubbo: diggitydane: guard is still what you want.
[20:00:22] build22: has joined #RubyOnRails
[20:00:28] build22: has left #RubyOnRails: ()
[20:00:35] tubbo: FailBit: scapegoat?
[20:00:39] diggitydane: tubbo, great, thanks
[20:00:50] FailBit: tubbo: ie, have a totally separate AWS box aside from our main VPS
[20:00:56] FailBit: that sends and receives all mail
[20:00:59] momomomomo: has joined #RubyOnRails
[20:01:00] shibabu: has joined #RubyOnRails
[20:01:02] FailBit: so that we don't leak our server IP
[20:01:08] tubbo: FailBit: does amazon SES leak the IP of the original machine?
[20:01:52] FailBit: that's too expensive
[20:02:13] tubbo: you'd be able to mitigate attacks by firewalling your app servers i think. if the email is truly being sent FROM the app server, you could put an internet-facing web server in front of it.
[20:02:43] tubbo: so the actual IP people connect to, the one protected by cloudflare, would be the web server...but your app server is actually doing the work behind the scenes
[20:02:56] tubbo: and everything behind the web server is not accessible to the open internet
[20:03:15] tubbo: that is one way we do it at work
[20:03:22] mices: i put a form into an <li> container in my navbar and it aligns itself higher vertically than the other <li> elements, i tried to corrent it by putting `li {vertical-align: bottom}` in my application css file but it didn't help
[20:03:26] FailBit: that would be fine if we had unmetered bandwidth
[20:03:43] tubbo: FailBit: what does your bandwidth limit have to do with this?
[20:04:12] FailBit: actually, no it wouldn't
[20:04:32] FailBit: the firewall dealing with the attack would be expensive in terms of CPU time, and the attack would be expensive in bandwidth
[20:05:13] tubbo: FailBit: you're strawmaning the shit out of this convo :)
[20:06:19] FailBit: tubbo: I don't really get what you're saying
[20:06:20] bmalum: has joined #RubyOnRails
[20:06:21] tubbo: FailBit: the answer to your question is "no", afaik there is no way to tell actionmailer to route your email thru another AWS instance. if you're using AWS, the strategy i just told you about is how we mitigate attacks at my job and it's a pretty standard thing to be doing.
[20:06:30] tubbo: FailBit: we don't use cloudflare though
[20:07:06] tubbo: FailBit: and with AWS, you don't pay for in-network traffic. so you're only paying for bandwidth that hits your internet-facing IP.
[20:07:16] tubbo: if you use cloudflare, any attack should be mitigated from that level right?
[20:07:19] tubbo: (never used it)
[20:07:39] FailBit: tubbo: I believe I said we're using a separate VPS (cheep) outside of AWS that we don't want to expose
[20:08:08] FailBit: that is what goes behind cloudflare
[20:08:14] FailBit: if an attacker gets the IP, boom, game over
[20:09:03] [Butch]: has joined #RubyOnRails
[20:09:29] tubbo: FailBit: how are you sending emails from this rails app? are you using a service or just an SMTP server somewhere?
[20:10:13] FailBit: I assume it would be postfix
[20:10:37] FailBit: er, ActionMailer would be sending, postfix would be receiving
[20:10:45] FailBit: that would be if it was on one server
[20:10:57] tubbo: FailBit: so in other words, you're not configuring actionmailer, you're letting it default to the MDA
[20:11:53] tubbo: suppose you used a service, like SendGrid, to send emails for you? there are lots of them and i think Mandrill has something like 15k msgs per month free
[20:11:58] Scripore: has joined #RubyOnRails
[20:12:46] sandstrom: has joined #RubyOnRails
[20:12:51] FailBit: I'm going to do some more research and come back with what I get
[20:12:57] FailBit: eventually
[20:13:06] tubbo: FailBit: fwiw you should be doing this anyway. sending emails with sendmail directly from a unix machine is problematic for a lot of reasons, most notably for spam/fraud detection.
[20:13:26] tubbo: FailBit: i fucked up the DKIM headers on my domain and i still don't get emails from native-instruments.com because their service perma-blocked my domain. don't let that happen to you! :)
[20:13:54] pawnbox: has joined #RubyOnRails
[20:15:33] cmolenda: has joined #RubyOnRails
[20:19:43] lxsameer: has joined #RubyOnRails
[20:19:43] lxsameer: has joined #RubyOnRails
[20:20:27] celly: has joined #RubyOnRails
[20:23:30] twilling: has joined #RubyOnRails
[20:23:47] nesQuick: has joined #RubyOnRails
[20:24:04] chouhoulis: has joined #RubyOnRails
[20:26:09] hobodave_: has joined #RubyOnRails
[20:28:10] SanguineAnomaly: has joined #RubyOnRails
[20:28:13] threeminutemonta: has joined #RubyOnRails
[20:30:12] apeiros: hm, slightly off-topic, but I guess here's a proper number of people knowledgable about it:
[20:30:19] apeiros: any ebook recommendations regarding google adwords?
[20:32:05] chipotle: has joined #RubyOnRails
[20:32:09] yfeldblum: has joined #RubyOnRails
[20:32:14] apeiros: if scope matters: local, small, physical company with the website being a way to inform customers about the presence and offers
[20:32:39] sandstrom: has joined #RubyOnRails
[20:32:50] roshanavand: has joined #RubyOnRails
[20:33:00] lacrymology: has joined #RubyOnRails
[20:33:33] FernandoBasso: has joined #RubyOnRails
[20:33:43] zpe: has joined #RubyOnRails
[20:33:45] Macaveli: has joined #RubyOnRails
[20:35:18] Sawbones: has joined #RubyOnRails
[20:36:41] [dmp]: has joined #RubyOnRails
[20:36:49] polishdub: has joined #RubyOnRails
[20:37:46] Coldblackice: has joined #RubyOnRails
[20:37:49] _Tariq: has joined #RubyOnRails
[20:37:58] zpe: has joined #RubyOnRails
[20:38:11] snowy: has joined #RubyOnRails
[20:38:29] mary5030: has joined #RubyOnRails
[20:38:38] Sawbones: has joined #RubyOnRails
[20:39:45] [dmp]: has joined #RubyOnRails
[20:42:01] mustmodify: has joined #RubyOnRails
[20:42:04] _Tariq: has joined #RubyOnRails
[20:42:20] jkamenik: has joined #RubyOnRails
[20:42:21] mustmodify: Hey uh... if I say PostOffice.mail().deliver_later ... do I have to do something to get that to send?
[20:42:26] mustmodify: Presumably so...
[20:42:37] mustmodify: the docs don't really make it clear what needs doing.
[20:42:44] Megamos: has joined #RubyOnRails
[20:42:50] chouhoulis: has joined #RubyOnRails
[20:43:46] ql6wlld: has joined #RubyOnRails
[20:43:52] pawnbox: has joined #RubyOnRails
[20:44:22] A124: has joined #RubyOnRails
[20:45:21] chipotle: has joined #RubyOnRails
[20:45:33] bmalum: has joined #RubyOnRails
[20:46:10] lacrymology: has joined #RubyOnRails
[20:47:52] safety_cut: has joined #RubyOnRails
[20:48:46] smathy: mustmodify, no, it will be sent by your ActiveJob backend.
[20:49:39] mustmodify: looks like you have to set up a backend. If you don't have one, they just go into the great void.
[20:51:28] smathy: mustmodify, no, the default backend is to just process the job inline.
[20:51:50] mustmodify: Oh? That didn't seem to happen for me.
[20:52:06] mustmodify: maybe it did and I have some other email problem. :)
[20:52:32] bmalum: has joined #RubyOnRails
[20:53:28] smathy: mustmodify, if you just enter ActiveJob::Base.queue_adapter in your console you should be able to confirm that it's set to the default.
[20:54:00] smathy: mustmodify, obviously if you've set that to something else, but don't have that backend actually running to process your queue, then nothing will be happening.
[20:55:57] dbugger_: has joined #RubyOnRails
[20:57:24] doodlehaus: has joined #RubyOnRails
[20:58:47] djbkd: has joined #RubyOnRails
[20:59:12] twilling: has joined #RubyOnRails
[20:59:33] ur5us: has joined #RubyOnRails
[21:00:05] _Tariq: has joined #RubyOnRails
[21:00:06] twilling: has joined #RubyOnRails
[21:00:46] pydave6367: has joined #RubyOnRails
[21:02:48] shibabu: has joined #RubyOnRails
[21:03:58] xnp70: has joined #RubyOnRails
[21:05:26] _Tariq: has joined #RubyOnRails
[21:06:53] aegis3121: has joined #RubyOnRails
[21:06:53] SteenJobs: has joined #RubyOnRails
[21:08:57] FooMunki: has joined #RubyOnRails
[21:10:43] codepete: has joined #RubyOnRails
[21:10:54] drale2k: has joined #RubyOnRails
[21:12:02] tubbo: i think you can rule out AJ by doing deliver_now
[21:13:54] pawnbox: has joined #RubyOnRails
[21:15:53] mices: has joined #RubyOnRails
[21:16:53] solars: has joined #RubyOnRails
[21:17:10] snowy: has joined #RubyOnRails
[21:17:10] ur5us: has joined #RubyOnRails
[21:18:02] luther07: has joined #RubyOnRails
[21:18:27] Cervajz__: has joined #RubyOnRails
[21:20:26] jobewan: has joined #RubyOnRails
[21:21:58] maxx88: has joined #RubyOnRails
[21:22:09] luther07: has left #RubyOnRails: ()
[21:24:30] twilling: has joined #RubyOnRails
[21:25:38] twilling: has joined #RubyOnRails
[21:27:23] hobodave: has joined #RubyOnRails
[21:29:35] _Tariq: has joined #RubyOnRails
[21:30:52] ur5us: has joined #RubyOnRails
[21:32:09] safety_cut: has joined #RubyOnRails
[21:33:22] madah: has joined #RubyOnRails
[21:33:30] mdw: has joined #RubyOnRails
[21:34:20] aegis3121: has joined #RubyOnRails
[21:35:06] mustmodify: tubbo: That's what I did.
[21:35:53] mdw: has joined #RubyOnRails
[21:37:44] sandstrom: has joined #RubyOnRails
[21:38:26] axl_: has joined #RubyOnRails
[21:38:41] maxx88: has joined #RubyOnRails
[21:39:09] twilling: has joined #RubyOnRails
[21:43:47] pawnbox: has joined #RubyOnRails
[21:44:04] xnp70: has left #RubyOnRails: ()
[21:45:52] build22: has joined #RubyOnRails
[21:48:15] fox_mulder_cp: hi again. i want randomly colorize my script output. how add variable calling as method for output? https://gist.github.com/foxmuldercp/decd34089d4fc29e30e0
[21:48:53] fox_mulder_cp: at colorize readme i must use it as: puts 'line'.$colorname
[21:52:49] rhizome: fox_mulder_cp: try .send
[21:53:12] fox_mulder_cp: rhizome: puts 'line'.send(color) ?
[21:54:07] build22: has left #RubyOnRails: ()
[21:54:18] fox_mulder_cp: rhizome: now test rabbitmq + bunny, it's very easy. i have a long sex with rabbitmq in perl at last summer...
[21:54:36] fox_mulder_cp: but it intresting only for me. hhe
[21:59:03] arBmind: has joined #RubyOnRails
[21:59:48] mdw: has joined #RubyOnRails
[22:00:24] threeminutemonta: has joined #RubyOnRails
[22:01:03] peeja: has joined #RubyOnRails
[22:01:29] aadam21: has joined #RubyOnRails
[22:01:31] celly: has joined #RubyOnRails
[22:02:03] snowy: has joined #RubyOnRails
[22:02:30] akshat: has joined #RubyOnRails
[22:04:00] guacamole: has joined #RubyOnRails
[22:04:06] slash_quit: Anyone know how to make rails return a different value for request.ip versus request.remote_ip? I understand that one can be fooled more easily than the other
[22:07:19] fox_mulder_cp: slash_quit: what is webserver? webrick, puma, or front nginx?
[22:10:04] slash_quit: nginx and unicorn
[22:10:07] slash_quit: fox_mulder_cp: ^
[22:10:42] slash_quit: I expect it's something to do with fiddling with browser's local proxy settings, but i have no idea... it's all for fun
[22:10:44] Megamos: has joined #RubyOnRails
[22:11:25] fox_mulder_cp: slash_quit: wait
[22:11:59] drale2k: has joined #RubyOnRails
[22:13:23] SteenJobs: has joined #RubyOnRails
[22:15:40] fox_mulder_cp: slash_quit: see https://gist.github.com/foxmuldercp/6ac4a6b255bc0b89b678
[22:16:00] fox_mulder_cp: slash_quit: see section with proxy_set_header
[22:16:16] snowy: has joined #RubyOnRails
[22:17:04] xnp70: has joined #RubyOnRails
[22:17:38] slash_quit: fox_mulder_cp: and that's your local http conf?
[22:19:13] roshanavand: has joined #RubyOnRails
[22:19:30] fox_mulder_cp: slash_quit: nginx virtual host for rails app in lxc vm, yes
[22:19:57] fox_mulder_cp: in rails log i see my real home ip
[22:20:20] fox_mulder_cp: nginx with lxc vm located in azure vm
[22:20:48] aadam21: has joined #RubyOnRails
[22:23:07] ss_much: has joined #RubyOnRails
[22:23:34] DonOtreply: has joined #RubyOnRails
[22:24:11] pawnbox: has joined #RubyOnRails
[22:24:50] slash_quit: fox_mulder_cp: i set up no.rthbound.com (don't go here if you're prone to seizures)... the first colored block is based on the request id... the next two blocks are based on a hash of request id + request.ip and request id + request.remote_ip... If request.ip != request.remote_ip then the two bottom blocks should flash differently. I'm trying to make that happen (for the hell of it)
[22:25:21] atomical: has joined #RubyOnRails
[22:25:36] fox_mulder_cp: slash_quit: what ip in app.log you see?
[22:27:22] mustmodify: has left #RubyOnRails: ()
[22:27:37] SteenJobs: has joined #RubyOnRails
[22:28:52] dstarh: has joined #RubyOnRails
[22:30:06] opposite: has joined #RubyOnRails
[22:30:37] chipotle: has joined #RubyOnRails
[22:31:14] kadoppe: has joined #RubyOnRails
[22:31:30] slash_quit: fox_mulder_cp: when i hit it, my own... did you hit it?
[22:31:32] opposite: is there a term for describing whitelisting acceptable values for storing in an attribute
[22:31:59] opposite: like in the model, first checking if values are contained in an enum
[22:32:13] smathy: opposite, I'd use an enum.
[22:32:33] opposite: smithy: thanks, is that built in to AR?
[22:33:08] nertzy: has joined #RubyOnRails
[22:33:53] luther07: has joined #RubyOnRails
[22:34:00] twilling: has joined #RubyOnRails
[22:34:57] slash_quit: opposite: which version of rails are you using? probably is
[22:35:09] aadam21_: has joined #RubyOnRails
[22:35:14] slash_quit: opposite: http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html
[22:36:07] pontiki: hi, folx, need a little guideance on something. this project has two potential sources for "external resources" meaning images, pdfs, docs, and things like that.
[22:36:25] opposite: slash_quit: 4.x
[22:36:30] pontiki: one is things that would be uploaded by an admin, and would get stored out on the CDN
[22:36:46] opposite: slash_quit: thank, I didn't realize that was a thing.
[22:36:52] pontiki: the other is direct URLs to such images, docs, etc, that are stored on someone *else's* CDN
[22:37:07] snowy: has joined #RubyOnRails
[22:37:25] smathy: opposite, there are also good gems like Enumerize (which I actually prefer to the Rails implementation).
[22:37:31] yfeldblum: has joined #RubyOnRails
[22:38:06] pontiki: i'm thinking we want to pull the resources stored on the other CDN and put them in ours so we're not directly dependent on them
[22:38:12] johnflux: has joined #RubyOnRails
[22:38:17] opposite: smithy: good to know
[22:38:46] FernandoBasso: has joined #RubyOnRails
[22:38:47] pontiki: other person wants to leave them in place
[22:39:11] Scripore: has joined #RubyOnRails
[22:40:04] fox_mulder_cp: pontiki: read CDN api
[22:40:20] pontiki: no api, just direct urls
[22:41:35] fox_mulder_cp: pontiki: oh. use manual for this CDN. i knows about 3+ CDN, and i don't know about api in your selected cdn for saving updating and deleteing fdiles
[22:41:47] pontiki: that's not even near the question
[22:43:00] Scripore: has joined #RubyOnRails
[22:43:34] pontiki: the question is whether to consolidate the CDN artifacts, or leave them separate
[22:44:58] c0defeed: Is there a best practice for creating a logger module that I can share across my entire application
[22:45:35] pontiki: c0defeed: Rails.logger is shared across your entire application
[22:46:20] c0defeed: pontiki, I would like to be able to write into multiple files, Rails.logger seems to only write into a single file.
[22:46:37] pontiki: c0defeed: ah, what are the other specifications for this logger?
[22:47:09] noodman: has joined #RubyOnRails
[22:47:27] pontiki: you might want to investigate the log4r gem
[22:47:37] fox_mulder_cp: c0defeed: you may use, sentry, as example... or database...
[22:48:42] c0defeed: pontiki, I want to have requests and database activity go to one file, then have custom logging statements go to another file. I also want to be able to control the log level without having to restart puma
[22:48:47] guacamole: has joined #RubyOnRails
[22:49:01] rdavila: has joined #RubyOnRails
[22:49:02] pontiki: yeah, do check log4r
[22:49:34] pontiki: it can have multiple destinations, multiple types of logging, and is highly configurable
[22:49:54] c0defeed: That sounds like what I am looking for
[22:50:02] c0defeed: Is it well-maintained?
[22:50:04] pontiki: another direction entirely is to look at logstash, which give a super searchable and filterable logging record
[22:50:33] fox_mulder_cp: logstash, elasticsearch, ooh, many projects..
[22:51:19] c0defeed: pontiki, If it's well maintained then I'd prefer to go that route. Ideally I would just have a tail -f open on several logs on my second monitor
[22:51:33] quazimod1: has joined #RubyOnRails
[22:51:42] guacamole: has joined #RubyOnRails
[22:51:47] pontiki: c0defeed: i'm thinking more like in production when you can't sit there and do that 24/7
[22:53:22] c0defeed: the issue is one of production env where I am debugging an issue and there is so much noise in a single file
[22:53:31] c0defeed: I keep having to trigger the bug then quickly break with Ctrl C on another screen
[22:53:39] Scripore: has joined #RubyOnRails
[22:54:41] pontiki: that's what logstash would be ideal for; you can filter on times, tags, fields, values, etc
[22:55:04] c0defeed: Sounds like splunk
[22:55:04] bsamson: has joined #RubyOnRails
[22:55:26] pontiki: they're of a kind
[22:56:02] pontiki: logstash self-hosted
[22:56:09] c0defeed: I guess I imagine something like that sitting on top of a log aggregator rather than an individual server
[22:56:31] smathy: c0defeed, you know you can pipe tail -f into grep/ack/ag/whatever?
[22:56:42] pontiki: yes, it's really great when you have a cluster, and don't know which app server is going to spring the bug
[22:57:08] pontiki: but no reason it won't work just as well with one server
[22:57:20] mices: has joined #RubyOnRails
[22:57:25] baweaver: has joined #RubyOnRails
[22:57:27] mices: should i not have put my search form inside my nav bar?
[22:57:48] brycesenz: has joined #RubyOnRails
[22:58:30] c0defeed: I reckon you are correct. I'll give log4r a go first and look into logstash if this doesn't feel right. thanks for the tip
[22:58:52] moei: has joined #RubyOnRails
[22:59:00] pontiki: c0defeed: do listen to smathy's suggestion as well, grepping tail -f might be all you need
[22:59:08] atomical: has joined #RubyOnRails
[22:59:26] mag42c: has left #RubyOnRails: ()
[22:59:53] GragHarker: has joined #RubyOnRails
[23:00:02] lemur: has joined #RubyOnRails
[23:00:05] c0defeed: Oh, yes I did know that. Thank you though. Useful trick
[23:00:11] janebootydoe: has joined #RubyOnRails
[23:00:11] pontiki: or even perl and ruby -- this is the only place i've found a use for either's flip-flop operator
[23:01:39] crystalneth: has joined #RubyOnRails
[23:01:48] wethu: has joined #RubyOnRails
[23:01:57] wethu: has joined #RubyOnRails
[23:02:12] fox_mulder_cp: so, about logging
[23:02:31] fox_mulder_cp: now i test rabbitmq + bunny, its very easy
[23:02:41] ubiks: has joined #RubyOnRails
[23:03:10] fox_mulder_cp: many queues/topics, consumers can make something
[23:03:23] guacamole: has joined #RubyOnRails
[23:03:40] janebootydoe: how would i use this first example in an app? requires in the model and parser in the controller? http://ruby-doc.org/stdlib-2.0.0/libdoc/rss/rdoc/RSS.html
[23:03:43] IFrank00: has joined #RubyOnRails
[23:04:13] pontiki: sure, you can use a pubsub scheme for logging; you should also look into Rails notifications to feed that
[23:05:40] mag42c: has joined #RubyOnRails
[23:05:50] shibabu: has joined #RubyOnRails
[23:05:54] guacamole: has joined #RubyOnRails
[23:06:14] janebootydoe2: has joined #RubyOnRails
[23:11:47] DonOtreply: has joined #RubyOnRails
[23:12:34] a1fa: has joined #RubyOnRails
[23:13:33] a1fa: argh. anyone using attr_encrypted to decrypt AES_ENCRYPTED fields in mySQL? I followed this guide, (http://qiita.com/shoutakenaka/items/aa05be54b93d057e8ceb) and (https://github.com/attr-encrypted/attr_encrypted), but "encrypted_email" returns blank, so does "email".
[23:15:43] fox_mulder_cp: if decrypt stay very easy, our password may be used for trash
[23:17:18] smathy: a1fa, I'm not using it right now, but I've used it quite a few times before - always worked well.
[23:17:58] fox_mulder_cp: oh. /opt/logstash/bin/logstash agent -f logstash.conf
[23:17:59] fox_mulder_cp: Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME.
[23:18:16] a1fa: smathy: not sure why "encrypted_email" is returning a blank on me. i assumed, it would return whatever was in the dbm regardless of the key
[23:18:20] djbkd: has joined #RubyOnRails
[23:18:39] a1fa: smathy: i've tried with varchar, and binary for the field. i believe the manual calls for varchar
[23:19:05] smathy: a1fa, yeah, I've always just put them in regular string (Rails) fields, so varchars.
[23:20:44] a1fa: thanks. i'll try to poke around a bit more
[23:21:40] drale2k: has joined #RubyOnRails
[23:21:57] jgpawletko: has joined #RubyOnRails
[23:22:43] luther07: has left #RubyOnRails: ()
[23:24:57] webhat: has joined #RubyOnRails
[23:26:11] quazimod1: has joined #RubyOnRails
[23:27:04] xnp70: has joined #RubyOnRails
[23:29:29] differentreality: has joined #RubyOnRails
[23:30:13] smathy: has joined #RubyOnRails
[23:32:37] _Tariq: has joined #RubyOnRails
[23:33:30] andywww: has joined #RubyOnRails
[23:34:31] xnp70: has left #RubyOnRails: ()
[23:34:52] mustmodify: has joined #RubyOnRails
[23:35:17] astickcalledlog: has joined #RubyOnRails
[23:35:38] astickcalledlog: has left #RubyOnRails: ()
[23:35:55] mustmodify: ok help me think my way out of this one. New request from my client: As a user, I want to be able to verify my account from my phone, then be logged in automatically on the web. Since users aren't signed in on user creation, I'll have to give the /signed_up page a token of some kind...
[23:36:26] Radar: mustmodify: Prompt them to enter their phone number on sign up, then redirect to a verification page.
[23:36:33] Radar: mustmodify: Send the SMS to their phone using Twilio.
[23:36:47] astickcalledlog: has joined #RubyOnRails
[23:37:00] Radar: https://rubygems.org/gems/twilio-ruby
[23:37:07] mustmodify: so use SMS for verification instead of email... how does that solve my "not logged in to logged in" problem?
[23:37:35] Radar: They won't be "automatically" logged in. They will need to try to log in, then verify their number.
[23:39:25] KnownSyntax: has joined #RubyOnRails
[23:39:49] KnownSyntax: has joined #RubyOnRails
[23:45:45] rhizome: the request is unsound. you aren't going to be able to create a session/cookie on some mysterious other browser
[23:47:38] bsamson: I updated an app to rails 5 today and everything is running great except for some reason I only see the first request in the log in development mode and then just nothing on subsequent requests. A fresh rails 5 dummy app on my machine works as expected. Has anyone seen something like this?
[23:48:11] guacamole: has joined #RubyOnRails
[23:48:28] mustmodify: rhizome: sorry, I must have mistyped. They sign up in browser A. They verify in browser B. Then browser A should check every few seconds, see that they are verified, and login.
[23:49:15] rhizome: what if they closed the browser?
[23:49:16] mustmodify: which means I have to pass an auth token that will allow both single-auth and persistent auth. Single auth to check if they are verified. Persistent auth to login once verified. Ugh.
[23:49:44] mustmodify: It's a nicety. If they want to be stupid, that's their business. They can login using the normal means.
[23:50:04] mustmodify: Frankly, I'm kind of against it. But not like "I'm not doing that" against it.
[23:52:51] davidw: has joined #RubyOnRails
[23:53:05] matthewd: bsamson: Which web server are you using?
[23:53:24] matthewd: (the fresh app is presumably using the default puma)
[23:53:38] davidw: I have this recollection of being able to do form_for with Something.new(blah: blah, foo: bar) and have it generate those parameters without doing a bunch of f.hidden_field(:foo) kinds of things... am I remembering incorrectly?
[23:55:02] guacamole: has joined #RubyOnRails
[23:55:54] mustmodify: =form_for( Something.new ) do |form|
[23:56:02] mustmodify: then =form.field :field_name
[23:56:13] guacamole: has joined #RubyOnRails
[23:56:25] andywww: i???m struggling with validating a nested form. I have a form which creates a parent model and 4 associated models. The associated models need a uniqueness validation based on the parent id but, because the parent doesn???t exist in the database yet, it???s coming up as null. I???ve gone the route of validating it in the parent model but i can???t seem to add errors to the associated models, only to the association of the parent model
[23:56:50] mustmodify: though you will probably want to do Something.new in a helper because you will want to handle the situation where the form submits but isn't valid.
[23:57:39] andywww: i have used error messages inline below the form fields so kinda need to put the error messages on the associated models for consistency
[23:57:40] davidw: mustmodify, it's having to do all those f.hidden_field(:something) that's a bit tedious, but I must have been mistaken.
[23:57:50] andywww: anyone come across this before?
[23:58:24] Radar: davidw: hidden fields aren't added automatically for you.
[23:59:23] superlou: has joined #RubyOnRails
[23:59:57] mustmodify: davidw: I'm not sure what you're saying / asking.