« Back to channel list

#RubyOnRails - 14 December 2015

« Back 1 day Forward 1 day »
[00:00:04] siaW: FailBit: i know. i don???t care what he???s doing. i need to make his testing system work. whatever code he writes is his problem but i???ll tell him
[00:00:51] jgt2: has joined #RubyOnRails
[00:01:15] ur5us: has joined #RubyOnRails
[00:02:02] sadaf2606: has joined #RubyOnRails
[00:02:50] Hazim: has joined #RubyOnRails
[00:03:11] siaW: FailBit: thanks lot FailBit :)
[00:03:41] jmimi: has joined #RubyOnRails
[00:03:46] doodlehaus: has joined #RubyOnRails
[00:04:27] maesitos: has joined #RubyOnRails
[00:04:29] pulgalipe: has joined #RubyOnRails
[00:04:46] K_r3aPeR: has joined #RubyOnRails
[00:08:21] ruid: has joined #RubyOnRails
[00:08:22] ruid: has joined #RubyOnRails
[00:08:26] Radar: Agree that dumb test is dumb.
[00:08:26] kapustka: has joined #RubyOnRails
[00:09:16] jmrepetti: has joined #RubyOnRails
[00:10:08] nyaa: has joined #RubyOnRails
[00:11:02] Moeh: Can someone tell me how to modify object.to_json so that if I do user.to_json(:include => {:comments => {}) the key in the resulting json for :comments would not be "comments" but "comments_attributes"? Otherwise I cannot parse the json into a new model :/
[00:11:41] Moeh: I don't really get why this is not supported out of the box. Meaning to serialize an object with associations and deserialize it.
[00:12:03] rgrmatt: has joined #RubyOnRails
[00:13:36] rhizome: it sounds like that part is working
[00:14:31] bklane: has joined #RubyOnRails
[00:14:47] Moeh: what exactly do you mean?
[00:15:49] Hans267: I???m trying to setup an autocomplete association following the railscasts episode https://www.youtube.com/watch?v=M7yhPlIehFA and this SO post to use it with simple_form. I???ve gone through it a ton of times but I???m still getting ???this.source is not a function??? error. What am I missing? Here???s my gist https://gist.github.com/janikhans/99c3565a05590f9062dc
[00:15:51] rubyonrailed: has joined #RubyOnRails
[00:16:09] Hans267: forgot the SO post link http://stackoverflow.com/questions/29779009/ruby-on-rails-simple-form-autocomplete-association-search
[00:16:11] tvon: has joined #RubyOnRails
[00:16:29] rhizome: "this.source" sounds like javascript
[00:17:28] FailBit: evilscript
[00:19:56] stannard: has joined #RubyOnRails
[00:22:24] shibabu: has joined #RubyOnRails
[00:23:28] ElFerna: has joined #RubyOnRails
[00:27:45] banister: has joined #RubyOnRails
[00:29:22] Hazim: has joined #RubyOnRails
[00:31:12] ElFerna_: has joined #RubyOnRails
[00:31:41] bklane: has joined #RubyOnRails
[00:31:43] guest22: has joined #RubyOnRails
[00:32:29] shock_one: has joined #RubyOnRails
[00:35:07] pulgalipe: has joined #RubyOnRails
[00:35:08] Moeh: For first level :includes, I already managed to overwrite the keys (http://pastie.org/10631357). However, it is not working for 2nd level nesting, like user.to_json(:include => {:comments => {:include => {:points}}})
[00:35:11] ben_vulpes: has left #RubyOnRails: ("ERC Version 5.3 (IRC client for Emacs)")
[00:36:23] rgrmatt: has joined #RubyOnRails
[00:36:48] ruid: looking at some sample code I see stuff like Model.create!(<model props>) What is the purpose of the '!' ?
[00:37:11] FailBit: the bang version throws an exception if the model was not created
[00:37:22] ruid: thanks FailBit
[00:39:00] superlou: has joined #RubyOnRails
[00:39:59] bklane: has joined #RubyOnRails
[00:40:05] Rodya_: has joined #RubyOnRails
[00:40:36] kegan_: has joined #RubyOnRails
[00:41:09] Ropeney: has joined #RubyOnRails
[00:41:40] prereflect: has joined #RubyOnRails
[00:44:43] StevenXL: has joined #RubyOnRails
[00:44:43] StevenXL: has joined #RubyOnRails
[00:47:05] bklane: has joined #RubyOnRails
[00:51:34] nettoweb: has joined #RubyOnRails
[00:51:38] djbkd: has joined #RubyOnRails
[00:52:23] hardtail: has joined #RubyOnRails
[00:54:08] bronson: has joined #RubyOnRails
[00:55:12] sonofdirt: has joined #RubyOnRails
[00:57:41] smathy: has joined #RubyOnRails
[00:58:13] _Tariq: has joined #RubyOnRails
[00:58:43] lyoshajapan: has joined #RubyOnRails
[00:59:29] Hans267: Well I sort of narrowed it down. For some reason it doesn???t work with simple_form but does with the rails form builder. Any ideas why?
[01:00:44] maesitos: has joined #RubyOnRails
[01:01:05] nyaa: has joined #RubyOnRails
[01:02:48] bklane: has joined #RubyOnRails
[01:06:36] pulgalipe: has joined #RubyOnRails
[01:07:48] rgrmatt: has joined #RubyOnRails
[01:08:22] DavidDudson: has joined #RubyOnRails
[01:08:42] sarink: has joined #RubyOnRails
[01:09:43] ruid: im trying to undo a scaffolding and subsequent db:migrate. Ive done 'rails destroy scaffold <name>' and 'rake db:rollback'. But when I try to do rails g scaffold <name>; bundle exec rake db:migrate; I get an error on creating the table....
[01:13:07] sonofdirt: has joined #RubyOnRails
[01:14:02] bklane: has joined #RubyOnRails
[01:14:04] ruid: This did it: ActiveRecord::Migration.drop_table(:<table_name>)
[01:15:30] StevenXL: has joined #RubyOnRails
[01:15:30] StevenXL: has joined #RubyOnRails
[01:16:15] pontiki: ruid: you need to do the rollback *before* you destroy the generated code
[01:17:03] Rodya_: has joined #RubyOnRails
[01:17:40] roshanavand: has joined #RubyOnRails
[01:22:53] ruid: any good links to the format for generating the rails migration templates? i.e. "rails generate migration AddBlahtoTable" will create an add migration with Blah being added to Table.
[01:23:52] bklane: has joined #RubyOnRails
[01:24:29] atomical: has joined #RubyOnRails
[01:24:30] shibabu: has joined #RubyOnRails
[01:28:26] bklane_: has joined #RubyOnRails
[01:30:13] doodlehaus: has joined #RubyOnRails
[01:30:36] _Tariq: has joined #RubyOnRails
[01:31:38] bklane: has joined #RubyOnRails
[01:33:25] Darkman738: has joined #RubyOnRails
[01:34:28] shock_one: has joined #RubyOnRails
[01:35:25] bklane_: has joined #RubyOnRails
[01:35:33] rhizome: migration guide
[01:35:45] Scripore: has joined #RubyOnRails
[01:36:28] jbrhbr: has joined #RubyOnRails
[01:38:15] juddey: has joined #RubyOnRails
[01:42:27] lyoshajapan: has joined #RubyOnRails
[01:45:56] pulgalipe: has joined #RubyOnRails
[01:46:48] pyemkey: has joined #RubyOnRails
[01:47:33] bklane: has joined #RubyOnRails
[01:48:21] heyrhett: has joined #RubyOnRails
[01:50:45] prereflect: has joined #RubyOnRails
[01:50:59] baweaver: has joined #RubyOnRails
[01:51:01] K_r3aPeR_: has joined #RubyOnRails
[01:54:29] rubyonrailed: has joined #RubyOnRails
[01:54:56] lessless: has joined #RubyOnRails
[01:57:40] ace05: has joined #RubyOnRails
[01:57:46] ElFerna_: has joined #RubyOnRails
[01:58:06] shibabu: has joined #RubyOnRails
[01:58:31] Jasaka: has joined #RubyOnRails
[01:59:15] Logico: has joined #RubyOnRails
[02:00:45] tenderlove: has joined #RubyOnRails
[02:00:52] gabeodess: has joined #RubyOnRails
[02:01:11] gabeodess: Does anyone have any ideas how I might be able to add a custom Arel predicate?
[02:01:36] gabeodess: specifically, I would like to add a predicate for the ??????? operator for a JSONB column.
[02:01:49] atomical_: has joined #RubyOnRails
[02:02:12] gabeodess: more specifically, I am trying to get Ransack to play friendly (via active admin) with my JSONB column
[02:02:12] pontiki: i don't know gabeodess, but if you figure it out, please let us know
[02:02:24] FailBit: gabeodess: https://github.com/dockyard/postgres_ext/blob/master/lib/postgres_ext/arel/nodes/contained_within.rb
[02:02:24] rickmasta: has joined #RubyOnRails
[02:02:24] pontiki: i'm just starting in using JSONB in this project
[02:02:30] FailBit: look here for ideas
[02:02:52] FailBit: you might want to file a PR against that particular project because that sounds really useful
[02:05:08] nickenchuggets: how can I get bundler to give me more error information
[02:05:13] nickenchuggets: it just says "killed"
[02:05:47] krz: has joined #RubyOnRails
[02:05:57] pontiki: FailBit: that's an awesome link, thanks
[02:06:03] gabeodess: FailBit: yeah, if I can figure it out.
[02:08:47] goodcodeguy: has joined #RubyOnRails
[02:08:48] sucks: has joined #RubyOnRails
[02:08:49] lyoshajapan: has joined #RubyOnRails
[02:09:12] roshanavand: has joined #RubyOnRails
[02:09:59] rromanchuk: has joined #RubyOnRails
[02:12:04] baweaver: has joined #RubyOnRails
[02:12:36] one_zero: has joined #RubyOnRails
[02:19:58] rgrmatt: has joined #RubyOnRails
[02:22:16] lyoshajapan: has joined #RubyOnRails
[02:25:59] _Tariq: has joined #RubyOnRails
[02:30:25] ornerymoose: has joined #RubyOnRails
[02:31:03] yfeldblum: has joined #RubyOnRails
[02:33:28] rubyonrailed: has joined #RubyOnRails
[02:37:53] shock_one: has joined #RubyOnRails
[02:38:52] Croves: has joined #RubyOnRails
[02:40:34] djbkd: has joined #RubyOnRails
[02:42:40] lyoshajapan: has joined #RubyOnRails
[02:43:40] heyrhett: does anyone here use react-rails?
[02:44:58] jstr: has joined #RubyOnRails
[02:45:58] _Tariq: has joined #RubyOnRails
[02:47:00] doodleha_: has joined #RubyOnRails
[02:48:09] Guest: has joined #RubyOnRails
[02:50:40] Croves: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[02:52:56] Hazim: has joined #RubyOnRails
[02:54:30] jbrhbr: has joined #RubyOnRails
[02:54:31] pulgalipe: has joined #RubyOnRails
[02:54:32] _Tariq: has joined #RubyOnRails
[02:54:45] bronson: has joined #RubyOnRails
[02:58:34] ElFerna: has joined #RubyOnRails
[02:58:46] armyriad: has joined #RubyOnRails
[02:59:20] Bloomer: has joined #RubyOnRails
[02:59:45] _Tariq: has joined #RubyOnRails
[03:00:29] smathy: has joined #RubyOnRails
[03:01:42] _Tariq: has joined #RubyOnRails
[03:02:15] ur5us: has joined #RubyOnRails
[03:02:38] ur5us: has joined #RubyOnRails
[03:06:45] goodcodeguy: has joined #RubyOnRails
[03:07:24] pawnbox: has joined #RubyOnRails
[03:08:14] rgrmatt: has joined #RubyOnRails
[03:10:31] gabeodess: FailBit: okay, after a bit of hackery, it looks like this is the simplest way to add a custom predicate: https://gist.github.com/gabeodess/c33b192e6d645f37f910
[03:11:06] iamdevnul: has joined #RubyOnRails
[03:11:51] FailBit: in the example you could use Person.arel_table[:address]
[03:12:40] FailBit: also, get some ActiveRecord query DSL in there, spice it up
[03:14:03] prereflect: has joined #RubyOnRails
[03:14:03] FailBit: ideally you want the example to look like Person.where.has_key(address: 'borough')
[03:17:07] iateadonut: has joined #RubyOnRails
[03:17:21] AnoHito_: has joined #RubyOnRails
[03:18:04] ElFerna: has joined #RubyOnRails
[03:18:13] RegulationD: has joined #RubyOnRails
[03:21:33] roshanavand: has joined #RubyOnRails
[03:22:28] lyoshajapan: has joined #RubyOnRails
[03:22:37] stannard: has joined #RubyOnRails
[03:25:23] gabeodess: FailBit: interesting, hadn???t thought of that. May main usecase for this is to support filtering through active admin.
[03:25:46] FailBit: !activeadmin
[03:26:03] FailBit: no, I'm still not allowed to use helpa
[03:26:04] tenderlove: has joined #RubyOnRails
[03:26:19] FailBit: but, uh, activeadmin is bad mkay
[03:26:27] gabeodess: FailBit: why?
[03:26:30] lyoshaja_: has joined #RubyOnRails
[03:26:35] gabeodess: I???ve used it on all my projects and love it
[03:27:15] FailBit: I'm kind of... in bed right now ... and about to go to sleep, but I'm sure someone else can explain
[03:27:34] FailBit: and I guess if you like it, whatever
[03:27:36] FailBit: but I don't
[03:33:54] djbkd: has joined #RubyOnRails
[03:34:25] Hazim: has joined #RubyOnRails
[03:37:24] AnoHito: has joined #RubyOnRails
[03:42:24] jessemcgilallen: has joined #RubyOnRails
[03:45:24] pawnbox: has joined #RubyOnRails
[03:49:02] pyemkey: has joined #RubyOnRails
[03:51:46] htmldrum: has joined #RubyOnRails
[03:59:23] pawnbox: has joined #RubyOnRails
[03:59:33] AnoHito: has joined #RubyOnRails
[04:00:57] ace05: has joined #RubyOnRails
[04:01:54] fexilal: has joined #RubyOnRails
[04:03:27] rubyonrailed: has joined #RubyOnRails
[04:04:33] Rodya_: has joined #RubyOnRails
[04:04:49] Cache_Money: has joined #RubyOnRails
[04:06:39] doodlehaus: has joined #RubyOnRails
[04:07:23] sarink: has joined #RubyOnRails
[04:09:03] exadeci: has joined #RubyOnRails
[04:10:23] LambdaSource: has joined #RubyOnRails
[04:16:00] krz: has joined #RubyOnRails
[04:16:27] braincrash: has joined #RubyOnRails
[04:20:55] fre: has joined #RubyOnRails
[04:21:33] tenderlove: has joined #RubyOnRails
[04:23:22] fre: has left #RubyOnRails: ()
[04:25:49] tildes: has joined #RubyOnRails
[04:27:53] ornerymoose: has joined #RubyOnRails
[04:29:09] AnoHito: has joined #RubyOnRails
[04:29:16] Exce1l: has joined #RubyOnRails
[04:30:16] fp-: has joined #RubyOnRails
[04:30:30] fp-: has joined #RubyOnRails
[04:30:48] roshanavand: has joined #RubyOnRails
[04:31:56] fp-: is there a way to make it so that when you generate a route via link_to [@account, @invoice] it would automatically call [@account.company, @invoice] instead?
[04:32:21] Exce1l: has left #RubyOnRails: ()
[04:33:42] AnoHito: has joined #RubyOnRails
[04:36:05] podman: has joined #RubyOnRails
[04:36:33] Y_Ichiro: has joined #RubyOnRails
[04:36:33] Y_Ichiro: has joined #RubyOnRails
[04:36:38] tejasmanohar: has joined #RubyOnRails
[04:37:08] hahuang61: has joined #RubyOnRails
[04:37:40] sfr^: has joined #RubyOnRails
[04:37:48] alevy: has joined #RubyOnRails
[04:38:49] G: has joined #RubyOnRails
[04:38:54] borkdude: has joined #RubyOnRails
[04:39:08] pwnd_nsfw: has joined #RubyOnRails
[04:39:35] krz: has joined #RubyOnRails
[04:39:48] eggoez: has joined #RubyOnRails
[04:40:51] FastJack: has joined #RubyOnRails
[04:41:23] rickmasta: has joined #RubyOnRails
[04:41:27] rhizome: why not just use @account.company in the first place?
[04:42:18] BLuEGoD: has joined #RubyOnRails
[04:42:39] Klumben: has joined #RubyOnRails
[04:50:06] ElFerna: has joined #RubyOnRails
[04:50:35] andrew91841: has joined #RubyOnRails
[04:50:50] LambdaSource: has joined #RubyOnRails
[04:53:26] bigbob: has joined #RubyOnRails
[04:53:28] quazimodo: I need help naming something... I have a collection that has time slots, employees and each employee has time slots, and a service id. This represents all the possible times that a service may be booked, along with which employees are available during those times.
[04:54:17] owenjones: has joined #RubyOnRails
[04:54:20] quazimodo: An instance of this class would be a collection of many things... I wanted to call it AvailableAppointments but the plural class name doesn't sit with me somehow... AvaliableAppointmentBucket ?
[04:56:48] pontiki: quazimodo: each instance of this class is itself a collection? or?
[04:56:53] pontiki: i'm not following your concept
[04:57:51] braincra-: has joined #RubyOnRails
[04:57:59] tildes: has joined #RubyOnRails
[04:58:21] pontiki: better to show than tell
[04:59:43] ibouvousaime: has joined #RubyOnRails
[05:01:43] ace05: has joined #RubyOnRails
[05:02:01] berserk_ren: has joined #RubyOnRails
[05:05:16] quazimodo: pontiki: yeah it is, i'll show you :)
[05:06:44] A124: has joined #RubyOnRails
[05:07:15] xcesariox: has joined #RubyOnRails
[05:09:03] pyemkey: has joined #RubyOnRails
[05:09:08] bigbob: has joined #RubyOnRails
[05:09:28] quazimodo: https://gist.github.com/siassaj/97b4293fcfb2190fcc0e
[05:11:28] quazimodo: the naming is camelcase because this is supposed to be sent back to front end as json,
[05:14:23] rubyonrailed: has joined #RubyOnRails
[05:18:38] pontiki: so that's a taken time slot?
[05:18:56] pontiki: that doens't look like a collection to me
[05:19:13] pulgalipe: has joined #RubyOnRails
[05:23:21] meme1: has joined #RubyOnRails
[05:24:46] quazimodo: pontiki: it has a collection of employees which have a collection of timeslots each
[05:24:49] quazimodo: it also has a bunch of other stuff
[05:24:51] meme1: has joined #RubyOnRails
[05:25:00] quazimodo: it's just not a simple object and i don't really have a domain name for it
[05:25:13] quazimodo: I've basically ended up calling it an AvailableAppointments::Bucket
[05:25:18] lictor36: has joined #RubyOnRails
[05:29:49] pontiki: so you have time slots, and you have employees
[05:29:55] pontiki: employees have available times
[05:31:12] pontiki: TimeSlot has many :availabilities / Employee has many availabilities / TimeSlot has many :employess through: availabilities / Employes has many :time_slots through: availabilities
[05:34:00] mdel: has joined #RubyOnRails
[05:34:50] sarink: has joined #RubyOnRails
[05:35:38] quazimodo: pontiki: that's a way to describe it although the AR associations are very different to this
[05:36:24] pontiki: then i have no idea what you're on about
[05:36:44] dionysus69: has joined #RubyOnRails
[05:37:44] heyrhett: has anyone used the react-rails gem?
[05:38:34] quazimodo: pontiki: that hash, that is the serialised representation of a single instance of a class
[05:38:37] quazimodo: what would you call that class
[05:38:48] pontiki: anything you want
[05:38:48] quazimodo: that class's instance variables hold all those fields you see
[05:39:08] heyrhett: Does anyone have a preferred way to build more responsive interfaces?
[05:42:48] heyrhett: pontiki: I mean something where I can click an element, and it updates the database and re-renders the page quickly without a full page reload
[05:44:00] techsethi: has joined #RubyOnRails
[05:45:05] srinidhi: has joined #RubyOnRails
[05:45:29] pontiki: what does that have to do with it?
[05:46:20] pontiki: you're going to need a controller to respond to that ajax request, and that controller builds the collection and sends it back
[05:46:29] pontiki: you can name the class anything you want
[05:47:24] lxsameer: has joined #RubyOnRails
[05:48:39] pawnbox_: has joined #RubyOnRails
[05:49:25] heyrhett: is anyone using actioncable in rails 5?
[05:51:31] Nodir: has joined #RubyOnRails
[05:52:33] pawnbox: has joined #RubyOnRails
[05:55:25] NBarnes: has joined #RubyOnRails
[05:59:08] pawnbox: has joined #RubyOnRails
[05:59:39] bronson: has joined #RubyOnRails
[06:03:21] pyemkey: has joined #RubyOnRails
[06:03:42] pawnbox_: has joined #RubyOnRails
[06:05:42] tenzan: has joined #RubyOnRails
[06:06:38] reoring: has joined #RubyOnRails
[06:06:42] tenzan: has joined #RubyOnRails
[06:07:39] pawnbox: has joined #RubyOnRails
[06:08:52] tenderlove: has joined #RubyOnRails
[06:10:58] zpe: has joined #RubyOnRails
[06:11:14] siaW: has joined #RubyOnRails
[06:11:55] pawnbox_: has joined #RubyOnRails
[06:12:06] andrew9184: has joined #RubyOnRails
[06:15:42] pawnbox: has joined #RubyOnRails
[06:15:53] Cache_Money: has joined #RubyOnRails
[06:16:09] yardenbar: has joined #RubyOnRails
[06:17:24] srinidhi1: has joined #RubyOnRails
[06:17:56] ur5us: has joined #RubyOnRails
[06:20:52] ace05: has joined #RubyOnRails
[06:21:39] wldcordeiro: has joined #RubyOnRails
[06:22:18] pawnbox: has joined #RubyOnRails
[06:22:18] djbkd: has joined #RubyOnRails
[06:23:16] krz: has joined #RubyOnRails
[06:26:06] Hans267: Is anyone doing an autocomplete association with simple_form?
[06:29:38] FooBarWidget: has joined #RubyOnRails
[06:34:30] tagrudev: has joined #RubyOnRails
[06:35:49] ewnd9: has joined #RubyOnRails
[06:38:24] ElFerna: has joined #RubyOnRails
[06:42:08] pyemkey: has joined #RubyOnRails
[06:44:00] trautwein: has joined #RubyOnRails
[06:47:09] shock_one: has joined #RubyOnRails
[06:47:32] xcesariox: has joined #RubyOnRails
[06:53:45] K_r3aPeR_: has joined #RubyOnRails
[06:54:27] K_r3aPeR_: has joined #RubyOnRails
[06:56:51] NBarnes: has joined #RubyOnRails
[07:05:48] comrad: has joined #RubyOnRails
[07:06:19] sevenseacat: has joined #RubyOnRails
[07:10:31] norc: has joined #RubyOnRails
[07:11:33] sadaf2605: has joined #RubyOnRails
[07:11:47] cschneid: has joined #RubyOnRails
[07:13:32] pyemkey: has joined #RubyOnRails
[07:13:45] norc: Hi. I have a static table of about 15 rows with this structure: http://pastie.org/10631704
[07:14:09] norc: The data are seeded with the same data in every environment, based on physical measurements done.
[07:14:49] norc: Does something like this belong in the database?
[07:15:01] norc: (The data are not very likely to change)
[07:16:04] ibouvousaime: has joined #RubyOnRails
[07:16:55] pontiki: i'd say yes
[07:17:33] pontiki: uniformity of access, etc
[07:17:48] solars: has joined #RubyOnRails
[07:18:00] pontiki: get on to something more difficult to implement :)
[07:18:13] christiandsg: has joined #RubyOnRails
[07:18:42] pawnbox: has joined #RubyOnRails
[07:18:56] norc: pontiki: That actually is a valid point. It works with no real downsides at this point - better spent my time being productive than overengineering I guess. :)
[07:19:47] RegulationD: has joined #RubyOnRails
[07:20:17] pontiki: give me that same advice tomorrow, okay?
[07:22:24] techsethi: has joined #RubyOnRails
[07:23:11] K_r3aPeR_: has joined #RubyOnRails
[07:24:32] norc: Deal. :-)
[07:27:36] artto: has joined #RubyOnRails
[07:30:38] Pupeno: has joined #RubyOnRails
[07:31:05] yardenbar: has joined #RubyOnRails
[07:32:44] pyemkey: has joined #RubyOnRails
[07:32:50] Macaveli: has joined #RubyOnRails
[07:34:04] pawnbox: has joined #RubyOnRails
[07:35:08] Cervajz: has joined #RubyOnRails
[07:40:05] pulgalipe: has joined #RubyOnRails
[07:40:22] aganov: has joined #RubyOnRails
[07:40:23] codelahoma: has joined #RubyOnRails
[07:43:07] tetraktys: has joined #RubyOnRails
[07:44:09] rvanlieshout: has joined #RubyOnRails
[07:46:15] Pumukel: has joined #RubyOnRails
[07:55:13] User458764: has joined #RubyOnRails
[07:55:40] pyemkey: has joined #RubyOnRails
[07:55:41] jgt2: has joined #RubyOnRails
[07:57:13] tenderlove: has joined #RubyOnRails
[07:58:45] techsethi: has joined #RubyOnRails
[08:01:38] arBmind: has joined #RubyOnRails
[08:02:55] ace05: has joined #RubyOnRails
[08:02:55] pyemkey: has joined #RubyOnRails
[08:06:00] lacrymology: has joined #RubyOnRails
[08:07:39] bmalum: has joined #RubyOnRails
[08:08:05] blackhuey: has joined #RubyOnRails
[08:10:01] jas02: has joined #RubyOnRails
[08:11:10] darutoko: has joined #RubyOnRails
[08:12:24] NBarnes: has joined #RubyOnRails
[08:12:32] bmalum_: has joined #RubyOnRails
[08:15:52] jbrhbr: has joined #RubyOnRails
[08:15:57] sucks: has joined #RubyOnRails
[08:16:12] Elion: has joined #RubyOnRails
[08:17:14] Elion: has joined #RubyOnRails
[08:17:43] Elion: has joined #RubyOnRails
[08:18:27] Elion: has joined #RubyOnRails
[08:18:40] kmckelvin: has joined #RubyOnRails
[08:19:57] krzkrz: has joined #RubyOnRails
[08:20:05] zpe: has joined #RubyOnRails
[08:20:38] Elion: has joined #RubyOnRails
[08:21:07] Elion: has joined #RubyOnRails
[08:21:07] Elion: has joined #RubyOnRails
[08:22:24] davonrails: has joined #RubyOnRails
[08:23:29] Elion: has joined #RubyOnRails
[08:23:30] Elion: has joined #RubyOnRails
[08:24:37] shock_one: has joined #RubyOnRails
[08:26:32] ElFerna: has joined #RubyOnRails
[08:26:45] moeabdol: has joined #RubyOnRails
[08:27:57] mark3: has joined #RubyOnRails
[08:28:59] wmdrossard: has joined #RubyOnRails
[08:30:11] shock_one: has joined #RubyOnRails
[08:30:39] __Andreas__: has joined #RubyOnRails
[08:34:00] __Andreas__: has left #RubyOnRails: ()
[08:34:19] AndreasGB: has joined #RubyOnRails
[08:35:25] AndreasGB: How would you represent a Windows file path in a rest api request?
[08:37:26] nettoweb: has joined #RubyOnRails
[08:37:45] AndreasGB: What I want to do is basically some webservice that tells you some stuff about a filepath that is being sent to it, but I don't know how one would do it in rest
[08:38:04] roshanavand: has joined #RubyOnRails
[08:38:52] AndreasGB: What I know is that it should probably be a GET request in the form of api.myserver.com/v1/file/{path}/ to get the information but it looks really bad
[08:39:12] AndreasGB: How would you represent it?
[08:39:21] srinidhi: has joined #RubyOnRails
[08:40:54] pyemkey: has joined #RubyOnRails
[08:41:17] elaptics`away: has left #RubyOnRails: ()
[08:41:30] shibabu: has joined #RubyOnRails
[08:41:31] elaptics: has joined #RubyOnRails
[08:42:40] tetraktys: has joined #RubyOnRails
[08:43:25] zpe: has joined #RubyOnRails
[08:43:32] Silex: why do yout hink it is bad?
[08:44:00] Silex: anyway, you could make it api.server.com/file?path={path}
[08:46:30] AndreasGB: I think it is bad because it would look like this: api.server.com/file/C:\Users\Andreas\Documents\receiver.py/
[08:46:50] pawnbox: has joined #RubyOnRails
[08:47:11] nhhagen: has joined #RubyOnRails
[08:47:20] Silex: are you making some sort of file explorer?
[08:47:51] Silex: anyway, api.server.com/file?path=C%3A%5CUsers%5CAndreas%5Csomefile.py
[08:48:08] Silex: (url encode it)
[08:48:10] pyemkey: has joined #RubyOnRails
[08:48:20] artto: has joined #RubyOnRails
[08:48:22] Silex: and you can use it in params[:path]
[08:49:02] AndreasGB: No file explorer; I try to make a service that renames icons to be consistent across multiple computers
[08:49:13] User458764: has joined #RubyOnRails
[08:49:42] AndreasGB: I guess these are my only two options right? Both don't really look pretty
[08:50:02] Silex: you can't have '\' in an url
[08:50:24] Silex: you could use forward slashes tho
[08:50:37] sevenseacat: not without encoding them
[08:50:44] Silex: e.g cygwin'ish paths
[08:51:05] Silex: api.server.com/file/c/Users/Andreas/receiver.py
[08:51:22] tenderlove: has joined #RubyOnRails
[08:51:46] Silex: but that requires a bit of manipulation before you can use straight on the host
[08:52:07] AndreasGB: I guess then I will use the simpler version and url encode it
[08:52:31] Silex: it depends whether url-prettyness is really important or not
[08:52:58] AndreasGB: It's not really important; users won't see the url anyway
[08:53:08] AndreasGB: I just wanted it to look nice for me :D
[08:54:25] reoring: has joined #RubyOnRails
[08:55:25] moei: has joined #RubyOnRails
[08:57:25] reoring_: has joined #RubyOnRails
[08:58:35] teclator: has joined #RubyOnRails
[08:59:30] jgt2: has joined #RubyOnRails
[09:01:23] ur5us: has joined #RubyOnRails
[09:03:31] Hazim: has joined #RubyOnRails
[09:04:48] pyemkey: has joined #RubyOnRails
[09:06:47] tvw: has joined #RubyOnRails
[09:07:19] Grey_H: has joined #RubyOnRails
[09:07:25] darkxploit: has joined #RubyOnRails
[09:07:30] jsrn: has joined #RubyOnRails
[09:10:30] pulgalipe: has joined #RubyOnRails
[09:11:05] snowy: has joined #RubyOnRails
[09:12:01] arBmind: has joined #RubyOnRails
[09:15:14] jsrn_: has joined #RubyOnRails
[09:16:12] agoldboi: has joined #RubyOnRails
[09:17:43] pyemkey: has joined #RubyOnRails
[09:18:28] pawnbox: has joined #RubyOnRails
[09:20:03] defsdoor: has joined #RubyOnRails
[09:21:27] lipoqil: has joined #RubyOnRails
[09:22:49] moei: has joined #RubyOnRails
[09:25:49] n008f4g_: has joined #RubyOnRails
[09:26:48] pulgalipe: has joined #RubyOnRails
[09:30:48] kitsuneyo: has joined #RubyOnRails
[09:34:12] roshanavand: has joined #RubyOnRails
[09:34:23] pyemkey: has joined #RubyOnRails
[09:35:01] WhereIsMySpoon_: has joined #RubyOnRails
[09:39:40] ql6wlld: has joined #RubyOnRails
[09:42:31] zpe: has joined #RubyOnRails
[09:44:34] rodfersou: has joined #RubyOnRails
[09:45:40] tenderlove: has joined #RubyOnRails
[09:46:33] yfeldblum: has joined #RubyOnRails
[09:47:49] zpe: has joined #RubyOnRails
[09:51:51] build22: has joined #RubyOnRails
[09:53:41] build22: has joined #RubyOnRails
[09:54:40] roshanavand: has joined #RubyOnRails
[09:55:27] techsethi: has joined #RubyOnRails
[09:55:41] Quintasan: has joined #RubyOnRails
[09:55:41] Quintasan: has joined #RubyOnRails
[09:57:59] Ergo: has joined #RubyOnRails
[09:58:23] akshat: has joined #RubyOnRails
[10:00:03] Palsson: has joined #RubyOnRails
[10:00:41] pyemkey: has joined #RubyOnRails
[10:00:42] steffkes: has joined #RubyOnRails
[10:00:42] steffkes: has joined #RubyOnRails
[10:02:04] xcesariox: has joined #RubyOnRails
[10:02:39] zamerick_: has joined #RubyOnRails
[10:03:32] Xentil: has joined #RubyOnRails
[10:08:12] quazimodo: has joined #RubyOnRails
[10:10:27] agoldboi: has joined #RubyOnRails
[10:13:40] NBarnes: has joined #RubyOnRails
[10:13:57] ruid: has joined #RubyOnRails
[10:13:57] ruid: has joined #RubyOnRails
[10:14:37] ur5us: has joined #RubyOnRails
[10:14:40] ElFerna: has joined #RubyOnRails
[10:16:39] deception1: has joined #RubyOnRails
[10:18:17] nfk|laptop: has joined #RubyOnRails
[10:21:04] deception1: Hi, I am new to ruby and ruby on rails, currently I am installing rails gem, it seems rails have dependency with following gems namely, active support, active record, rack, action pack, action mailer, active resource. (I have seen them while installing rails).I would like to know the responsibilities of those gems, afak active record helps with models no idea about the others,Since googling them leads me to more advanced discussions which I couldn't u
[10:21:47] defsdoor: deception1, those are the core rails gems
[10:22:01] defsdoor: they are rails
[10:22:22] pyemkey: has joined #RubyOnRails
[10:24:04] deception1: defsdoor, they are there because they provide some abstraction, right. so each of them have some responsibilities. like active record is an ORM ?
[10:24:05] JohnBat26: has joined #RubyOnRails
[10:24:25] ur5us: has joined #RubyOnRails
[10:25:30] FernandoBasso: has joined #RubyOnRails
[10:25:31] deception1: defsdoor, thanks I forgot that those gems have readme doc :)
[10:25:51] Quintasan: has joined #RubyOnRails
[10:25:51] Quintasan: has joined #RubyOnRails
[10:27:15] zpe: has joined #RubyOnRails
[10:31:21] snowy: has joined #RubyOnRails
[10:33:25] antgel: has joined #RubyOnRails
[10:35:30] solars: is there an easy way to access hashes with methods instead of keys? I need to test a json response and it's painful
[10:37:39] JohnBat26: has joined #RubyOnRails
[10:37:46] Pazician: has joined #RubyOnRails
[10:37:46] Pazician: has joined #RubyOnRails
[10:38:47] djgraham: has left #RubyOnRails: ()
[10:38:52] jxs_: has joined #RubyOnRails
[10:39:01] Peg-leg: has joined #RubyOnRails
[10:39:38] tenderlove: has joined #RubyOnRails
[10:40:19] pushpak: has joined #RubyOnRails
[10:41:10] ljarvis: has joined #RubyOnRails
[10:41:55] ljarvis: is it possible to rename_table in a migration without renaming constraints? (in which case they're dropped and re-added which I'd like to avoid)
[10:42:05] shibabu: has joined #RubyOnRails
[10:43:15] bronson: has joined #RubyOnRails
[10:44:22] kitsuneyo: has joined #RubyOnRails
[10:45:44] fox_mulder_cp: ljarvis: you must rename table and reconfigure relations, but test it into test app project before touching production
[10:47:30] gioele: has joined #RubyOnRails
[10:47:39] ljarvis: fox_mulder_cp: right, but rename_table renames the indexes/constraints automatically which is what I'm trying to avoid
[10:48:37] ElFerna: has joined #RubyOnRails
[10:49:41] ljarvis: I guess I can just use raw sql
[10:50:58] gioele: hi, can the `flash` object be accessed from inside an helper method called from ERB? I can see the `flash` variable set in the ERB context, but inside the helper `flash` is not accessible
[10:52:34] gioele: oh, I see, it is not available inside a _lambda_ that is called from the helper
[10:54:11] teclator: has joined #RubyOnRails
[10:58:08] efy: has joined #RubyOnRails
[10:58:14] AndreasGB: has joined #RubyOnRails
[10:59:03] c355E3B: has joined #RubyOnRails
[10:59:50] Detch: has joined #RubyOnRails
[11:00:01] FooMunki: has joined #RubyOnRails
[11:02:55] suchness: has joined #RubyOnRails
[11:03:34] doodlehaus: has joined #RubyOnRails
[11:03:40] suchness: I am curious what you all call your different environments. I usually have three environments, production, beta, and a development server environment. What do you all call them?
[11:03:52] antgel: has joined #RubyOnRails
[11:04:00] Hates_: suchness: production and staging
[11:04:19] suchness: Just the two huh?
[11:04:55] Hates_: suchness: yeah, no need for more on our current projects
[11:05:15] suchness: I would like to have that, we currently have 6!
[11:05:43] suchness: I am trying to get our business development team to understand it's way to many
[11:06:32] suchness: I wonder though, if you had to have three, would you call the one furthest away from production the beta, or the staging server, or something else?
[11:06:34] Hates_: suchness: I've worked on a project with 5. I think they were production, pre-prod, staging, qa, dev
[11:06:56] suchness: Hates_: Yeah that's pretty much what I have setup now, with one additional server for longer term development
[11:07:41] Hates_: suchness: depends, to me staging means it's just waiting to go onto production and just needs a final approval
[11:07:53] suchness: Yeah, that's kind of my thought as well.
[11:08:25] suchness: I can't really think of a better name than development, but I don't want that to clash with local development and all of those configurations.
[11:08:27] Hates_: suchness: I would name the tier under that as development as it's for
[11:08:40] Hates_: suchness: demonstating features etc
[11:08:46] jcromartie: has joined #RubyOnRails
[11:08:52] Hates_: suchness: yeah, the name clash is a pain in that case
[11:08:56] suchness: How do you differentiate between 'server development' and 'local development' environments?
[11:09:24] Hates_: naming stuff is always difficult
[11:09:30] suchness: I might just call it server development, that wouldn't be too bad.
[11:10:25] rikkipitt: has joined #RubyOnRails
[11:10:54] GarethAdams: has joined #RubyOnRails
[11:10:56] rikkipitt: hello everyone. I'm just wondering where people tend to put their Faraday (or generic API) connection scripts for accessing remote data in a model?
[11:11:25] CornishPasty: rikkipitt: I personally use a Her model
[11:11:39] rikkipitt: CornishPasty: I've just found Her
[11:12:04] rikkipitt: does it work when a resource isn't strictly restful?
[11:12:34] rikkipitt: or can it be configured to return what you like from the end point? It's a single endpoint...
[11:12:40] pawnbox: has joined #RubyOnRails
[11:14:33] pawnbox: has joined #RubyOnRails
[11:14:41] yogeshrt: has joined #RubyOnRails
[11:18:15] Sawbones: has joined #RubyOnRails
[11:20:29] rickmasta: has joined #RubyOnRails
[11:20:56] nfk|laptop: has joined #RubyOnRails
[11:21:34] yashinbasement: has joined #RubyOnRails
[11:22:28] ElFerna: has joined #RubyOnRails
[11:22:53] cabotto: has joined #RubyOnRails
[11:23:42] yashinbasement: Hi I want to create a table in my rails app, Examples http://markcell.github.io/jquery-tabledit/#examples can anyone guide what's the best gem or approach to do this (jquery and rails)
[11:25:25] kitsuneyo: has joined #RubyOnRails
[11:25:27] Oog: has joined #RubyOnRails
[11:28:51] maesitos: has joined #RubyOnRails
[11:29:56] shock_one: has joined #RubyOnRails
[11:30:12] marr: has joined #RubyOnRails
[11:31:29] ljarvis: has left #RubyOnRails: ()
[11:34:33] arup_r: has joined #RubyOnRails
[11:35:14] sininen: has joined #RubyOnRails
[11:35:50] kmckelvin: has joined #RubyOnRails
[11:37:06] doodlehaus: has joined #RubyOnRails
[11:37:10] chipotle: has joined #RubyOnRails
[11:42:58] artto: has joined #RubyOnRails
[11:43:03] redondos: has joined #RubyOnRails
[11:43:53] nyaa: has joined #RubyOnRails
[11:43:57] shibabu: has joined #RubyOnRails
[11:44:12] drptbl: has joined #RubyOnRails
[11:47:35] cassioscabral: has joined #RubyOnRails
[11:48:10] drptbl: has joined #RubyOnRails
[11:50:45] cassioscabral_: has joined #RubyOnRails
[11:51:16] tetraktys: has joined #RubyOnRails
[11:51:26] mercwithamouth: has joined #RubyOnRails
[11:51:39] drptbl: has joined #RubyOnRails
[11:52:12] ewnd9: has joined #RubyOnRails
[11:52:12] mercwithamouth: does anyone know of any open source projects where i can see nested resources created.....i've been having an issue getting a form to work. i'm not at my computer at the moment to show the error or code...
[11:52:30] moeabdol: has joined #RubyOnRails
[11:52:49] c355E3B: mercwithamouth: try altered beast
[11:52:58] c355E3B: Last i recall it had a decent example
[11:53:04] mercwithamouth: c355e3b: thanks...checking it out
[11:55:15] mercwithamouth: c355e3b: ah hah...i think this is exactly what i needed to see...
[11:55:51] c355E3B: A word of warning it's old rails code, you may run into issues using it for 4.2
[11:56:01] drptbl: has joined #RubyOnRails
[11:56:37] mercwithamouth: yeah...this gives me the basics though. i should be able to work it out
[11:58:47] kitsuneyo: has joined #RubyOnRails
[11:59:52] drptbl: has joined #RubyOnRails
[12:00:41] lacrymology: has joined #RubyOnRails
[12:02:33] doodlehaus: has joined #RubyOnRails
[12:03:09] FooMunki: has joined #RubyOnRails
[12:03:53] cornerma1: has joined #RubyOnRails
[12:04:37] drptbl: has joined #RubyOnRails
[12:05:04] build22_: has joined #RubyOnRails
[12:09:08] ElFerna: has joined #RubyOnRails
[12:12:32] Pupeno: has joined #RubyOnRails
[12:12:32] Pupeno: has joined #RubyOnRails
[12:12:34] gavit: wow, I know I am using dotenv, but I cant find where I initialized it :S
[12:12:43] ibouvousaime: has joined #RubyOnRails
[12:13:49] pawnbox: has joined #RubyOnRails
[12:13:52] NBarnes: has joined #RubyOnRails
[12:15:49] pawnbox: has joined #RubyOnRails
[12:16:00] AntiSpamMeta: has joined #RubyOnRails
[12:16:14] nocontrol: has joined #RubyOnRails
[12:16:15] c355E3B: gavit: grep -r . "Dotenv" ?
[12:17:17] SylarRuby: has joined #RubyOnRails
[12:17:20] sevenseacat: you didnt need to initialize it, if you're using dotenv-rails
[12:18:55] gavit: c355e3b: I did find ./ -type f -exec grep -H 'dotenv' {} \;
[12:19:08] gavit: I only get gemfile.lock and Gemfile
[12:19:33] c355E3B: as sevenseacat said, dotenv does initialize itself
[12:19:42] gavit: sevenseacat: that's why! :)
[12:20:33] gavit: but if thats true, I dont get why my current app is giving me 'Incomplete response received from application'
[12:20:44] gavit: I cant find anything in my production.log
[12:20:58] c355E3B: does rails c start in production?
[12:21:03] sevenseacat: gavit: whats that got to do with dotenv?
[12:21:33] gavit: sevenseacat: according to the internet its because my secret key isnt 'loaded'
[12:21:39] gavit: but I see I'm an idiot :)
[12:21:46] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[12:22:06] gavit: ACTION cd'd into current and then deployed, which changed the 'current' dir. so I was looking in the wrong dir
[12:22:20] shmoon: has joined #RubyOnRails
[12:22:45] gavit: nope guess not :(
[12:22:58] shmoon: in our production app, we get about 200-300 cases of ActionController::InvalidAuthenticityToken errors every day, I'm trying to figure out why is that but I don't understand. could someone help me figure out what to do ?
[12:23:20] gavit: sevenseacat: all I know right now is that when I go to the production environment where I have a .env I get 'Incomplete response received from application'
[12:23:32] sevenseacat: get when? how?
[12:23:41] sevenseacat: where? where's the rest of the info?
[12:23:42] gavit: sevenseacat: I'm guessing its related to secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
[12:23:54] sevenseacat: did you set that value?
[12:23:57] qejk: has joined #RubyOnRails
[12:24:14] gavit: sevenseacat: when browsing to server_ip:80
[12:24:22] marienz: has joined #RubyOnRails
[12:24:31] gavit: sevenseacat: I set the value in .env
[12:24:40] gavit: sevenseacat: but I am wondering if it get's loaded
[12:24:49] nfk|laptop: has joined #RubyOnRails
[12:25:14] chrislotix: has joined #RubyOnRails
[12:26:39] pulgolino: has joined #RubyOnRails
[12:26:51] loren: has joined #RubyOnRails
[12:26:54] nettoweb: has joined #RubyOnRails
[12:27:03] gavit: sevenseacat: https://gist.github.com/gavit/77bd9b3b246683aa9026https://gist.github.com/gavit/77bd9b3b246683aa9026
[12:27:33] chrislotix: Hey guys i posted this issue on SO and i've gotten an answer but i'm not quite sure how to approach it. http://stackoverflow.com/questions/34227796/has-one-association-and-disappearing-user-id (Benjamin's answer)
[12:27:45] chrislotix: Would anyone mind explaining me? I'm quite new to rails
[12:28:07] tenderlove: has joined #RubyOnRails
[12:28:27] sevenseacat: gavit: uh... thats not a valid .env file
[12:28:28] confact: gavit: you show us your db & email password.. not a good idea.
[12:28:41] tknz: has joined #RubyOnRails
[12:28:45] ornerymoose: has joined #RubyOnRails
[12:28:45] sevenseacat: check out the example format here - https://github.com/bkeepers/dotenv#usage
[12:29:11] gavit: confact: I changed it :)
[12:29:31] FernandoBasso: I need ideas. There is a system where users log in and see only their on stuff. One session per user only is allowed. We now need to allow a "support" person to login and see the content as if they were the user. What approaches could be considered?
[12:29:39] gavit: sevenseacat: hmm, I'll check why it's invalid
[12:29:39] sevenseacat: chrislotix: you have a post without a user
[12:29:43] sevenseacat: seems pretty straightforward
[12:30:35] c355E3B: FernandoBasso: I've always split the User's data and the Users's identity into two distinct systems.
[12:30:56] sevenseacat: chrislotix: if a user has_one post, then when you create a second post for the user, then they get disassociated from the first post
[12:31:06] jgt2: has joined #RubyOnRails
[12:31:07] confact: gavit: puh, good. you scared me for a bit.
[12:31:22] FernandoBasso: c355e3b: I see. Just that this is a system I am maintaining. I did not make any decisions about its design.
[12:31:47] gavit: confact: you'll need to be on the localhost anyways
[12:32:11] chrislotix: sevenseacat: I understand as much. What i don't understand is what edit action has to do with it and how would i find the correct user again.
[12:32:37] sevenseacat: chrislotix: a user has_one post, but your reproduction steps create *two* posts for one user
[12:32:44] sevenseacat: they will only have the latter one
[12:32:52] gavit: sevenseacat: odd, on a 'working' I have :, but my googlefoo shows me '=' Did it change?
[12:32:53] sevenseacat: the first one will change to have no user
[12:33:00] sevenseacat: gavit: no it did not.
[12:34:20] FernandoBasso: c355e3b: They even store user passwords in plain text, if you believe me...
[12:35:44] dede__: has joined #RubyOnRails
[12:36:29] chipotle: has joined #RubyOnRails
[12:36:30] chrislotix: sevenseacat: Oh i get it now, so how do you find the correct user again if the user_id gets nil after trying to create second post?
[12:37:36] elaptics: FernandoBasso: seriously? yikes
[12:38:13] elaptics: chrislotix: the url has the id as part of it so that you can pick it up and re-find it
[12:39:47] broman: has joined #RubyOnRails
[12:40:10] broman: can someone please help me? i have this object: e=[@list=[a,b]] .... how do i update e.@list ?
[12:40:52] broman: let me paste it so you can have a better look
[12:41:18] krz: has joined #RubyOnRails
[12:41:30] broman: sevenseacat, http://pastie.org/10632091
[12:41:56] sevenseacat: ok, thats totally different, thats just an object
[12:42:20] broman: the thing is.. i got new elements i would like to replace on the @lista variable
[12:42:27] broman: @lista = newarray
[12:42:28] sevenseacat: if your object has a setter for lista, then you can modify it
[12:42:37] FernandoBasso: elaptics: I'm indeed serious.
[12:42:56] elaptics: FernandoBasso: what does the app do?
[12:43:14] broman: sevenseacat, can't i just do something like EventoPresenter.@lista = @newarray ?
[12:43:33] FernandoBasso: elaptics: It is for generating landing pages and banners for advertisement.
[12:44:26] wmdrossard: has joined #RubyOnRails
[12:45:10] elaptics: FernandoBasso: I would say, job one should be to get those passwords encrypted :)
[12:45:11] gavit: sevenseacat: I replaced it, but it doesnt seem to have resulted in a loaded env file :( s/: /=/g
[12:45:27] sevenseacat: gavit: !debug
[12:45:27] helpa: gavit: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[12:46:46] FernandoBasso: elaptics: Sure, but I am not allowed to change that. There are a lot of stuff that depend on that, like, sending the "lost" password to people. They just read it from db and send by email.
[12:46:51] FernandoBasso: I would need to change tons of stuff.
[12:47:01] FernandoBasso: Perhaps in the future, if time permits.
[12:47:23] elaptics: I would run away - very fast! :)
[12:48:10] elaptics: FernandoBasso: since security seems to be minimal you practically might as well just show the password to the support user and get them to log right in...
[12:48:38] FernandoBasso: The problem, as I said, is that only one session per user is allowed.
[12:48:56] FernandoBasso: If the support person logs in, the system will logout the original user, and vice-versa.
[12:49:17] FernandoBasso: The original user can't even login from two browsers.
[12:49:25] FernandoBasso: (not at the same time).
[12:51:27] bronson: has joined #RubyOnRails
[12:52:54] chipotle: has joined #RubyOnRails
[12:55:59] snowy: has joined #RubyOnRails
[12:56:24] tenderlove: has joined #RubyOnRails
[12:56:49] shibabu: has joined #RubyOnRails
[13:01:16] robbanp: has joined #RubyOnRails
[13:02:01] renegadeandy: has joined #RubyOnRails
[13:02:26] ornerymoose: has joined #RubyOnRails
[13:06:20] jtb__: has joined #RubyOnRails
[13:07:56] doodlehaus: has joined #RubyOnRails
[13:07:57] c355E3B: FernandoBasso: it sounds like you have a lot of refactoring to do
[13:08:11] c355E3B: All I can say is good luck and I hope you have tests
[13:08:34] Quintasan: has joined #RubyOnRails
[13:08:34] Quintasan: has joined #RubyOnRails
[13:09:13] akshat: has joined #RubyOnRails
[13:09:15] FernandoBasso: I have no luck and no tests.
[13:10:09] FernandoBasso: But I will perhaps take the opportunity to learn how to write tests for rails apps on the weekends, on this project.
[13:10:21] FernandoBasso: My experience with rails so far was the getting started tutorial.
[13:10:45] c355E3B: Oh man they are not making it easy on you are they?
[13:10:50] IFrank00: has joined #RubyOnRails
[13:11:04] FernandoBasso: And then suddenly this maintenance project popped up.
[13:11:22] FernandoBasso: c355e3b: I am not afraid of these tasks. The only constraint is time.
[13:11:41] c355E3B: That is the attitude to have
[13:12:21] jtb__: has joined #RubyOnRails
[13:12:25] FernandoBasso: They are two different pieces of software, and they are already in production, users accessing, etc. Sometimes I am in a hurry to fix or implement something. That is when time pressure is cruel.
[13:12:49] FernandoBasso: But I am loving rails anyway, despite the unconventional way to get started.
[13:13:43] ornerymoose_: has joined #RubyOnRails
[13:15:51] acosonic: has joined #RubyOnRails
[13:21:05] rickmasta: has joined #RubyOnRails
[13:21:17] steffkes: has joined #RubyOnRails
[13:21:17] steffkes: has joined #RubyOnRails
[13:21:41] cassioscabral: has joined #RubyOnRails
[13:23:51] pulgolino: has joined #RubyOnRails
[13:24:55] pulgolino: has joined #RubyOnRails
[13:25:39] Mia: has joined #RubyOnRails
[13:25:39] Mia: has joined #RubyOnRails
[13:26:09] Axy: has joined #RubyOnRails
[13:26:10] Axy: has joined #RubyOnRails
[13:27:27] ibouvousaime: has joined #RubyOnRails
[13:29:21] shanemcd: has joined #RubyOnRails
[13:30:04] NBarnes: has joined #RubyOnRails
[13:30:41] dideler: has joined #RubyOnRails
[13:31:00] shanemcd: has joined #RubyOnRails
[13:31:29] Ergo: has joined #RubyOnRails
[13:32:39] bmalum_: has joined #RubyOnRails
[13:32:50] appledroid: has joined #RubyOnRails
[13:33:54] aaronr: has joined #RubyOnRails
[13:38:22] Darkman738: has joined #RubyOnRails
[13:39:10] Bloomer: has joined #RubyOnRails
[13:39:14] shock_one: has joined #RubyOnRails
[13:40:38] moeabdol: has joined #RubyOnRails
[13:43:31] gabeodess: has joined #RubyOnRails
[13:44:35] shibabu: has joined #RubyOnRails
[13:45:35] thejamespinto: has joined #RubyOnRails
[13:49:19] netwoodle: has joined #RubyOnRails
[13:52:12] goodcodeguy: has joined #RubyOnRails
[13:52:26] tvw: has joined #RubyOnRails
[13:53:15] jkamenik: has joined #RubyOnRails
[13:54:01] emilkarl: has joined #RubyOnRails
[13:54:47] ramortegui: has joined #RubyOnRails
[13:54:52] wacko: has joined #RubyOnRails
[13:56:17] d0nn1e: has joined #RubyOnRails
[13:56:24] appledroid: Hi everyone. I'm having this issue that is stumping me and was wondering if anyone could take a quick peek? https://gist.github.com/726c04b7ccff534ad470
[13:57:36] Hates_: appledroid: what error are you getting?
[13:57:45] appledroid: Sorry, I forgot the error =/ Mondays. https://gist.github.com/5997e690c1283d84df74
[13:58:13] Hazim: has joined #RubyOnRails
[13:58:21] Hates_: appledroid: nothing to do with load paths changing from pre 4 to 4?
[13:58:33] andrmrtmr: has joined #RubyOnRails
[13:59:05] Hates_: appledroid: have you tried c.classify.constantize too?
[13:59:17] appledroid: I haven't tried .classify, let me check
[13:59:27] appledroid: Don't believe its load paths as of yet
[13:59:37] mary5030: has joined #RubyOnRails
[13:59:51] Hates_: appledroid: does "Bin".constantize work on it's own?
[14:00:31] appledroid: .classify produces same. And the actual classes exist and work =(
[14:00:49] Hates_: appledroid: and in your console you can do it like I put above?
[14:01:14] appledroid: Yeah, console works fine
[14:01:32] nettoweb: guys, Im trying to folter a list of results with Ransack and getting "undefined method" using this field: <%= f.search_field :id_eq_or_user_name_cont %>. that model belongs to user
[14:01:46] Hates_: appledroid: so if it works in the console it'll be something to do with the params you're passing in?
[14:02:31] nettoweb: it's possible only using this way: <%= f.search_field :id_or_user_name_cont %>, so, using same type (cont) for both fields
[14:02:45] appledroid: Yeah, that was the only thing I could thing of also, but the params are all correct, I logged them out prior to the call
[14:03:58] appledroid: I know the enum on a string was removed, and I've run just about everything I can think of (camelcase, uppercase, etc).constantize and it always chokes
[14:04:56] appledroid: I'll do some more trial and error on it and see if I can find some more valuable info =)
[14:05:44] NBarnes: has joined #RubyOnRails
[14:06:32] trautwein: has joined #RubyOnRails
[14:06:33] nettoweb: any help with ransack?
[14:07:45] artX000: has joined #RubyOnRails
[14:07:59] ace05: has joined #RubyOnRails
[14:10:15] jtb__: has joined #RubyOnRails
[14:13:33] zamerick_: has joined #RubyOnRails
[14:13:45] kuroro: has joined #RubyOnRails
[14:14:00] B1n4r10: has joined #RubyOnRails
[14:14:21] symbol: has joined #RubyOnRails
[14:14:49] Axilla: has joined #RubyOnRails
[14:15:44] gavit: why does my capistrano first look in my .env file exists and then ln it
[14:17:58] mary5030: has joined #RubyOnRails
[14:18:20] atomical: has joined #RubyOnRails
[14:18:32] tetraktys: has joined #RubyOnRails
[14:19:55] rgtk: has joined #RubyOnRails
[14:19:59] johnflux: has joined #RubyOnRails
[14:20:00] johnflux: has joined #RubyOnRails
[14:23:47] symbol: has joined #RubyOnRails
[14:25:08] Yomero3: has joined #RubyOnRails
[14:26:07] atomical: has joined #RubyOnRails
[14:26:44] arup_r: When I am trying to create a permission object, it is getting called 2 times. Why so ? https://gist.github.com/aruprakshit/0840b03570b92c9a1242
[14:26:45] boxofrox: has joined #RubyOnRails
[14:26:50] n1lo: has joined #RubyOnRails
[14:27:26] thejamespinto: has joined #RubyOnRails
[14:27:27] BhavyaM: has joined #RubyOnRails
[14:28:41] bmalum_: has joined #RubyOnRails
[14:29:28] uris: has joined #RubyOnRails
[14:29:50] dstarh: has joined #RubyOnRails
[14:32:34] silverdust: Where may I get the FACEBOOK_KEY and FACEBOOK_SECRET for working with omniauth-facebook
[14:32:50] fox_mulder_cp: silverdust: in facebook dev center
[14:33:05] silverdust: All I see is JavaScript SDK
[14:33:18] silverdust: can you help with a link
[14:33:38] fox_mulder_cp: ttps://developers.facebook.com/
[14:34:22] doodlehaus: has joined #RubyOnRails
[14:34:45] silverdust: hmm that's their entire developers site that's misleading
[14:34:56] The_Phoenix: has joined #RubyOnRails
[14:35:48] atomical_: has joined #RubyOnRails
[14:36:08] roshanavand: has joined #RubyOnRails
[14:36:24] diego2: has joined #RubyOnRails
[14:37:03] diego2: I've added bootstrap-sass to my rails app, what's the sane way to use the material theme from bootstrap in rails?
[14:37:12] mary5030: has joined #RubyOnRails
[14:38:55] silverdust: dviola: I recommend you don't use rubygems to manage your assets
[14:39:20] roshanavand: has joined #RubyOnRails
[14:39:52] roshanavand: has joined #RubyOnRails
[14:40:30] silverdust: Start by creating a .bowerrc file in the root of your project
[14:40:38] silverdust: * root directory
[14:41:00] silverdust: Add this {"directory" : "vendor/assets/components" }
[14:41:16] silverdust: This tells bower to install components to the vendor directory
[14:41:33] dviola: isn't bower a nodejs thing?
[14:41:50] silverdust: no bower is a frontend asset management thing
[14:42:01] mostlybadfly: has joined #RubyOnRails
[14:42:14] silverdust: npm is another package manager particular for node
[14:42:23] dviola: just to be clear
[14:42:29] silverdust: It does require npm to install
[14:42:37] dviola: silverdust: I remove bootstrap-sass from my Gemfile and I add all that with bower?
[14:42:46] silverdust: so install with npm install -g bower
[14:43:08] silverdust: Do you by chance have npm installed before now?
[14:43:15] dviola: yeah I have npm
[14:43:18] dviola: and nodejs
[14:43:23] dviola: I'm on archlinux
[14:43:36] silverdust: another important thing to do is this
[14:44:07] silverdust: Add this to your config/application.rb
[14:44:09] silverdust: config.assets.paths << Rails.root.join('vendor', 'assets', 'components')
[14:44:45] silverdust: It makes it then easy for you to use sprockets to include any javascript or css asset in application.js or application.css
[14:45:06] polishdub: has joined #RubyOnRails
[14:46:43] Scripore: has joined #RubyOnRails
[14:46:43] jtb___: has joined #RubyOnRails
[14:49:58] roshanavand: has joined #RubyOnRails
[14:50:26] mikecmpbll: has joined #RubyOnRails
[14:50:31] silverdust: I keep getting here https://developers.facebook.com/docs/facebook-login/web#token no matter how hard I try to get a api key and api secret key for facebook omniauth
[14:51:02] tenderlove: has joined #RubyOnRails
[14:51:31] mhib: has joined #RubyOnRails
[14:51:47] jtb__: has joined #RubyOnRails
[14:52:52] roshanavand: has joined #RubyOnRails
[14:53:26] jgt2: has joined #RubyOnRails
[14:53:44] bronson: has joined #RubyOnRails
[14:54:18] jgpawletko: has joined #RubyOnRails
[14:56:59] B1n4r10: has joined #RubyOnRails
[14:58:24] gabeodess: Is it possible to monkeypatch through a method call? I???m trying to add custom predicates to Arel, and I would like to obfuscate it through a method like this: https://gist.github.com/gabeodess/e24e99085b0455f90a15
[14:58:55] gabeodess: apparently I cannot define Modules or Classes within a method, so is there some other way to do this?
[14:59:04] Sawbones: has joined #RubyOnRails
[14:59:29] gabeodess: basically I want to be able to call Arel.add_predicate and then have that predicate accessible.
[14:59:35] goodcodeguy: has joined #RubyOnRails
[15:01:02] Cervajz: has joined #RubyOnRails
[15:01:39] sininen_: has joined #RubyOnRails
[15:01:46] stannard: has joined #RubyOnRails
[15:05:01] PsychoPhobic: has joined #RubyOnRails
[15:05:36] artto: has joined #RubyOnRails
[15:05:37] chipotle: has joined #RubyOnRails
[15:05:41] mary5030: has joined #RubyOnRails
[15:06:46] nettoweb: has joined #RubyOnRails
[15:07:21] PsychoPhobic: has joined #RubyOnRails
[15:08:06] jkamenik1: has joined #RubyOnRails
[15:08:47] mary5030: has joined #RubyOnRails
[15:08:54] PsychoPhobic: i found a strange "bug" in serialize.. maybe someone can help me
[15:09:26] Ergo^: has joined #RubyOnRails
[15:09:32] PsychoPhobic: <%= map = {'y' => 'x1', 'x1' => 'y' } %><br/> #=> {"y"=>"x1", "x1"=>"y"}
[15:09:32] PsychoPhobic: <%= mapb = r['sub'] %><br/> #=> {"y"=>"x1", "x1"=>"y"}
[15:09:32] PsychoPhobic: <%= map.class %><br/> #=> Hash
[15:09:32] PsychoPhobic: <%= mapb.class %><br/> #=> Hash
[15:09:32] PsychoPhobic: <%= map.keys %><br/> #=> ["y", "x1"]
[15:09:32] PsychoPhobic: <%= mapb.keys %><br/> #=> #=> NoMethodError: undefined method `keys' for []:Array
[15:09:50] PsychoPhobic: r['sub'] is a serialized hash
[15:10:42] lacrymology: has joined #RubyOnRails
[15:12:17] Quintasan: has joined #RubyOnRails
[15:12:17] Quintasan: has joined #RubyOnRails
[15:13:02] loren: has joined #RubyOnRails
[15:14:09] dviola: silverdust: should I use the bower-rails gem?
[15:17:59] brunoalano: has joined #RubyOnRails
[15:18:07] lacrymology: has joined #RubyOnRails
[15:18:35] Fly80: has joined #RubyOnRails
[15:20:28] kiez0rd: has joined #RubyOnRails
[15:22:13] rickmasta: has joined #RubyOnRails
[15:23:42] sarink: has joined #RubyOnRails
[15:26:46] adavia: has joined #RubyOnRails
[15:26:52] ornerymoose: has joined #RubyOnRails
[15:28:51] moeabdol: has joined #RubyOnRails
[15:29:12] hardtail: has joined #RubyOnRails
[15:29:49] atomical: has joined #RubyOnRails
[15:33:34] kitsuneyo: has joined #RubyOnRails
[15:34:01] Jet4Fire: has joined #RubyOnRails
[15:39:31] marr: has joined #RubyOnRails
[15:41:04] robbanp: has joined #RubyOnRails
[15:41:37] Quintasan: has joined #RubyOnRails
[15:41:37] Quintasan: has joined #RubyOnRails
[15:42:05] axl_: has joined #RubyOnRails
[15:42:17] jtb__: has joined #RubyOnRails
[15:42:31] arup_r: has joined #RubyOnRails
[15:43:49] Hates_: PsychoPhobic: please use a gist for code !gist
[15:43:58] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[15:45:35] tenderlove: has joined #RubyOnRails
[15:45:38] shanemcd: has joined #RubyOnRails
[15:48:07] dviola: do you guys use bower to manage your assets?
[15:48:25] dviola: what do you use
[15:48:41] tubbo: well i guess i do if i need some stuff that
[15:48:44] tubbo: doesn't have a gem made up for it
[15:48:56] dviola: I need some boostrap that are not in gems
[15:48:59] tubbo: but i'm using bower repos through the https://rails-assets.org thing
[15:49:00] Hates_: bower-rails is a good option
[15:49:03] dviola: I'm using bootstrap already
[15:49:08] dviola: but I need some themes that are not as gems
[15:49:16] dviola: what can I do
[15:49:26] mag42c: has joined #RubyOnRails
[15:49:31] tubbo: dviola: check out rails-assets.org?
[15:49:37] dviola: what is this
[15:49:50] dviola: yeah i looked at this
[15:50:58] dviola: is it some bridge between bundler and bower?
[15:51:06] tubbo: yeah, basically
[15:51:13] tubbo: it's pretty easy to use
[15:52:55] roshanavand: has joined #RubyOnRails
[15:53:13] sonofdirt: has joined #RubyOnRails
[15:53:28] gavit: what do I specify in my controller#street_registry_params for https://gist.github.com/gavit/91611216ebefbad4c118#file-console-log-L2 to be 'valid'?
[15:53:51] speakingcode: has joined #RubyOnRails
[15:56:24] alex88: has joined #RubyOnRails
[15:56:49] arup_r: has joined #RubyOnRails
[15:57:30] dviola: so is bower just like a repo basically?
[15:57:34] dviola: to pull all my assets and libs from
[15:57:47] Cache_Money: has joined #RubyOnRails
[16:00:49] gavit: what do I specify in my controller#street_registry_params for https://gist.github.com/gavit/91611216ebefbad4c118#file-console-log-L2 to be 'valid'? also it needs to be "0"=>{"ancestor_ids"=>["18", "3"] I think
[16:01:15] kmckelvi1: has joined #RubyOnRails
[16:02:05] ibouvousaime: has joined #RubyOnRails
[16:03:36] RegulationD: has joined #RubyOnRails
[16:03:42] loren: has left #RubyOnRails: ("Leaving")
[16:06:02] Xentil: has joined #RubyOnRails
[16:06:44] rails487: has joined #RubyOnRails
[16:07:19] Nikke: has joined #RubyOnRails
[16:08:36] nickenchuggets: has joined #RubyOnRails
[16:08:36] nickenchuggets: has joined #RubyOnRails
[16:08:41] arup_r: has joined #RubyOnRails
[16:09:00] dopie: has joined #RubyOnRails
[16:09:22] ace05: has joined #RubyOnRails
[16:09:39] Nikke: hey guys, do you have any tips for gems for admin tools
[16:10:02] Nikke: there's rails_admin by sferik, is it any good?
[16:12:33] elaptics: what do you mean by admin tools?
[16:13:21] nyaa: has joined #RubyOnRails
[16:14:23] deception1: has joined #RubyOnRails
[16:14:47] robbanp: I have a Rails / Session problem, when clients visit a page, there is no session available
[16:14:51] roshanavand: has joined #RubyOnRails
[16:15:01] robbanp: They go to my page, I set a session with some data. Then they are redirected to a 3:rd party, which redirect them back to me.
[16:15:05] shock_one: has joined #RubyOnRails
[16:15:15] robbanp: So I expect there to be a session available, but sometime it???s not there. Any ideas?
[16:16:16] noobi1: has joined #RubyOnRails
[16:16:21] shibabu: has joined #RubyOnRails
[16:17:40] wmdrossard: has joined #RubyOnRails
[16:18:28] ZiggyTheHamster: has joined #RubyOnRails
[16:18:28] ZiggyTheHamster: has joined #RubyOnRails
[16:18:50] nickenchuggets: bundle install keeps stopping part-way, and only displays the message "Killed"
[16:19:13] nickenchuggets: I am trying to upgrade to rails 2.4.5
[16:19:25] elaptics: nickenchuggets: sounds like maybe you're running out of memory or you have something that prevents something running too long
[16:19:34] elaptics: nickenchuggets: also there's no such thing as rails 2.4.5
[16:19:39] gabeodess: has joined #RubyOnRails
[16:19:41] elaptics: do you mean 4.2.5?
[16:20:06] nickenchuggets: feeling dyslexic today I guess
[16:21:14] nickenchuggets: well, yeah, looks like I'm pretty much out of memory
[16:21:36] YankNYC: has joined #RubyOnRails
[16:21:37] tubbo: that'll do it
[16:21:56] tubbo: nickenchuggets: two reasons why bundle would just stop half-way and not tell you -> 1.) out of RAM, 2.) out of disk space
[16:21:59] elaptics: nickenchuggets: at least it's an easy fix :D
[16:22:03] tubbo: 3.) your computer exploded
[16:23:48] roshanavand: has joined #RubyOnRails
[16:25:15] itsmeduncan: has joined #RubyOnRails
[16:25:26] _Tariq: has joined #RubyOnRails
[16:25:31] bmalum_: has joined #RubyOnRails
[16:30:36] Denarii: has joined #RubyOnRails
[16:30:50] amortimer: has joined #RubyOnRails
[16:32:54] [Butch]: has joined #RubyOnRails
[16:33:48] AugustoC: has joined #RubyOnRails
[16:35:00] dviola: has joined #RubyOnRails
[16:35:43] disgrntld: has joined #RubyOnRails
[16:36:10] flashpoint9: has joined #RubyOnRails
[16:37:04] skullcrasher: does activeResource not recognize (and deserialize) json-objects with only one property?
[16:37:39] dviola: has joined #RubyOnRails
[16:37:47] gabeodess: has joined #RubyOnRails
[16:37:55] skullcrasher: something like: {"value":13} seems not to be valid
[16:38:56] tubbo: skullcrasher: i always though ActiveResource had to have the object embedded inside an attribute, like { "modelName": { "value": 13 } }
[16:39:08] tubbo: been a while though
[16:39:18] flashpoint9: There's something I'm not quite understanding about rspec and im not finding any clear tutorials on this. I want to write a super simple test that just verifies an object is created. Here is my rspec code and controller code http://paste.ofcode.org/P5nnfh9gaLUmksxkm6ndFJ.
[16:39:47] tubbo: flashpoint9: well, create() is a private method on the instance of an AR::Base model. so that's your first problem.
[16:39:48] tenderlove: has joined #RubyOnRails
[16:39:48] skullcrasher: tubbo, for findAll and findOne with multiple attributes it seems to work
[16:40:59] flashpoint9: tubbo: ok, so where do I start? i can crud the crap out of rails but im pretty lost for testing, so many tutorials are outdated or dont show eamples of what im trying to accomplish
[16:41:23] chouhoulis: has joined #RubyOnRails
[16:41:23] hobodave: has joined #RubyOnRails
[16:41:48] tubbo: flashpoint9: well, the first thing i would do is look real closely at that code. what exactly is it testing? are you trying to test whether a Trip was created?
[16:42:02] tubbo: flashpoint9: your other problem is require "TripsController", which you don't need.
[16:42:06] tubbo: rails autoloads that for you
[16:42:19] gavit: what do I specify in my controller#street_registry_params for https://gist.github.com/gavit/91611216ebefbad4c118#file-console-log-L2 to be 'valid'? also it needs to be "0"=>{"ancestor_ids"=>["18", "3"] I think
[16:42:32] tubbo: flashpoint9: not sure why spec/trips_spec.rb is named like that, shouldn't it be named spec/controllers/trips_controller_spec.rb?
[16:42:35] flashpoint9: tubbo: my code is pretty rough now, have been trying this and that from multiple tutorials
[16:42:56] brunoalano: Anyone knows a good gem to use Sendgrid Web API instead SMTP?
[16:42:57] flashpoint9: tubbo: i named it like that to match naming conventions on a tutorial
[16:43:27] Encapsulation: has joined #RubyOnRails
[16:43:46] tubbo: flashpoint9: the convention is typically something like spec/controllers/foos_controller_spec.rb. and that goes for everything else in app/
[16:44:07] kitsuneyo: has joined #RubyOnRails
[16:44:23] tubbo: flashpoint9: all that syntax and naming conventions aside (the convention matters because IIRC rspec-rails will automatically change the type of your spec if you put it in a certain folder)
[16:44:35] tubbo: i think you still have an issue trying to run Trip.new.create
[16:44:45] tubbo: there's a class method on AR::Base called create() that is what you want i think
[16:44:49] tubbo: so just Trip.create()
[16:45:10] teclator: has joined #RubyOnRails
[16:45:35] flashpoint9: yea i originally had Trip.create() but no dice and was trying different stuff, im going back through and reading the rspec docs, they arent super clear though
[16:46:00] andatche: has joined #RubyOnRails
[16:46:38] tubbo: flashpoint9: what's "no dice" mean? what happeneD?
[16:46:58] tubbo: flashpoint9: also...you know that none of those methods return a number, right? so expect(Trip.create).to eq(0) wouldn't ever pass.
[16:47:10] flashpoint9: when i tried Trip.create() the test didn't run, nothing happened, no failures,
[16:47:19] tubbo: well you did something else wrong then
[16:47:21] flashpoint9: yes i was trying for a failure
[16:47:30] ewnd9: has joined #RubyOnRails
[16:47:30] tubbo: flashpoint9: what tutorials are you reading btw?
[16:47:33] flashpoint9: i was simply trying to get the test to fail
[16:47:50] flashpoint9: ill have to find the links again, i closed them
[16:48:03] flashpoint9: reading http://rspec.info/documentation/3.4/rspec-core/#Get_Started right now
[16:48:17] flashpoint9: its still not step by step instructions, which i do better with
[16:48:19] tubbo: flashpoint9: oh yeah, sometimes the rspec documentation is a little weird to look at because it's actually generated from cucumber features.
[16:49:11] roshanavand: has joined #RubyOnRails
[16:49:37] tubbo: flashpoint9: you can do two things here...you could either scrap what you're doing and follow that tutorial as loyally as possible, meaning start work in a new folder, create a Gemfile and add rspec to it, `bundle`, then run `rspec --init`, then start the tutorial there.
[16:49:42] atumzin: has joined #RubyOnRails
[16:49:42] atumzin: has joined #RubyOnRails
[16:49:50] sucks: has joined #RubyOnRails
[16:49:52] tubbo: flashpoint9: literally copy/paste code or re-type it and watch what happens.
[16:49:59] shock_one: has joined #RubyOnRails
[16:50:30] tubbo: flashpoint9: you want to learn the mechanics of RSpec the testing framework, here. what you're doing (and what is confusing you) is conflating learning RSpec with learning how Rails testing works.
[16:50:56] tubbo: i think if you learned how RSpec works first, at its most basic level, then it will be easier for you to use rspec-rails.
[16:51:02] _Tariq: has joined #RubyOnRails
[16:51:46] flashpoint9: tubbo: ok, i guess I can do that, not ideal since i need to get rails stuff done also
[16:52:24] tubbo: it shouldn't take you too long...but RSpec has mechanics that work differently from, say, MiniTest.
[16:52:38] tubbo: so it's kinda the same idea as separating learning ruby and rails at the same time.
[16:53:25] rails_nub: has joined #RubyOnRails
[16:54:49] chaas: has joined #RubyOnRails
[16:55:26] chaas: has joined #RubyOnRails
[16:56:10] ElFerna: has joined #RubyOnRails
[16:56:28] browndawg: has joined #RubyOnRails
[16:56:34] leofrozenyogurt: has joined #RubyOnRails
[16:56:38] steffkes: has joined #RubyOnRails
[16:56:39] steffkes: has joined #RubyOnRails
[16:56:51] leofrozenyogurt: im drawing a blank here whats the name for @products =Product.all
[16:57:09] leofrozenyogurt: not an association but the actual name for the the instance variable is
[16:57:10] browndawg: What's a good design for a "Spam Filter" in my rails app? Like one that fires on a certain type of event and figures out if a user is doing something malicious? I don't want to put before_filters in the same controller to avoid bloat...
[16:57:13] tweeeaks: has joined #RubyOnRails
[16:57:50] browndawg: Let's pretend I've got Posts and Comments in the app, and my spam filter can potentially fire on each new post / comment.
[16:59:45] leofrozenyogurt: anyone know how to do a multi record query cleanly?
[16:59:50] leofrozenyogurt: @products.brands
[16:59:58] leofrozenyogurt: so product belongs_to brand
[17:00:07] leofrozenyogurt: @products is Product.all
[17:00:16] Elion: whoops sorry
[17:01:51] hxegon: has joined #RubyOnRails
[17:03:58] Nikke: leofrozenyogurt: i would assume something like Product.includes(:brands).all (i forget the syntax off the top of my head)
[17:04:10] Nikke: but more or less just a join
[17:05:00] leofrozenyogurt: nikk_: but that would just return all products
[17:05:10] Nikke: i thoguht thats what you want
[17:05:11] NBarnes: has joined #RubyOnRails
[17:05:23] Nikke: all products with their brands?
[17:05:24] leofrozenyogurt: sorry i wasnt more clear
[17:05:33] leofrozenyogurt: @products = Product.all
[17:05:39] leofrozenyogurt: @brands = @products.brands
[17:05:41] moeabdol: has joined #RubyOnRails
[17:05:51] leofrozenyogurt: so all the products brands
[17:05:57] leofrozenyogurt: what i dont want to do is
[17:06:31] leofrozenyogurt: Brand.includes(:products).where("products.id = ?", @product.map { |p| p.id})
[17:06:32] tomoyuki28jp: has joined #RubyOnRails
[17:07:33] ElectricAlan_: has joined #RubyOnRails
[17:07:45] ElectricAlan_: late night programing
[17:07:54] ElectricAlan_: anyone around atm?
[17:07:58] defsdoor: leofrozenyogurt, you aint making much sense
[17:08:04] Nikke: what you really maena
[17:08:15] tomoyuki28jp: Is there a way to detect association changes on rails4? I want to call some methods only once when one or more association changes.
[17:08:18] leofrozenyogurt: @brands = Brand.where(id: @products.map{ |p| p.brand_id })
[17:08:44] Nikke: why not just do Brand.all , or do you have extra brands that are not related to certain products?
[17:08:50] jbrhbr: has joined #RubyOnRails
[17:08:59] defsdoor: leofrozenyogurt, thats great if you already have all the products
[17:09:14] leofrozenyogurt: @products = Product.all
[17:09:21] dionysus69: has joined #RubyOnRails
[17:09:25] leofrozenyogurt: thanks ! sometimes just typing it out helps!
[17:09:27] defsdoor: otherwise you can just combine it all
[17:10:04] ace05: has joined #RubyOnRails
[17:10:08] Nikke: you should just do @brands = @products.map(&:brand_id)
[17:10:18] Nikke: if you want the id's
[17:10:39] sonofdirt: has joined #RubyOnRails
[17:12:16] ElectricAlan_: question about record associations if anyone can help me
[17:12:18] ElectricAlan_: http://pastie.org/private/ki8oah4qnhivwxokutvww
[17:12:39] ElectricAlan_: I want my location table to have a field to store one user id to represent the manager of the location
[17:13:06] ElectricAlan_: but when I try to view my page, I get an error saying there's no location_id field on the user tabe
[17:13:18] ElectricAlan_: I do intend to have a location field later on, but for something else
[17:13:19] dviola: can I write js in my coffeescript files?
[17:13:26] dviola: I don't know coffeescript
[17:13:32] qejk: has joined #RubyOnRails
[17:13:59] theod: has joined #RubyOnRails
[17:14:04] nertzy: has joined #RubyOnRails
[17:15:32] ElectricAlan_: so I don't need a joining table for this, I jsut want my location to have a special user id field
[17:16:08] smathy: has joined #RubyOnRails
[17:17:15] ElectricAlan_: I could implement it shonkily and get what I am after, but I'd rather use active record properly
[17:17:27] ElectricAlan_: it's also quite possible that I'm doing something terribly and there's a much simpler way to do things
[17:17:39] ElectricAlan_: I am not thoroughly experienced with ror atm, but I'm working on that
[17:18:34] build22: has joined #RubyOnRails
[17:18:47] FooMunki: has joined #RubyOnRails
[17:18:52] techsethi: has joined #RubyOnRails
[17:18:54] steffkes: has joined #RubyOnRails
[17:18:55] steffkes: has joined #RubyOnRails
[17:19:53] tomoyuki28jp: I've posted my question to SO because no one has answered here. http://stackoverflow.com/questions/34272913/any-way-to-detect-if-one-or-more-association-changes-in-rails4
[17:20:05] ornerymoose: has joined #RubyOnRails
[17:22:00] shanemcd: has joined #RubyOnRails
[17:22:46] deception1: has joined #RubyOnRails
[17:23:11] rickmasta: has joined #RubyOnRails
[17:29:22] mustmodify: has joined #RubyOnRails
[17:29:26] King_Rex: has joined #RubyOnRails
[17:30:40] mustmodify: I was really hoping that if I created a public/404.xml, that would be the response to /invalid_url.xml ... but it wasn't. Is that what anyone else would expect? I ask because I want to know whether to go further down this path or just rescue 404s.
[17:31:39] gioele: suggestions for a better logging system in Rails? Something that makes it possible to tell apart #error calls from normal #info or #debug calls
[17:32:00] bbrowning_: has joined #RubyOnRails
[17:32:28] sol: has joined #RubyOnRails
[17:32:35] defsdoor: gioele, create multiple loggers
[17:33:27] mustmodify: gioele: www.rollbar.com
[17:33:46] Hans267: has joined #RubyOnRails
[17:34:01] tenderlove: has joined #RubyOnRails
[17:36:18] markh: has joined #RubyOnRails
[17:37:25] mikecmpbll: has joined #RubyOnRails
[17:38:00] orikremer: has joined #RubyOnRails
[17:39:19] polishdub: has joined #RubyOnRails
[17:40:22] dici: has joined #RubyOnRails
[17:41:10] gavit: what do I specify in my controller#street_registry_params for https://gist.github.com/gavit/91611216ebefbad4c118#file-console-log-L2 to be 'valid'? also it needs to be "0"=>{"ancestor_ids"=>["18", "3"] I think
[17:43:23] moeabdol: has joined #RubyOnRails
[17:44:17] tildes: has joined #RubyOnRails
[17:45:34] smathy: gavit, ancestor_ids: []
[17:46:59] lacrymology: has joined #RubyOnRails
[17:47:31] lemur: has joined #RubyOnRails
[17:47:58] lacrymol1gy: has joined #RubyOnRails
[17:49:54] ElectricAlan_: @managers_array = User.where(is_admin: true).each.map { |user| [user.name, user.id] }
[17:50:07] ElectricAlan_: does this LOC do what I think it does?
[17:50:31] ElectricAlan_: getting an unknown method 'merge' error and I'm trying to narrow down the source
[17:50:51] ElectricAlan_: this should give me an array of name/id tuplets to use in an option select
[17:51:02] momomomomo: has joined #RubyOnRails
[17:51:37] tubbo: ElectricAlan_: no, the each() method returns something called an Iterator, and not an Array that you can call map() on. IIRC.
[17:51:58] tubbo: ElectricAlan_: since User.where() returns a relation (which works kind-of like an array), you can do where(is_admin: true).map { ...
[17:52:27] tubbo: ElectricAlan_: you wouldn't happen to be trying to populate a <select> tag with a bunch of users, would you? :)
[17:52:35] skyjumper: anyone know why options[:include_blank] gets forced to 'true' when a <select> has required=true? it's on https://github.com/rails/rails/blob/4-2-stable/actionview/lib/action_view/helpers/tags/base.rb#L128
[17:52:43] ElectricAlan_: you know, I might be tubbo
[17:52:52] jbrhbr: has joined #RubyOnRails
[17:53:28] tubbo: ElectricAlan_: this method might help http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#method-i-collection_select
[17:54:01] lemur: also don't use each map like that
[17:54:07] ornerymoose: has joined #RubyOnRails
[17:54:08] lemur: that's what pluck and select are for
[17:54:08] gavit: smathy: params.require(:street_registry).permit(:registry_number, :description, ancestors_attributes: [ancestor_ids: [], :_destroy])?
[17:54:42] nickenchuggets: just upgraded to 4.2.5
[17:54:46] ElectricAlan_: lemur, I'm just going by what I see in docs and other examples
[17:55:03] lemur: User.where(is_admin: true).pluck(:name, :id)
[17:55:11] ElectricAlan_: if I do the wrong thing, pls to point me in the right direction
[17:55:27] ElectricAlan_: nice, I don't think Iv'e seen the pluck function at all
[17:55:49] lemur: http://baweaver.com/blog/2015/09/07/aggregate-active-record/
[17:56:09] maxz: has joined #RubyOnRails
[17:56:19] lemur: read that
[17:56:22] berserk_ren: has joined #RubyOnRails
[17:56:35] Sawbones: has joined #RubyOnRails
[17:56:55] sleungcy: has joined #RubyOnRails
[17:58:01] smathy: gavit, you'd need to put the :_destroy first, or the hash in {}s - but yes.
[17:58:04] baweaver: there we go
[17:58:20] ElectricAlan_: haha, hey baweaver, thought I recognized your unique brand of helpfulness
[17:58:32] lemur: has joined #RubyOnRails
[17:58:33] baweaver: should really remember to lock my other computer at home...
[17:59:36] Pazician: has joined #RubyOnRails
[18:00:03] gavit: smathy: it no longer complains, but still no insert: https://gist.github.com/gavit/91611216ebefbad4c118#file-console-log-L5
[18:00:58] ElectricAlan_: wow there's a lot going on in that link baweaver
[18:01:11] baweaver: ACTION also needs to write more
[18:01:23] bronson: has joined #RubyOnRails
[18:01:30] baweaver: indeed, I tried to go for getting a lot of the basics in one shot
[18:01:40] ElFerna: has joined #RubyOnRails
[18:02:10] baweaver: tea time, be back in a bit.
[18:02:59] smathy: gavit, probably the `reject_if` you've got on your anaf is true.
[18:03:03] Moeh: has joined #RubyOnRails
[18:03:13] Scripore: has joined #RubyOnRails
[18:03:47] Moeh: Is there any way to use a "where" equivalent in a CollectionProxy where the elements are not saved to the db yet?
[18:04:28] tubbo: Moeh: !xy
[18:04:28] helpa: Moeh: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[18:04:42] Pazician: has joined #RubyOnRails
[18:05:20] Synthead: has joined #RubyOnRails
[18:06:06] lib: has joined #RubyOnRails
[18:06:48] baweaver: has joined #RubyOnRails
[18:06:56] gavit: smathy: gonna remove the reject and see :)
[18:07:40] Moeh: tubbo: Okay, so I have I have a user model and a comment model. A user has many comments. Is there a way to look for a specific comments in users.comments when the comments that are added are not saved to the db yet?
[18:08:20] tubbo: Moeh: you might be able to treat it like an Array and do users.comments.select { ...
[18:08:37] SylarRuby: has joined #RubyOnRails
[18:08:59] gavit: smathy: you seem to be right again, but it's trying to write in the wrong table: https://gist.github.com/gavit/91611216ebefbad4c118#file-console-log-L6
[18:09:38] gavit: also the wrong columns :S
[18:09:50] Moeh: Yes, I saw that. Unfortunately this doesn't work in my case as I need the actual object. So something similar what I get when I do user.comments.first, except that I would like to do something like users.comments.where(real: true).first
[18:10:36] ace05: has joined #RubyOnRails
[18:11:07] LambdaSource: has joined #RubyOnRails
[18:11:12] ElectricAlan_: aw man, I got the select box working finally, but it looks like total balls
[18:12:37] ReCompile: has joined #RubyOnRails
[18:13:54] emilkarl: has joined #RubyOnRails
[18:14:25] ElectricAlan_: so I ended up with <%= f.select(:manager, options_for_select(@managers_array)) %> and I'm getting what I want, but where do I put the inclube_blank option in here?
[18:14:25] ibouvousaime: has joined #RubyOnRails
[18:14:32] Cohedrin: has joined #RubyOnRails
[18:15:00] tubbo: Moeh: guess i'm a little unsure as to why you want data that isn't in the database, especially in the *same* request since that's the only way for user.comments to return Comment objects that haven't been saved yet.
[18:15:25] tubbo: ElectricAlan_: i think you put it in options_for_select, so <%= f.select :manager, options_for_select(@managers, include_blank: true) %>
[18:15:42] mustmodify: has left #RubyOnRails: ()
[18:15:49] banister: has joined #RubyOnRails
[18:15:57] ElectricAlan_: ahh right, that's more sensible than what I tried
[18:16:13] ElectricAlan_: for some reason I didn't expect it to need a value, jsut include blank
[18:16:15] hoylemd: has joined #RubyOnRails
[18:16:36] djbkd: has joined #RubyOnRails
[18:17:23] hoylemd: Hey, Is there a safe way to render arbitrary user-generated html in a template? I assume the main part would be stripping out any script tags. does a helper exist that already does that, or do I need to roll it myself?
[18:18:16] Sawbones: has joined #RubyOnRails
[18:18:48] Moeh: tubbo: I have a multi step form where I store the intermediate objects in the session, therefore it is not saved yet.
[18:18:58] [Butch]: has joined #RubyOnRails
[18:19:10] King_Rex: has joined #RubyOnRails
[18:19:57] shibabu: has joined #RubyOnRails
[18:20:07] jmrepetti: has joined #RubyOnRails
[18:20:30] _djbkd: has joined #RubyOnRails
[18:20:33] jgt2: has joined #RubyOnRails
[18:21:08] markh: hoylemd, you could try https://github.com/flavorjones/loofah
[18:21:58] arooni: has joined #RubyOnRails
[18:22:04] ElectricAlan_: tubbo, that executes without an error, but Idon't get the blank field
[18:22:21] colleenmcguckin: has joined #RubyOnRails
[18:22:29] ElectricAlan_: I could add the blank option manually I suppose
[18:23:07] smathy: gavit, is ancestors_ids really a nested attribute of the ancestors of the main object, or maybe ancestors_ids should just be on the main object?
[18:23:16] sloggerkhan: has joined #RubyOnRails
[18:24:10] smathy: gavit, might also be just getting confused because the belongs_to associations in the join table are named the same as the hmt associations in the main table.
[18:24:13] Scripore: has joined #RubyOnRails
[18:24:19] smathy: s/table/model/g
[18:25:43] hoylemd: markh: hthanks
[18:26:28] Cervajz: has joined #RubyOnRails
[18:26:50] rakm: has joined #RubyOnRails
[18:27:51] ElectricAlan_: tubbo, fyi it was <%= f.select(:manager, options_for_select(@managers_array), include_blank: true) %>
[18:28:00] renegadeandy: has joined #RubyOnRails
[18:28:03] ElectricAlan_: so the include blank was just not in the options array
[18:28:06] colleenmcguckin: has joined #RubyOnRails
[18:28:28] ElectricAlan_: which makes sense, when you know that the options are the values to be selected, not actually options for configuring the select element
[18:29:57] srinidhi: has joined #RubyOnRails
[18:32:20] itsmeduncan: has joined #RubyOnRails
[18:33:33] pawnbox: has joined #RubyOnRails
[18:34:34] bronson: has joined #RubyOnRails
[18:34:57] gavit: smathy: http://imgur.com/dmOow7z
[18:35:16] Frem: has joined #RubyOnRails
[18:35:45] tubbo: ElectricAlan_: that always confuses me :)
[18:35:59] kmckelvi1: has joined #RubyOnRails
[18:36:33] ElectricAlan_: yeah, it seems ok once you know to what all the nomenclature is referring
[18:37:04] ewnd9: has joined #RubyOnRails
[18:37:44] gavit: smathy: also updated the source: https://gist.github.com/gavit/91611216ebefbad4c118#file-console-log-L7
[18:39:08] Hazim: has joined #RubyOnRails
[18:39:25] ur5us: has joined #RubyOnRails
[18:40:17] messine: has joined #RubyOnRails
[18:40:27] jessemcgilallen: has joined #RubyOnRails
[18:43:18] pika_pika: has joined #RubyOnRails
[18:45:19] messine: I'm using a select helper in my form and it's not pre-selecting values. That is, when I go to edit a Status the current value is not being displayed.
[18:45:21] messine: http://pastie.org/10632596
[18:45:27] weaksauce: has joined #RubyOnRails
[18:45:47] messine: I might have messed things up by naming my attribute, value.
[18:47:04] hoylemd: I have a different problem now. I have a resource in my routes.rb file `resources: 'photos'. but `photo_path(<some_id>) produces `/photos.<some_id>` instead of `/photos/<some_id>`. Anyone know why this might be, or where to look to find out?
[18:47:26] dionysus69: has joined #RubyOnRails
[18:47:45] Jasaka: has joined #RubyOnRails
[18:47:50] smathy: gavit, why not just: belongs_to :ancestor, class_name: "StreetRegistry" ?
[18:48:29] Pupeno: has joined #RubyOnRails
[18:48:29] Pupeno: has joined #RubyOnRails
[18:48:37] robbanp: has joined #RubyOnRails
[18:50:55] thomasfedb_: has left #RubyOnRails: ()
[18:51:08] thomasfedb: has joined #RubyOnRails
[18:51:22] B1n4r10: has joined #RubyOnRails
[18:51:23] sbarg: has joined #RubyOnRails
[18:52:03] jbrhbr: has joined #RubyOnRails
[18:52:57] hxegon: should I be commiting precompiled assets?
[18:54:47] Cervajz: has joined #RubyOnRails
[18:55:12] Cervajz_: has joined #RubyOnRails
[18:55:44] c355E3B: hxegon: no
[18:55:58] smathy: hxegon, shouldn't even BE precompiling assets in dev.
[18:56:10] c355E3B: (assuming your not using a deployment system that lets you do it on deploy)
[18:57:10] kadoppe: has joined #RubyOnRails
[18:57:22] hxegon: smathy, c355e3b: thanks.
[18:57:44] moeabdol: has joined #RubyOnRails
[18:58:14] thejamespinto: has joined #RubyOnRails
[18:58:50] markelite: has joined #RubyOnRails
[18:59:22] kitsuneyo: has joined #RubyOnRails
[18:59:26] jkamenik: has joined #RubyOnRails
[19:02:18] weaksauce: has joined #RubyOnRails
[19:03:53] djbkd: has joined #RubyOnRails
[19:04:10] sarink: has joined #RubyOnRails
[19:04:50] djbkd: has joined #RubyOnRails
[19:05:25] chadhs: has joined #RubyOnRails
[19:05:33] ElFerna: has joined #RubyOnRails
[19:07:27] RegulationD: has joined #RubyOnRails
[19:07:28] kegan_: has joined #RubyOnRails
[19:07:44] thejamespinto: has joined #RubyOnRails
[19:09:04] arBmind: has joined #RubyOnRails
[19:09:49] Regulati_: has joined #RubyOnRails
[19:10:22] bigbob: has joined #RubyOnRails
[19:10:43] hardtail: has joined #RubyOnRails
[19:11:14] Cohedrin: has joined #RubyOnRails
[19:11:23] ace05: has joined #RubyOnRails
[19:11:48] n008f4g_: has joined #RubyOnRails
[19:12:54] messine: Am I understanding the guides correctly? http://guides.rubyonrails.org/form_helpers.html#binding-a-form-to-an-object
[19:13:04] messine: 'One advantage here is that you don't have to worry about pre-selecting the correct city if the user already has one - Rails will do this for you by reading from the @person.city_id attribute.'
[19:13:14] deception2: has joined #RubyOnRails
[19:14:24] messine: Just like any other form the current value of the attribute will be displayed, but when I am using this select helper my form does display the current value first on the drop down.
[19:14:45] tubbo: messine: you're not using the form builder to create the <option> tags, which i believe you need to do if you want to take advantage of that feature rails is providng.
[19:15:31] tubbo: so rather than create the <option> tags yourself with the content_tag helper, look up f.collection_select and options_for_select to generate the proper <option> tags
[19:16:16] Pupeno: has joined #RubyOnRails
[19:16:31] greengriminal: has joined #RubyOnRails
[19:16:58] hardtail: has joined #RubyOnRails
[19:16:58] messine: Alright I will look at it again. although I already created a new project to test options_for_select and same thing happend
[19:18:05] yardenbar: has joined #RubyOnRails
[19:18:45] jessemcgilallen: has joined #RubyOnRails
[19:20:58] markh: hoylemd it sounds like a pluralization issue with your path helper
[19:21:25] messine: tubbo, are you saying I need to use both or just one or the other?
[19:21:29] markh: but i've been wrong many times before
[19:21:59] djbkd: has joined #RubyOnRails
[19:22:11] tenderlove: has joined #RubyOnRails
[19:22:45] Ergo: has joined #RubyOnRails
[19:22:54] tubbo: messine: just one or the other
[19:23:11] momomomomo: has joined #RubyOnRails
[19:23:12] tubbo: messine: collection_select uses select under the hood
[19:23:45] rickmasta: has joined #RubyOnRails
[19:23:50] messine: tubbo, alright that means I will use options_for_select since I'm working with arbitrary values not multiple objects I think
[19:25:18] YoMotha: has joined #RubyOnRails
[19:28:48] ap4y: has joined #RubyOnRails
[19:29:19] messine: So I used options_for_select, as you suggested, to generate option tags. http://pastie.org/10632657 :(
[19:30:18] nyaa: has joined #RubyOnRails
[19:30:34] axl_: has joined #RubyOnRails
[19:31:07] edwinvdgraaf: has joined #RubyOnRails
[19:31:31] chouhoul_: has joined #RubyOnRails
[19:32:07] nettoweb: has joined #RubyOnRails
[19:33:33] edwinvdgraaf: has joined #RubyOnRails
[19:33:51] doodlehaus: has joined #RubyOnRails
[19:34:01] tubbo: messine: yeah you probably aren't going to get real far until you read the docs for that method because you're doing it completely wrong.
[19:34:10] joshsmith: has joined #RubyOnRails
[19:34:55] axl_: has joined #RubyOnRails
[19:35:28] robbanp: has joined #RubyOnRails
[19:36:18] smathy: Seems ok to me.
[19:37:10] netzfisch: has joined #RubyOnRails
[19:39:40] smathy: ...well aside from the fact that the field name has changed (from :value to :current) between the two pasties.
[19:40:10] smathy: Oh, gone.
[19:40:24] messine: has joined #RubyOnRails
[19:41:23] edwinvdgraaf: has joined #RubyOnRails
[19:42:48] chouhoulis: has joined #RubyOnRails
[19:43:38] ElectricAlan_: ACTION is outta here
[19:43:40] ElectricAlan_: thanks again tubbo
[19:44:52] yfeldblum: has joined #RubyOnRails
[19:46:27] doodlehaus: has joined #RubyOnRails
[19:46:56] hoylemd: markh: yup! you were right. Thanks!
[19:48:20] jbrhbr: has joined #RubyOnRails
[19:49:05] djbkd: has joined #RubyOnRails
[19:49:18] markh: yup no problem
[19:49:41] AzaToth: has joined #RubyOnRails
[19:51:28] apotry: has joined #RubyOnRails
[19:52:31] Radar: GOOD MORNING
[19:52:40] andrew9184: has joined #RubyOnRails
[19:53:07] FailBit: the drama machine endeth
[19:54:35] tubbo: FailBit: or it just began
[19:55:30] messine: tubbo, got it
[19:55:51] gioele: has left #RubyOnRails: ()
[19:56:25] snowy: has joined #RubyOnRails
[19:57:47] zpe: has joined #RubyOnRails
[19:58:28] djbkd: has joined #RubyOnRails
[19:59:49] messine: It's strange that the guides would suggest using the content_tag helper inside a form builder object. This would only be applicable when creating a new object
[20:02:11] baweaver: has joined #RubyOnRails
[20:05:44] messine: Yeah wat were they thinking
[20:06:07] tubbo: messine: think you might be reading that wrong
[20:06:15] tubbo: messine: can you show me where you saw that/
[20:06:15] colleenmcguckin: has joined #RubyOnRails
[20:06:35] AndreasGB: has joined #RubyOnRails
[20:07:12] ElFerna: has joined #RubyOnRails
[20:07:44] twilling: has joined #RubyOnRails
[20:07:58] browndawg: has joined #RubyOnRails
[20:08:03] messine: I'm reading it fine unless I'm reading it wrong. Passing a block to a select helper under 3.2, http://guides.rubyonrails.org/form_helpers.html
[20:08:26] otherj: has joined #RubyOnRails
[20:09:09] nhhagen: has joined #RubyOnRails
[20:09:39] mdel: has joined #RubyOnRails
[20:09:52] twilling: Can anyone confirm or deny that `calling model_name.has_many_association_name <<` runs `valid?` on each of the associated records?
[20:10:03] alaing: has joined #RubyOnRails
[20:10:23] FailBit: you could set up set_trace_func to confirm that for you
[20:10:25] alaing: has joined #RubyOnRails
[20:10:30] remjih: has joined #RubyOnRails
[20:10:38] rhizome: is "set_trace_func" a built-in thing?
[20:10:54] FailBit: in MRI, yes
[20:10:56] norc: has joined #RubyOnRails
[20:10:57] FailBit: it's part of Kernel
[20:10:57] twilling: I???m initializing a number of empty objects for a form and the fields for those associated objects are coming back invalid.
[20:11:00] rhizome: never heard of it
[20:11:06] twilling: never heard of it. let me read up
[20:11:18] tubbo: twilling: it does not
[20:11:30] FailBit: http://ruby-doc.org/core-2.2.3/Kernel.html#method-i-set_trace_func
[20:11:30] tubbo: twilling: however, when you save the parent model, it *will* run validations and callbacks on the child models.
[20:11:33] edwinvdgraaf: has joined #RubyOnRails
[20:11:53] rhizome: even without validate_associated?
[20:12:05] atomical: has joined #RubyOnRails
[20:12:09] Guest55752: has left #RubyOnRails: ()
[20:12:13] alaing: i'm using a form_for and have = f.label :quantity_to_allocate and = number_field_tag :quantity_to_allocate. no errors but the labels "for" is not the same as the number fields id. so when users click on the label it doesn't place them in the number field
[20:12:15] twilling: might be something funky going on in this huge model
[20:12:17] tubbo: rhizome: i think that is just for belongs_to. pretty sure callbacks get run when you try to save has_manys
[20:12:30] norc: has joined #RubyOnRails
[20:12:54] messine: Children records are validated unless :validate is false.
[20:12:59] twilling: because testing in the rails console as soon as i do example_model.some_assoc << NewAssociatedRecord.new I can immedietly call example_model.some_assoc.first.errors and see my errors
[20:13:27] alaing: label "for" attribute is returning allocation_quantity_to_allocate but the number fields id is returning quantity_to_allocate
[20:13:58] andrew9184: has joined #RubyOnRails
[20:14:30] twilling: is there a searchable name for ???<<??? ?
[20:14:32] messine: rhizome, http://api.rubyonrails.org/classes/ActiveRecord/AutosaveAssociation.html I worked with nested attributes lately this is helpful
[20:14:48] rhizome: alaing: is the form object ("f.") of class "allocation"?
[20:15:01] norc: Hi, I have a model design issue, is this okay if I post some pseudo code, because I cannot figure out how to write some proper code at this point.
[20:15:17] colleenmcguckin: has joined #RubyOnRails
[20:15:46] twilling: looks like i can just change my `<<` to `.build` and move on
[20:16:05] twilling: thats less coupled too
[20:16:06] tenderlove: has joined #RubyOnRails
[20:16:18] alaing: rhizome: = form_for [:case_workers, :admin, @allocation] do |f|
[20:16:24] momomomomo: has joined #RubyOnRails
[20:16:29] alaing: i see where you going with this
[20:16:54] alaing: rhizome: but f.number_field_tag doesn't seem to work
[20:17:05] FailBit: is apidock borked again
[20:17:05] alaing: and throws an error
[20:18:10] rhizome: messine: weirdly no clear distinction is being made, but i did find someone saying validates_associated was deprecated. never seen it in logs tho so maybe not official.
[20:18:45] tfitts: has joined #RubyOnRails
[20:20:09] jessemcgilallen: has joined #RubyOnRails
[20:20:23] tubbo: FailBit: i always hated apidock
[20:20:36] tubbo: do you find yourself drawn to it moreso than api.rubyonrails.org?
[20:21:02] FailBit: I go with whatever google brings me to first
[20:21:19] shanemcd: has joined #RubyOnRails
[20:21:42] steffkes: has joined #RubyOnRails
[20:21:43] steffkes: has joined #RubyOnRails
[20:22:20] rhizome: SEO hurts everybody
[20:23:20] FailBit: doesn't someone in this channel run apidock
[20:24:07] Cohedrin: anyone here _really_ familiar with activemodelserializers?
[20:24:14] gabeodess: has joined #RubyOnRails
[20:24:25] tildes: has joined #RubyOnRails
[20:24:25] tubbo: FailBit: how's w3schools these days?
[20:24:28] shibabu: has joined #RubyOnRails
[20:24:30] Hans267: I have a parts model and most of the parts will be seeded but occasionally users will need to create a new part if it doesn???t exist yet. They???ll need to have the ability to edit it as well. Can I do a user_id reference column if they submitted it and leave it blank if it???s seeded? Is there a better way of achieving this?
[20:24:32] tubbo: Cohedrin: define "_really_"
[20:24:34] alaing: thanks rhizome I've managed to get label to point to field thanks to your advise
[20:24:34] tubbo: i am familiar with it
[20:24:35] FailBit: tubbo: mostly accurate
[20:24:51] Cohedrin: basically, I need to use two different adaptors
[20:24:55] kmckelvin: has joined #RubyOnRails
[20:24:57] Cohedrin: for different endpoints
[20:25:01] FailBit: I rarely go there anyways
[20:25:11] FailBit: most of what I would need, I already have memorized
[20:25:13] norc: Okay. This is the basic assumption I have: https://gist.github.com/anonymous/f58edba8a565903afd58
[20:25:14] tubbo: FailBit: you should basically never go there, simba
[20:25:14] Cohedrin: 1 endpoint needs to use the attributes type, the other needs to use jsonapi
[20:25:18] norc: Now my problem is the following:
[20:25:42] FailBit: tubbo: if it helps I browse with an adblocker so nobody gets money from me for me making a mistake
[20:25:51] baweaver: has joined #RubyOnRails
[20:26:11] norc: I have a library that polls hundreds of devices, grabbing port specific data, pushing it to my API. That part already is working. However, its a pure mess with badly configured system names, and badly maintained lists of data on some other end.
[20:26:22] tubbo: FailBit: my biggest problem with apidock is the top result is almost always like out-of-date or something. funny you mention an adblocker, pipework and i were considering a chrome extension that would basically be "adblock for google results"
[20:26:34] tubbo: so you can say "I don't want w3schools.com to show up in my google results"
[20:26:45] norc: So I need the ability for my rake task to report any port with IP address, unit and port as it sees it, and let the controller set a relationship through the port_id if it can, but silently fail if it cannot.
[20:27:00] tubbo: and it would come pre-populated with a bunch of resources to be blocked, like w3schools and out-of-date docs
[20:27:02] FailBit: MDN is higher than w3schools for a lot of stuff IIRC
[20:27:08] norc: (Reason is I dont want to disgard data just because it cannot find the system in our databases, the data are needed)
[20:27:13] tubbo: didn't used to be
[20:27:15] FailBit: norc: what database
[20:27:49] norc: FailBit: It is a separate Oracle database used by an application for documentation purposes.
[20:27:51] Pupeno_: has joined #RubyOnRails
[20:28:17] norc: I want to create a relationship as much as I can, without actually enforcing it.
[20:29:00] AnoHito: has joined #RubyOnRails
[20:29:23] browndawg: has joined #RubyOnRails
[20:29:50] norc: sadly there is no way to patch the application to actually test the ip address, whether a valid network node is behind that.
[20:30:19] tvw: has joined #RubyOnRails
[20:30:29] ace05: has joined #RubyOnRails
[20:31:04] norc: Just feels wrong to keep both reported_unit / system / port while also having a port_id around.
[20:32:56] hardtail: has joined #RubyOnRails
[20:34:02] flashpoint9: has joined #RubyOnRails
[20:34:07] Cervajz: has joined #RubyOnRails
[20:34:57] idakyne: has joined #RubyOnRails
[20:39:17] rhizome: not sure i understand the problem
[20:39:35] gabeodess: has joined #RubyOnRails
[20:40:22] ElFerna: has joined #RubyOnRails
[20:40:52] dopie: anyone use tmux and vim together?
[20:41:15] fox_mulder_cp: dopie: any problems with tmux + vim?
[20:41:47] lacrymology: has joined #RubyOnRails
[20:41:53] dopie: not really I'm just having a hard time with the prefix % and prefix " to open new panes and was wondering if anyone else had a better solution
[20:42:42] tubbo: dopie: used to, but i haven't in a while.
[20:43:17] fox_mulder_cp: dopie: you can redefine hotkeys in tmux, as you wand
[20:44:09] kmckelvin: has joined #RubyOnRails
[20:44:41] arBmind: has joined #RubyOnRails
[20:44:49] mchu: has joined #RubyOnRails
[20:45:04] Sceko: has joined #RubyOnRails
[20:45:05] Sceko: has joined #RubyOnRails
[20:45:33] dopie: yes i know
[20:45:41] Scripore: has joined #RubyOnRails
[20:45:57] moeabdol: has joined #RubyOnRails
[20:46:57] mchu: has left #RubyOnRails: ()
[20:47:08] mchu: has joined #RubyOnRails
[20:48:33] Pazician: has joined #RubyOnRails
[20:48:49] tubbo: dopie: i thought you had to use the tmux 'leader' keystroke or whatever to actually use tmux commands
[20:49:13] dopie: yes you do
[20:49:15] tubbo: in tmux it's called a "prefix"
[20:50:10] jgpawletko: has joined #RubyOnRails
[20:50:28] jgt2: has joined #RubyOnRails
[20:52:11] mary5030: has joined #RubyOnRails
[20:52:26] jstransky: has joined #RubyOnRails
[20:53:35] jstransky: Hey guys. A while back someone here posted a link to an awesome ???how to ask good questions on IRC??? article. Anyone happen to remember that link?
[20:53:36] meoblast001: has joined #RubyOnRails
[20:53:49] mary5030: has joined #RubyOnRails
[20:53:53] rhizome: probably esr's how to ask questions
[20:54:07] tubbo: jstransky: !ask
[20:54:07] helpa: jstransky: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[20:54:15] tubbo: i don't, but bots do :)
[20:54:26] jstransky: Yep that???s it1
[20:55:06] mchu: help please, thanks.
[20:55:06] Palsson: has joined #RubyOnRails
[20:55:13] Fire-Dragon-DoL: has joined #RubyOnRails
[20:55:19] tubbo: mchu: you're welcome.
[20:55:37] bap1313: has joined #RubyOnRails
[20:55:40] tubbo: mchu: !ask
[20:55:40] helpa: mchu: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[20:56:22] SylarRuby: has joined #RubyOnRails
[20:56:27] colleenmcguckin: has joined #RubyOnRails
[20:57:57] juddey: has joined #RubyOnRails
[20:58:16] tubbo: Fire-Dragon-DoL: hai
[20:59:35] FernandoBasso: has joined #RubyOnRails
[21:00:44] IFrank00: Hi I have 2 models Task has_one Section and Section has_many Task how can I show only Sections that have tasks
[21:02:40] rhizome: IFrank00: you don't, because you need a belongs_to
[21:03:39] IFrank00: Task belongs_to :section and Section has_many :tasks
[21:03:45] Fire-Dragon-DoL: tubbo: ehy :) was checking sasl is was working :P
[21:03:50] slash_nick: that's better IFrank00
[21:04:00] tubbo: Fire-Dragon-DoL: yep, wanted to give you a confirmation
[21:04:03] tubbo: that we can hear you
[21:04:10] IFrank00: I write it incorrect in the chat
[21:04:21] djbkd: has joined #RubyOnRails
[21:04:23] Fire-Dragon-DoL: tubbo: oh, thanks for that!
[21:04:32] Fire-Dragon-DoL: I'm starving, need some food
[21:04:46] atomical: has joined #RubyOnRails
[21:05:01] IFrank00: what im trying to do is a query that show me the Section but with the condition of having a task
[21:06:35] DavidDudson: has joined #RubyOnRails
[21:07:16] IFrank00: I know I saw they line of code some where but can remember If any of you now the line of the doc or word to look for the info
[21:08:09] lacrymology: what's the right error (status) to return when someone tries to create an existing unique object?
[21:08:42] Daozen: has joined #RubyOnRails
[21:09:04] robbanp: has joined #RubyOnRails
[21:09:38] pwnd_nsfw: has joined #RubyOnRails
[21:09:40] draig: has joined #RubyOnRails
[21:10:16] tenderlove: has joined #RubyOnRails
[21:10:18] draig: has joined #RubyOnRails
[21:10:25] hardtail: has joined #RubyOnRails
[21:12:04] [gmi]: has joined #RubyOnRails
[21:12:23] pawnbox: has joined #RubyOnRails
[21:14:06] Palsson: has joined #RubyOnRails
[21:14:58] moeabdol: has joined #RubyOnRails
[21:15:25] hobodave: has joined #RubyOnRails
[21:17:40] Cache_Money: has joined #RubyOnRails
[21:18:51] colleenmcguckin: has joined #RubyOnRails
[21:22:01] Dreamer3: has joined #RubyOnRails
[21:22:24] YoMotha: has left #RubyOnRails: ()
[21:22:45] baweaver: has joined #RubyOnRails
[21:24:21] Pumukel: has joined #RubyOnRails
[21:25:06] rickmasta: has joined #RubyOnRails
[21:26:41] moeabdol: has joined #RubyOnRails
[21:28:54] smathy: has joined #RubyOnRails
[21:28:55] rgtk: has joined #RubyOnRails
[21:33:57] DavidDudson: has joined #RubyOnRails
[21:36:14] makenoise: has joined #RubyOnRails
[21:37:02] moeabdol1: has joined #RubyOnRails
[21:37:47] shock_one: has joined #RubyOnRails
[21:41:05] maesitos: has joined #RubyOnRails
[21:44:37] makenoise: has joined #RubyOnRails
[21:45:04] nettoweb: has joined #RubyOnRails
[21:46:14] shock_one: has joined #RubyOnRails
[21:47:39] steffkes: has joined #RubyOnRails
[21:47:39] steffkes: has joined #RubyOnRails
[21:48:02] rhizome: lacrymology: 409 maybe
[21:48:36] duncannz: has joined #RubyOnRails
[21:50:39] lacrymology: rhizome: like that
[21:51:41] rhizome: thing i read says you shoould describe the problem in the error, or use 404 instead
[21:53:03] tubbo: 'Invalid request format' is not a good error message
[21:53:08] slash_nick: hmm... you guys know there's a whole new tier of status codes, right?
[21:53:11] matthias_: has joined #RubyOnRails
[21:53:36] slash_nick: https://github.com/joho/7XX-rfc FYI
[21:53:42] htmldrum: has joined #RubyOnRails
[21:54:53] jkamenik: has joined #RubyOnRails
[21:54:58] lacrymology: how can I validate that two fields are unique together? I seem to recall something like validates :a_field, uniqueness: [:other, :fields]. but I
[21:55:34] davout: has joined #RubyOnRails
[21:56:26] davout: ohai, why doesn't AR automatically associate records when added in parent_model_instance.collection_singular_ids ?
[21:56:30] fox_mulder_cp: hi, people. can you knows some lite in setup and use CI software?
[21:56:42] tubbo: fox_mulder_cp: travis-ci
[21:56:50] davout: say I have a Horse and Picture model
[21:57:01] tubbo: the catch is that it costs money
[21:57:47] davout: Horse has_many :p??ctures, as: :imageable, autosave: true
[21:57:58] rhizome: slash_nick: sticking with 418 for everything
[21:58:05] davout: Picture belongs_to :imageable, polymorphic: true
[21:58:30] rhizome: davout: you're operating on that method directly?
[21:58:51] davout: I kind of expected picture IDs being added to my_horse.picture_ids to trigger the Picture instances to be updated with the matching horse ID
[21:58:58] davout: rhizome: yes, I'm not supposed to?
[21:59:05] rhizome: or...wha? [professor farnsworth voice]
[21:59:28] rhizome: davout: what is the actual line
[21:59:35] atomical: has joined #RubyOnRails
[21:59:40] davout: the actual line: "good news everyone, apparently i'm misusing basic rails functionality!"
[22:00:05] rhizome: @foo.bars << Bar.find(id)
[22:00:23] davout: rhizome: nah, what I'm doing is @foo.bar_ids << some_bar_id
[22:00:31] chouhoul_: has joined #RubyOnRails
[22:00:33] rhizome: yeah that's no good
[22:00:59] davout: ah, sucks, looked pretty cool to be used directly from forms
[22:01:27] rhizome: it shouldn't change anything else, you just need to do the find first. you can find an array and << that, too
[22:01:39] davout: isn't there a better, railsier way to associate records like that?
[22:01:53] neanderslob: has joined #RubyOnRails
[22:02:18] davout: rhizome: the change is that when done right, you get an ID array right from the params, so pretty much nothing to do
[22:02:38] davout: i couldn't find anywhere the collection_ids accessor is documented
[22:03:00] chouhoulis: has joined #RubyOnRails
[22:03:23] davout: (well, other than 'hey, here is this cool collection_ids= accessor')
[22:04:30] tenderlove: has joined #RubyOnRails
[22:04:59] rhizome: i'm not saying something like what you want can't be done, but it's probably not going to look like that and at any rate what i gave you is std rails technique
[22:08:51] tubbo: davout: why not just @foo.bars << some_bar?
[22:08:59] tubbo: where some_bar = Bar.find(some_bar_id) :D
[22:09:17] rhizome: wants to @foo.bar_ids << array_of_ids
[22:09:22] davout: tubbo: yeah, that's what rhizome was saying, the reason is simply that i'm lazy
[22:09:38] tubbo: there's a really good reason why rails forces you to pass objects in order to create associations: it doesn't have to do extra work making sure that the child exists
[22:09:42] tubbo: davout: hey, at least you're honest
[22:10:05] davout: i've been doing rails since 2007 and i swear to god i saw stuff like this working this very way
[22:10:21] davout: https://ernie.io/2010/10/02/the-underused-collection_singular_ids-method/ <<< this would look like it i guess
[22:10:25] rhizome: you could make a custom setter that did essentially the same thing ;)
[22:10:51] rhizome: ah, HABTM. i bet it's special in that land
[22:10:51] cassioscabral: has joined #RubyOnRails
[22:11:53] davout: looks like folks are wondering how to disable the behaviour i'm after :D --> http://stackoverflow.com/questions/13426229/using-collection-singular-ids-ids-without-saving-to-database
[22:12:41] davout: rhizome: i'd find it curious if something that works for an habtm doesn't also work for a polymorphic has_many <-> belongs_to
[22:14:44] kmckelvin: has joined #RubyOnRails
[22:15:22] tubbo: davout: yeah it might be specific to HABTM...HABTM *does* work differently.
[22:17:12] axl__: has joined #RubyOnRails
[22:18:50] rhizome: huh, the docs list the method for both
[22:19:07] rhizome: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-has_and_belongs_to_many
[22:19:21] rhizome: has_many follows that
[22:20:41] HalcyonicStorm: has joined #RubyOnRails
[22:22:21] rubyonrailed: How can I call other models from inside of my application controller? Instead of calling `Airbrake` it thinks the path is `Api::V1::ApplicationController::Airbrake` https://gist.github.com/JasonMannon/c04c4fc7390c253db157
[22:22:55] Radar: rubyonrailed: Did you add the airbrake gem to your Gemfile and then after doing that did you restart your server?
[22:23:04] hxegon: has joined #RubyOnRails
[22:23:39] rubyonrailed: Radar: Yes, i've restarted my server
[22:23:40] Xentil: has joined #RubyOnRails
[22:23:51] Radar: rubyonrailed: You didn't answer the first question.
[22:24:42] rory096: has joined #RubyOnRails
[22:25:27] rubyonrailed: Radar: Well i'm an idiot. The airbrake gem wasn't under development in the gemfile
[22:25:34] rubyonrailed: Radar: Thanks though.
[22:25:36] Radar: rubyonrailed: that'll do it :)
[22:25:47] Radar: Always happy to rubber ducky.
[22:26:35] smathy: Gems don't need to be under development.
[22:27:21] rubyonrailed: Well I testing Airbrake in development and getting that error.
[22:28:01] shibabu: has joined #RubyOnRails
[22:28:19] rory096: are there best practices/gems for when you have a globally available model but want users to be able to set their own sort order? (in terms of database modeling, not how to sort on the front-end)
[22:29:27] akshat: has joined #RubyOnRails
[22:30:45] smathy: rubyonrailed, do you have anything in your .bundle/config file?
[22:31:14] ornerymoose: has joined #RubyOnRails
[22:31:27] Haydos: has joined #RubyOnRails
[22:31:49] davout: rhizome: actually after doing some more research, turns out my gut was right
[22:32:01] smathy: rory096, there's a worst practice, which is just passing some user-provided params into .order
[22:32:27] davout: for some reason in my case, doing foo.bar_ids << some_bar_id does nothing
[22:33:03] davout: but doing foo.bar_ids = [some_bar_id, some_other_bar_id] immediately updates the Bar instances, as expected
[22:33:31] rory096: smathy: even that would only let you do asc/desc right? i'm thinking about sorting by a specific column, but in any arbitrary order
[22:33:45] rubyonrailed: smathy: this is my current .bundle/config https://gist.github.com/JasonMannon/4cd75fef3710a69e2385
[22:33:52] B1n4r10: has joined #RubyOnRails
[22:34:12] smathy: davout, right, because the latter calls the bar_ids= method, and the former just calls the bar_ids accessor and then adds something to the resulting array (which itself doesn't trigger any writes).
[22:34:15] jessemcgilallen: has joined #RubyOnRails
[22:34:29] davout: smathy: hah, that makes sense
[22:35:01] smathy: rory096, the user-provided params could include a column name, but again - not a good approach.
[22:36:00] davout: smathy: i suppose i was unconsciously expecting some kind of proxy to be returned by bar_ids, like an association, instead of a plain boring array
[22:36:08] twilling: has joined #RubyOnRails
[22:36:40] smathy: davout, yeah, not a ridiculous assumption :) Unfortunately the DSL isn't wholly consistent like that.
[22:37:52] rory096: guess i could just make a has_and_belongs_to_many pivot table, include a sort_order column, and add all the global rows to each user by default
[22:38:48] Scripore: has joined #RubyOnRails
[22:38:51] yfeldblum: has joined #RubyOnRails
[22:39:53] hobodave: has joined #RubyOnRails
[22:40:12] tenderlove: has joined #RubyOnRails
[22:40:55] nickenchuggets: has joined #RubyOnRails
[22:40:55] nickenchuggets: has joined #RubyOnRails
[22:48:20] marr: has joined #RubyOnRails
[22:49:22] bigbob: has joined #RubyOnRails
[22:50:07] hhgridd: has joined #RubyOnRails
[22:50:19] hhgridd: i'm coming from node and used to the idea of async database requests. could someone explain how rails is still capable of handling a practical request load without exploding if every db query blocks the entire server?
[22:50:45] nickjj: has joined #RubyOnRails
[22:51:19] ciree: different webservers handle it differently, but for the most part
[22:51:27] tfitts: does it block the entire server or that thread?
[22:51:28] ciree: it blocks a single web request
[22:51:37] ciree: 1 request = 1 thread
[22:51:42] ciree: for the most part
[22:52:17] ciree: ruby can do concurrency, not parallelism
[22:52:24] ciree: well, I think you can in different runtimes
[22:52:36] ciree: I take it you are familiar with promises?
[22:52:40] nickjj: has joined #RubyOnRails
[22:52:52] ciree: you might enjoy https://github.com/ruby-concurrency/concurrent-ruby
[22:53:30] pawnbox: has joined #RubyOnRails
[22:53:49] baweaver: has joined #RubyOnRails
[22:53:57] Scriptonaut: Hi guys. I'm having a strange ordering issue. When I .order("people.login_user_id asc,account_permissions.write asc"), it tells me PG::UndefinedTable: ERROR: missing FROM clause entry for table "account_permissions". However, when I switch them around it works (like this: "account_permissions.write asc,people.login_user_id asc")
[22:54:45] pramsky: has joined #RubyOnRails
[22:55:12] hhgridd: ciree: basically i'm considering rails/grape to write an api. i think i'm overthinking it. i'm probably not going to hit the limits where it matters anyways
[22:55:18] sucks: has joined #RubyOnRails
[22:55:45] diggitydane: has joined #RubyOnRails
[22:55:48] Scriptonaut: also, "account_permissions.write asc" works on its own
[22:56:00] Siyo: has joined #RubyOnRails
[22:56:01] Siyo: has joined #RubyOnRails
[22:56:14] ciree: hhgridd: Probably, think about it this way
[22:56:20] ciree: Rails will make you fast to getting it out the door
[22:56:32] ciree: if rails starts to be the bottle neck, thats a great thing ;)
[22:56:48] ciree: then you can start stripping things out and maybe going to node/whatever
[22:56:57] ciree: Even then, dont worry about it till its an issue
[22:57:54] quazimodo: has joined #RubyOnRails
[22:58:04] Scriptonaut: Is rails that bad as scaling?
[22:58:20] jgpawletko: has joined #RubyOnRails
[22:58:23] Scriptonaut: My app is midsized, and we've done a good job just by optimizing stuff whenever stuff gets slow
[22:58:45] ciree: There are faster things than rails, lets leave it at that
[22:58:49] Scriptonaut: making sure indexes are where they should be, normalizing certain resources in the db, doing all kinds of caching, etc
[22:59:22] ciree: hhgridd: you can't go wrong with that approach, we use that at work
[22:59:45] ciree: also take a look at roar
[23:00:00] ciree: makes defining your json responses clean
[23:00:17] ciree: To be honest, I don't really see a point of using grape
[23:00:33] ciree: You could just use rails controllers and road
[23:00:50] ciree: unless I'm missing something...
[23:01:47] diggitydane: general question, we have an orders table with about 2M records. running reports from postgres are starting to take longer (sometimes times out on heroku's 30 second limit). database is about 4GB. do we "compile" into another table? sync data to something like redis?
[23:03:34] diggitydane: there are not a lot of joins. it's mostly just SUM() on columns for specific date ranges
[23:03:52] tfitts: diggitydane: is it a lot of different date ranges in the same request?
[23:04:10] rgrmatt: has joined #RubyOnRails
[23:04:19] tfitts: you could setup a worker to run the report in the background so it has longer than 30 seconds to run.
[23:04:25] diggitydane: tfitts, well, not sure what you mean. If someone chose the 1st to the 10th, it would compile those 10 days and return 10 rows
[23:04:53] tfitts: diggitydane: are your indexes setup properly?
[23:05:34] tfitts: I have a table with 11.5M rows. fixing my indexes moved some queries from 50+ seconds down to like 200ms
[23:05:48] tfitts: and I even had all of the columns I was using indexed, just not all of them in the same index.
[23:06:20] diggitydane: tfitts, yes, BUT the database is actively getting data in it. so sometimes the query might be 5 seconds, and sometimes it times out at 30 seconds. So, i've looked at adding a follower and just reading from there
[23:07:11] diggitydane: tfitts, I have a sql view that I run first that takes about 1 sec to run that gathers most of the data, then I select from there
[23:09:52] rickmasta: has joined #RubyOnRails
[23:12:11] pika_pika: has joined #RubyOnRails
[23:14:52] jessemcgilallen: has joined #RubyOnRails
[23:15:54] smathy: diggitydane, is the date field you're using indexed?
[23:16:04] smathy: diggitydane, you know about EXPLAIN ?
[23:16:51] diggitydane: smathy, yes and yes. I've been using EXPLAIN (ANALYZE, BUFFERS) on the queries to optimize them
[23:18:16] smathy: diggitydane, "sometimes the query might be 5 seconds, and sometimes it times out at 30 seconds" - sounds like fairly typical heroku derp.
[23:19:05] smathy: diggitydane, I'd be calling heroku support to work out what the problem is.
[23:19:30] diggitydane: smathy, ha, yep. going to new relic gives me some insight on what trips it up and when I execute it multiple times in a row it will vary when there are a lot of new inserts going on.
[23:20:30] diggitydane: smathy, so, i'm just not sure if having a follower database is better, or going to some "big data" solution, or just compiling a stored procedure every 10 minutes, or etc etc. is the best solution for consistent queries
[23:22:30] ql6wlld: has joined #RubyOnRails
[23:22:36] diggitydane: I don't know enough about NoSQL to know if I need to move that direction. My dataset is much larger than the memory, so I don't think Redis or related would work
[23:24:00] smathy: diggitydane, at a normal DB level new inserts won't impact the ongoing select due to transaction isolation. That's why I'm pointing at heroku, totally anecdotal but I think they de-prioritize either long running queries and/or select queries.
[23:24:04] Synthead: has joined #RubyOnRails
[23:24:10] kmckelvin: has joined #RubyOnRails
[23:24:20] ornerymoose: has joined #RubyOnRails
[23:25:24] chouhoulis: has joined #RubyOnRails
[23:27:39] diggitydane: smathy, so, assuming a scenario where it's not heroku postgres and the data was getting bigger, what would be a good add-on technology? Is it NoSQL I should be looking at? Or, what technology is best for finding how many orders I processed on June 20th when I have millions of records?
[23:28:41] rhizome: from what i know of reporting, i'd create an aggregate table that you then work with instead of having this huge monster query
[23:29:39] smathy: diggitydane, I'd just be replicating the DB, and I'd be doing the query on an offline DB.
[23:29:40] leeky: has joined #RubyOnRails
[23:30:37] smathy: 5 seconds wouldn't bother me, and if it did then I'd be aggregating the data too, eg. keeping a count of the orders (and anything else) per day, per week, per other time periods that I may be interested in.
[23:30:58] diggitydane: rhizome, I use a sql view to aggregate it similar to this: https://rietta.com/blog/2013/11/28/rails-and-sql-views-for-a-report/
[23:31:03] smathy: You _could_ do those aggregations in your live DB, but I'd be doing them in an offline DB.
[23:31:38] diggitydane: smathy, we're starting to get more users on that need the data live. do you mean offline as in a follower?
[23:31:57] rhizome: live is a whoooole other dimension
[23:31:59] tenderlove: has joined #RubyOnRails
[23:32:35] diggitydane: well, it's fine if it tails 10 mins, not live as in live :)
[23:33:11] rhizome: just wait until you see how dissatisfied they get with 10min
[23:33:11] smathy: diggitydane, the view doesn't aggregate the data though, it just stores the procedure you're going to use, it's still run in real time when you access the view (unless there's some tricky options in pg that I'm unaware of for caching that data).
[23:33:18] owenjones: has joined #RubyOnRails
[23:33:50] smathy: diggitydane, I'm not familiar with the "follower" terminology. I mean a replicated DB that's not accessed by your main web app, specifically it's never used for writes.
[23:34:04] Pupeno: has joined #RubyOnRails
[23:34:06] diggitydane: smathy, yeah, you're right, the view takes less than 1 sec to run everytime, so it's not the culprit of the long running query
[23:34:23] diggitydane: smathy, yeah, follower is just a term that postgres uses, similar to master/slave on mysql
[23:34:54] smathy: diggitydane, right, so yeah - probably that then.
[23:35:35] cassioscabral: has joined #RubyOnRails
[23:36:07] smathy: ...but the essence of the aggregation fix isn't really whether the DB is online or offline, the essence is that you do the bulk of the work/calculations ahead of when they're needed for the report.
[23:36:15] diggitydane: smathy, ok, i'll roll one up and test that out. next step would just be to aggregate the data into an intermediate table and query from there?
[23:36:37] jstransky: has joined #RubyOnRails
[23:36:41] diggitydane: smathy, yeah, and I'm just wondering if postgres is still the right tool for that or if there is something else I'm not aware of that fits better
[23:37:03] nyaa: has joined #RubyOnRails
[23:37:24] mary5030_: has joined #RubyOnRails
[23:37:26] smathy: diggitydane, I'd just use pg.
[23:38:42] sarink: has joined #RubyOnRails
[23:39:34] diggitydane: smathy, ok, thanks for your help
[23:40:04] shock_one: has joined #RubyOnRails
[23:44:54] smathy: diggitydane, you're welcome.
[23:46:17] boomsin: has joined #RubyOnRails
[23:49:00] sbarg1: has joined #RubyOnRails
[23:49:34] hardtail: has joined #RubyOnRails
[23:51:07] hhgridd: ciree: i was actually thinking about using only grape with active record
[23:53:20] banister: has joined #RubyOnRails
[23:57:06] ja: ???ActiveJob::SerializationError: Unsupported argument type: Time??? ??? So-uhh, does anyone have a recommendation on how to pass `Date`s and `DateTime`s to Active Job jobs? ^_^
[23:57:47] ja: ACTION is quite surprised date/datetime/time is not supported by default
[23:58:05] tfitts: and reverse it from the integer
[23:58:25] tfitts: Date.to_i and in your job use Time.at(Date.to_i)
[23:58:34] tfitts: I'm surprised as well but it seems like a pretty simple workaround
[23:58:46] Scripore: has joined #RubyOnRails
[23:58:55] ja: I guess I can do that, tfitts; thanks
[23:59:01] ja: that???s just pretty annoying >.<
[23:59:29] tfitts: I haven't ever tried sending a date or time to a job before but I'm sure I would be feeling the same way.