« Back to channel list

#RubyOnRails - 03 June 2015

« Back 1 day Forward 1 day »
[00:03:54] neanderslob: I'm using the ruby csv class to put data from a spreadsheet into a database table, row by row with Data.create!(row.to_hash)
[00:04:01] Llamachka88: has joined #RubyOnRails
[00:04:08] sevenseacat: has joined #RubyOnRails
[00:04:21] Llamachka88: has joined #RubyOnRails
[00:04:21] Llamachka88: has left #RubyOnRails: ()
[00:04:32] neanderslob: does anyone know how I might check the value of a particular column in that given row? (I'm using column headers if it helps)
[00:04:40] zorak8: lol what?
[00:04:49] zorak8: Llamachka88> I just wanted to make sure you go to heaven when you die, the bible says we're not good enough to make it to heaven, so we need to get saved in order to make it to heaven! Google "Jesus is savior" and click how to be saved"
[00:05:16] pharserror: modsmodsmodsmodsmodsmodsmodsmods
[00:05:17] ivanc: has joined #RubyOnRails
[00:05:31] sevenseacat: zorak8: 'scuse me?
[00:05:39] ChanServ: +o sevenseacat
[00:05:43] kinduff: has joined #RubyOnRails
[00:05:44] zorak8: anyone else recive that pm?
[00:06:03] ghr: has joined #RubyOnRails
[00:06:09] zorak8: llamachaka88 join, spanme and left
[00:06:45] Zadrel: pharserror: thx, the query generated ran without errors, but i'm still getting an empty set. i'll research a little more
[00:06:51] zorak8: i didnt even have time to tell him/her that im atheist so im not going anywhere...
[00:07:16] ChanServ: -o sevenseacat
[00:07:53] dopieee: has joined #RubyOnRails
[00:08:07] baweaver|work: has joined #RubyOnRails
[00:08:18] moeabdol1: has joined #RubyOnRails
[00:08:19] _seanc_: neanderslob: It might not be helpful to you but we wrote a library a while back for loading large CSVs into our database. We needed to be able to structure the CSV and validate it: https://github.com/liftopia/clerk-gem
[00:08:37] charleystran: has joined #RubyOnRails
[00:08:56] pharserror: Zadrel: if you are pulling a timestamp from the db you want to do DateTime.new(my_record.timestamp).strftime('%Y-%d-%m %H:%M:%S')
[00:08:57] _seanc_: FWIW it???s been bug free in production for 2 years now. Easily processed tens of millions of CSV rows :)
[00:09:34] neanderslob: _seanc_: cool I'll take a look, thanks
[00:09:50] baweaver|work: Anyone ever seen a scenario where MySQL starts rejecting queries?
[00:09:51] _seanc_: neanderslob: If the library isn???t useful, some of the code in it may be :D
[00:10:14] neanderslob: _seanc_: you read my mind!
[00:10:30] Zadrel: pharserror: i'm not, i'm trying to pull the timestamp from my system's clock and compare with the timestamp of the DB;
[00:10:42] _seanc_: I???ve got to step out but feel free to ping me if you need a hand.
[00:11:39] baweaver|work: ACTION starts poking at InnoDB IO rates
[00:11:42] neanderslob: Zadrel: so why can't you do something like this? http://stackoverflow.com/a/15626098/2540204
[00:15:14] charliesome: has joined #RubyOnRails
[00:16:37] duderonomy: has joined #RubyOnRails
[00:16:44] quazimodo: has joined #RubyOnRails
[00:17:02] chintanparikh: has joined #RubyOnRails
[00:17:12] mary5030: has joined #RubyOnRails
[00:19:25] bricker: has joined #RubyOnRails
[00:19:41] spyderman4g63: has joined #RubyOnRails
[00:19:54] rushed: has joined #RubyOnRails
[00:20:08] baweaver|work: Anyone ever seen AWS fog return empty result sets?
[00:20:37] shyshy: has joined #RubyOnRails
[00:20:44] Rager: when my data source is empty.
[00:20:47] Rager: *rimshot*
[00:21:02] Rager: or you mean as a response that should be telling you status and such?
[00:21:07] Rager: could be timing out
[00:21:11] Rager: or could be lolconfigs
[00:21:31] baweaver|work: Someone decided to base our sync process without checking that, so now there's a fun mess to clean
[00:24:14] dopieee: has joined #RubyOnRails
[00:24:20] baweaver|work: ACTION repeatedly bashes head on desk
[00:24:39] baweaver|work: Just trying to figure out if anyone's seen Fog timeout and return an empty set for lolz
[00:24:51] Lightsword: has joined #RubyOnRails
[00:26:38] snophey: has joined #RubyOnRails
[00:27:07] starfox_sf: has joined #RubyOnRails
[00:29:09] snophey: has left #RubyOnRails: ()
[00:32:44] fgo: has joined #RubyOnRails
[00:34:17] moeabdol1: has joined #RubyOnRails
[00:34:46] maz-dev: has joined #RubyOnRails
[00:35:04] earthquake: has joined #RubyOnRails
[00:35:31] sarink: has joined #RubyOnRails
[00:39:00] DutchEdam: has joined #RubyOnRails
[00:40:27] rkofman: has joined #RubyOnRails
[00:41:14] baweaver_: has joined #RubyOnRails
[00:41:19] DutchEdam: has left #RubyOnRails: ()
[00:41:49] pjammer: has joined #RubyOnRails
[00:42:55] goleldar: has joined #RubyOnRails
[00:43:39] goleldar: is it bad form to change multiple column types for one table in one migration file? vs one migration file per column type change
[00:45:30] charliesome: has joined #RubyOnRails
[00:48:06] robustus|Off: has joined #RubyOnRails
[00:48:56] tjbiddle: has joined #RubyOnRails
[00:49:12] baweaver_: has joined #RubyOnRails
[00:49:57] krz: anyone deploying to AWS opsworks with ssl? do you set ssl on the ELB (load balancer) and the same SSL certs on the Opsworks app?
[00:50:08] workmad3: has joined #RubyOnRails
[00:50:28] kinduff: has joined #RubyOnRails
[00:51:03] Aswebb_: has joined #RubyOnRails
[00:53:55] ekain: has joined #RubyOnRails
[00:55:54] ght: Question: Using rails 4.2, I need a table with an add button that will dynamically create rows without reloading the entire page.
[00:56:04] ght: I've been looking for tutorials on this subject, does anyone have a general guide or example of this behavior?
[00:56:16] ght: I realize javascript / ajax are involved.
[00:58:57] TheNet: ght I think railscasts did an episode on something like that
[00:59:28] chouhoul_: has joined #RubyOnRails
[00:59:53] thebatu1: has joined #RubyOnRails
[01:01:25] _seanc_: has joined #RubyOnRails
[01:02:46] bricker: ght: it's not trivial. https://github.com/SCPR/outpost/blob/master/lib/action_view/helpers/form_builder.rb https://github.com/SCPR/outpost/blob/master/app/assets/javascripts/outpost/field_manager.js.coffee
[01:03:25] bricker: I wish this functionality was just a native form type, it's so common.
[01:03:30] sevenseacat: the cocoon gem would be useful here.
[01:03:34] neanderslob: ght: adding rows to what?
[01:03:35] patie: has joined #RubyOnRails
[01:03:39] sevenseacat: assumed it was a form
[01:04:12] bricker: I tried cocoon once and it didn't work for me, ymmv
[01:04:35] DoctorMonocular: has joined #RubyOnRails
[01:04:39] ght: neanderslob: to a table.
[01:04:41] neanderslob: bricker: that's a shame; I love it!
[01:04:57] ght: 20:55 < ght> Question: Using rails 4.2, I need a table with an add button that will dynamically create rows without reloading the entire page.
[01:04:58] bricker: neanderslob: Last time I tried was years ago so many it has improved
[01:05:09] bricker: oh, a table?
[01:05:34] bricker: neanderslob: look at Data Tables, it can do everything on the client-side
[01:05:36] neanderslob: ght: at the risk of sounding repetitive... a table of what? inputs?
[01:06:21] sevenseacat: cocoon is awesome
[01:06:39] sevenseacat: can be a little fiddly, but definitely better than writing it all yourself (which I've also done)
[01:06:42] neanderslob: ght: I second cocoon: https://github.com/nathanvda/cocoon
[01:07:07] ghr: has joined #RubyOnRails
[01:07:19] ght: The user would be able to fill in values, and if they want to add a row, they click an add button of some sort, and it would dynamically create another row in the table. The rows in the table correspond to a Rails model.
[01:07:33] ght: After filling in as many rows as they like, they hit submit and it commits them to the database as individual entries.
[01:08:04] ght: neanderslob: Checking out cocoon, thank you.
[01:08:47] neanderslob: ght: this video is a great tutorial on how to implement for exactly what you're describing: https://www.youtube.com/watch?v=QhdzE1yNs-0
[01:09:22] neanderslob: bricker: you mean this gem? https://github.com/rweng/jquery-datatables-rails
[01:09:32] j_mcnally: has joined #RubyOnRails
[01:09:42] bricker: neanderslob: just datatables, I don't care how you get it into your app
[01:09:49] bricker: datatables is a javascript library
[01:10:04] neanderslob: bricker: ohhhh I see
[01:10:21] j_mcnally: has joined #RubyOnRails
[01:11:05] Lightsword: has joined #RubyOnRails
[01:12:08] cornerma1: has joined #RubyOnRails
[01:13:24] rodfersou: has joined #RubyOnRails
[01:13:44] Rubie: has joined #RubyOnRails
[01:14:02] ProLoser: has joined #RubyOnRails
[01:14:35] chouhoulis: has joined #RubyOnRails
[01:14:55] boombadaroomba: has joined #RubyOnRails
[01:15:11] Cache_Money: has joined #RubyOnRails
[01:18:16] Elboerea: has joined #RubyOnRails
[01:19:15] tjbiddle: has joined #RubyOnRails
[01:19:57] duderonomy: has joined #RubyOnRails
[01:24:05] Sylario: has joined #RubyOnRails
[01:26:43] Lightsword: has joined #RubyOnRails
[01:27:10] luchillo: has joined #RubyOnRails
[01:29:57] simplyianm: has joined #RubyOnRails
[01:31:05] ivanskie: has joined #RubyOnRails
[01:31:50] scottmatheina: has joined #RubyOnRails
[01:32:01] sandstrom: has joined #RubyOnRails
[01:33:21] Brozo: has joined #RubyOnRails
[01:35:52] RegulationD: has joined #RubyOnRails
[01:35:59] beauby: has joined #RubyOnRails
[01:36:05] luchillo: Hello there, anyone home?
[01:37:36] luchillo: It says that 593 people are connected but it's quiet
[01:37:49] luchillo: Too quiet ...
[01:38:37] luchillo: So, hi sevenseacat, how are you?
[01:38:46] sevenseacat: not bad, and yourself?
[01:39:04] luchillo: Very good thanks
[01:39:16] sevenseacat: working on anything frosty today?
[01:39:49] luchillo: I was hopping to ask something about models and exeptions
[01:40:11] sevenseacat: sure ,ask away
[01:40:15] SeanLazer: has joined #RubyOnRails
[01:40:29] spetryk: has joined #RubyOnRails
[01:40:50] luchillo: U see, i'm using postgress as db, made a User model with email uniq
[01:41:11] luchillo: the validation is inside the db and in the model itself
[01:42:27] luchillo: when i ignore the validation in the model and thrust the db to handle uniq i get an exception as ActiveRecord::RecordNotUnique
[01:42:46] rubyonrails347: has joined #RubyOnRails
[01:43:24] luchillo: I handle this one by rescue it in the model with before save, putting the error in the model errors so it redirects to the /new route
[01:43:47] luchillo: Do you think it's a good way to handle this?
[01:44:45] sevenseacat: I'd put the validation in both the model and the database, and just let it fail it the database validation gets triggered - the chances of that happening are so slim
[01:46:07] ght: So, to use this cocoon gem as recommended earlier, these tutorials are all recommending I utilize haml-rails. When researching this, doing so requires I convert my project from erb to haml format.
[01:46:14] ght: What are the advantages / disadvantages of this?
[01:46:23] sevenseacat: you dont need to use haml to use cocoon
[01:46:39] ght: That's correct, but as stated, these tutorials are recommending I do so.
[01:46:56] sevenseacat: then see what reasoning the tutorials give for it
[01:47:08] ght: What are some of the advantages of disadvantages of haml vs erb?
[01:47:08] sevenseacat: I use haml, but telling people to use it just because I do, is a bit silly
[01:47:28] sevenseacat: you also don't need to convert anything, you can use both in a project quite happily.
[01:49:36] pepelui: has joined #RubyOnRails
[01:49:51] bob14: has joined #RubyOnRails
[01:50:05] fgo: has joined #RubyOnRails
[01:50:59] luchillo: Well i actually wanted to handle this exception so in case i want to use the db with other instances, u know, to ensure db integrity
[01:51:13] pepelui: has left #RubyOnRails: ()
[01:51:35] pontiki: has joined #RubyOnRails
[01:52:15] sevenseacat: then you'd need to wrap any call to `save` in an exception handler, or anything that potentially modify data in the db
[01:54:12] axl_: has joined #RubyOnRails
[01:55:13] luchillo: I actually made it inside the model, redefinig save function i called super inside a error handler
[01:55:22] codepete: has joined #RubyOnRails
[01:57:00] Elboerea: Imagine how many errors one could avoid by reading a simple book.
[01:58:15] hazelux: has joined #RubyOnRails
[01:59:18] merryfett: has joined #RubyOnRails
[02:00:50] markalanevans: has joined #RubyOnRails
[02:01:19] luchillo: I do it to rescue only ActiveRecord::RecordNotUnique
[02:03:28] briandavis: has joined #RubyOnRails
[02:03:46] [H]unt3r: has joined #RubyOnRails
[02:03:54] siemprefresco: has joined #RubyOnRails
[02:04:45] nonparfumee: has joined #RubyOnRails
[02:05:06] bob14: could someone help me with trying to add a condtion to the count() method in one of my queries? It seems easy but I can't figure it out. Here is the gist: https://gist.github.com/theDazzler/ad7b60f10b5f8b2f4307
[02:05:47] rushed: has joined #RubyOnRails
[02:05:50] tjbiddle: has joined #RubyOnRails
[02:07:45] DoctorMonocular: has joined #RubyOnRails
[02:07:55] ghr: has joined #RubyOnRails
[02:08:38] beauby: has joined #RubyOnRails
[02:10:54] ght: "ERB vs. HAML has the fervor of a religious debate in the Rails community. According to surveys, about 46% of the community prefers HAML."
[02:11:02] ght: Where do you guys stand on ERB vs HAML?
[02:11:09] weaksauce: by a long margin
[02:11:21] weaksauce: erb is popular because it's built into rails
[02:12:10] sevenseacat: erb is popular because its the simplest solution, stick your dynamic content into your unmodified HTML, its also easy for non-railsy people to work with
[02:12:44] sarink: has joined #RubyOnRails
[02:12:52] ght: Is it straightforward to convert an existing erb-formatted project to HAML?
[02:13:04] weaksauce: fairly yeah. use html2haml
[02:13:05] Elboerea: sevenseacat, Send me your github again wanna see your Elixir work :)
[02:13:11] sevenseacat: sure, there are probably tools to do it out of the box.
[02:13:27] sevenseacat: Elboerea: https://github.com/sevenseacat/ticketee-phoenix ?
[02:14:04] SeanLazer: has joined #RubyOnRails
[02:14:23] weaksauce: bob14 how's it failing right now?
[02:14:39] Elboerea: sevenseacat, You movin?
[02:14:45] Brozo: has left #RubyOnRails: ("Leaving...")
[02:14:48] darrencauthon: has joined #RubyOnRails
[02:14:49] sevenseacat: havent done much on it. got sidetracked yesterday fixing a bug in phoenix_html
[02:14:56] sevenseacat: Elboerea: moving where? no
[02:15:07] Elboerea: sevenseacat, To Elixir/Phoenix
[02:15:33] dannycast: has joined #RubyOnRails
[02:15:36] sevenseacat: cant one do both?
[02:15:57] dannycast: has left #RubyOnRails: ()
[02:17:19] bob14: weaksauce: when I add that date condtion into the where method with "apps.id = installations.app_id" it only returns developers that have apps installed in the current month. I would like it to return a list with all developers with app installs for the current month and just have a count of 0 if they don't have any this month
[02:17:46] crevax: has joined #RubyOnRails
[02:17:58] annlewis: has joined #RubyOnRails
[02:17:59] erichmenge: has joined #RubyOnRails
[02:18:20] IFrank00: has joined #RubyOnRails
[02:18:43] weaksauce: bob14 that's going to be a little trickier. you could do a left join possibly and handle the nils be 0 when you display things. or use a coalesce value perhaps.
[02:19:53] hyperjuice: has joined #RubyOnRails
[02:20:05] hyperjuice: Hi, I'm making a RoR app and I made a form that has a field with the :datetime type. What would a user type in that field?
[02:23:32] maz-dev: has joined #RubyOnRails
[02:27:17] zrl: has joined #RubyOnRails
[02:27:30] chouhoulis: has joined #RubyOnRails
[02:28:06] bob14: weaksauce: how should i do the left join?
[02:28:15] chouhoulis: has joined #RubyOnRails
[02:30:18] mary5030: has joined #RubyOnRails
[02:33:39] ur5us_: has joined #RubyOnRails
[02:38:02] penguinpowernz: has joined #RubyOnRails
[02:38:29] givanse: has joined #RubyOnRails
[02:40:13] Aswebb_: has joined #RubyOnRails
[02:40:30] djbkd: has joined #RubyOnRails
[02:41:23] Spami: has joined #RubyOnRails
[02:41:46] charliesome: has joined #RubyOnRails
[02:42:07] Cache_Money: has joined #RubyOnRails
[02:44:59] IFrank00: has joined #RubyOnRails
[02:45:06] Brozo: has joined #RubyOnRails
[02:47:34] ProLoser: has joined #RubyOnRails
[02:48:34] beauby: has joined #RubyOnRails
[02:48:41] annlewis: has joined #RubyOnRails
[02:48:44] byonic: has joined #RubyOnRails
[02:48:44] mike___1234: has joined #RubyOnRails
[02:48:47] thebatu1: has joined #RubyOnRails
[02:50:46] creature: has joined #RubyOnRails
[02:51:01] jgpawletko: has joined #RubyOnRails
[02:52:07] chouhoulis: has joined #RubyOnRails
[02:53:46] tomeara: has joined #RubyOnRails
[02:54:04] sarink: has joined #RubyOnRails
[02:56:57] ramfjord: Does anyone know of a way to check whether "ClassName".constantize will throw a NameError?
[02:56:59] jfarmer: has joined #RubyOnRails
[02:57:08] ramfjord: besides rescuing it
[02:57:13] ramfjord: just curious
[02:57:20] sevenseacat: i'm not sure how it could
[02:57:30] ramfjord: there is the defined? method for actual constants
[02:57:35] ramfjord: defined? ClassName
[02:57:50] ramfjord: er, probably not actually a method
[02:59:30] jfarmer: ramfjord Correct
[02:59:40] duderonomy: has joined #RubyOnRails
[03:00:12] simplyianm: has joined #RubyOnRails
[03:01:11] jfarmer: ramfjord There is Module#const_defined though
[03:01:35] jfarmer: http://ruby-doc.org/core-2.2.0/Module.html#method-i-const_defined-3F
[03:01:47] m0r0n: has joined #RubyOnRails
[03:01:52] mostlybadfly: has joined #RubyOnRails
[03:04:37] ramfjord: Ahh, that's pretty cool, and actually seems to work
[03:04:41] rogaps: has joined #RubyOnRails
[03:04:58] ramfjord: strange that you can even use Float.const_defined("MyDefinedClass") # => true
[03:05:15] Rubie: has joined #RubyOnRails
[03:05:23] n80: has joined #RubyOnRails
[03:08:48] Lightsword: has joined #RubyOnRails
[03:08:51] ghr: has joined #RubyOnRails
[03:09:19] beauby: has joined #RubyOnRails
[03:09:47] braincrash: has joined #RubyOnRails
[03:10:09] krz: im using an elb which has my CA's ssl certificate. the first point of access is the load balancer (ELB). the elb directs traffic to the instances. the instances each have a copy of the rails app, unicorn, etc. at this point do i need to force_ssl in rails?
[03:10:16] krz: the instances cant be accessed directly
[03:10:49] rhizome: no. it's common enough to strip ssl at the border
[03:12:01] TheNet: has joined #RubyOnRails
[03:12:11] krz: rhizome: force_ssl automatically redirects traffic from http to https. i also read somewhere that it does a little more than that. something about securing cookies a different way
[03:12:51] macmartine: has joined #RubyOnRails
[03:13:17] krz: http://api.rubyonrails.org/classes/ActionController/ForceSSL/ClassMethods.html only indicates http to https redirection
[03:13:46] krz: http://stackoverflow.com/questions/15676596/what-does-force-ssl-do-in-rails second answer suggests that force_ssl does more that redirection
[03:17:28] moretti: has joined #RubyOnRails
[03:18:28] krz: so at this point is it necessary to force_ssl? or should the SSL terminate at the load balancer?
[03:19:32] lessless: has joined #RubyOnRails
[03:21:43] rogaps: has joined #RubyOnRails
[03:21:51] Olipro_: has joined #RubyOnRails
[03:22:03] sandstrom: has joined #RubyOnRails
[03:24:00] BlissOfBeing: has joined #RubyOnRails
[03:24:21] maz-dev: has joined #RubyOnRails
[03:24:27] Anakat: has joined #RubyOnRails
[03:24:30] RegulationD: has joined #RubyOnRails
[03:26:11] MEATCHICKEN: has joined #RubyOnRails
[03:26:59] Limix: has joined #RubyOnRails
[03:29:38] darrencauthon: has joined #RubyOnRails
[03:30:10] jenrzzz: has joined #RubyOnRails
[03:31:23] rubyonrails697: has joined #RubyOnRails
[03:33:42] SalexW: has joined #RubyOnRails
[03:34:02] sp1rs: has joined #RubyOnRails
[03:34:48] tbuehlmann: has joined #RubyOnRails
[03:34:57] x-light: has joined #RubyOnRails
[03:36:26] mark[oz]: has joined #RubyOnRails
[03:38:18] gambl0re: has joined #RubyOnRails
[03:38:52] mark[oz]: has joined #RubyOnRails
[03:39:30] MEATCHICKEN: Hi guys - trying to get this to tile as a background image but it doesn't line up properly. Any tips?
[03:39:32] MEATCHICKEN: http://imgur.com/0vBNDlX
[03:40:46] sevenseacat: make it symmetrical. its not.
[03:41:05] chouhoul_: has joined #RubyOnRails
[03:41:16] sevenseacat: crop the right side, and a chunk off the bottom.
[03:41:59] skkeeper: has joined #RubyOnRails
[03:42:27] byprdct: has joined #RubyOnRails
[03:45:58] weaksauce: bob14 instead of join you say join("left join on ...)
[03:47:35] MEATCHICKEN: checking into that, sevenseacat . Thanks
[03:49:06] iamjarvo: has joined #RubyOnRails
[03:50:20] sarink: has joined #RubyOnRails
[03:50:29] David_H__: has joined #RubyOnRails
[03:51:59] bob14: weaksauce: I think i just got it to work using left join. thanks
[03:53:06] merryfett: has joined #RubyOnRails
[03:53:40] creature: has joined #RubyOnRails
[03:55:02] BlissOfBeing: has joined #RubyOnRails
[03:56:29] annlewis: has joined #RubyOnRails
[03:58:52] fedexo: has joined #RubyOnRails
[04:03:36] yfeldblum: has joined #RubyOnRails
[04:04:14] hahuang65: has joined #RubyOnRails
[04:08:04] merryfett: has joined #RubyOnRails
[04:08:31] justintv90: has joined #RubyOnRails
[04:08:55] seank_: has joined #RubyOnRails
[04:11:52] nonparfumee: has joined #RubyOnRails
[04:13:09] ProLoser: has joined #RubyOnRails
[04:14:08] x44x45x41x4E: has joined #RubyOnRails
[04:15:38] varunwachaspati: has joined #RubyOnRails
[04:18:40] nahtnam: has joined #RubyOnRails
[04:19:17] towski_: has joined #RubyOnRails
[04:19:21] markalanevans: has joined #RubyOnRails
[04:19:22] _djbkd: has joined #RubyOnRails
[04:22:57] sleungcy: has joined #RubyOnRails
[04:23:20] Cache_Money: has joined #RubyOnRails
[04:23:30] David_H_Smith: has joined #RubyOnRails
[04:24:26] michael_mbp: has joined #RubyOnRails
[04:24:45] mark[oz]: has joined #RubyOnRails
[04:25:09] David_H__: has joined #RubyOnRails
[04:25:59] Anakat: has joined #RubyOnRails
[04:28:18] nahtnam: has joined #RubyOnRails
[04:29:07] Aswebb_: has joined #RubyOnRails
[04:30:05] mark[oz]: has joined #RubyOnRails
[04:30:10] DoctorMonocular: has joined #RubyOnRails
[04:32:34] jaequery: has joined #RubyOnRails
[04:36:01] Ropeney: sevenseacat: You live in Sydney?
[04:36:09] sevenseacat: Ropeney: nope, Perth.
[04:36:36] Ropeney: are you attending the railsconf?
[04:36:42] sevenseacat: most definitely.
[04:36:55] Ropeney: Staying at the Mecure?
[04:37:15] Ropeney: Im organising it now trying to work out where to stay - open to suggestions
[04:37:19] sevenseacat: if its cheap and within walking distance, maybe >_>
[04:37:26] Ropeney: obviously would rather the cheaper but close
[04:37:39] thebatu1: has joined #RubyOnRails
[04:37:57] kinduff: has joined #RubyOnRails
[04:37:57] kinduff: has joined #RubyOnRails
[04:39:48] sevenseacat: I've only been to sydney a couple of times, so
[04:40:01] Ropeney: I have never been haha
[04:40:04] markalanevans: has joined #RubyOnRails
[04:40:11] sevenseacat: I'm going next week for railscamp :)
[04:40:19] moeabdol: has joined #RubyOnRails
[04:41:39] Ropeney: that would of been good to goto - never knew of it
[04:41:58] sevenseacat: next one then!
[04:42:13] Ropeney: yes, next one!
[04:42:19] Ropeney: ill be at the railsinstallfest in adelaide thoiugh
[04:42:49] sevenseacat: i think rachelle is looking forward to that one
[04:43:35] Ropeney: It should be good fun :D
[04:44:17] JohnBat26: has joined #RubyOnRails
[04:44:47] DoctorMo_: has joined #RubyOnRails
[04:49:29] zzing: has joined #RubyOnRails
[04:50:14] Scripore: has joined #RubyOnRails
[04:52:03] rvanlieshout: has joined #RubyOnRails
[04:52:57] rkofman: has joined #RubyOnRails
[04:52:58] macmartine: has joined #RubyOnRails
[04:54:49] daneo: has joined #RubyOnRails
[04:55:03] GPrime: has joined #RubyOnRails
[04:56:59] mark[oz]: has joined #RubyOnRails
[04:57:36] annlewis: has joined #RubyOnRails
[04:57:49] olegtc: has joined #RubyOnRails
[04:58:46] Lightsword: has joined #RubyOnRails
[05:02:50] Lightsword: has joined #RubyOnRails
[05:03:08] sandstrom: has joined #RubyOnRails
[05:04:15] pontiki: has joined #RubyOnRails
[05:05:47] Lightsword: has joined #RubyOnRails
[05:07:18] macmartine: has joined #RubyOnRails
[05:08:23] theery: has joined #RubyOnRails
[05:09:28] quazimodo: anyone know how toget a list of required/installed gems from Bundler ?
[05:10:14] ghr: has joined #RubyOnRails
[05:11:03] zkanda: has joined #RubyOnRails
[05:11:39] rvanlieshout: they are in Gemfile.lock
[05:11:41] zkanda: has left #RubyOnRails: ()
[05:12:11] quazimodo: rvanlieshout: programattically
[05:12:29] quazimodo: i need to go 'inside' each gems directory and look for a particular fil
[05:12:34] Limix: has joined #RubyOnRails
[05:13:09] maz-dev: has joined #RubyOnRails
[05:13:22] Radar: what file
[05:13:23] RegulationD: has joined #RubyOnRails
[05:13:29] quazimodo: Radar: Bowerfile
[05:13:55] quazimodo: my engines have Bowerfiles
[05:14:04] quazimodo: i need to parse them to get the bower components or them
[05:14:30] quazimodo: i'm not sure how bundler does it
[05:14:45] Radar: Look at what `bundle show` does.
[05:15:08] quazimodo: i'm presuming it fetches, places the gem somewhere and reads its gemspec, updates its own list of requirements to flag stuff that is not resolving et
[05:15:12] jenrzzz: has joined #RubyOnRails
[05:15:24] Lightsword: has joined #RubyOnRails
[05:16:18] Limix: has joined #RubyOnRails
[05:16:27] quazimodo: i think I need to copy a lot of bundlers logic
[05:16:29] mbuf: has joined #RubyOnRails
[05:16:43] quazimodo: honestly, i wonder what world with bundler-bower would be like
[05:17:01] quazimodo: an extension to bundler to let us specify bower componenst in our gemfile/gemspec
[05:17:12] quazimodo: whimsical thought, but still?
[05:17:27] melonstorm: has joined #RubyOnRails
[05:17:27] melonstorm: has joined #RubyOnRails
[05:17:35] Lightsword: has joined #RubyOnRails
[05:18:09] Limix: has joined #RubyOnRails
[05:18:17] mbuf: if I use <%= ENV['DATABASE_NAME'] %> in config/database.yml, and start the server with DATABASE_NAME=development rails server, the environment variable gets evaluated. I have other config/*.yml files that also have ERB templating, but, they don't seem to get the passed environment variables. What could I be missing?
[05:18:49] Lightsword: has joined #RubyOnRails
[05:19:15] chrissonar: has joined #RubyOnRails
[05:20:26] byonic: quazimodo: like https://rails-assets.org/?
[05:22:56] lxsameer: has joined #RubyOnRails
[05:23:52] xploshioon: has joined #RubyOnRails
[05:24:05] hamster88: has joined #RubyOnRails
[05:24:41] hamster88: hello people
[05:24:58] hamster88: have any of used haml + bootstrap + rails
[05:25:20] xploshioon: someone had the problem that jquery code doesn't work when first load, but if you click in a link the code that affects the yield works? any idea of what can be the problem?
[05:25:57] xploshioon: the opposite of turbolinks problems, that's crazy
[05:26:19] hamster88: I have a question with reference to that
[05:26:35] Anakat: has joined #RubyOnRails
[05:26:40] aganov: has joined #RubyOnRails
[05:26:47] hamster88: I have created a project , I have added notice and alerts but for some reason, The notices are hidden but alert bar is still showing?
[05:26:47] xploshioon: what's your question @hamster88?
[05:27:10] Lightsword: has joined #RubyOnRails
[05:28:13] xploshioon: like dissmisable alerts?
[05:28:31] Brozo: has joined #RubyOnRails
[05:28:48] hamster88: please check the link https://gist.github.com/thedesignable/6522704615a4fb72167c
[05:29:08] hamster88: let me give you a screenshot so you can see what i am referring to
[05:29:20] sevenseacat: 'else alert' does not make snese
[05:29:37] sevenseacat: i think you want elsif there
[05:29:44] mary5030: has joined #RubyOnRails
[05:29:48] kinduff: has joined #RubyOnRails
[05:30:40] dionysus69: has joined #RubyOnRails
[05:31:44] hamster88: sevenseacat, elseif is not working for haml
[05:31:51] hamster88: or may be i am not writing it correctly
[05:31:59] sevenseacat: i said elsif, not elseif
[05:32:07] fgo: has joined #RubyOnRails
[05:32:22] hamster88: let me give it a shot
[05:32:47] hamster88: lol that just worked :D
[05:33:14] hamster88: i have a question regarding gems tho
[05:33:29] pontiki: somewhat unrelated, how are notice and alert set?
[05:33:43] hamster88: I have used devise pontiki
[05:34:15] hamster88: what gem should i use for social media sharing?
[05:34:28] pontiki: does devise always set those?
[05:34:37] pontiki: i've never seen that before
[05:34:48] simplyianm: has joined #RubyOnRails
[05:34:57] hamster88: pontiki, we have to set them when we install devise gem
[05:35:03] spicymagpie: has joined #RubyOnRails
[05:35:19] hamster88: have a look at the docs for devise https://github.com/plataformatec/devise
[05:35:21] jenrzzz: has joined #RubyOnRails
[05:36:05] pontiki: i am looking at it.
[05:36:20] pontiki: it talks about setting flash[:notice] and flash[:alert]
[05:36:37] pontiki: i don't see anything about using them as barewords
[05:36:52] xploshioon: someone had the problem that jquery code doesn't work when first load, but if you click in a link the code that affects the yield works? any idea of what can be the problem?
[05:37:18] pontiki: you said that 11 minutes ago, xploshioon
[05:37:22] hamster88: xploshioon, have you checked for the javascript tag ?
[05:37:39] hamster88: in application.html
[05:37:58] sevenseacat: xploshioon: !ncnh
[05:37:58] helpa: xploshioon: If you don't provide any code, it becomes really difficult for us to help you. Providing code to reproduce the problem increases your chances of getting great, accurate help immensely.
[05:38:20] xploshioon: thanks, let me create a gist
[05:38:39] hamster88: pontiki have a look at my gist code https://gist.github.com/thedesignable/6522704615a4fb72167c in application.html.haml file you can see how i setup the notice
[05:39:05] Ropeney: has joined #RubyOnRails
[05:39:14] pontiki: yes, hamster88, that's why i'm asking
[05:39:25] pontiki: i've never seen them as bare words like that
[05:39:35] pontiki: line 13 and line 15
[05:39:48] hamster88: lol sevenseacat xD
[05:39:58] pontiki: but where do they get set?
[05:40:09] sevenseacat: theyre just helper methods provided by devise iirc
[05:40:21] tagrudev: has joined #RubyOnRails
[05:41:36] hamster88: they get set on your header actually
[05:41:37] hamster88: let me give you a screenshot where they show up
[05:41:49] pontiki: searching through the api docs, i can't find anything for either notice or alert
[05:41:52] sevenseacat: code would be better than a screenshot.
[05:42:14] pontiki: hamster88: i'm not wondering whether you're using them. i'm totally confused about where they get set
[05:42:30] hamster88: pontiki, yes i am using them notices and alert
[05:42:39] hamster88: sevenseacat, i have them in gist already
[05:42:43] pontiki: what did i just say, hamster88 ?
[05:42:53] sevenseacat: hamster88: you're answering questions that pontiki isnt asking
[05:42:55] sarink: has joined #RubyOnRails
[05:44:16] hamster88: can you rephrase your question pontiki
[05:44:18] xploshioon: this is my code guys https://gist.github.com/xploshioOn/b77728369bcbea20d1cd
[05:45:21] sevenseacat: xploshioon: you only want guys to help you? oh okay.
[05:46:05] xploshioon: the problem is that when I enter in the url bar localhost:3000/start-now for example, the script does nothing, but if i click in another link and go back, it works...
[05:46:29] dideler: has joined #RubyOnRails
[05:46:54] xploshioon: haha lol @sevenseacat no, is just a habit, sorry
[05:47:11] xploshioon: by the way !ncnh?
[05:47:19] sevenseacat: "no code, no help"
[05:47:41] xploshioon: well, there is the code xD
[05:48:01] xploshioon: the dropdown of bootstrap is with the same problem
[05:48:11] hamster88: xploshioon, I had same prob like that too
[05:48:22] pontiki: right here: http://api.rubyonrails.org/classes/ActionDispatch/Flash/FlashHash.html#method-i-notice
[05:48:37] sevenseacat: either remove jquery.turbolinks and write code compatible with turbolinks, or remove turbolinks
[05:49:09] hamster88: remove the turbolinks that would help
[05:49:20] hamster88: i had same prob with my project too
[05:49:35] xploshioon: but turbolinks cause problem in the opposite way
[05:49:58] sevenseacat: or dont then. thats fine.
[05:50:03] xploshioon: when you enter, all works, but if you go to a link the jquery code doesn't work anymore
[05:50:33] xploshioon: i had that problem and jquery.turbolinks solve that
[05:51:47] hamster88: pontiki, I set the flash/notice & alert right before the "navbar" like - if notice, %p.notice.alert-success= notice
[05:52:04] sevenseacat: hamster88: thats not setting them.
[05:52:07] sevenseacat: thats just using them.
[05:52:15] sevenseacat: pontiki found the code she was after.
[05:52:56] hamster88: well i don't think you have to set them if you are using the devise notices, just have to add those 2 lines of codes right after body tag
[05:53:00] goleldar: has joined #RubyOnRails
[05:53:15] sevenseacat: hamster88: you're again misunderstood the question. never mind. its been resolved.
[05:54:32] hamster88: always happens to me xD (english is not my first language) but i try my best
[05:55:42] creature: has joined #RubyOnRails
[05:56:06] riotjones: has joined #RubyOnRails
[05:56:24] xploshioon: we are in the same @hamster88 haha
[05:56:27] justintv90: has joined #RubyOnRails
[05:56:42] hamster88: xploshioon, hi^5 :D
[05:57:39] xploshioon: why not, hi5 x_X
[05:57:49] DoctorMonocular: has joined #RubyOnRails
[05:58:00] hamster88: lol everybody writes in different way :D
[05:58:07] hamster88: but yeah hi5 :D
[05:58:22] annlewis: has joined #RubyOnRails
[05:58:49] Elboerea: sevenseacat, Can I pm you for a personal question?
[05:58:57] sevenseacat: Elboerea: sure.
[06:00:58] nfk: has joined #RubyOnRails
[06:01:53] daneo: has joined #RubyOnRails
[06:02:52] riotjones: has joined #RubyOnRails
[06:03:33] quazimodo: a crap solution for a non existant problem
[06:04:33] hamster88: what gem should i use for social post sharing?
[06:04:47] hamster88: or sharing post to social media?
[06:05:38] sinkensabe: has joined #RubyOnRails
[06:06:08] Scripore: has joined #RubyOnRails
[06:06:17] chinmay_dd: has joined #RubyOnRails
[06:06:38] shortCircuit__: has joined #RubyOnRails
[06:07:11] hamster88: hello shortCircuit__
[06:08:03] shortCircuit__: can I not submit a javascript FormData() object in rails?
[06:08:45] sevenseacat: ACTION nods sagely.
[06:09:20] Radar: God damn it
[06:09:40] Radar: Radar is le tired after dealing with payment gateway issues for the past two days
[06:09:54] Radar: Radar is going to go home early today because he feels himself burning out and is no fun to play with
[06:10:02] sevenseacat: go home and chillax0r.
[06:10:04] shortCircuit__: I was trying to post a file along with records(using angularjs) so, I made a FormData Object, var fd = new FormData() and then fd.append("profile", JSON.stringify(vm.profile)) and fd.append("profile[photo_attributes][0]", vm.files[0]) .. now when I post teh form, it says rails was expecting a hash not an fd object
[06:10:13] Radar: chill with my cat. That'll be nice.
[06:10:16] shortCircuit__: chillax0r :P :D
[06:10:17] sevenseacat: shortCircuit__: !debug
[06:10:17] helpa: shortCircuit__: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[06:10:18] bruno-: has joined #RubyOnRails
[06:10:22] Radar: shortCircuit__: Say it don't spray it
[06:10:24] Radar: shortCircuit__: !gist
[06:10:24] helpa: shortCircuit__: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[06:10:55] Pupeno: has joined #RubyOnRails
[06:10:55] Pupeno: has joined #RubyOnRails
[06:10:58] ghr: has joined #RubyOnRails
[06:11:20] randomizer: has joined #RubyOnRails
[06:12:08] kinduff: has joined #RubyOnRails
[06:12:09] kinduff: has joined #RubyOnRails
[06:12:51] shortCircuit__: let me start the server, I can paste teh error
[06:12:55] Sylario: has joined #RubyOnRails
[06:13:01] Radar: error + code
[06:13:10] Radar: I think we have been through this at least once before.
[06:13:41] kp666: has joined #RubyOnRails
[06:13:42] shortCircuit__: is that count equal to present + not present ?
[06:14:41] Radar: Days since the first day the bot saw you.
[06:15:02] netzfisch: has joined #RubyOnRails
[06:15:42] Radar: patches welcome if you want it the other way: https://github.com/radar/railsbot/blob/master/bot.rb#L84-L106
[06:16:12] workmad3: has joined #RubyOnRails
[06:16:25] helpa: has joined #RubyOnRails
[06:17:48] Aswebb_: has joined #RubyOnRails
[06:21:41] pontiki: i wish i could remember the question i wanted to ask earlier today
[06:21:50] quazimodo: Radar: getting there
[06:22:06] metus_violarium: has joined #RubyOnRails
[06:22:19] n3b: has joined #RubyOnRails
[06:22:32] quazimodo: but actually I'm not sure that I need to think about Bundler
[06:22:38] quazimodo: since Gem::Specification has all the data
[06:22:41] pontiki: getting rather tired of the hacky-hack going on with a current project
[06:22:44] RahulT: has joined #RubyOnRails
[06:23:17] quazimodo: pontiki: blow it apart with some anti hack?
[06:23:54] pontiki: quazimodo: i am the only one on the project writing any tests
[06:24:56] sandstrom: has joined #RubyOnRails
[06:24:58] quazimodo: pontiki: that's ok
[06:25:00] pontiki: the one i wrote today is absolutely horrendous because of the way things are implemented
[06:25:10] Lightsword: has joined #RubyOnRails
[06:25:13] quazimodo: then not so ok
[06:25:19] quazimodo: what are they doing?
[06:25:42] pontiki: but i'll be damned if i'm going to spend my time poking and clicking on the browser every time i want to test it
[06:26:06] pontiki: @radar, please don't laugh
[06:26:22] pontiki: we're implementing e-commerce in this app so people can order a complete recipe
[06:26:25] Radar: no laughing from me
[06:26:54] cppcho: has joined #RubyOnRails
[06:27:25] Anakat: has joined #RubyOnRails
[06:27:56] pontiki: i'm so scared of all the holes that will be in this
[06:28:53] cppcho: oh thanks ! first time using irc lol
[06:28:57] Rubie: has joined #RubyOnRails
[06:28:59] quazimodo: pontiki: lol
[06:29:02] quazimodo: pontiki: surprise surprise
[06:29:38] sevenseacat: pontiki: soundsfamiliar
[06:35:20] superflat: has joined #RubyOnRails
[06:37:10] aufi: has joined #RubyOnRails
[06:37:38] pontiki: it is familiar; we've all been through this, or will go through this
[06:37:56] pontiki: we're supposed to release on thursday
[06:38:44] pontiki: if it doesn't happen, well i don't know what's going to happen, except the founders are going to be very very unhappy
[06:38:57] roolo: has joined #RubyOnRails
[06:39:14] pontiki: but since they won't actually pull people from paying projects, there's really no time to work on this
[06:42:15] mary5030: has joined #RubyOnRails
[06:44:09] netzfisch: has joined #RubyOnRails
[06:44:22] quazimodo: pontiki: just do your best
[06:44:32] pontiki: i always do
[06:44:57] pontiki: and if that's thwarted, i walk
[06:45:24] fgo: has joined #RubyOnRails
[06:46:30] hamster88: has joined #RubyOnRails
[06:46:58] shortCircuit__: my codes has a got a mind of their own,. what was working yestrday dosn't work today..
[06:47:10] edwinvdgraaf: has joined #RubyOnRails
[06:51:28] gauke: has joined #RubyOnRails
[06:52:13] quazimodo: shortCircuit__: reading code doesn't really tell you much about the dynamic run time does it :P
[06:52:27] quazimodo: reasoning about code is abastard, that's why haskell's got the rulse that it does
[06:53:49] mbuf: when using a Dockerfile for a Rails project, when is a good time to run the tests? during the creation of the Docker image, or to run the Docker instance with test databases?
[06:54:54] patie: has joined #RubyOnRails
[06:56:35] chrissonar: has joined #RubyOnRails
[06:57:39] creature: has joined #RubyOnRails
[06:58:31] shortCircuit__: ok, got the error to occur .. huff
[06:58:38] hamster88: which hosting provider do you use for hosting your rails apps generally?
[06:59:08] ddv: hamster88: that is different for everyone
[06:59:09] annlewis: has joined #RubyOnRails
[07:00:09] hamster88: ddv, yeah, I had a look at digital ocean heroku, ninefold etc, but can't decide which one is better
[07:00:41] juni0r: has joined #RubyOnRails
[07:00:52] sevenseacat: i dont have any personal rails apps, all the work i do is hosted by my company.
[07:02:12] RegulationD: has joined #RubyOnRails
[07:02:29] shortCircuit__: https://gist.github.com/argentum47/77628cad40183b70a069 here is it
[07:02:42] hamster88: I have a few personal projects out of which i am thinking of launching them. But hosting is a part that actually is too hard to choose
[07:02:42] hamster88: lots of hosts are out there :/
[07:03:27] sevenseacat: shortCircuit__: so data in your js post isnt a hash?
[07:03:29] sevenseacat: it has to be.
[07:04:04] comrad: has joined #RubyOnRails
[07:04:05] pipework: hamster88: What is your systems administration competency level?
[07:04:49] shortCircuit__: but its a formData object, how to post a file as a hash/json data, in my network's tab, its like this http://hastebin.com/ijurucuqib.hs
[07:05:08] dede: has joined #RubyOnRails
[07:05:14] srinidhi: has joined #RubyOnRails
[07:05:26] sevenseacat: i have no idea what that is
[07:05:41] maz-dev: has joined #RubyOnRails
[07:06:32] rushed: has joined #RubyOnRails
[07:08:16] fluxsource: has joined #RubyOnRails
[07:08:51] shortCircuit__: ew, I mean normally when I upload the image and other data, similar thing appears in the network tab.. what to do ? how to make it a hash ?
[07:09:19] sevenseacat: seems like a question for js people
[07:09:45] pipework: shortCircuit__: So you're posting some JSON, or you're posting some formencoded data?
[07:10:08] hamster88: pipework, i am linux guy, and very good at server administration
[07:10:08] alex88: has joined #RubyOnRails
[07:10:55] shortCircuit__: pipework I am posting a multipart form, having JSON data as well as the file .. json data includes the name, email and other details and file is simplly an image.
[07:11:05] pipework: hamster88: Then I tend to use digitalocean, but I use hosting differently than most people. If you want to set up a server by hand and then manage it like that and you want the host to be pretty solid, you'll probably want to start with digitalocean or linode or something like that.
[07:11:14] shortCircuit__: the angularjs irc channel sucks
[07:11:31] sevenseacat: colour me surprised.
[07:11:38] ghr: has joined #RubyOnRails
[07:12:58] hamster88: pipework, lot of guys told me about linode, they say their servers are pretty good.. whereas on other hand digitalocean gives ssd , and its almost the same price. But their billing system is kinda confusing to me
[07:12:58] ramfjord: has joined #RubyOnRails
[07:13:04] pipework: shortCircuit__: And so what does the params object look like in your controller?
[07:13:08] ddv: hamster88: I would get 3 vps in 2 or 3 datacenters and then use coreos with docker
[07:13:45] srinidhi: has joined #RubyOnRails
[07:14:03] pipework: I'd set up an ephemeral system that you can bring up and down servers depending on load, having some in reserve, and solve your failover and redundancy story according to the information you have.
[07:14:11] ddv: hamster88: since you're very good it should be a piece of cake
[07:14:11] pipework: But that's me.
[07:14:52] hamster88: i haven't checked out docker yet
[07:14:56] shortCircuit__: its normal like params.require(:profile).permit(:user_id, :name, :father_name, :email, photo_attributes: [:id, :image]) .. but in the server console there is only the error..
[07:15:51] shortCircuit__: sevenseacat, why, I mean if they don't want to answer they don't say that, they don't kick me, even they don't say we have never ever had such problems, or hey we don't bother we are core angular team here or any hint or something.. yestarday I posted the question and i was sitting for 4 hours ..
[07:15:55] DarkBushido: has joined #RubyOnRails
[07:15:55] DarkBushido: has joined #RubyOnRails
[07:16:13] pipework: shortCircuit__: That didn't answer my question.
[07:16:48] shortCircuit__: then ? which params object ?
[07:16:49] ddv: shortCircuit__: You don't make any sense
[07:17:02] pipework: shortCircuit__: Sorry, I have to go choke a chicken.
[07:17:32] sevenseacat: shortCircuit__: i'm sorry, is there some rule that says everyone must immediately answer your questions? how much are you paying for this privilege?
[07:17:57] hamster88: lol @choke a chicken
[07:18:02] fluxsource: has joined #RubyOnRails
[07:18:22] xploshioon: has joined #RubyOnRails
[07:18:31] shortCircuit__: I said like 4 hours, that isn't immediate thing.. :P
[07:18:43] ddv: shortCircuit__: you cannot demand anything
[07:18:50] arielserafini: has joined #RubyOnRails
[07:19:03] shortCircuit__: I understand the rules of a chat room .. I am saying that they haven't been very helpful to me
[07:21:48] shortCircuit__: pipework when would you come back.
[07:24:49] pwnz0r: has joined #RubyOnRails
[07:25:48] edwinvdgraaf: has joined #RubyOnRails
[07:26:20] Brozo: has joined #RubyOnRails
[07:26:45] arBmind: has joined #RubyOnRails
[07:28:11] Anakat: has joined #RubyOnRails
[07:28:52] daneo: has joined #RubyOnRails
[07:29:18] artto: has joined #RubyOnRails
[07:30:20] pontiki: ddv: i'm trying to figure out what CoreOS is. is it a managed service? something i download and build my own clusters with?
[07:30:40] ddv: pontiki: just a linux distro with some tools for managing a cluster
[07:30:52] pontiki: okay, thanks, ddv
[07:31:21] pontiki: i hope i get some time to play more with docker
[07:32:55] Pumukel: has joined #RubyOnRails
[07:33:35] Forgetful_Lion: has joined #RubyOnRails
[07:33:39] dseitz: has joined #RubyOnRails
[07:35:35] ddv: pontiki: one of the things you want in a cluster is statelessness, so you don't tie a particular container to some node
[07:36:20] ddv: pontiki: and docker is great for this
[07:36:23] RTG`: has joined #RubyOnRails
[07:36:44] pontiki: i have only had a little experience with it, but enough that'd i'd really like to use it
[07:37:17] pontiki: i am very much behind the concept of disposable production environments
[07:37:54] pontiki: even though i don't understand it very well yet, the idea that you spool up a new set and dispose of the old ones
[07:40:35] rzsd: has joined #RubyOnRails
[07:40:43] thebatu1: has joined #RubyOnRails
[07:41:09] rzsd: My Gemfile.lock keeps going back to modified status, even if i do git checkout Gemfile.lock. Why does it automatically go back to modified ?
[07:42:33] sevenseacat: rzsd: probably because you bundle
[07:42:51] HayesHimself: has joined #RubyOnRails
[07:43:08] karimb: has joined #RubyOnRails
[07:44:03] sandstrom: has joined #RubyOnRails
[07:45:35] justintv90: has joined #RubyOnRails
[07:48:45] rzsd_: has joined #RubyOnRails
[07:48:59] Axy: has joined #RubyOnRails
[07:48:59] Axy: has joined #RubyOnRails
[07:49:56] darutoko: has joined #RubyOnRails
[07:52:30] elia: has joined #RubyOnRails
[07:52:39] rickmasta: has joined #RubyOnRails
[07:53:12] the_villiage_idi: has joined #RubyOnRails
[07:53:35] jfarmer: has joined #RubyOnRails
[07:53:45] workmad3: has joined #RubyOnRails
[07:54:28] livathinos: has joined #RubyOnRails
[07:55:20] the_villiage_idi: Hey guys, I'm considering making an upgrade on my personal project app from ruby 1.9.3 to 2.0.0 and rails 3.0.7 to rails 3.2 and then possibly to rails 4.0.0, I'm not looking for instructions but some advice on whether it's worthwhile for me to do it now based on my situation
[07:55:56] sevenseacat: the_villiage_idi: well your version of ruby is past end of life, and so is your version of rails
[07:56:06] sevenseacat: so there have been many security updates that you've missed
[07:56:43] sevenseacat: and we dont really know what your situation is, but anyone with code so old, i'd advise to upgrade
[07:56:57] DoctorMonocular: has joined #RubyOnRails
[07:57:29] the_villiage_idi: yep, and now heroku's bamboo stack being ended completely I need to upgrade to cedar and they advise not using anything below ruby 2.0.0
[07:57:47] the_villiage_idi: let me explain my situation a little and see what you guys think
[07:59:03] tomkadwill: has joined #RubyOnRails
[07:59:05] devsigner: has joined #RubyOnRails
[07:59:08] ghr: has joined #RubyOnRails
[07:59:19] ddv: the_villiage_idi: 1.9.3 is EOL anyways
[07:59:27] sevenseacat: so is rails 3.
[08:00:03] annlewis: has joined #RubyOnRails
[08:00:08] michael_mbp: has joined #RubyOnRails
[08:00:11] ddv: oh sorry didn't read your reply, sevenseacat
[08:00:35] sevenseacat: all good, reinforcement that this is a *bad thing* helps :)
[08:00:45] jsrn_: has joined #RubyOnRails
[08:01:56] the_villiage_idi: First off, I'm not really a coder. I learned basic rails and ruby starting with michael hartls book about 3 years ago. To be honest I feel like I completely suck at coding and most of the time have to write meticulous notes so I don't forget how to do even the most basic of things. Just to be clear, I have great respect for coders and find the precision creating of code to be fascinating but it's not my path in lif
[08:01:56] the_villiage_idi: e. I got into coding because of an idea for a website that i think should exist. I think it would be useful to so many people and I'd love to see it exist. And so I thought the best thing to do was to try and make it myself and see what people think. It's been a big time struggle, learning so much from html/css a little jquery, and all the while beating my head against the wall because of problems for me would be i
[08:01:57] the_villiage_idi: nstantly fixed by anyone with the ability to code.
[08:02:56] the_villiage_idi: It's been such a struggle, and I've done it completely alone, with no support and all my friends thinking I'm crazy, although they like the idea they don't see how I could possibly make it happen because I'm not a coder. I've given up a few times and then returned after a month or two.
[08:03:00] universa1: the_villiage_idi: like anything coding takes about 10000hours to be good at ;)
[08:03:07] solars: has joined #RubyOnRails
[08:03:07] ddv: the_villiage_idi: maybe you should see therapist
[08:03:47] ddv: universa1: people who think they are good are a problem usually
[08:03:58] sevenseacat: i can empathize with your situation, but i dont know how it relates at all to 'should i upgrade my app'
[08:04:06] the_villiage_idi: The site is about 98% finished, and the last part has been a struggle too because of fears about "what to do next"
[08:04:10] universa1: the_villiage_idi: make smaller steps, maybe join a programming course, having some structured steps to learn stuff helps a lot
[08:04:59] universa1: ddv: well yeah, it was a general reference to the time it takes to actually really learn an instrument and so on ;)
[08:05:24] the_villiage_idi: I guess the thing is, while I really believe in this website idea and I know everyone has ideas blah blah blah, but I have this idea due to my own life experiences and it's shown be how a single website could really make things so much easier and awesome for people
[08:05:26] universa1: ddv: so it's a lot of time you have to invest before you feel confident that you can do stuff, even though you know where you're missing stuff
[08:05:43] ddv: universa1: true
[08:06:00] universa1: the_villiage_idi: so join a local ruby/rails group and look for a partner?
[08:06:17] the_villiage_idi: but I don't see myself being able to maintain and code it in the long run. I think I need to see if people like it, if their viability in it's future, and then if somehow things went right, I
[08:06:29] the_villiage_idi: I'd need to hire a real programmer, or a few
[08:06:36] ddv: I miss stuff all the time and i'm doing this for about 5 years professionally
[08:06:42] Aswebb_: has joined #RubyOnRails
[08:07:01] the_villiage_idi: Thanks guys, some of you your comments don't make me feel "super" stupid at least haha
[08:07:30] universa1: the_villiage_idi: you could also join the local startup scene/groups, present your idea, ...
[08:08:05] tbuehlmann: the_villiage_idi, there's a mentoring thing going on on the ruby subreddit, maybe a mentor is something that could work for you
[08:08:18] the_villiage_idi: I live in Vietnam, would there be a way to do that online
[08:08:26] tbuehlmann: (finding a new maintainer for your project is of course a different thing)
[08:08:33] Brando753: has joined #RubyOnRails
[08:08:35] the_villiage_idi: Interesting I think I maybe should check out the subredit, thanks
[08:08:45] tbuehlmann: sure, I bet there are people willing to help you
[08:08:48] Aeyrix: https://www.reddit.com/r/ruby/comments/387kaw/anyone_need_a_mentor/
[08:09:02] tbuehlmann: I mean, this place here is great, but sometimes a personal mentor is even better
[08:10:13] the_villiage_idi: Yeah I will definitely make a post on the subredit and see what happens there.
[08:10:16] ddv: we accept interns
[08:10:36] DoctorMo_: has joined #RubyOnRails
[08:11:22] universa1: ddv: what are you paying your interns? ;)
[08:11:49] ddv: universa1: For Uni students usually 500 EUR per month
[08:12:10] tbuehlmann: "paying for interns? who are you, google?"
[08:12:23] universa1: ddv: where are you from? (not interested in the internship, just curious )
[08:12:28] srinidhi: has joined #RubyOnRails
[08:12:30] ddv: Netherlands
[08:12:41] universa1: tbuehlmann: hmm, not being payed as a computer science intern? haha, go away ;)
[08:12:57] ddv: I work for a company that creates software for the agricultural sector
[08:13:01] tbuehlmann: yea, I really dislike companies not paying their interns
[08:13:12] universa1: ddv: so not that far away ;)
[08:13:15] Aeyrix: ddv: That must be an interesting
[08:13:20] Aeyrix: of work :^)
[08:13:26] ddv: yes pretty interesting
[08:13:26] universa1: Aeyrix: it actually is
[08:13:48] Aeyrix: I didn't realise Freenode allowed you to IRC as root.
[08:14:05] granthatcher: has joined #RubyOnRails
[08:14:19] the_villiage_idi: So as far as upgrading, my site is about 98% complete and working on ruby 1.93/rails 3.0.7, and since I have no users and no potential users I think on one hand I don't really need to take the time (because I know it will be very difficult...I have written zero tests...) and integrating gems is always so hard for me anyways that if a old gem becomes obsolete and then I need to replace old code for things to work, I
[08:14:20] the_villiage_idi: just feel it will take a substantial amount of time, and I don't even know for sure if anyone will like the idea. I kind of feel this idea would be something someone will either not believe in and not like, or something they will think oh shit yah I'd use that for sure. So do you guys think maybe I should hold off upgrading and instead get the app working 100% and then take time to see what people think? Show it t
[08:14:20] the_villiage_idi: o people, try and make contacts?
[08:14:51] universa1: the_villiage_idi: your site will never be at 100%
[08:15:26] universa1: ddv: anythign gis related? ;)
[08:15:32] Lightsword: has joined #RubyOnRails
[08:15:33] the_villiage_idi: but 100% in the terms of the essential functions and what I feel is needed to be representative of my intentions, to demo
[08:15:49] ddv: universa1: no, but a lot of linear programming
[08:15:58] rushed: the_villiage_idi: those are very old versions, so you've had this for a while? stop fluffing about and get it released :)
[08:16:00] aclapinpepin: has joined #RubyOnRails
[08:16:39] rushed: the_villiage_idi: what you think you need to do next is going to change dramatically once you have actual users
[08:16:53] Obfuscate: the_villiage_idi: Even if the site doesn't turn out to be successful (should I say popular?), the experience/evidence of having created a site in rails 3 and ported it to rails 4 could make you very valuable on the job market. Either way that is not wasted effort.
[08:17:08] Pumukel: has joined #RubyOnRails
[08:17:59] the_villiage_idi: yeah I have this absurd paranoia that maybe someone will steal the idea, and yes I know thats a common absurdity for newbies to have. Yet my idea really takes zero greatness to code, no algorithms, etc, just a good idea in my opinion. You see people using twitter/facebook/other alllllll the time for what my site does, except on those networks is lost in the clutter forever and here it's given a home. And the 'thing
[08:17:59] the_villiage_idi: ' being shared/done is quite valuable and worth being saved forever
[08:18:22] cschneid: has joined #RubyOnRails
[08:18:25] ddv: the_villiage_idi: ideas are stolen all the time, do you think Facebook was the first?
[08:18:27] rushed: the_villiage_idi: ideas mean little compared to execution, start executing
[08:18:57] sevenseacat: ideas arent worth the paper theyre written on, sadly
[08:19:00] epochwolf: has joined #RubyOnRails
[08:19:03] rhizome: if it involves absolutely nothing clever, it likely already exists
[08:19:28] creature: has joined #RubyOnRails
[08:19:43] the_villiage_idi: yes i do know this :) and I have, like i said it's 98% done, and that's me coding for 3+ years, going through 4 different UI make-overs (I never read the fail fast book until it was too late :(
[08:19:50] sevenseacat: just finished reading a book about introducing IT into healthcare - everyone has good intentions, and the software all sucks
[08:19:50] arielserafini: has joined #RubyOnRails
[08:20:00] DarkBushido: has joined #RubyOnRails
[08:20:46] x-light: has joined #RubyOnRails
[08:20:50] rushed: the_villiage_idi: four UI make overs and zero users? you're basically justing playing a video game called rails at this point~
[08:21:03] the_villiage_idi: rhizome: It's got 2-3 clever things but they don't need any clever technical skills to create, unless to possibly scale like any site would
[08:21:34] rhizome: still probably exists
[08:22:00] the_villiage_idi: Yeah I've never released it, I've just labored over it trying to make it look as good as a professional top end website. Which after the fact I've learned is not what I should have done, owning to the idea itself could be used with a design as great as craigslist yet still serve the same function
[08:22:33] Aswebb_: has joined #RubyOnRails
[08:23:08] the_villiage_idi: rhizome: no it really doesn't, at least not the way I'm doing it, there are a few sites that maybe have a sliver of it going on but do it terribly by trying to make money instead of serving an extremely useful purpose
[08:24:50] the_villiage_idi: I come from an art background and it's something I've noticed in my lives and in the lives of my social group. Something we use the internet for and something that makes our lives enriched, yet there is no tool/site that serves this function.
[08:25:09] Aeyrix: Are you making a deviantART competitor
[08:25:23] marr: has joined #RubyOnRails
[08:25:24] simmerz: has joined #RubyOnRails
[08:25:59] the_villiage_idi: but it could expose more users to deviantArt possibly
[08:26:01] sevenseacat: i worked on one of those once.
[08:26:09] sevenseacat: its still limping along somewhere.
[08:26:52] the_villiage_idi: my site could draw traffic to deviantArt and users on deviantART could possibly make more money
[08:27:25] rushed: the_villiage_idi: don't tell us, release it and post a link~
[08:27:41] rhizome: there could have been a tool/site for this three years ago
[08:28:54] Anakat: has joined #RubyOnRails
[08:29:04] tianyi: has joined #RubyOnRails
[08:30:21] squiercaster: has joined #RubyOnRails
[08:30:36] the_villiage_idi: yah for sure 3 years ago if I had one coder friend or wasn't anti social hahaa
[08:30:51] stoffus: has joined #RubyOnRails
[08:30:56] dawkirst: has joined #RubyOnRails
[08:32:19] dawkirst: Hey guys, I'm new to software engineering and Rails, and I'm trying to wrap my head around the concept of token authentication. I've built an app that uses Devise, and now I'm looking at https://github.com/gonzalo-bulnes/simple_token_authentication. All this seems to do is allow certain resources to authenticated with a token (as opposed to just a email and password). How is this different from just using an email and password though?
[08:33:00] rhizome: if you're antisocial, you're not going to "take time to see what people think,"
[08:33:13] fgo: has joined #RubyOnRails
[08:33:20] dionysus69: has joined #RubyOnRails
[08:33:26] rhizome: or "show it to people," or "try and make contacts"
[08:33:26] Aeyrix: dawkirst: The user doesn't have to send their password.
[08:33:57] rushed: dawkirst: it's not, it's just a tool for some kinds of access (api, mobile, etc) and usually starts w/ a username + pw auth
[08:34:34] the_villiage_idi: rhizome: haha yeah it's difficult for me but that is what I was asking advice for, if that sounds like a more logical next step instead of worrying about upgrading
[08:34:43] rushed: dawkirst: you might find an example helpful http://railscasts.com/episodes/352-securing-an-api
[08:35:10] tvw: has joined #RubyOnRails
[08:35:45] the_villiage_idi: rhizome: and "you're not going to" sounds quite absolute when you don't know that yet, and also not very encouraging =p
[08:36:17] rhizome: look up "antisocial"
[08:36:18] helpa: http://i.imgur.com/m9m3wr9.gif
[08:36:25] Aeyrix: !popcorn7
[08:36:28] Aeyrix: Please. :(
[08:36:43] adre: has joined #RubyOnRails
[08:36:45] sevenseacat: i dont have permission to give people bot access.
[08:37:50] dawkirst: Aeyrix, rushed, that makes sense I guess. So you just take the password out of the equation.
[08:37:54] the_villiage_idi: rhizome: sorry I interchange antisocial with social anxiety, when yeah you're right antisocial clinically is very different
[08:38:14] dawkirst: rushed: thanks for the link
[08:38:50] dawkirst: Aeyrix, rushed, also, I guess you could "revoke" the token at any time as a system owner, whereas with passwords you don't really have such control.
[08:40:49] dawkirst: When I looked at another gem (https://github.com/lynndylanhurley/devise_token_auth) however, it seemed to imply that tokens need to be passed between requests and responses (see https://github.com/lynndylanhurley/devise_token_auth#about-token-management). Is that something unique to the particular gem, or is it something that's inherent in the idea of tokens?
[08:41:01] Sylario: has joined #RubyOnRails
[08:43:24] dionysus69: has joined #RubyOnRails
[08:44:28] Aeyrix: dawkirst: That's tokens.
[08:45:23] dawkirst: Aeyrix: so with the first gem, I'd have to manage that flow myself, right? e.g. something like generate a new token for each request, and check that the response send back that same token?
[08:45:38] Aeyrix: I only cursorily glanced at it but it appears that way.
[08:46:15] dawkirst: Ok, thanks.
[08:46:50] XThief: has joined #RubyOnRails
[08:47:50] sevenseacat: see ya shortCircuit__
[08:51:06] RegulationD: has joined #RubyOnRails
[08:52:23] DoctorMonocular: has joined #RubyOnRails
[08:57:59] mikecmpbll: has joined #RubyOnRails
[08:59:04] leslie1: has joined #RubyOnRails
[09:00:43] annlewis: has joined #RubyOnRails
[09:01:02] dseitz_: has joined #RubyOnRails
[09:03:06] DEA7TH: has joined #RubyOnRails
[09:03:24] dseitz__: has joined #RubyOnRails
[09:04:44] mikecmpbll: i have an after_initialize method which checks an attribute using if <attr>; # .. do something. however, when i use .select and don't include that attribute I get ActiveModel::MissingAttributeError: missing attribute: <attr>
[09:04:55] mikecmpbll: how can make the check survive this case?
[09:05:14] Ergo: has joined #RubyOnRails
[09:06:23] kenndel: has joined #RubyOnRails
[09:06:28] leslie1: has left #RubyOnRails: ()
[09:06:47] leslie1: has joined #RubyOnRails
[09:07:31] mikecmpbll: ah, got it .. has_attribute?(:attribute_name)
[09:08:57] Silex: Sorry for the can of worm but: puma, unicorn or phusion passenger? for a single app with potentially lots of I/O (serving lots of images)
[09:09:31] Silex: (and lots of sidekiq background workers)
[09:10:57] XThief: I think phusion passenger is the easiest to setup, but if you need to limit ram usage, etc is paid
[09:11:41] ddv: Silex: nginx, passenger with haproxy in front of it?
[09:11:41] XThief: nginx could handle the serving of the images without touching passenger/puma/unicorn
[09:12:25] XThief: why haproxy if he doesnt need multiple servers?
[09:13:01] Aeyrix: nginx + unicorn
[09:13:05] Aeyrix: That's my go-to.
[09:13:11] DoctorMonocular: has joined #RubyOnRails
[09:13:46] mikecmpbll: Silex: just pick whatever you want and move on
[09:15:10] Brozo: has joined #RubyOnRails
[09:17:35] mbuf: has left #RubyOnRails: ("Ex-Chat")
[09:17:51] LiquidInsect: has joined #RubyOnRails
[09:19:49] stevednd: has joined #RubyOnRails
[09:19:59] ddv: XThief: if you want to spread the load
[09:21:48] ddv: also 'potentially lots of IO' doesn't say anything
[09:22:57] krz: has joined #RubyOnRails
[09:24:38] mikecmpbll: it says don't use a evented server :p
[09:24:49] Silex: ddv: given nginx serve those images directly I guess it doens't matter (puma/unicorn/passenger)
[09:25:20] Aeyrix: mikecmpbll: wat
[09:25:45] ddv: Silex: no idea, are you only serving images?
[09:25:52] mikecmpbll: or did i get that wrong eh? :)
[09:25:58] Aeyrix: mikecmpbll: Other way around.
[09:26:00] Aeyrix: Don't use threaded.
[09:26:23] Aeyrix: Don't use threaded in general though, because they're all garbage.
[09:26:24] mikecmpbll: ah okay. i never did quite get my head around that
[09:26:57] Aeyrix: mikecmpbll: https://mmcgrana.github.io/2010/07/threaded-vs-evented-servers.html
[09:27:09] Silex: Aeyrix: "it depends" no? I mean sidekiq scales better than resque
[09:27:12] Aeyrix: mikecmpbll: Threaded with a bunch of IO means it could spin out something fierce if a lot of users did a lot of IO-heavy stuff.
[09:27:42] Aeyrix: Silex: Uh, probably.
[09:28:01] ddv: only the paid version used threading instead of forking
[09:28:13] Silex: ddv: for sidekiq?
[09:28:50] Silex: I guess you meant passenger
[09:29:17] mikecmpbll: Silex: the background processing library really isn't relevant here anyway
[09:29:25] mikecmpbll: (to the discussion of app servers)
[09:29:44] Anakat: has joined #RubyOnRails
[09:29:45] toretore: has joined #RubyOnRails
[09:30:03] Aeyrix: Silex: If you're only serving images
[09:30:05] Aeyrix: nginx + unicorn
[09:30:14] Aeyrix: + varnish if you think you're gonna be serving them a lot
[09:30:57] Silex: Aeyrix: okay. I also serve css/js but I guess that's not your question. What other things you had in mind that could alter the recommendation?
[09:31:11] Aeyrix: Silex: Reading / writing complex data to disk.
[09:31:18] Aeyrix: Also that css / js should also go through ngixn.
[09:31:22] jenrzzz: has joined #RubyOnRails
[09:32:06] krz: rhizome: about our short discussion earlier today. so if ssl is terminated at the ELB. it woudl be safe to assume turning force_ssl off?
[09:32:44] Silex: Aeyrix: yeah assets goes through nginx (using scss & coffeescript). Thanks for the varnish suggestion
[09:32:49] Aeyrix: krz: Yes.
[09:33:01] Aeyrix: Silex: Rad. What're you building?
[09:33:41] Synthead: has joined #RubyOnRails
[09:34:20] Silex: Aeyrix: basically a timelapse engine. Background workers download shitload of images periodically, and then there's some youtube-like player for these images where you naviguate time
[09:34:26] penguinpowernz: has joined #RubyOnRails
[09:34:55] Aeyrix: Depending on how big you're intending this to be, I'd spin out the workers to be a separate app.
[09:35:02] Aeyrix: I did something similar with Twitter's hosepipe once.
[09:35:23] varunwachaspati: has joined #RubyOnRails
[09:35:24] Silex: it also involves galleries and filters applied to images (rotate, overlays, cropping)
[09:35:31] krz: Aeyrix: force_ssl flags cookies as secure and from what ive read, has some protection against MITM (man in the middle) attacks though
[09:36:05] krz: is this at all still needed? or not anymore since the instances cant be accessed directly anyway. i.e. ONLY via the ELB
[09:36:12] Silex: I had a first version almost done 6 months ago but had to work on other things, now that I'm back on this project I wondered if my passenger solution could be improved
[09:36:35] Aeyrix: krz: Yeah that's okay.
[09:36:59] Aeyrix: The ;secure part of the cookie can be served over http.
[09:37:00] Silex: Aeyrix: yeah I'm thinking about splitting the workers in a separate app. They should share the models and the db tho. Atm I'm dockerizing everyhting.
[09:37:09] Aeyrix: But it'll be served over http to the lb, then https to the client.
[09:37:16] livcd: what's your opinion about this ? http://mattbriggs.net/blog/2014/09/09/the-rails-value-proposition-no-longer-adds-up/
[09:37:33] Aeyrix: Silex: Ugh, fuck Docker.
[09:37:50] krz: Aeyrix: so not needed thend :) as in force_ssl can be off, in this case
[09:37:58] Aeyrix: krz: AFAIK yes.
[09:37:59] Aeyrix: Should be fine.
[09:38:23] shortCircuit__: has joined #RubyOnRails
[09:38:33] mikecmpbll: livcd: load of bs?
[09:38:41] sn4p3: has joined #RubyOnRails
[09:38:41] Aeyrix: livcd: Who's Matt Briggs and why is he writing garbage?
[09:39:53] Aeyrix: Sec, got a link
[09:39:57] n008f4g_: has joined #RubyOnRails
[09:40:11] Aeyrix: sevenseacat
[09:40:16] Aeyrix: livcd: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
[09:40:24] shortCircuit__: yes, yes, I reverted back all the changes, did things step by step and now the proper form with image data is getting posted, but the problem is there is a Paperclip registry error. http://hastebin.com/vusokuceda.vbs what to do ?
[09:40:27] penguinpowernz: has joined #RubyOnRails
[09:40:41] sevenseacat: shortCircuit__: wb
[09:40:43] Aeyrix: livcd: Ruby is #15 on that list. Until Go even gets on that list I don't care about it.
[09:40:51] Aeyrix: Same with Clojure.
[09:41:05] sevenseacat: people still look at the tiobe index?
[09:41:06] Aeyrix: It's "super cool and leet" but no serious business is really using it.
[09:41:10] Aeyrix: sevenseacat: You'd be surprised.
[09:41:23] Aeyrix: People were crowing that C overtook Java last month.
[09:41:28] Aeyrix: It's back the way it was before now.
[09:41:30] sevenseacat: i cant take any list seriously that has visual basic at 10.
[09:41:43] Aeyrix: I ran into some VB the other day.
[09:41:48] Aeyrix: Remember, it's still used in ASP.NET.
[09:41:52] Aeyrix: Heavily, heavily used.
[09:41:54] mikecmpbll: climbed over php
[09:42:12] Aeyrix: It's not even "discontinued" by MS. They're actively improving it alongside C#.
[09:42:35] Aeyrix: Welcome back.
[09:42:38] mikecmpbll: and lol at that article saying it is "extremely rare to find one with documentation" w.r.t. gems .. waat
[09:42:41] sevenseacat: aw man, elixir isnt even in the top 100
[09:42:48] sevenseacat: ACTION keeps learning it
[09:43:12] Aeyrix: sevenseacat: I use this list to work out what languages I should maybe be across from a work perspective.
[09:43:32] Aeyrix: I know an embarrassing amount of the top 20 to a degree where I could fumble around and get a solid grasp in about a day.
[09:43:40] Aeyrix: Except R, actually.
[09:43:56] sevenseacat: i can agree with some of this matt briggs blog post
[09:44:04] Aeyrix: Which bits?
[09:45:50] sevenseacat: node came out in 2005?
[09:46:11] sevenseacat: I'd literally never heard of it until 2012
[09:47:53] sevenseacat: rails still offers lots of new things. but theyre things i dont have much interest in
[09:48:30] Aeyrix: The major thing that needs to be worked on really is speed.
[09:48:32] Aeyrix: Interpreter speed.
[09:48:36] bruno-: has joined #RubyOnRails
[09:48:57] chouhoulis: has joined #RubyOnRails
[09:49:13] sevenseacat: i have no interest in actioncable or turbolinks or streaming data
[09:49:20] sevenseacat: or whatever the newfangled things are
[09:49:22] Aeyrix: wtf is actioncable
[09:49:34] sevenseacat: something dhh announced at railsconf recently, i have no idea
[09:49:43] chouhoulis: has joined #RubyOnRails
[09:50:58] sevenseacat: dont get me wrong, i'm going to keep using rails. it pays my bills. but its not exciting to me anymore.
[09:51:05] toomus: has joined #RubyOnRails
[09:51:24] drale2k: has joined #RubyOnRails
[09:51:25] Aeyrix: It's apparently message passing with websockets.
[09:51:27] mikecmpbll: that says nothing of it as a framework though
[09:51:30] Aeyrix: This is relevant to my interests.
[09:52:02] mikecmpbll: yeah, actioncable is pretty cool tbh.
[09:52:26] toomus: I want to play sound with HTML5 audio tag and jQuery. Where to put mp3 file, and how access it in audio tag?
[09:52:26] sevenseacat: i dont know what a websocket is.
[09:53:24] Aeyrix: sevenseacat: TCP socket?
[09:53:27] Aeyrix: over HTTP
[09:53:34] sevenseacat: toomus: somewhere in public/ would make sense.
[09:53:54] sevenseacat: Aeyrix: what is that useful for
[09:54:06] Aeyrix: sevenseacat: Dynamically updating stuff like Slack.
[09:54:17] sevenseacat: oh i see. realtime stuff
[09:54:26] toomus: websockets? Realtime events!!
[09:54:31] Aeyrix: Actually v. useful for me.
[09:54:36] Aeyrix: [ interest intensifies ]
[09:54:36] toomus: like chat or notification
[09:54:48] Aeyrix: Websockets in Ruby atm is average.
[09:55:37] Aeyrix: https://github.com/rails/rails/blob/master/version.rb
[09:56:04] krz: has joined #RubyOnRails
[09:57:40] barnex: I have @import "datepicker/bootstrap-datepicker3.css"; in my application.css.scss
[09:58:01] barnex: and the file exists and everything works fine in development
[09:58:26] barnex: in production I run rake assets precompile and it makes assets, but it's trying to load datepicker/bootstrap-datepicker3.css
[09:59:31] avril14th: has joined #RubyOnRails
[09:59:32] barnex: and I don't know why would it do that? Shouldn't the CSS be part of application-stamp.css?
[09:59:50] yfeldblum: has joined #RubyOnRails
[09:59:51] workmad3: has joined #RubyOnRails
[09:59:55] DaniG2k: has joined #RubyOnRails
[10:00:34] rushed: barnex: what is still trying to load datepicker/bootstrap-datepicker3.css?
[10:01:30] annlewis: has joined #RubyOnRails
[10:01:57] fgielow: has joined #RubyOnRails
[10:02:20] barnex: rushed: that's the problem, I don't know. I mean the browser is trying to download it, but I don't know why
[10:02:24] raj___: has joined #RubyOnRails
[10:02:26] acti0nman: has joined #RubyOnRails
[10:03:04] barnex: I guess it's because there's still '@import "datepicker/bootstrap-datepicker3.css";' in the compiled application.css?
[10:03:28] fgielow: Hi people, I am converting a rails 2.x code to rails 4.2.2. Could you advise me on how to change the instruction find_all_by_sset_type("fund", :conditions => ["name != 'At risk' AND name != 'Hard to treat'"]) ? I guess it would start with where(sset_type: "fund") but I have no idea regarding the :conditions that were effectively a part of an SQL instruction
[10:04:02] cleopatra: has joined #RubyOnRails
[10:04:39] meoblast001: has joined #RubyOnRails
[10:05:10] barnex: can't scss import pure css?
[10:05:35] sevensea_: has joined #RubyOnRails
[10:06:22] simplyianm: has joined #RubyOnRails
[10:06:41] leafac: has joined #RubyOnRails
[10:08:26] mikecmpbll: fgielow: where(sset_type: "fund").where.not(name: ['At risk', 'Hard to treat'])
[10:08:58] chagel: has joined #RubyOnRails
[10:09:16] tbuehlmann: fgielow, this one might work: arel_table = YourModel.arel_table; YourModel.where(sset_type: 'fund', arel_table[:name].not_eq('At risk'), arel_table[:name].not_eq('Hard to treat'))
[10:09:18] tbuehlmann: or: YourModel.where(sset_type: 'fund').where.not(name: 'At risk').where.not(name: 'Hard to treat')
[10:09:40] fgielow: mikecmpbll tbuehlmann thx - do you by any chance know if where(sset_type: "fund").where("name != 'At risk' AND name != 'Hard to treat'") could work also? direct SQL injections are still supported?
[10:09:44] barnex: Aeyrix: that 'yeah' was for me?
[10:09:54] Aeyrix: barnex: It was.
[10:09:55] tbuehlmann: (using the array one from mikecmpbll is better than the double .where.not)
[10:10:10] tbuehlmann: fgielow, that will also work, yes
[10:10:12] mikecmpbll: fgielow: that's fine too, there's no risk of sql injection because you're not intepolating anything from the user
[10:10:12] ArTiSTiX: has joined #RubyOnRails
[10:10:27] tbuehlmann: I personally try not to write SQL strings myself
[10:10:57] mikecmpbll: yeah, especially when there's a perfectly fine rails way :p
[10:11:42] livcd: but rails does not always produce the most performant sql
[10:11:53] workmad3: livcd: neither do people :P
[10:11:59] fgielow: Oki, I'll keep that in mind! Thanks very much folks
[10:12:09] livcd: workmad3: true
[10:12:24] barnex: Aeyrix: so after some reaserch it seems like I should just add the regular css files to the pipeline as separate files to make and then the CSS rule @import that sass generates will work fine?
[10:12:41] livcd: but i think it still makes sense to optimize SQL sometimes
[10:12:46] workmad3: livcd: and a case where rails produces crap SQL is a good reason to use a direct SQL string or fragment ;)
[10:12:49] Aeyrix: That should work barnex, yeah.
[10:13:04] livcd: workmad3: i would say so
[10:13:07] workmad3: livcd: i.e. the rails way isn't perfectly fine at that point ;)
[10:13:57] workmad3: brb, need to restart laptop
[10:14:49] krz: Aeyrix: are you deployed on aws too?
[10:15:02] Aeyrix: I'm not. I've used it a bit though.
[10:15:45] medk: has joined #RubyOnRails
[10:16:43] workmad3: has joined #RubyOnRails
[10:17:04] barnex: Aeyrix: uhh, it doesn't. I have Rails.application.config.assets.precompile += %w( pdf.css datepicker/bootstrap-datepicker3.css ) in my assets initializer
[10:17:16] barnex: and it generates asset that's not compatible with the css import generated
[10:17:24] MeowZedong: has joined #RubyOnRails
[10:17:30] mikecmpbll: barnex: can you just use the pipeline include instead of sass?
[10:17:42] mikecmpbll: i dunno how sass would know about the fingerprint
[10:17:57] krz: i have an nginx rule that redirects traffic from http to the https version. the problem is when the ELB does health checks to http (80) /ping. it hits the instances which trigger a 301 redirect to https (443) /ping. the ELB thinks the instance is unhealty and take it out of the pool
[10:18:07] krz: Aeyrix: ^^
[10:18:30] Aeyrix: krz: Look into the HSTS HTTP Header.
[10:20:22] rickmasta: has joined #RubyOnRails
[10:20:41] fgo: has joined #RubyOnRails
[10:20:49] porkqpain: has joined #RubyOnRails
[10:20:54] mikecmpbll: is there a rails/minitest assertion to check array equivalence irrespective of order?
[10:21:03] MeowZedong: has left #RubyOnRails: ()
[10:21:59] DaniG2k: array equivalence irrespective of order
[10:22:54] DaniG2k: mikecmpbll: I suppose you can check array1.all? {|e| array2.include?(e) }
[10:22:58] maz-dev: has joined #RubyOnRails
[10:23:05] sandelius: has joined #RubyOnRails
[10:23:15] mikecmpbll: well, i can just & them and check the length, probably easier
[10:23:26] DaniG2k: mikecmpbll: but I'd probably go more with something like array1.sort == array2.sort
[10:23:30] DoctorMonocular: has joined #RubyOnRails
[10:23:31] mikecmpbll: but the assert_equal assertion gives me a nice output with expected and actual
[10:23:36] mikecmpbll: i lose that with assert
[10:23:56] kerunaru: has joined #RubyOnRails
[10:24:21] mikecmpbll: DaniG2k: ah, that's an idea.
[10:24:26] barnex: mikecmpbll: thanks, that worked and I don't have to deal with separate file
[10:24:37] mikecmpbll: sevenseacat: how'd i use =~ ?
[10:24:53] sevenseacat: oh, assertion
[10:25:02] allcentury: has joined #RubyOnRails
[10:25:05] krz: has joined #RubyOnRails
[10:25:10] DaniG2k: mikecmpbll: just do array1.sort == array2.sort its the easiest :P
[10:25:27] DaniG2k: and you cna just assertequal or whatever
[10:25:28] maz-dev: has joined #RubyOnRails
[10:25:31] mikecmpbll: assert_equal expected.sort, actual.sort
[10:25:37] mikecmpbll: i'll roll with that.
[10:25:49] DaniG2k: rubys sort is fast as balls anyway
[10:26:10] DaniG2k: won't be too much of a performance hit unless the array is absolutely massive
[10:26:13] sevenseacat: how fast are balls, exactly?
[10:26:23] DaniG2k: sevenseacat: I just use "balls" for everything
[10:26:43] Aeyrix: sevenseacat: 9.81m/sec/sec.
[10:26:51] moeabdol: has joined #RubyOnRails
[10:27:13] SalexW: has joined #RubyOnRails
[10:27:26] sevenseacat: whats that, G or something? *digs out physics knowledge*
[10:27:32] workmad3: Aeyrix: we asked for a speed, not an acceleration :P
[10:27:42] sevenseacat: acceleration due to gravity?
[10:27:43] Aeyrix: sevenseacat: Yes, G.
[10:27:44] waseem_: mikecmpbll: assert((actual - expected).empty?)
[10:27:55] workmad3: sevenseacat: yes, acceleration due to gravity on earth
[10:27:57] sevenseacat: shit, i remembered something.
[10:28:01] Aeyrix: Speed of four men in coats.
[10:28:04] workmad3: not G (which is the gravitational constant)
[10:28:17] srinidhi: has joined #RubyOnRails
[10:28:21] mikecmpbll: waseem_: yeah, i know i can do that, i was doing that originally but i don't get the benefit of the assert_equal output
[10:28:22] Aeyrix: >terminology
[10:28:23] waseem_: workmad3: Knows his physics.
[10:28:23] sevenseacat: close enough.
[10:28:26] Aeyrix: I don't into physics.
[10:28:30] waseem_: mikecmpbll: Yeah. :(
[10:28:35] Hates_: has joined #RubyOnRails
[10:28:38] sevenseacat: i did a semester of physics in 2002. thats about it.
[10:29:05] workmad3: waseem_: I like physics :P or at least, I like some physics :)
[10:29:05] Hates_: has joined #RubyOnRails
[10:29:09] stamina: has joined #RubyOnRails
[10:29:12] Pathfinder: has joined #RubyOnRails
[10:29:21] waseem_: workmad3: I like physics too.
[10:29:27] shortCircuit__: any help for me?
[10:29:44] waseem_: workmad3: Magnetism and Electrical physics were my favorite.
[10:29:50] universa1: shortCircuit__: yes. 42.
[10:29:54] workmad3: waseem_: I like quantum mechanics and relativity :)
[10:29:57] waseem_: workmad3: And also a little bit of Kinematics.
[10:30:03] workmad3: universa1: haha :) I was googling psychiatrists :D
[10:30:13] universa1: workmad3: ;-)
[10:30:15] waseem_: workmad3: Har! Har!
[10:30:27] Anakat: has joined #RubyOnRails
[10:31:02] Aeyrix: shortCircuit__: What was your Q?
[10:31:06] Aeyrix: I can't see it in my scrollback/
[10:31:54] fgo: has joined #RubyOnRails
[10:32:16] waseem_: So on one of my servers when my capistrano does a bundle install, I get "You have to install development tools first." error. I'm assuming that updating `build-essentials` should fix this error. But my / is 100% full. Don't know what to clean up.
[10:33:35] shortCircuit__: universa1 , :) I am submitting a form with image data using angular, the proper form with image data is getting posted, but the problem is there is a Paperclip registry error. https://gist.github.com/argentum47/77628cad40183b70a069
[10:33:50] workmad3: waseem_: try an 'apt-get autoclean' to start with
[10:34:10] workmad3: waseem_: I normally find that clears out a few gb of unused linux header packages ;)
[10:34:30] universa1: shortCircuit__: code for this? https://gist.github.com/argentum47/77628cad40183b70a069#file-error-txt-L10
[10:34:54] workmad3: waseem_: the "You have to install dev tools" could easily be caused by the lack of disk space directly, btw
[10:35:06] cleopatra: any help? controller can be used inside javascript helper
[10:35:17] universa1: shortCircuit__: and there should be a tempfile somewhere i think
[10:35:18] waseem_: workmad3: Yes, I've same assumptions. I'm giving it a shot. Thanks.
[10:35:29] workmad3: waseem_: as that frequently gets displayed as the error if *any* error happens during compilation, e.g. can't build the file because there's no space on the disk
[10:35:32] rushed: waseem_: once you've run out of drive space all bets are off regarding what state you're in
[10:35:57] isthisreallife: has joined #RubyOnRails
[10:36:09] universa1: shortCircuit__: check in your browser network tab that it actually sends the image data.
[10:36:11] isthisreallife: where can i buy it? http://img2.cda.pl/g/25774_7e7805cf376403737a6ee46d9a615253.jpeg
[10:36:22] thatkid: has joined #RubyOnRails
[10:36:41] darrencauthon: has joined #RubyOnRails
[10:37:03] shortCircuit__: universa1 , for the profile.rb arg.each { |image| photos << photos.build(image: image) } since I am posting it by converting the image to fileobject or a formdata object , its only sending those parameters
[10:37:09] shortCircuit__: in the error file.
[10:37:19] universa1: isthisreallife: funny? not so much...
[10:37:42] thatkid: Why using the names like "X-User-Email" in the simple token authentication gem? https://github.com/gonzalo-bulnes/simple_token_authentication Is there any reason behind it?
[10:38:05] shortCircuit__: there is only a profile object, no image blob kind of data as such.. like it should be with --- seperators
[10:38:13] isthisreallife: has left #RubyOnRails: ("Leaving")
[10:38:20] universa1: shortCircuit__: compare what you submit when you submit a multipart form with what you're submitting right now... ...i very much think there is something wrong in what you're doing.
[10:38:30] workmad3: thatkid: 'X-' prefixes on HTTP headers are used to indicate non-standard headers
[10:38:31] universa1: shortCircuit__: and that is in the angular/js part, not rails part.
[10:38:41] rushed: thatkid: did you read the page you linked? https://github.com/gonzalo-bulnes/simple_token_authentication#authentication-method-2-request-headers
[10:39:56] RegulationD: has joined #RubyOnRails
[10:40:40] thatkid: workmad3: I think I have to more about the standard REST API practices, Do you have any recommendation for resources?
[10:41:40] mikecmpbll: rest resources, hehe.
[10:42:26] RahulT: has joined #RubyOnRails
[10:43:05] thatkid: mikecmpbll: i mean learning materials :)
[10:43:16] maz-dev: has joined #RubyOnRails
[10:43:38] raj___: has joined #RubyOnRails
[10:43:51] shortCircuit__: ok, I am checking a few things if the parameters can be changed, here is the basic difference http://hastebin.com/madipetebu.hs
[10:44:47] shortCircuit__: basically the name has to be filename ... I think I can change that
[10:47:49] snophey: has joined #RubyOnRails
[10:48:14] snophey: has left #RubyOnRails: ()
[10:50:28] chouhoulis: has joined #RubyOnRails
[10:52:19] srinidhi: has joined #RubyOnRails
[10:54:19] Aeyrix: wow feds @ my door
[10:55:06] ndrei: has joined #RubyOnRails
[10:56:16] rahult_: has joined #RubyOnRails
[10:57:05] Aeyrix: van incoming
[10:57:16] barnex: for illegally downloading rails
[10:57:18] simpleid: has joined #RubyOnRails
[10:57:46] mikecmpbll: ross ulbricht should've served as a warning to ya
[10:57:49] barnex: there were actually few people accused by police of illegaly having Linux install in companies
[10:57:57] barnex: in Poland
[10:58:03] Aeyrix: nah it was
[10:58:05] barnex: infringing on rights of GNU ;3
[10:58:06] Aeyrix: about a traffic ticket
[10:58:10] Aeyrix: from the previous tenant of this house
[10:58:19] aditya432: has joined #RubyOnRails
[10:58:48] jokke: sevenseacat: it's really a problem with cancan
[10:58:58] sevenseacat: jokke: is it? show me?
[10:59:19] rodfersou: has joined #RubyOnRails
[10:59:19] jokke: can't believe how long i've been stuck on this
[10:59:31] aditya432: I want users/1/biz to get me all user specific businesses but biz/ to get all businesses. How can I achieve this?
[10:59:35] doodlehaus: has joined #RubyOnRails
[11:00:15] jokke: but apparently cancan has a problem with can :action, SomeModel followed by can :action, SomeModel, some: 'condition'
[11:00:26] barnex: I rolled my own role/auth system in less than a day with rusty rails knowledge
[11:00:32] jokke: (the second rule)
[11:00:35] barnex: and it does exactly what I want :P
[11:00:51] jokke: the can above overrides the cannot every time
[11:02:06] sevenseacat: jokke: show me?
[11:02:14] surrealanalysis: has joined #RubyOnRails
[11:02:15] annlewis: has joined #RubyOnRails
[11:03:21] chinmay_dd: has joined #RubyOnRails
[11:03:32] quazimodo: has joined #RubyOnRails
[11:03:55] Brozo: has joined #RubyOnRails
[11:04:02] relix: has joined #RubyOnRails
[11:08:36] Coldblackice_: has joined #RubyOnRails
[11:10:10] stevednd: has joined #RubyOnRails
[11:11:03] aditya432: I want users/1/biz to get me all user specific businesses but biz/ to get all businesses. How can I achieve this?
[11:11:26] michael_mbp: has joined #RubyOnRails
[11:11:57] jokke: sevenseacat: https://github.com/ryanb/cancan/blob/master/spec/cancan/model_adapters/mongoid_adapter_spec.rb#L105
[11:12:06] jokke: that definately doesn't work
[11:12:36] jokke: if i try using a scope or mongoid criteria, i get The can? and cannot? call cannot be used with a raw sql 'can' definition
[11:13:13] surrealanalysis: has joined #RubyOnRails
[11:13:27] ur5us: has joined #RubyOnRails
[11:14:55] jokke: also rules with blocks don't work
[11:15:31] Anakat_: has joined #RubyOnRails
[11:15:40] jokke: aditya432: with the appropriate controller actions and routes?
[11:15:55] jokke: or nested resources
[11:16:00] aditya432: jokke both would point to business index
[11:16:25] aditya432: and both would have same view but customized?
[11:16:39] jokke: how customized?
[11:17:06] aditya432: one for showing everything if route is /biz. and other for showing user specific biz if route is users/1/biz
[11:19:43] jokke: aditya432: and why do you need to use different views?
[11:19:58] jokke: i don't know
[11:20:16] jokke: you might check if params[:user_id] exists
[11:20:29] jokke: and depending on that, render this or that view
[11:21:27] jenrzzz: has joined #RubyOnRails
[11:22:20] Synthead: has joined #RubyOnRails
[11:24:56] yfeldblum: has joined #RubyOnRails
[11:26:03] LiquidInsect: has joined #RubyOnRails
[11:27:48] chinmay_dd: has joined #RubyOnRails
[11:28:17] chinmay_dd: has joined #RubyOnRails
[11:28:49] c355E3B: has joined #RubyOnRails
[11:31:04] seank_: has joined #RubyOnRails
[11:31:51] cryptocronus: has joined #RubyOnRails
[11:34:40] jokke: ok so cancan cannot (lol) deal with can :action, :all followed by exclusion by model, as in cannot :action, Model
[11:34:59] jokke: i wonder why this isn't documented anywhere
[11:35:11] jokke: would appear like a pretty common use case to me
[11:35:57] Silex: jokke: you'd use cancancan
[11:36:03] ldnunes: has joined #RubyOnRails
[11:36:06] jokke: Silex: i do
[11:36:20] Silex: jokke: and yes, it is very weird. Great at first, and then you hit corner cases everywhere
[11:36:26] Silex: pundit is MUCH simpler (and thus better imho)
[11:37:12] Silex: https://github.com/CanCanCommunity/cancancan/issues/created_by/Silex
[11:37:37] Silex: I tried to work around cancancan issues but it's just impossible when doing anything a little bit complex
[11:37:52] Silex: for static set of permissions it's fine tho
[11:38:30] chagel: has joined #RubyOnRails
[11:38:30] Silex: for permissions in db with a bit of relation it's a PITA
[11:38:46] Silex: "it works" eventually tho, but you fight it quite a lot
[11:39:39] DoctorMonocular: has joined #RubyOnRails
[11:39:46] Silex: jokke: give pundit a try, you'll quickly see it's so simple it's hard for it to create bugs
[11:40:03] Silex: it's much less magic and more verbose tho
[11:40:15] jokke: yeah i just checked out the github page
[11:40:19] jokke: seems really cool
[11:40:32] jokke: love projects that use plain ol' ruby objects
[11:40:37] commondream: has joined #RubyOnRails
[11:41:25] moeabdol: has joined #RubyOnRails
[11:41:44] cleopatra: any way is nickname already taken how suggest ather nickname variant?
[11:41:45] sevenseacat: yesterday we talked about cancancan, and today we're talking about cancan with mongoid :(
[11:42:17] sevenseacat: jokke: glad you fixed it, or something.
[11:42:26] jokke: sevenseacat: i didn't
[11:42:47] jokke: well cancancan with mongoid
[11:43:06] sevenseacat: but you linked me to cancan code?
[11:44:16] fgo: has joined #RubyOnRails
[11:44:54] anti-freeze: has joined #RubyOnRails
[11:45:19] leafac: has joined #RubyOnRails
[11:45:33] wethu: has joined #RubyOnRails
[11:46:28] anti-freeze: Hi everyone. Does anyone have any experience using AngularJS and Rails containing models with multiple nested attributes using accepts_nested_attributes_for? I can't seem to get stuff posting through AJAX to the rails controller. I know the model expects something like model_attributes, but angular sends just model. Does anyone know the best way around this?
[11:47:34] anti-freeze: Hi everyone. Does anyone have any experience using AngularJS and Rails containing models with multiple nested attributes using accepts_nested_attributes_for? I can't seem to get stuff posting through AJAX to the rails controller. I know the model expects something like model_attributes, but angular sends just model. Does anyone know the best way around this?
[11:47:44] Aeyrix: Hi Dr. Nick.
[11:47:54] srinidhi: has joined #RubyOnRails
[11:49:59] n80: has joined #RubyOnRails
[11:52:06] sameerynho: has joined #RubyOnRails
[11:53:23] mike: has joined #RubyOnRails
[11:54:38] quazimodo: has joined #RubyOnRails
[11:54:43] gerep: has joined #RubyOnRails
[11:56:09] gerep: A quick question: I have a route match 'merchants/get_cnpj' => 'merchants#get_cnpj', :via => :get. And I have this get_cnpj method on my controller but when I call it: http://localhost:3000/merchants/get_cnpj, it tells me that it doesn't have a show action. What am I missing here?
[11:56:42] gerep: I have a debugger inside this get_cnpj but it doesn't get called
[11:57:23] moeabdol: has joined #RubyOnRails
[11:57:27] gerep: "The action 'show' could not be found for MerchantsController"
[11:58:11] gerep: It is like a fallback. It doesn't find the get_cnpj action and then tries to run the show action?
[11:58:24] Aeyrix: Do you have `resources :merchants` in your routes?
[11:58:33] gerep: resources :merchants, except: [:destroy]
[11:58:39] Aeyrix: Yeah, is that at the top?
[11:58:53] Aeyrix: Move it to the bottom, above `root` and above the `end`.
[11:59:39] gerep: That's it
[12:00:07] gerep: I didn't think of that because there is a resource :users and above it, lots of match commands and they work
[12:00:37] chinmay_dd: has joined #RubyOnRails
[12:01:05] treehug88: has joined #RubyOnRails
[12:01:06] nfk: has joined #RubyOnRails
[12:01:09] gerep: Aeyrix, thanks ;)
[12:01:14] shyshy: has joined #RubyOnRails
[12:01:39] nonparfumee: has joined #RubyOnRails
[12:02:01] charliesome: has joined #RubyOnRails
[12:02:47] leafac: has joined #RubyOnRails
[12:02:50] Scripore: has joined #RubyOnRails
[12:02:52] abuzze_: has joined #RubyOnRails
[12:03:00] annlewis: has joined #RubyOnRails
[12:03:04] goodcodeguy: has joined #RubyOnRails
[12:03:09] k4nd4lf: has joined #RubyOnRails
[12:03:13] simplyianm: has joined #RubyOnRails
[12:04:12] squiercaster: has joined #RubyOnRails
[12:05:23] abuzze__: has joined #RubyOnRails
[12:05:32] Aeyrix: gerep np :)
[12:07:19] moeabdol: has joined #RubyOnRails
[12:09:17] Rubie: has joined #RubyOnRails
[12:09:51] mostlybadfly: has joined #RubyOnRails
[12:10:18] Papierkorb: has joined #RubyOnRails
[12:11:27] jkamenik: has joined #RubyOnRails
[12:12:03] abuzze: has joined #RubyOnRails
[12:15:45] mrbubbles: has joined #RubyOnRails
[12:17:19] DaniG2k: has joined #RubyOnRails
[12:18:04] Anakat: has joined #RubyOnRails
[12:18:29] maloik: I'm having an issue when using paranoia (acts as paranoid) with an association using inverse_of. Situation is explained here: https://gist.github.com/hannesfostie/c2627c6e6cfbe217293b - does anyone know if there is anything I can do to get around this? /cc Radar
[12:18:55] Limix: has joined #RubyOnRails
[12:19:23] XThief: has joined #RubyOnRails
[12:19:31] tjbiddle: has joined #RubyOnRails
[12:19:33] cryptocronus: has joined #RubyOnRails
[12:19:53] Aeyrix: Rad's probably asleep mate.
[12:19:58] Aeyrix: Don't ping people out of nowhere.
[12:21:22] maloik: If pinging is a problem for him I'm sure he has it turned off :-)
[12:23:14] srinidhi: has joined #RubyOnRails
[12:23:45] chinmay_dd: has joined #RubyOnRails
[12:23:49] codeurge: has joined #RubyOnRails
[12:25:17] aderium: has joined #RubyOnRails
[12:26:40] aufi: has joined #RubyOnRails
[12:28:52] RegulationD: has joined #RubyOnRails
[12:29:48] bendangelo: has joined #RubyOnRails
[12:30:29] k4nd4lf: has joined #RubyOnRails
[12:34:56] michael_mbp: has joined #RubyOnRails
[12:35:41] Anakat_: has joined #RubyOnRails
[12:36:35] TinkerTyper: has joined #RubyOnRails
[12:36:52] JDeen: has joined #RubyOnRails
[12:37:43] JDeen: Looking on how to handle composite primary keys, it seems like AR doesn't support it out of the box and have to use https://github.com/composite-primary-keys/composite_primary_keys. Is this correct?
[12:38:07] sevenseacat: AR doesnt support them out of the box, thats correct.
[12:38:19] n008f4g_: has joined #RubyOnRails
[12:38:23] Maya_: has joined #RubyOnRails
[12:38:23] JDeen: sevenseacat: Thanks
[12:38:27] jottr: has joined #RubyOnRails
[12:41:23] iamjarvo: has joined #RubyOnRails
[12:41:41] chouhoulis: has joined #RubyOnRails
[12:42:00] Maya_: has joined #RubyOnRails
[12:42:29] dexter91x: has joined #RubyOnRails
[12:44:10] sankaber: has joined #RubyOnRails
[12:45:25] jamiely_: has joined #RubyOnRails
[12:46:18] Ergo: has joined #RubyOnRails
[12:46:30] nhhagen: has joined #RubyOnRails
[12:46:39] fgo: has joined #RubyOnRails
[12:47:31] philcrissman: has joined #RubyOnRails
[12:47:31] allcentury: has joined #RubyOnRails
[12:49:43] Anakat_: has joined #RubyOnRails
[12:50:33] hardtail: has joined #RubyOnRails
[12:51:08] rushed: has joined #RubyOnRails
[12:51:18] hardtail: Good day everyone
[12:52:24] medk: has joined #RubyOnRails
[12:52:33] watchtheblur: has joined #RubyOnRails
[12:52:43] Brozo: has joined #RubyOnRails
[12:53:15] garrypolley: has joined #RubyOnRails
[12:53:49] pedrosnk: has joined #RubyOnRails
[12:55:06] fgo: has joined #RubyOnRails
[12:56:31] SeanLazer: has joined #RubyOnRails
[12:56:56] garrypolley: has joined #RubyOnRails
[13:01:20] ringarin: has joined #RubyOnRails
[13:03:44] DaniG2k: has joined #RubyOnRails
[13:05:33] DarkFoxDK: has joined #RubyOnRails
[13:05:39] ldnunes_: has joined #RubyOnRails
[13:06:20] DarkFoxDK: has left #RubyOnRails: ()
[13:07:54] nettoweb: has joined #RubyOnRails
[13:08:20] olegtc: has joined #RubyOnRails
[13:08:57] dopieee: has joined #RubyOnRails
[13:10:41] karimb: has joined #RubyOnRails
[13:11:18] jenrzzz: has joined #RubyOnRails
[13:11:29] seank_: has joined #RubyOnRails
[13:13:01] pjammer: has joined #RubyOnRails
[13:13:04] givanse: has joined #RubyOnRails
[13:14:13] surrealanalysis: has joined #RubyOnRails
[13:14:50] jsrn_: has joined #RubyOnRails
[13:15:07] doodlehaus: has joined #RubyOnRails
[13:16:24] aderium: has joined #RubyOnRails
[13:17:24] chridal: has joined #RubyOnRails
[13:18:40] aderium: I am having a hard time understaning how to compile ruby in 64 bit in solaris 11.2
[13:19:08] aderium: usually we deploy via rvm but when doing typical deploy it always comes up saying i386
[13:20:15] jhass: might have better luck in #solaris or so tbh
[13:20:53] aderium: no news there been told to look here :)
[13:21:04] griffindy: has joined #RubyOnRails
[13:21:22] JDeen: In rails/ruby is there a way to throw an exception. For example I have a method `assign_user_to_role` that would be making an relation that PG could raise an exception. Insted of handling it inside the method I like to handle it on the controller action that called the method. I think in Java, its throwing an exception.
[13:21:23] jhass: #ruby has a few more members, just inform where you asked already
[13:21:31] jhass: Aderium: ^
[13:22:05] jhass: jdeen: did you google that question?
[13:22:35] jhass: jdeen: http://www.zenspider.com/Languages/Ruby/QuickRef.html
[13:22:53] vedu: Hello. I want to create a admin dashboard app to manage delivery people and orders. Where shall I start?
[13:23:26] sevenseacat: vedu: rails new app_name
[13:23:34] TheNet: has joined #RubyOnRails
[13:23:47] jhass: rails new admin_dashboard, didn't you read
[13:23:53] sevenseacat: oh oops. sorry.
[13:23:55] allcentury: has joined #RubyOnRails
[13:24:14] abuzze: has joined #RubyOnRails
[13:24:31] JDeen: jhass: I actually quickly ran through few articles, the very first one i red had it on the bottom. My bad...
[13:25:31] TheNet: anyone know if it's possible to use awesome_print with lograge's raw formatter?
[13:25:32] abuzze: has joined #RubyOnRails
[13:25:34] vedu: come on guys -_-
[13:25:38] rickmasta: has joined #RubyOnRails
[13:25:52] sevenseacat: vedu: thats pretty much the most vague question you could ask, other than 'how do i rails'
[13:25:54] vedu: I meant which gems should I look into. is there a similar app already, etc
[13:26:29] vedu: yeah was worried about that. its very open. that's why couldn't google properly
[13:26:56] sevenseacat: !gettingstarted
[13:26:56] helpa: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy and Ryan Bigg
[13:27:59] vedu: I have made rails apps. Are you suggesting that I should make an app from scratch? Nothing to build on top of
[13:28:38] sevenseacat: build on top of one of those apps then.
[13:28:43] sevenseacat: i dont know what you want us to say.
[13:29:10] justintv90: has joined #RubyOnRails
[13:29:19] DigitallyBorn: has joined #RubyOnRails
[13:29:20] dexter91x: has joined #RubyOnRails
[13:29:47] RegulationD: has joined #RubyOnRails
[13:30:18] vedu: sorry for being vauge :/
[13:30:40] Spami: has joined #RubyOnRails
[13:31:28] Morkel: has joined #RubyOnRails
[13:32:01] workmad3: has joined #RubyOnRails
[13:32:11] delianides: has joined #RubyOnRails
[13:32:30] hardtail: has joined #RubyOnRails
[13:32:44] sarink: has joined #RubyOnRails
[13:33:31] Anakat: has joined #RubyOnRails
[13:33:47] bmurt: has joined #RubyOnRails
[13:34:00] annlewis: has joined #RubyOnRails
[13:36:11] kii: has joined #RubyOnRails
[13:36:20] umgrosscol: has joined #RubyOnRails
[13:36:30] jokke: Silex: thanks for the hint with pundit. Will most likely use it for any future project requiring user based authorization
[13:36:35] mary5030: has joined #RubyOnRails
[13:36:50] jokke: Silex: i finally got around my issue
[13:36:57] jokke: but it's very hacky
[13:40:26] DoctorMonocular: has joined #RubyOnRails
[13:42:02] fuzzyhorns: has joined #RubyOnRails
[13:42:58] andywww: has joined #RubyOnRails
[13:43:47] andywww: has left #RubyOnRails: ()
[13:44:25] Anakat: has joined #RubyOnRails
[13:45:05] elia: has joined #RubyOnRails
[13:45:38] jsrn_: has joined #RubyOnRails
[13:47:00] Anakat_: has joined #RubyOnRails
[13:47:54] abuzze: has joined #RubyOnRails
[13:48:00] tagrudev: has joined #RubyOnRails
[13:49:29] ekain: has joined #RubyOnRails
[13:49:37] penguinp1wernz: has joined #RubyOnRails
[13:49:38] devdazed: has joined #RubyOnRails
[13:49:49] paulcsmith: has joined #RubyOnRails
[13:51:40] srinidhi: has joined #RubyOnRails
[13:51:50] commondream: has joined #RubyOnRails
[13:52:06] Hates_: has joined #RubyOnRails
[13:52:10] simplyianm: has joined #RubyOnRails
[13:52:25] earthquake: has joined #RubyOnRails
[13:53:27] Brozo: has joined #RubyOnRails
[13:53:41] loechel: has joined #RubyOnRails
[13:53:55] moeabdol: has joined #RubyOnRails
[13:54:36] orikremer: has joined #RubyOnRails
[13:56:50] Ropeney: has joined #RubyOnRails
[13:57:52] sandelius: has joined #RubyOnRails
[13:57:53] cornerma1: has joined #RubyOnRails
[13:58:57] chinmay_dd: has joined #RubyOnRails
[14:00:25] crankharder: has joined #RubyOnRails
[14:00:31] commondream: has joined #RubyOnRails
[14:02:47] darrencauthon: has joined #RubyOnRails
[14:03:42] darrencauthon: has joined #RubyOnRails
[14:04:47] jkamenik1: has joined #RubyOnRails
[14:08:31] axl__: has joined #RubyOnRails
[14:08:56] TheNet: what's a pretty good tutorial on using devise with cancan?
[14:09:20] creature: has joined #RubyOnRails
[14:10:34] g0rx: is there any coder ?
[14:12:18] Hates_: coders everywhere
[14:12:29] allcentury: has joined #RubyOnRails
[14:12:55] sevenseacat: g0rx: we won't take it here either.
[14:15:51] RegulationD: has joined #RubyOnRails
[14:17:47] dopie: has joined #RubyOnRails
[14:21:10] gambl0re: has joined #RubyOnRails
[14:22:45] Scripore: has joined #RubyOnRails
[14:24:44] platosha: has joined #RubyOnRails
[14:25:11] kies: has joined #RubyOnRails
[14:30:34] bruno-: has joined #RubyOnRails
[14:31:20] krz: has joined #RubyOnRails
[14:32:07] Joshmfrankel: has joined #RubyOnRails
[14:32:12] Joshmfrankel: has left #RubyOnRails: ()
[14:32:15] chagel: has joined #RubyOnRails
[14:32:48] iamjarvo: has joined #RubyOnRails
[14:33:18] thiagovsk: has joined #RubyOnRails
[14:33:31] iamjarvo: has joined #RubyOnRails
[14:34:10] bhorn1: has joined #RubyOnRails
[14:36:00] SalexW: has joined #RubyOnRails
[14:37:17] chouhoulis: has joined #RubyOnRails
[14:37:40] j_mcnally: has joined #RubyOnRails
[14:38:21] chouhoulis: has joined #RubyOnRails
[14:42:35] maxmanders: has joined #RubyOnRails
[14:43:07] Sigma00: g0rx: ask your question, don't ask to ask
[14:45:48] benhuda: has joined #RubyOnRails
[14:46:30] jamiely: has joined #RubyOnRails
[14:47:19] hnanon: I have the following scope: https://gist.github.com/anonymous/05f908de49f85c797e89
[14:47:38] hnanon: How can I also limit the query to only include the current user id?
[14:47:41] Silex: jokke: yw
[14:48:33] jhass: hnanon: in the scope? pass the user in as a parameter
[14:49:36] jhass: or call the scope on a relation of the current user, not enough context actually
[14:51:24] sarink: has joined #RubyOnRails
[14:51:31] g0rx: Sigma00 i m not allowed to talk . i will get banned
[14:51:59] Sigma00: sounds like you being in the channel isn't very productive, then
[14:52:20] yekta: has joined #RubyOnRails
[14:52:26] byonic: has joined #RubyOnRails
[14:52:44] simplyianm: has joined #RubyOnRails
[14:53:16] hnanon: jhass: I now have this: https://gist.github.com/anonymous/769d6998242d2e64fd32
[14:53:34] hnanon: error: wrong number of arguments (0 for 3)
[14:53:41] yekta: If I perform a Model.where().present? or .any? or .blank? What kind of query does that trigger underneath the hood? Like, is that still able to lazy load the query set?
[14:54:05] JohnHirbour: has joined #RubyOnRails
[14:54:14] jhass: hnanon: sounds like you call it without arguments?
[14:55:07] joaomdmoura: has joined #RubyOnRails
[14:56:10] DoctorMonocular: has joined #RubyOnRails
[14:56:44] hnanon: jhass: Where will the parameters be passed from?
[14:57:18] hnanon: I'm calling a "reconcile" action that has those same exact params.
[14:57:19] jhass: .unpaid(Time.now, 1.day.ago, current_user)
[14:58:35] maloik: yekta: you can add #to_sql :-)
[14:58:39] TommyTheKid: I am working on a capistrano deploy issue where it precompiles the assets every time (currently ~7 mins) it deploys, however, if I run the same command the capistrano is running (via ssh the same way), it completes in fractions of a second (for subsequent runs)
[14:59:08] coderhs: has joined #RubyOnRails
[14:59:10] hnanon: jhass: Shouldn't this line just handle that: .where('carrier_commissions.id IS NULL', customer_id: current_user.customer.id, created_at: start_date..end_date)
[14:59:12] TommyTheKid: ... even if I cap deploy the exact same commit twice
[14:59:13] nhhagen_: has joined #RubyOnRails
[14:59:30] TommyTheKid: and, yes, tmp/cache and public/assets are symlinks to a shared location
[15:00:12] yekta: maloik: so its just running the full query anytime a boolean / nonzero operator is applied?
[15:00:41] foucist: has joined #RubyOnRails
[15:00:42] TommyTheKid: so.. Q: Is the ${PWD} somehow hashed into the manifest so that the capistrano "releases" style deployment breaks the assets that were already compiled once?
[15:00:54] jhass: hnanon: sorry, I bail, you simply provide not enough context to help you
[15:01:02] abuzze: has joined #RubyOnRails
[15:01:13] maloik: yekta: from the top of my head, the cases you mentioned: yes. Try Model.exists?(your_where_hash_goes_here)
[15:01:22] hnanon: jhass: Sorry. Thanks for your help so far, anyway.
[15:01:30] jenrzzz: has joined #RubyOnRails
[15:01:39] yekta: maloik: Actualyl the query just spat itself out in the console when I tried it and it does indeed do a count.
[15:01:39] garrypolley: has joined #RubyOnRails
[15:02:02] disgrntld: has joined #RubyOnRails
[15:04:14] Axilla: hi all, how can i stub a RestClient.get which downloads a tmp file for processing from a URL and return a local file instead for use?
[15:04:23] Axilla: in testing
[15:06:25] rodferso1: has joined #RubyOnRails
[15:06:46] Axilla: https://gist.github.com/travisdmathis/9af2e6865a15453b09a2
[15:06:48] Brozo: has joined #RubyOnRails
[15:07:04] abuzze: has joined #RubyOnRails
[15:08:05] pjammer: has joined #RubyOnRails
[15:08:29] hnanon: jhass: Does this help? https://gist.github.com/anonymous/0acbcad67d458092bdd3
[15:09:28] jhass: hnanon: you have to pass them on, dealer_commissions.unpaid(start_date, end_date, current_user).each do
[15:10:09] leafac: has joined #RubyOnRails
[15:10:55] hnanon: I tried that and I get the same error: wrong number of arguments (0 for 3)
[15:11:05] mordocai: has joined #RubyOnRails
[15:11:16] hnanon: The params come from the reconcile action in the controller.
[15:11:25] hnanon: Will they be available to the scope too?
[15:12:59] |RicharD|: has joined #RubyOnRails
[15:13:09] acti0nman: has joined #RubyOnRails
[15:14:38] iamjarvo: has joined #RubyOnRails
[15:14:48] _seanc_: has joined #RubyOnRails
[15:15:13] |RicharD|: someone here use faye ? it's still a good solution or better something native like EventSource ?
[15:16:00] leafac: has joined #RubyOnRails
[15:16:19] ur5us: has joined #RubyOnRails
[15:17:07] devdazed: has joined #RubyOnRails
[15:17:13] jschoolcraft: has joined #RubyOnRails
[15:18:19] jeffleeismyhero: has joined #RubyOnRails
[15:19:42] spyderman4g63: has joined #RubyOnRails
[15:20:01] TommyTheKid: has joined #RubyOnRails
[15:20:35] syzygy_: has joined #RubyOnRails
[15:22:12] universa1: |RicharD|: EventSource is client-side, you still need something on the server.
[15:22:37] Axilla: nevermind figured it out.
[15:22:43] Cache_Money: has joined #RubyOnRails
[15:23:16] arup_r: has joined #RubyOnRails
[15:23:21] duhhhsty: has joined #RubyOnRails
[15:23:31] |RicharD|: universa1: ok thx
[15:23:52] JohnHirbour: has left #RubyOnRails: ()
[15:23:54] |RicharD|: what you suggest ? there is something better than faye ?
[15:23:59] universa1: |RicharD|: depends.
[15:24:05] |RicharD|: I know that there is socket.io but I want still use ruby
[15:24:24] arup_r: Why includes throwing error while joins work https://gist.github.com/aruprakshit/d93326cb80a6c1e3180f
[15:24:27] |RicharD|: is for about 120-130 people connected...so I don't need good performances
[15:24:34] |RicharD|: (it's a simple chat)
[15:24:35] universa1: |RicharD|: eventsource needs something like server sent events, which means streaming requests (ac::live) in rails
[15:25:02] |RicharD|: ac= actionable right ?
[15:25:07] universa1: |RicharD|: and streaming requests would mean you'd need as many threads on the srever as you have users, if you go with "plain" rails
[15:25:10] snockerton: has joined #RubyOnRails
[15:25:12] universa1: ac = actioncontroller
[15:25:39] universa1: |RicharD|: there is goliath, not sure that works with eventsource
[15:25:50] universa1: |RicharD|: and there is faye, and then there is also the possibility of polling.
[15:26:01] |RicharD|: no, no polling
[15:26:17] maloik: groslotmusic
[15:26:19] chinmay_dd: has joined #RubyOnRails
[15:26:30] maloik: oops, apoliogies, wrong window
[15:26:46] atmosx: When creating a standard 'User' scaffold, does rails add random functions? I'm getting errors about 'uknown method `name`' while I never defiend a 'name' method... only username/realname.
[15:27:03] universa1: atmosx: no.
[15:27:10] universa1: atmosx: rails does not define random functions.
[15:27:33] universa1: atmosx: you probably ran rails scaffold User name; and changed the migration afterwards manually...
[15:27:52] atmosx: universa1: hm, strange thing I can't even see a .name method called in the controller or the controller's test... and yet I get this error.
[15:28:03] atmosx: universa1: omg
[15:28:21] jdkealy: has joined #RubyOnRails
[15:28:34] universa1: arup_r: because includes doesn't necessarily create a join query, you can use includes(:association).references(:association) iirc
[15:28:44] atmosx: universa1: no that's my migration https://gist.github.com/atmosx/1213972fbf5ea075ecac ...
[15:28:53] atmosx: anyway I'll dig into it some more.
[15:29:33] universa1: atmosx: error trace in a gist.
[15:30:10] arup_r: that;s the reason
[15:30:34] atmosx: universa1: k
[15:33:24] atmosx: universa1: https://gist.github.com/atmosx/1213972fbf5ea075ecac
[15:33:37] paulcsmith_: has joined #RubyOnRails
[15:34:03] universa1: atmosx: https://gist.github.com/atmosx/1213972fbf5ea075ecac#file-rake-test-L44
[15:34:25] Ankit: has joined #RubyOnRails
[15:34:34] universa1: atmosx: show user_controller, user_controller_test classes please, too
[15:35:45] spyderman4g63: has joined #RubyOnRails
[15:36:02] atmosx: universa1: here https://gist.github.com/atmosx/1213972fbf5ea075ecac#file-users_controller-rb-L30
[15:36:08] atmosx: it's @user.save
[15:36:27] atmosx: I have a unique username validation, hm
[15:36:52] atmosx: but if that was the case the error should be more explicit.
[15:36:53] universa1: atmosx: can you also add the user model please?
[15:37:08] jschoolcraft: atmosx: the error complains about 'name', are you using 'name' somewhere instead of username or realname?
[15:37:10] hamster88: has joined #RubyOnRails
[15:37:16] atmosx: universa1: validates :name, :email, presence: true, uniqueness: true <-
[15:37:22] hamster88: greetings people ^^
[15:37:22] universa1: atmosx: see
[15:37:27] atmosx: universa1: and the has_secure_password line
[15:37:28] universa1: atmosx: validates :name !!!!!
[15:37:38] universa1: atmosx: your user class has no attribute name
[15:37:39] jschoolcraft: should validate :username :)
[15:37:41] atmosx: sorry, MY BAD
[15:37:44] atmosx: IT WAS 2 AM
[15:37:48] atmosx: ACTION hides
[15:37:48] universa1: atmosx: nm :-)
[15:38:01] universa1: happens to everyone
[15:38:10] dhjondoh: has joined #RubyOnRails
[15:38:32] atmosx: thank you ppl :-)
[15:38:38] hamster88: I am using erb and trying to link the image in navbar, but i am not able to do so, The code i am writing is <%= link_to, root_path :class => "navbar-brand" do image_tag("slogo.svg") %> <% end %>, i am not sure what i am doing wrong. can anyone please point me in right direction?
[15:39:02] hamster88: note: navbar-brand is the class for site's logo
[15:39:16] sandstrom: has joined #RubyOnRails
[15:39:16] universa1: hamster88: do %><%= image_tag ... %><% end %>
[15:39:25] moretti: has joined #RubyOnRails
[15:39:26] atmosx: out of curiosity, if I wanted to use HAML instead of ERB in my rails project, I should manually switch from erb to haml all files?
[15:39:49] hamster88: aha thanks universa1 :3
[15:39:50] universa1: atmosx: there is the html2haml gem which can automate it for you.
[15:39:53] jschoolcraft: atmosx: no, there's a gem to do that
[15:39:59] rubyonrails531: has joined #RubyOnRails
[15:40:54] hamster88: ummm that didn't worked at all :/
[15:41:50] rubyonrails531: hey, question ??? I'm not the lead dev on a project, so I don't usually deploy to production, but trying to deploy an important style fix on https://github.com/TeaWithStrangers/tws-on-rails
[15:42:10] rubyonrails531: but we have a second repo for our styles at https://github.com/TeaWithStrangers/tws-styles/
[15:42:32] hamster88: that is still giving me "syntax error, unexpected keyword_ensure, expecting end-of-input"
[15:42:37] universa1: hamster88: !gist what you did
[15:42:37] helpa: hamster88: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[15:42:37] hamster88: let me gist it
[15:42:45] ndrei: has joined #RubyOnRails
[15:42:52] rubyonrails531: I don't actually understand submodules very well though
[15:42:58] spyderman4g63: has joined #RubyOnRails
[15:43:25] rubyonrails531: and when I try to deploy, it's giving me an an error that it can't precompile the assets
[15:43:30] rubyonrails531: -----> Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! Sass::SyntaxError: File to import not found or unreadable: tws-styles/application.
[15:43:48] hamster88: https://gist.github.com/thedesignable/ebff0ea3db8de96af818
[15:43:52] rubyonrails531: (Also, this is my first time in IRC, so have no clue how to approach asking for help here
[15:44:05] universa1: rubyonrails531: there are some guidelines in the topic ;)
[15:44:37] krz: has joined #RubyOnRails
[15:45:29] rubyonrails531: chances anyone can lend a hand?
[15:45:50] universa1: hamster88: https://gist.github.com/universal/72c5dac1b4c7f6a2f359
[15:46:00] universa1: hamster88: https://gist.github.com/universal/72c5dac1b4c7f6a2f359/revisions
[15:46:08] universa1: and with that i'm out ;)
[15:46:19] hamster88: thanks universa1
[15:47:16] nhhagen: has joined #RubyOnRails
[15:48:32] philcrissmanzzz: has joined #RubyOnRails
[15:49:59] hnanon: rubyonrails531: Looks like a reference to a file in your sass file doesn't exist.
[15:50:41] rubyonrails531: I pulled from master, made a change to two files that shouldn't be affecting references to the file
[15:51:15] rubyonrails531: where would I expect to find references to the file
[15:51:51] meoblast001: has joined #RubyOnRails
[15:52:15] hnanon: Probably in one of your stylesheets.
[15:52:36] baweaver: has joined #RubyOnRails
[15:52:56] Scriptonaut: has joined #RubyOnRails
[15:53:11] fmcgeough: has joined #RubyOnRails
[15:54:11] Zadrel: has joined #RubyOnRails
[15:55:11] mase-chatter: has joined #RubyOnRails
[15:55:22] shinnya: has joined #RubyOnRails
[15:55:41] mase-chatter: has joined #RubyOnRails
[15:57:15] jkamenik: has joined #RubyOnRails
[15:57:31] ogpastaling: has joined #RubyOnRails
[15:57:49] towski_: has joined #RubyOnRails
[15:58:22] asheinfeld: has joined #RubyOnRails
[15:58:24] commondream: has joined #RubyOnRails
[15:59:31] rubyonrails531: @hnanon I'm an idiot. It had nothing to do with submodules. I didn't close an argument with }
[15:59:50] rubyonrails531: I got preemptively excited about pushing
[16:00:17] Rubie: has joined #RubyOnRails
[16:02:08] TheNet: is find_by deprecated?
[16:03:50] rkofman: has joined #RubyOnRails
[16:04:10] TheNet: rather find_by<column>
[16:06:02] commondream: has joined #RubyOnRails
[16:09:08] leafac: has joined #RubyOnRails
[16:10:20] ndrei: has joined #RubyOnRails
[16:10:51] theery: has joined #RubyOnRails
[16:11:33] ciree: has joined #RubyOnRails
[16:11:57] DoctorMonocular: has joined #RubyOnRails
[16:12:10] mary5030_: has joined #RubyOnRails
[16:13:29] balr0g: has joined #RubyOnRails
[16:14:17] _seanc_: has joined #RubyOnRails
[16:15:16] Scripore: has joined #RubyOnRails
[16:15:18] AzaToth: has joined #RubyOnRails
[16:16:26] mary5030: has joined #RubyOnRails
[16:16:32] ramfjord: has joined #RubyOnRails
[16:16:39] jottr: has joined #RubyOnRails
[16:17:35] fragamus: has joined #RubyOnRails
[16:19:04] Sigma00: TheNet: yes
[16:19:40] podman: has joined #RubyOnRails
[16:19:47] asheinfeld: has joined #RubyOnRails
[16:19:53] yfeldblum: has joined #RubyOnRails
[16:20:12] TheNet: Sigma00: why?
[16:20:23] abuzze: has joined #RubyOnRails
[16:20:36] TheNet: it seems much nicer to write User.find_by_name('name') than User.where(name: 'name')[0]
[16:20:49] Sigma00: go tell that to the rails maintainers
[16:21:13] jottr_: has joined #RubyOnRails
[16:21:30] podman: Hey guys! Any idea why using ActiveRecord::Base.connection_pool.with_connection would take about 5-6 seconds to yield to the block?
[16:22:22] porkqpain: has joined #RubyOnRails
[16:22:34] Sigma00: TheNet: http://edgeguides.rubyonrails.org/active_record_querying.html#dynamic-finders
[16:22:36] hnanon: rubyonrails531: Cool. Glad you found the source of the problem.
[16:22:51] Sigma00: don't ask stuff without first googling. We might lie out of boredom
[16:23:09] rubyonrails531: @hnanon turns out I didn't
[16:23:12] rubyonrails531: still getting the same issue
[16:23:17] m0r0n: has joined #RubyOnRails
[16:23:30] hazelux: has joined #RubyOnRails
[16:23:35] rubyonrails531: hnanon: I'm actually still getting the issue. What I pointed out was one problem but apparently wasn't the only uss
[16:23:36] tbuehlmann: find_by_attribute works, as Sigma00 just posted, but the method is defined on the fly, which can lead to confusion
[16:23:48] hnanon: Hmm...I'm sure it's something similar...look carefully at the changes you made.
[16:25:02] tbuehlmann: User.respond_to?(:find_by_name) will always be true, but User.method(:find_by_name) will raise a NameError if the method wasn't called before
[16:25:07] pixelhandler: has joined #RubyOnRails
[16:25:08] ivan__: has joined #RubyOnRails
[16:25:33] arBmind: has joined #RubyOnRails
[16:25:34] barnex: hmm, Is there an select box replacement that changes it to something like datalist that plays nice with scripting?
[16:25:51] barnex: ie. doesn't break when I change the value by script or change the options by script?
[16:26:37] centrx: has joined #RubyOnRails
[16:26:38] barnex: select2 seems to break everytime, and invoking .select2() again on selects throws errors.
[16:26:54] hmnhf: has joined #RubyOnRails
[16:28:52] briandavis: has joined #RubyOnRails
[16:29:19] drale2k_: has joined #RubyOnRails
[16:29:36] JDeen: has joined #RubyOnRails
[16:31:11] Brozo: has joined #RubyOnRails
[16:31:59] garrypolley: has joined #RubyOnRails
[16:32:16] TheNet: Sigma00 sorry
[16:32:23] XThief: has joined #RubyOnRails
[16:32:27] TheNet: Sigma00 doesn't look very deprecated to me though
[16:32:33] Sigma00: yes, that's what I'm saying
[16:32:45] Sigma00: because it annoys me that people don't google
[16:32:52] gerep: has joined #RubyOnRails
[16:33:07] codepete: has joined #RubyOnRails
[16:33:10] TheNet: it's difficult to google when you don't know the correct terms
[16:33:25] TommyTheKid: The problem with googling is there is a lot of outdated information out there :)
[16:34:17] edwinvdgraaf: has joined #RubyOnRails
[16:34:20] codeurge: has joined #RubyOnRails
[16:34:28] TommyTheKid: SO, apologies for repeating my next question, but I got disconnected for a while there (freaking comcast)
[16:35:00] TommyTheKid: I am working on a capistrano deploy issue where it precompiles the assets every time (currently ~7 mins) it deploys, however, if I run the same command the capistrano is running (via ssh the same way), it completes in fractions of a second (for subsequent runs). Rails4, tmp/cache and public/assets are symlinked to shared
[16:35:09] merryfett: has joined #RubyOnRails
[16:35:12] asheinfeld: has joined #RubyOnRails
[16:35:17] Brozo: has left #RubyOnRails: ()
[16:35:55] TommyTheKid: any thoughts on how to get it to only compile "changed" assets like it appears to do if you run rake assets:precompile from the previous release directory
[16:36:34] TommyTheKid: or should I replace capistrano's deploy process with something that just uses git and keeps everything in the same directory the whole time?
[16:36:48] TheNet: maybe you should try googleing it /s
[16:37:06] TommyTheKid: Yea, they say to use turbo-sprockets-rails3 :)
[16:37:15] TommyTheKid: it will solve all my problems
[16:37:25] TommyTheKid: (except that its Rails 4.2)
[16:38:00] codeurge: has joined #RubyOnRails
[16:38:33] Maya_: has joined #RubyOnRails
[16:41:01] Sigma00: when you google something and it doesn't net you something that works, try changing your terms :P
[16:41:13] Sigma00: first hit led me to this https://coderwall.com/p/aridag/only-precompile-assets-when-necessary-rails-4-capistrano-3
[16:41:44] Hates_: has joined #RubyOnRails
[16:42:19] TommyTheKid: I tried his, but that is still working like a lightswitch, with that it either compiles everything or nothing.
[16:42:30] TommyTheKid: actually I believe there is even a gem for that
[16:42:40] TommyTheKid: Here you go: https://github.com/capistrano-plugins/capistrano-faster-assets ;)
[16:44:07] spyderman4g63: has joined #RubyOnRails
[16:44:10] TommyTheKid: I was looking at the code earlier, trying to determine how assets:precompile decides whether it needs to "re"compile something, but I am a bit lost
[16:45:06] Rodya_: has joined #RubyOnRails
[16:45:22] Sigma00: timestamp, which is why you disable 'touch'ing in capistrano 2
[16:46:57] TommyTheKid: if its that simple I am deeply sorry for wasting your time :)
[16:47:17] Fabiocftv: has joined #RubyOnRails
[16:47:41] erich: has joined #RubyOnRails
[16:48:05] TommyTheKid: I suppose its this: https://github.com/capistrano/rails/blob/master/lib/capistrano/tasks/assets.rake#L8-L19 that is burning me then?
[16:50:50] TinkerTyper: has joined #RubyOnRails
[16:51:18] iliketurtles: has joined #RubyOnRails
[16:53:06] paulcsmith_: has joined #RubyOnRails
[16:53:20] bashusr: has joined #RubyOnRails
[16:54:35] Anakat: has joined #RubyOnRails
[16:54:45] jmignault: has joined #RubyOnRails
[16:55:08] sonofdirt: has joined #RubyOnRails
[16:59:42] asheinfeld: has joined #RubyOnRails
[16:59:57] chouhoul_: has joined #RubyOnRails
[17:01:24] philcris_: has joined #RubyOnRails
[17:01:31] jamesrward: has joined #RubyOnRails
[17:02:37] ogpastal_: has joined #RubyOnRails
[17:02:49] gerep_: has joined #RubyOnRails
[17:03:05] jfarmer: has joined #RubyOnRails
[17:04:22] jamesrward: I've generated some models called issue and ally and included issues:references on the ally model. I then added has_many :allies to the issue model. When I try to run my migration to create the allies table I am hitting the following error: ERROR: column "issue_id" referenced in foreign key constraint does not exist Any idea where I went wrong?
[17:05:17] centrx: Sounds like allies does have the referenced column
[17:05:18] tbuehlmann: jamesrward, shouldn't it be "issue:references"?
[17:06:17] jamesrward: tbuehlmann: I was thinking I likely messed up pluralization somewhere. Where would I look to fix it?
[17:06:40] TommyTheKid: Sigma00: well, thanks for pointing me down the road of timestamps, the way that capistrano populates the "release_to" directory (git archive master | tar...) causes all the files to have the same timestamp (within reason). So, at least I know "why"
[17:07:08] jamesrward: Ally model has belongs_to :issue so I think the generator caught the puralization mistake.
[17:07:13] Anakat__: has joined #RubyOnRails
[17:07:26] tbuehlmann: check the schema then
[17:07:53] Anakat__: has joined #RubyOnRails
[17:08:02] jamesrward: create_table "issues", force: :cascade do |t|
[17:08:02] jamesrward: t.string "name"
[17:08:02] jamesrward: t.datetime "created_at", null: false
[17:08:04] jamesrward: t.datetime "updated_at", null: false
[17:08:19] endenwer: has joined #RubyOnRails
[17:08:21] _djbkd: has joined #RubyOnRails
[17:09:11] Anakat__: has joined #RubyOnRails
[17:09:15] tbuehlmann: please don't paste code in here
[17:09:19] tbuehlmann: also, wrong table
[17:10:05] jamesrward: sorry. There is nothing in the schema.rb for the allies table.
[17:10:39] tbuehlmann: the migration errored out, so no wonder
[17:10:47] jamesrward: I assume that was because the migration failed
[17:10:48] tbuehlmann: can you gist the allies migration?
[17:11:22] jamesrward: https://gist.github.com/jamesrward/edb10e5a2f273d9fe4d8
[17:11:26] GarethAdams: has joined #RubyOnRails
[17:11:41] jottr: has joined #RubyOnRails
[17:11:59] tbuehlmann: there it is, "t.references :issues"
[17:12:05] tbuehlmann: that should be singular
[17:12:41] jamesrward: Bingo. Thanks for your help.
[17:12:44] centrx: If have a website with small width, for both desktop and mobile. Should it be centered to the left of the page, or centered in the middle?
[17:12:46] artto: has joined #RubyOnRails
[17:14:18] chintanparikh: has joined #RubyOnRails
[17:15:11] podman: I'm having trouble with AR connection pools and threads. It seems to take up to 8 seconds for a ActiveRecord::Base.connection_pool.with_connection to yield. Any idea why it would be so slow? https://gist.github.com/podman/1ec55dcfeec6ee377fcc
[17:15:18] allcentury: has joined #RubyOnRails
[17:15:33] Zadrel: hello there! i have a Highlight model and in it's _form i need to populate with all the products in Product model, then the value should be the route for the selected product (#=><value="<%product_path(selected_id)%>), anyone could help me with this? i'm really confused on hw collection_select works. already looked in APIDock and a few questions in StackOverflow that didn't help me
[17:15:47] moeabdol: has joined #RubyOnRails
[17:16:47] endenwer: has left #RubyOnRails: ()
[17:16:55] rhizome: centrx: not sure what "centered to the left" means, but it depends on the content
[17:17:09] garrypolley: has joined #RubyOnRails
[17:17:10] centrx: yeah placed on the left I mean
[17:17:33] centrx: Content is just some bullet points and a header
[17:17:33] rhizome: left-justified
[17:18:03] hnanon: This scope is supposed to limit the query to the logged in user's records: https://gist.github.com/anonymous/8977c4081d5cb9655365
[17:18:07] mcantor: has joined #RubyOnRails
[17:18:19] hnanon: It gives me the error: wrong number of arguments (0 for 3)
[17:18:45] mcantor: What exactly is the "class_name" in Rails generator definitions supposed to be?
[17:19:03] iliketurtles: has joined #RubyOnRails
[17:19:06] mcantor: Is it always the final positional argument provided to the generator on the command line?
[17:19:20] vickleton: has joined #RubyOnRails
[17:20:42] centrx: rhizome, is that left-justified, you are saying that is the way it should be?
[17:21:00] dopie: has joined #RubyOnRails
[17:21:01] Zadrel: hnanon: i'm a newbie in RoR but everytime i get this error it's becouse i'm putting the wrong number of arguments. in your case there's a parenthesis with 3 arguments inside where should be no parenthesis at all
[17:21:31] hnanon: Which line?
[17:22:22] Zadrel: hnanon: isn't it being described in your error screen?
[17:22:29] hnanon: You mean I shouldn't list them as arguments?
[17:22:29] Zadrel: hnanon: odd..
[17:23:36] Zadrel: hnanon: maybe
[17:23:42] Zadrel: hnanon: !try
[17:24:28] Zadrel: hnanon: i may be wrong but i gess the error is being generated in the first line, unless your error screen syas otherwise
[17:24:34] walidvb: has joined #RubyOnRails
[17:24:38] Brozo: has joined #RubyOnRails
[17:25:21] hnanon: It is from the first line.
[17:25:23] ankhers: has joined #RubyOnRails
[17:25:33] hnanon: If I remove the arguments: error: SQLite3::SQLException: unrecognized token: ":": SELECT COUNT(*) FROM "dealer_commissions" LEFT OUTER JOIN carrier_commissions ON dealer_commissions.phone_id...
[17:25:45] rhizome: centrx: left-justified is aligned along the left edge of the column
[17:26:07] rhizome: if you have bullets, they should be in a straight line
[17:26:26] bmurt_: has joined #RubyOnRails
[17:26:46] bmurt_: has left #RubyOnRails: ()
[17:26:58] Zadrel: hnanon: search in the console for the SQL query and look if there's a ":" in the wrong place.
[17:26:58] iamjarvo: has joined #RubyOnRails
[17:27:20] bmurt: has joined #RubyOnRails
[17:28:07] gaustin: has joined #RubyOnRails
[17:28:08] Zadrel: hnanon: i can't see why it's generating the ":" becouse i don't use scopes yet. but you shoud trust RoR error screens, it always says where the shit is happening :)
[17:28:40] centrx: rhizome, Thank you
[17:28:54] Zadrel: i have a Highlight model and in it's _form i need to populate with all the products in Product model, then the value should be the route for the selected product (#=><value="<%product_path(selected_id)%>), anyone could help me with this? i'm really confused on hw collection_select works. already looked in APIDock and a few questions in StackOverflow that didn't help me
[17:29:35] _seanc_: has joined #RubyOnRails
[17:29:49] hnanon: sql: https://gist.github.com/anonymous/e4194eccdd903fa2d0ab
[17:30:15] kies: has joined #RubyOnRails
[17:30:40] baweaver: has joined #RubyOnRails
[17:30:52] longdcr: has joined #RubyOnRails
[17:31:33] ankhers: has joined #RubyOnRails
[17:31:48] Zadrel: hnanon: here i gess --customer_id: current_user.customer.id, created_at: start_date..end_date-- see the ":" there? i guess ":" is not recognized as a comparator, try to use a comparator that fits what you're trying to do :)
[17:32:02] jamiely: has joined #RubyOnRails
[17:32:31] centrx: SQL fragment != ActiveRecord parameters
[17:32:39] maz-dev: has joined #RubyOnRails
[17:33:02] RegulationD: has joined #RubyOnRails
[17:33:50] Rodya_: has joined #RubyOnRails
[17:34:07] towski_: has joined #RubyOnRails
[17:34:23] rhizome: centrx: np
[17:34:30] chintanparikh2: has joined #RubyOnRails
[17:35:21] rhizome: Zadrel: it makes no sense to put a route in a select value
[17:35:30] mikecmpbll: has joined #RubyOnRails
[17:36:43] walidvb: has joined #RubyOnRails
[17:36:54] hnanon: Zadrel: Thanks, I'll keep trying.
[17:36:56] Zadrel: rhizome: that's what i thought to do becouse i neet do put a banner in the site, and when i click on it, i'll be directed to the highlighted product in the banner.
[17:37:19] Zadrel: hnanon: no worries, sorry for not being able to be more helpful
[17:38:50] maz-dev_: has joined #RubyOnRails
[17:39:37] lapide_viridi: has joined #RubyOnRails
[17:40:25] SeanLazer: has joined #RubyOnRails
[17:41:03] Lightsword: has joined #RubyOnRails
[17:42:06] Sigma00: hnanon: dc.rb, line 4, your last WHERE should not be a string
[17:42:15] Sigma00: not if you wanna write it that way
[17:42:34] DoctorMonocular: has joined #RubyOnRails
[17:42:39] thebatu1: has joined #RubyOnRails
[17:42:42] syzygy_: has joined #RubyOnRails
[17:44:51] rhizome: i don't understand how a select relates to clicking on a banner
[17:46:07] walidvb: hi guys, i'm getting a very weird behaviour.. 1 specific action in a controller loses current_user(or sets it to nil)
[17:46:26] walidvb: any hint? i'm currently removing all my before_filters
[17:47:26] rhizome: based on that description, no idea.
[17:48:45] RegulationD: has joined #RubyOnRails
[17:49:07] barnex: so, display logic in sql queries is fine, right?
[17:49:18] Hates_: has joined #RubyOnRails
[17:49:23] barnex: (say yes, because I was drunk with SQL power yesterday and don't want to fix it)
[17:49:28] centrx: Display logic belongs in the view
[17:49:31] centrx: Presentation
[17:49:49] barnex: (SUM (nalezn + opl_za_wyd + opl_spec) / 100 || '.' || to_char(SUM (nalezn + opl_za_wyd + opl_spec) % 100, 'FM00')) AS combined
[17:49:52] barnex: it's just too pretty
[17:49:54] barnex: and readable
[17:50:15] barnex: that query has like only 1000 chars
[17:50:32] barnex: I don't want someone maintaining this code to miss on all that beauty
[17:50:56] barnex: ok, I'll fix it, but you're literally hitler centrx :<
[17:51:06] centrx: Store the query itself in a varchar column, then you can add 7000 more chars to it
[17:51:11] fgo: has joined #RubyOnRails
[17:51:19] barnex: now we're talking
[17:51:35] Spami: has joined #RubyOnRails
[17:51:59] barnex: on a more serious note though, since I have to have the query anyway
[17:52:08] barnex: is it fine to rely on the order of fields in it?
[17:52:19] hahuang65: has joined #RubyOnRails
[17:52:34] sandelius: has joined #RubyOnRails
[17:52:37] centrx: barnex, If you add an ORDER BY clause it is
[17:52:47] barnex: centrx: sorry, I mean column order
[17:52:52] iamjarvo: has joined #RubyOnRails
[17:52:52] barnex: not row order
[17:52:53] jkwood: That's only row order
[17:53:15] barnex: I guess it's not really fine if I have to ask that question :<
[17:53:34] jkwood: barnex: If you define the columns in the order you want them within the select, then it should be.
[17:53:34] barnex: someone might change the query to produce the same results in a different order and break the code
[17:53:51] barnex: while I can easily avoid it by just using the column names
[17:53:51] jkwood: select * should not be relied upon.
[17:53:53] centrx: You want to specify the columns in the query, to anticipate changes to the schema
[17:54:00] jkwood: Precisely.
[17:54:11] barnex: they are specified, that's not the thing
[17:54:19] barnex: and this schema hasn't changed for ten years :P
[17:54:38] barnex: because people using it think it's easier to just reasign a new role for old fields
[17:54:40] jkwood: That's a good way to get it changed the day after you go to prod.
[17:54:59] jkwood: In a database? Ugh. That's terrible.
[17:55:08] jkwood: (Not that doing it in, say, a VSAM is great...)
[17:55:12] barnex: p_co_value now holds time :3
[17:55:39] barnex: and version2 is for date obviously
[17:55:59] barnex: apparently at some point everything became version2 and it's no longer needed
[17:56:03] barnex: that's called recycling :D
[17:56:10] chrisja: has joined #RubyOnRails
[17:56:29] jkwood: It's a database! You create a new column/table and drop the old!
[17:56:45] jkwood: Recycling is, in this case, wasteful of developer resources.
[17:56:51] jenrzzz: has joined #RubyOnRails
[17:57:43] edwinvdgraaf: has joined #RubyOnRails
[17:58:12] spyderman4g63: has joined #RubyOnRails
[17:58:12] simplyianm: has joined #RubyOnRails
[17:59:56] sdwrage: has joined #RubyOnRails
[18:00:09] simplyianm: has joined #RubyOnRails
[18:03:20] baweaver: has joined #RubyOnRails
[18:04:04] hamster88: I have a question ..
[18:04:11] barnex: ask it ;P
[18:04:26] hamster88: let me create a gist first
[18:04:48] jkwood: But first, let me take a selfie.
[18:05:16] TommyTheKid: constipation of the brain, diarrhea of the mouth (fingers)
[18:05:29] sp1rs: has joined #RubyOnRails
[18:06:07] meat147: has joined #RubyOnRails
[18:06:07] edgarjs: has joined #RubyOnRails
[18:06:40] hamster88: ok here is the question. I have created a post controller defined everything that will be required. I created a post, but it is not showing in the show page. gist : https://gist.github.com/thedesignable/4b090c0d27c360ca83a5
[18:06:44] SeanLazer: has joined #RubyOnRails
[18:07:09] bhorn1: has joined #RubyOnRails
[18:07:20] hamster88: I mean the created post is not showing up when i go to let's say http://localhost:3000/posts/3
[18:08:11] Zadrel: rhizome: i figured out what was wrong. the form object was, for some reason, preventing me from using the collection_select. i removed the standard "f." from the collection_select and it rendered properly :)
[18:08:31] kernkw: has joined #RubyOnRails
[18:08:43] Zadrel: rhizome: now the step 2, i guess i'll just put the id from gotten from the select in a dinamic route in the view :)
[18:09:06] Zadrel: rhizome: now the step 2, i guess i'll just put the id gotten from the select in a dinamic route in the view :) *
[18:09:46] walidvb: has joined #RubyOnRails
[18:11:04] Zadrel: hamster88: i guess that if you transfer the content from find_post method to the show method it'll work
[18:11:15] DoctorMonocular: has joined #RubyOnRails
[18:11:51] hamster88: but i would need that find_post method for others too, that's why i have added it to before action at the top
[18:12:25] Zadrel: hamster88: also: i use the ".find_by_id(params[:id])" in all my show methods, it's Rails' standard from "rails g scaffold"
[18:12:49] simplyianm: has joined #RubyOnRails
[18:12:49] Zadrel: hamster88: never had a problem with that
[18:13:24] hamster88: it will be duplicating the code eh
[18:14:04] Zadrel: hamster88: the Rails' standard scaffold genertes with "duplicated" code
[18:14:20] hamster88: Zadrel, i tried doing this way, def show @post = Post.find(params[:id]) end <== that didn't worked
[18:14:27] jshepherd: has joined #RubyOnRails
[18:15:07] Zadrel: hamster88: try @post = Post.find_by_id(params[:id])
[18:15:18] hamster88: let me give it a shot
[18:15:48] tvw: has joined #RubyOnRails
[18:15:59] Zadrel: hamster88: in either method, maybe the error is in ".find", change it to ".find_by_id" even if you don't change methods
[18:16:22] hamster88: Zadrel, well both didn't worked
[18:16:33] Zadrel: hamster88: oh..
[18:17:05] netzfisch: has joined #RubyOnRails
[18:17:48] surrealanalysis: has joined #RubyOnRails
[18:18:10] hamster88: Zadrel, wait.. i have checked the database (using mysql) the data is not being sent
[18:18:23] hamster88: everything is null xD
[18:18:37] x1337807x: has joined #RubyOnRails
[18:18:59] coin3d: has joined #RubyOnRails
[18:19:11] Zadrel: hamster88: in my guts i knew your gist's code was right. ish :P
[18:19:35] x1337807x: has joined #RubyOnRails
[18:19:44] hamster88: Zadrel, i have just added the form file too would you mind taking a look at it?
[18:19:58] hamster88: https://gist.github.com/thedesignable/4b090c0d27c360ca83a5
[18:20:42] philcris_: has left #RubyOnRails: ()
[18:20:58] philcris_: has joined #RubyOnRails
[18:21:23] hamster88: nvm worked :D
[18:21:30] Zadrel: hamster88: lol
[18:21:37] Zadrel: hamster88: what you did?
[18:22:17] philcris_: has left #RubyOnRails: ()
[18:22:35] qejk: has joined #RubyOnRails
[18:22:35] philcrissman: has joined #RubyOnRails
[18:22:43] hamster88: Zadrel, i just deleted those null posts, and then added a new post :D
[18:22:48] hamster88: Zadrel, that worked hahaha
[18:22:59] erich: has joined #RubyOnRails
[18:23:06] vim_shimm: has joined #RubyOnRails
[18:23:14] arup_r: why the last value as `nil` ? http://apidock.com/rails/ActionView/Helpers/FormHelper/check_box
[18:23:19] philcrissman: hamster88: the @post = Post.new{post_params} line doesn't look to me like it should work at all...
[18:23:24] arup_r: check_box("puppy", "commands", {:multiple => true}, "sit", nil)
[18:23:44] hamster88: philcrissman, , all the code i am using there on gist is now working :D
[18:24:13] hamster88: philcrissman, I made change to that line i used paranthesis instead of those ugly brackets :D
[18:24:15] philcrissman: hamster88: well, you don't need or want curly braces there. Just, you know. Trying to help.
[18:25:04] hamster88: philcrissman, thanks for the help bud :) i figured that out before you pointed it out :D and that could be the one causing problem hehe
[18:25:35] philcrissman: That was causing the problem
[18:26:00] philcrissman: I had tried to mention it earlier but I had to log out and back in because my nick wasn't registered on this irc client.
[18:26:11] philcrissman: you weren't saving anything in your posts.
[18:26:50] x1337807x: has joined #RubyOnRails
[18:26:59] gerep_: has left #RubyOnRails: ()
[18:27:25] hamster88: thanks very much for explaining it out phil ;)
[18:27:59] philcrissman: welll... I didn't explain it, but anyways.
[18:28:05] hamster88: I am kinda new to this ruby thing, and don't really understand much of this trying out apps with trial and error.
[18:28:12] _seanc_: has joined #RubyOnRails
[18:28:37] hamster88: mostly by checking on videos.
[18:28:45] philcrissman: you were passing a block to your #new method, and the only thing in the block was your post_params hash. So, that was doing nothing.
[18:29:16] philcrissman: hamster88: no worries, we're all new at some point. Spend a bit of time doing just Ruby, it will help.
[18:29:49] Scripore: has joined #RubyOnRails
[18:29:56] philcrissman: Or, if you're going to follow videoes/tutorials, make sure your code actually looks like theirs. :)
[18:31:47] mordocai: has joined #RubyOnRails
[18:32:01] brain_shim: has joined #RubyOnRails
[18:32:20] zorak8: has joined #RubyOnRails
[18:32:43] foucist: has joined #RubyOnRails
[18:32:53] hamster88: philcrissman, this video i am following, all code is written in haml and i am trying to make this whole app in erb. Though i should be more aware to not to make errors :D
[18:32:54] kernkw: has joined #RubyOnRails
[18:33:17] philcrissman: hamster88: there's no haml or erb in the controller :)
[18:34:15] hamster88: philcrissman, not in ruby controller the html's i am talking about :D, p.s video resolution is crappy haha :D and thats the reason why () looks like {} :D
[18:34:54] brain_shim: I just took over a project locked to ruby 2.0.0 and Rails 4.0.3. Any particular reason I shouldn't bring it up to 2.2.2 and Rails 4.2?
[18:35:04] Joshmfrankel: has joined #RubyOnRails
[18:35:12] simplyianm: has joined #RubyOnRails
[18:35:19] erich: has joined #RubyOnRails
[18:35:34] Rodya_: has joined #RubyOnRails
[18:35:51] danshultz: has joined #RubyOnRails
[18:36:47] philcrissman: hamster88: aha. Also a good reason to spend an afternoon learning Ruby syntax; :) Anyways, have fun.
[18:38:16] brain_shim: I know that it's highly contingent on my Gemfile, and what things are version locked to, I'm just trying to suss whether I'm willfully walking into a minefield or not.
[18:38:24] sleungcy: has joined #RubyOnRails
[18:39:27] hamster88: philcrissman, a question.. what is a private method and the method's defined otherwise?
[18:39:29] philcrissman: brain_shim: I haven't done that particular upgrade... My hunch would be that it shouldn't be too painful as far as ruby and rails themselves.. But yeah, that may depend on everything else in the gemfile.
[18:40:00] smola1022: has joined #RubyOnRails
[18:41:07] sleungcy: Is there a way to reopen / redefine a private instance method of a class? I want to stub behavior in my tests
[18:41:18] philcrissman: hamster88: private methods can only be called without a receiver, that is, within the class itself. If methods are defined before the `private` keywork, they're public by default. There are also such things as protected methods; protected methods can be called by any instance of a class or subclasses of that class.
[18:41:27] michael_mbp: has joined #RubyOnRails
[18:41:56] foucist: has joined #RubyOnRails
[18:41:57] philcrissman: sleungcy: same as you'd redefine any other method, I'm pretty certain...?
[18:42:46] hamster88: philcrissman, thank you for explaining :)
[18:42:49] ght: Question: As recommended in here last night, I'm using the cocoon gem to allow users to dynamically add rows to an html table we provide in a view. The issue is, the gem requires you utilzie the nested-fields div tag for the partial you're dynamically adding, and the problem is, when we remove the <div> line from the partial, the new html table rows appear properly within the grid, but when the div is present in the partial, when a user clicks "ad
[18:43:06] ght: So the <div class='nexted-fields'> call within the partial is breaking the formatting.
[18:43:18] XThief: has joined #RubyOnRails
[18:43:39] ght: We've tried adding style="display: inline" to the <div> decleration within the partial to no avail.
[18:43:44] jniziol: has joined #RubyOnRails
[18:43:53] philcrissman: sleungcy: yeah, just tried this in the console, you just, open the class and redefine the method. You'll want to still include the `private` keyword.
[18:44:02] baweaver: What happens if MySQL is pegged out and a query is made? Does it raise an error?
[18:45:12] ght: brain_shim: I'd leave the major versions the same (2.2, 4.0), but upgrade the minor versions. I believe the latest 4.0 is 4.0.13.
[18:45:26] ght: Otherwise yes, you're essentially installing a new version of Rails and that can break your code, as well as gem compatability.
[18:45:45] brain_shim: ght: Gotcha. Thanks!
[18:46:27] Maya_: has joined #RubyOnRails
[18:48:09] crdpink: has joined #RubyOnRails
[18:48:32] simplyianm: has joined #RubyOnRails
[18:49:12] DukeDave: has joined #RubyOnRails
[18:49:52] spyderman4g63: has joined #RubyOnRails
[18:52:10] jfarmer: has joined #RubyOnRails
[18:52:15] hamster88: if i have this <%= link_to "Edit", edit_post_path(@post) %> here (@post) means the current post .. right?
[18:52:48] jottr: has joined #RubyOnRails
[18:52:56] simplyianm: has joined #RubyOnRails
[18:53:19] drale2k: has joined #RubyOnRails
[18:53:55] Papierkorb: hamster88: @post refers to the instance variable called @post, so if you've set @post to the 'current post' in your controller, then you're correct
[18:54:58] barnex: how about having a module in app/modules and having it perform both view and model functions?
[18:55:01] moeabdol: has joined #RubyOnRails
[18:55:02] barnex: in different classes
[18:55:17] Ergo: has joined #RubyOnRails
[18:55:21] barnex: because there's a lot of logic in my prawn display stuff already
[18:56:41] Papierkorb: Sounds not that great to me. You can put helper methods for view purposes in the classes helper module though
[18:57:24] Pathfinder: has joined #RubyOnRails
[18:58:11] Sevelia: has joined #RubyOnRails
[18:59:35] Synthead: has joined #RubyOnRails
[19:00:26] Synthead: in a model method, if I do all.map, it runs new queries against the db instead of the already-fetched data. What's going on here?
[19:00:55] asheinfeld: has joined #RubyOnRails
[19:03:23] patcable: has joined #RubyOnRails
[19:03:28] jkamenik: has joined #RubyOnRails
[19:05:05] hamster88: if i want to have an Admin user, do you guys suggest setting up an admin view? (i am using devise for generating admin user)
[19:05:37] jkamenik: has joined #RubyOnRails
[19:05:38] jottr_: has joined #RubyOnRails
[19:05:57] patcable: hey there. this is probably stupid, but -- i have a form that even though i've specified the params to permit, I still get a ForbiddenAttributesError. https://gist.github.com/patcable/dfd4758d870b7e03f740
[19:06:01] walidvb: has joined #RubyOnRails
[19:06:33] patcable: am i missing something glaringly obvious? I call all the params I'm trying to use via adduser_params
[19:07:46] maz-dev: has joined #RubyOnRails
[19:08:17] patcable: hamster88: I use the role_model gem and create a roles_mask attribute to specify a user as an admin
[19:09:06] centrx: has joined #RubyOnRails
[19:09:42] sleungcy: patcable: do you still have attr_accessible in your model?
[19:09:55] spyderman4g63: has joined #RubyOnRails
[19:09:59] TheNet: is there a definitive guide to deploying with capistrano?
[19:10:09] foucist: has joined #RubyOnRails
[19:10:27] patcable: sleungcy: so, I do -- because some of the variables I'm passing arent in the model itself
[19:10:42] patcable: sleungcy: I may be able to do this differently, though
[19:10:52] hamster88: patcable, is that better than devise?
[19:11:04] jfarmer: has joined #RubyOnRails
[19:11:12] sleungcy: patcable: maybe you should use attr_accessor instead
[19:11:21] patcable: hamster88: i still use devise, this just helps
[19:11:52] weaksauce: TheNet not really. what's stopping you right now?
[19:13:38] syzygy_: has joined #RubyOnRails
[19:14:11] patcable: sleungcy: sorry, I have attr_accessor, not attr_accessible. they're so similarly named :)
[19:14:51] TheNet: weaksauce choosing the right guide
[19:15:34] edwinvdgraaf: has joined #RubyOnRails
[19:16:03] sleungcy: patcable: thats very strange! I am out of ideas
[19:16:04] hamster88: how do i give the admin user right to current user? the devise document page shows that i need to use this "current_user.update_attribute :admin, true" not sure where to do that ?
[19:16:44] weaksauce: TheNet well the official docs are pretty abysmal. deploying rails applications has a pretty good explanation of cap deploying. https://leanpub.com/deploying_rails_applications
[19:17:07] weaksauce: aww they left already
[19:17:34] jniziol: hamster: depends , do you want to give admin rights to every ???current_user????
[19:17:44] jniziol: probably not i would assume
[19:17:57] platosha: has joined #RubyOnRails
[19:19:31] lapide_viridi: has joined #RubyOnRails
[19:20:46] maz-dev: has joined #RubyOnRails
[19:21:03] patcable: sleungcy: its a cancancan issue. hooray!
[19:23:01] patcable: cancancan makes you name your private strong params function the same as the class
[19:24:30] barnex: Papierkorb: welllllll, I have a bunch of columns to format and the whole affair is going to look ugly with helper methods
[19:24:31] jottr: has joined #RubyOnRails
[19:24:49] dstarh: has joined #RubyOnRails
[19:24:59] barnex: and if I just make a class for it I could say in declarative way 'that field looks like this'
[19:25:08] barnex: and reuse the class for many reports I need to do
[19:25:21] Mesta: has joined #RubyOnRails
[19:25:28] barnex: which all need simmilar formatting, just on different columns
[19:25:51] Papierkorb: barnex: Ah. Well, I won't stop you, if MVC hurts too much then throw it away
[19:26:36] asheinfeld: has joined #RubyOnRails
[19:27:06] platosha: has joined #RubyOnRails
[19:27:16] barnex: I don't think this is not MVC, the views are still going to orchestrate the display thing
[19:27:20] barnex: just in a readable manner
[19:27:32] barnex: while model does its thing and deals with data
[19:27:56] joaomdmoura: has joined #RubyOnRails
[19:29:24] jniziol: When I feel like I???m using my models for a bunch of view related logic, I would probably consider using a decorator
[19:30:18] pjammer: has joined #RubyOnRails
[19:30:41] barnex: jniziol: you mean the pattern? Or is there some railsy way to do decorators?
[19:30:50] jniziol: yes and yes
[19:30:54] jniziol: draper gem
[19:30:57] momomomomo: has joined #RubyOnRails
[19:31:32] thebatu1: has joined #RubyOnRails
[19:32:33] bluish: has joined #RubyOnRails
[19:32:34] barnex: I fail to see what that gem does except using model.decorate instead of SomeDecoratorClass(model)
[19:32:58] barnex: I don't feel like it's gemworthy for me, I want to keep my stuff simple as possible
[19:33:54] barnex: and it actually limits you, since I don't see a way to make those decorators inherit some parts of themselves
[19:34:03] barnex: and common functionality has to be either in helpers or mixins
[19:34:08] Geffy: has joined #RubyOnRails
[19:34:14] Mesta: has joined #RubyOnRails
[19:35:35] jniziol: barnex: fair enough
[19:36:42] ohcibi: has joined #RubyOnRails
[19:38:15] ProteusX: has joined #RubyOnRails
[19:38:26] barnex: also I feel like there's limit to how much automagic is good. When someone else sees this code and isn't aware of the gem he's going to look for the .decorate method in model. Then in railsapi. And then google it. And all it really saved you was one require and two lines.
[19:38:40] momomomomo: has joined #RubyOnRails
[19:39:01] barnex: thanks anyway, I guess I now have better idea of what I'm going to do.
[19:39:18] jfarmer: has joined #RubyOnRails
[19:39:41] Mesta: has left #RubyOnRails: ()
[19:41:15] benhuda: has joined #RubyOnRails
[19:42:19] arup_r: How to write Work.where("roles ? ?", "admin") double `?` not woeking JSONB datatype
[19:42:46] simplyianm: has joined #RubyOnRails
[19:42:52] barnex: Work.where("roles ? ?", ["admin", "admin") should do the trick?
[19:42:58] barnex: Work.where("roles ? ?", ["admin", "admin"]) should do the trick?
[19:43:23] barnex: if you want admin in both of those binds. Otherwise I don't know what you want.
[19:44:04] tubbo: has joined #RubyOnRails
[19:44:34] cryptocronus: has joined #RubyOnRails
[19:45:23] arup_r: `? ?` is throwing some error
[19:45:44] barnex: well, can you paste the error? It might be helpful :3
[19:46:10] arup_r: and `?` don;t take array I thik http://www.postgresql.org/docs/9.4/static/functions-json.html
[19:46:48] barnex: well, it's not a postgres function you'r calling, right? It's a rails one?
[19:46:52] cryptocronus: i keep running into this pattern: i have a boolean attribute on a model (eg. active, approved) that defaults to false. The user can take an action in the UI (eg. activate! or approve!) which will update the attribute to true. I want to monitor these attributes and trigger a method when they flip states. I???ve been doing this in an after_update callback that monitors the attribute_changed? to call the method.. is there a better way to do
[19:47:08] Coldblackice: has joined #RubyOnRails
[19:47:14] cryptocronus: for example: after_update :activate, if: Proc.new { |campaign| campaign.active? && campaign.active_changed?}
[19:47:16] cryptocronus: something like that
[19:48:13] barnex: arup_r: http://apidock.com/rails/ActiveRecord/QueryMethods/where
[19:48:49] barnex: arup_r: it takes both array and just a list of things, point is, if you have two '?' and want both replaced, you need two arguments after the statement
[19:49:14] jcromartie: has joined #RubyOnRails
[19:49:42] rhizome: cryptocronus: isn't activate what is occurring? not sure why you'd name a callback that as well
[19:49:54] arup_r: `?` is the operator.. and and `?` is for replacement
[19:50:04] cryptocronus: rhizome: why not? it will handle activation
[19:50:27] maz-dev: has joined #RubyOnRails
[19:50:29] rhizome: isn't that happening in the thing that occurs before the callback?
[19:50:39] hamster88: when i am trying to get the name of the user for post i am getting undefined method 'name' for nil:NilClass, here is the piece of code that is being used "<p><%= @post.user.name %></p>"
[19:50:54] cryptocronus: it???s essentially handling the side effects of being activated
[19:51:01] cryptocronus: all that???s happening before is active is set to true
[19:51:14] rhizome: i guess essentially i don't understand the order of operations
[19:51:23] cryptocronus: i need to send email, schedule a couple jobs on activation
[19:51:42] cryptocronus: so im detecting activation my monitoring when active gets set to true
[19:51:48] rhizome: service class and do it all in the controller
[19:51:53] dopie: has joined #RubyOnRails
[19:52:24] cryptocronus: really? I???ve been trying to avoid putting logic like that in controller
[19:52:29] sandelius: has joined #RubyOnRails
[19:52:50] chouhoulis: has joined #RubyOnRails
[19:52:52] cryptocronus: just feels like it belongs in the model, easier to test too
[19:53:03] rhizome: next question will be why you're coupling your model to these other classes
[19:53:15] kadoppe: has joined #RubyOnRails
[19:53:54] spyderman4g63: has joined #RubyOnRails
[19:53:57] cryptocronus: i guess because i dont know how else to structure it
[19:54:30] chouhoulis: has joined #RubyOnRails
[19:54:31] tvw: has joined #RubyOnRails
[19:54:57] rhizome: service class. if @whatever.activate!; ProcessActivation.call(@whatever); else ....
[19:55:24] rhizome: TIMTOWTDI lives here
[19:56:21] cryptocronus: yeah figured, i do like hearing how (hopefully more) experienced people structure things
[19:56:25] FCser: has joined #RubyOnRails
[19:56:41] leafac: has joined #RubyOnRails
[19:57:43] hamster88: figured out. :D resolved xD
[19:57:45] arup_r: barnex: u got me ?
[19:57:50] workmad3: has joined #RubyOnRails
[19:57:54] markalanevans: has joined #RubyOnRails
[19:58:14] hnanon: The syntax for this scope is not correct: https://gist.github.com/anonymous/8977c4081d5cb9655365
[19:58:44] barnex: arup_r: yeah, I just don't know the answer.
[19:58:48] hnanon: I'm trying to limit my queries to the logged in user.
[19:58:54] barnex: Some guy on the internets suggests using the other search operator.
[19:59:02] markalanevans: When in production mode, even if my environments/production.rb :: config.log_level = :debug
[19:59:04] barnex: arup_r: and that's the best I've got for you, sorry.
[19:59:18] simplyianm: has joined #RubyOnRails
[19:59:22] yfeldblum: has joined #RubyOnRails
[19:59:22] barnex: maybe try escaping the questionmark, but I don't know if it'll do anything.
[19:59:27] markalanevans: the production.log file doesn???t spit out all the errors
[19:59:48] markalanevans: but if i change my apache RailsEnv=production the logs have the errors
[20:00:14] markalanevans: Is there some other setting to ensure that all errors are written to the logs when on production?
[20:00:35] iamjarvo: has joined #RubyOnRails
[20:00:53] yaymukund: has joined #RubyOnRails
[20:01:10] kurtf: has joined #RubyOnRails
[20:01:13] TheNet: has joined #RubyOnRails
[20:01:24] momomomomo: has joined #RubyOnRails
[20:01:52] uris: has joined #RubyOnRails
[20:02:08] garrypolley: has joined #RubyOnRails
[20:03:12] tubbo: markalanevans: you're not in production mode unless you set RailsEnv=production
[20:03:50] jgpawletko: has joined #RubyOnRails
[20:03:52] markalanevans: tubbo: In my situation, i???m saying that I have RailsEnv=production in my vhost file. And i also have environments/production.rb :: config.log_level = :debug
[20:04:06] siddart: has joined #RubyOnRails
[20:04:08] markalanevans: So i would expect all errors to be written to the production log file
[20:04:31] markalanevans: But nothing is written out to it. In particular when there are app errors.
[20:04:39] Pathfinder: has joined #RubyOnRails
[20:04:40] tubbo: markalanevans: i suppose you restart the server after every change to apache configs?
[20:04:41] simplyianm: Do y'all believe in "fat models, skinny controllers"?
[20:04:45] markalanevans: However, if i change RailsEnv=development
[20:04:48] duderonomy: has joined #RubyOnRails
[20:04:51] markalanevans: i see all the errors i???m looking for in the logs.
[20:05:04] Joshmfrankel: has left #RubyOnRails: ()
[20:05:04] markalanevans: tubbo: yes. touch tmp/restart
[20:05:07] tubbo: simplyianm: no. models are for data modeling. don't put bullshit in your model. use regular classes/modules for biz logic.
[20:05:18] tubbo: markalanevans: it's touch tmp/restart.txt fwiw :)
[20:05:20] simplyianm: tubbo: could you elaborate?
[20:05:28] markalanevans: i just left that off
[20:05:43] markalanevans: What else needs to be done to get full errors in my logs?
[20:05:48] simplyianm: Where would i put a function like user.purchaseItems()
[20:05:57] paulcsmith__: has joined #RubyOnRails
[20:06:09] simplyianm: would I make a "PaymentProcessor" class
[20:06:21] tubbo: markalanevans: that should be it...there might be something else going on here.
[20:06:29] simplyianm: then do PaymentProcessor.purchaseItems(user, items)?
[20:06:33] markalanevans: simplyianm: you should consider having a few classes to do what you are talking about.
[20:06:48] simplyianm: markalanevans: is what I just said a good example of how I should handle it?
[20:06:49] markalanevans: For example a class to handle payments in general.
[20:07:03] simplyianm: markalanevans: but is using a lot of static methods fine?
[20:07:07] markalanevans: and then a class that its specific for purchasing items.
[20:07:22] tubbo: simplyianm: using static (class) methods is similar to using globals.
[20:07:26] simplyianm: Or would I use something like UserPaymentProcessor.new(user)
[20:07:29] tubbo: they don't encapsulate your state very well
[20:07:37] simplyianm: and abstract over the user
[20:07:45] markalanevans: simplyianm: what do these thigns need to do?
[20:07:53] simplyianm: markalanevans: I have a bunch of payment related functions
[20:07:58] simplyianm: like init_stripe
[20:08:01] tubbo: but they're great for defining a nice interface, like you might do Session.authenticate(user, password) which just does new(user: user, password: password).authenticate!
[20:08:05] simplyianm: or purchase_items
[20:08:08] jwaldrip: has joined #RubyOnRails
[20:08:19] tubbo: simplyianm: so first of all, those aren't functions. they are methods.
[20:08:20] siddart: has joined #RubyOnRails
[20:08:31] hamster88: When i am trying to click on delete button to delete the post, i can't get it working "<%= link_to "Destroy", post_path(@post), method: :delete, data: { confirm: "Are you sure? "} %>" << this is what i have for delete link
[20:08:35] simplyianm: Sorry i come from JS, my terminology is probably off
[20:08:40] tubbo: a method has the implication of being attached to something. in this case, those methods are attached to a user. and they're just messages to send to a User.
[20:08:58] tubbo: simplyianm: it's kinda like JS but you'll have to learn all the other inheritance techniques in Ruby, like composition and class inheritance
[20:08:59] simplyianm: So should I make a UserPaymentProcessor that encapsulates a user?
[20:09:14] simplyianm: Or how should I group all these random payment related functions?
[20:09:41] tubbo: simplyianm: i would start with modeling the Order, because that's the data point that connects a user with a bunch of purchased items
[20:10:20] edwinvdgraaf: has joined #RubyOnRails
[20:10:22] simplyianm: Well I only have one type of item to purchase
[20:10:40] tubbo: ah, so the "items" in purchase_items refers to quantity?
[20:11:32] simplyianm: tubbo: I was giving an example, but the exact parameters in the function now are "draw, itemData, stripeToken, group"
[20:11:42] simplyianm: where I'm setting the same draw and group for each item
[20:11:46] simplyianm: but each item has its own itemData
[20:11:54] i: has joined #RubyOnRails
[20:11:58] simplyianm: And I also have a stripe token that I need to pass to the method
[20:12:03] simplyianm: It's a very messy way of doing it
[20:12:06] simplyianm: which is why I'm here today
[20:12:19] hamster88: gist here > https://gist.github.com/thedesignable/4b090c0d27c360ca83a5
[20:12:45] simplyianm: so an item is something like { draw: Draw, group: Group, data: itemData[n] } if that makes sense
[20:12:47] Guest28228: has left #RubyOnRails: ()
[20:13:12] tubbo: simplyianm: makes sense if this was javascript ;)
[20:13:13] jniziol: has joined #RubyOnRails
[20:13:46] tubbo: simplyianm: in JS that would just be a object literal, in ruby that's a specific kind of object called a Hash. i would say it makes sense to convert that hash into an object.
[20:14:00] simplyianm: tubbo: So how should I organize my logic? I have like 300ish lines of code related to payments
[20:14:11] simplyianm: which are only used in like 3 controller methods
[20:15:05] markalanevans: simplyianm: are you familiar with singe responsibility ?
[20:15:30] simplyianm: markalanevans: no
[20:15:35] simplyianm: Do you have any recommended reading on that?
[20:15:54] simplyianm: I haven't read any design patterns books yet actually. i've heard that gang of four book and Code Complete were both awesome
[20:15:56] tubbo: simplyianm: my rule of thumb is organize your project in the way that is easiest to test. don't stuff a bunch of logic into a single method, stay away from using a lot of local variables because you can't mock out those values or introspect on them in your tests.
[20:16:04] simplyianm: but are there any things I should read up on to become a better programmer?
[20:16:10] tubbo: simplyianm: !poodr
[20:16:10] helpa: simplyianm: Practical Object Oriented Design in Ruby - http://www.poodr.info/
[20:16:12] markalanevans: simplyianm: read these: https://robots.thoughtbot.com/back-to-basics-solid
[20:16:16] simplyianm: So then an adapter is probably what makes the most sense?
[20:16:29] simplyianm: Like a UserPaymentProcessor class
[20:16:35] simplyianm: that's what makes most sense to me at least
[20:16:45] markalanevans: simplyianm: then read this: https://robots.thoughtbot.com/sandi-metz-rules-for-developers
[20:16:53] tubbo: but what does a UserPaymentProcessor *do*?
[20:17:05] dopie: has joined #RubyOnRails
[20:17:26] simplyianm: tubbo: it processes payments for a user
[20:17:33] simplyianm: so it contains the user.charge method?
[20:17:34] tubbo: pssh what does that even mean
[20:17:38] simplyianm: You're right
[20:17:47] tubbo: does it save credit cards? make transactions?
[20:17:53] tubbo: capture/authorize?
[20:18:01] simplyianm: So it should be even more focused than that
[20:18:13] tubbo: these are all pieces of the billing puzzle, and IMHO having objects that represent each of these parts is very helpful when you need to solve bugs.
[20:18:42] simplyianm: tubbo: But then that's still keeping all the data in the model right?
[20:18:46] simplyianm: just there are more of them
[20:18:49] tvw: has joined #RubyOnRails
[20:19:02] tubbo: no, model != class. you don't necessarily have to store transactions in your database
[20:19:21] tubbo: a lot of people do, though
[20:19:22] simplyianm: so you can have a CreditCard object that doesn't necessarily correspond to a table
[20:19:33] simplyianm: And what it does is it operates on the user object
[20:19:37] simplyianm: but you can treat it like it's a model?
[20:19:43] tubbo: yeah. that CreditCard probably comes from Stripe, and it just boils down to a secure token.
[20:19:49] simplyianm: That's what I did when I used to write Java
[20:20:00] simplyianm: is that a common design pattern?
[20:20:05] tubbo: actually no, it doesn't operate on the User object
[20:20:13] tubbo: it just uses the data in the User object to do its job
[20:20:35] simplyianm: and for User you might have User#credit_cards or something to get all of the cards?
[20:20:43] simplyianm: And that function might generate a bunch of CreditCard objects
[20:20:47] gambl0re: has joined #RubyOnRails
[20:21:05] tubbo: simplyianm: biggest piece of advice i would say is start to think of your apps as a collection of nouns, not verbs.
[20:21:13] simplyianm: That sounds like great advice
[20:21:17] simplyianm: makes a lot of sense
[20:21:40] tubbo: a User makes a Transaction which purchases an Item, and now the User owns that Item. all those capitalized words could be classes, and the words in between them are methods on the classes.
[20:22:00] Geffy: has joined #RubyOnRails
[20:23:09] [H]unt3r: has joined #RubyOnRails
[20:24:12] simplyianm: tubbo: makes sense
[20:24:23] simplyianm: In rails would these go into models/ or would they go into lib/ ?
[20:24:38] Sigma00: you'll very rarely use lib
[20:24:48] simplyianm: so a model doesnt' have to be ActiveRecord then
[20:24:53] ght: Apologies if redundant, but I have a question. I'm using the cocoon gem as recommended here yesterday for allowing users to click "add row" in a view and, when doing so, that dynamitcally adds a row to an HTML table I have within the view. I'm using the "link_to_add_association" helper to allow users to add these rows, as documented. The issue is, when the row is added, all <td> elements from the partial are inserted within the first column in the
[20:24:59] simplyianm: But then that's putting stuff in the models right?
[20:24:59] Sigma00: you could also have a folder called 'services'
[20:25:11] simplyianm: and the point is to move away from using models
[20:25:16] Sigma00: I'm a fan of using app/services to house classes that help me connect models, etc
[20:25:22] ght: If I remove the <div> tag in the partial, it will add the <td> elements properly...
[20:25:59] ght: But of course when that is removed, it breaks the "link_to_remove_association" helper, since that relies on the partial being encompassed within a div with the class "nested-fields" assigned.
[20:26:07] rhizome: i'm guessing your markup is bad
[20:26:09] BlissOfBeing: has joined #RubyOnRails
[20:26:13] Sigma00: show code, ght
[20:26:19] ght: I've been reading and searching online and I can't find anything on this particular issue.
[20:26:29] ght: Ok, pasting code to gist, one second.
[20:26:41] rhizome: not sure the particular issue is anything but proper table markup
[20:26:54] Sigma00: probably table markup, yeah
[20:29:02] umgrosscol: has joined #RubyOnRails
[20:29:34] Scripore: has joined #RubyOnRails
[20:30:39] ght: Sigma00: here, as requested: https://gist.github.com/anonymous/e4457e231062b9eb39a3
[20:30:41] chintanparikh: has joined #RubyOnRails
[20:30:54] byprdct: has joined #RubyOnRails
[20:31:14] rhizome: yeah that's not going to work
[20:31:19] paulcsmith__: has joined #RubyOnRails
[20:31:20] user: has joined #RubyOnRails
[20:31:38] Sigma00: ght: get rid of the div
[20:31:42] Sigma00: put the class on the tr
[20:31:46] ght: So when someone hits "add thing", it displays the partial beneath the existing headers as designed, but it places all the partial <td> fields within one column.
[20:31:53] ght: oh, you can define a class within a tr?
[20:31:56] ght: Very nice, ok.
[20:32:21] baweaver: has joined #RubyOnRails
[20:32:30] ght: My hero.
[20:32:38] byprdct: has joined #RubyOnRails
[20:32:39] ght: Worked perfectly Sigma00, thank you.
[20:33:04] paulcsmith__: has joined #RubyOnRails
[20:34:49] _djbkd: has joined #RubyOnRails
[20:35:07] iliketurtles: has joined #RubyOnRails
[20:36:24] barnex: how do I make my class support methods simmilar to rails's own validate?
[20:36:43] barnex: So the methods that I can call out of other methods?
[20:36:45] SalexW: has joined #RubyOnRails
[20:36:57] barnex: are those just regular methods?
[20:39:13] Sigma00: class methods
[20:39:39] daneo: has joined #RubyOnRails
[20:39:56] barnex: so they'll get called when? On class load?
[20:40:03] bricker: has joined #RubyOnRails
[20:41:38] asheinfeld: has joined #RubyOnRails
[20:42:00] drale2k: has joined #RubyOnRails
[20:42:52] tubbo: simplyianm: sorry i was afk, you can actually make any dir under ./app and that gets autoloaded with the rest of your code
[20:42:53] _djbkd: has joined #RubyOnRails
[20:43:26] barnex: tubbo: really? That's not what I'm experiencing with rails console :o
[20:43:37] barnex: I have some code in app/modules/reporters/report.rb
[20:43:43] barnex: and I have to require it all the time.
[20:43:43] simplyianm: tubbo: np, but should I put non-ActiveRecord models in lib/ or models/
[20:43:46] simplyianm: what makes more sense?
[20:44:04] Radar: Good morning everyone
[20:44:51] tubbo: simplyianm: you can put non-AR models in app/models, as long as they are actually models and not service objects. :)
[20:45:04] simplyianm: tubbo: what's the diff between models and service objects?
[20:45:17] tubbo: simplyianm: you can actually do whatever you want, i'm just trying to give you tips to make your code easier to read
[20:45:50] tubbo: well to me, a model is a class that represents some kind of data persisted elsewhere, like in a database or an external API.
[20:45:52] simplyianm: I am just trying to figure out conventions
[20:46:03] simplyianm: i started rails about 2 months ago haha
[20:46:16] simplyianm: Actually are there any mandatory Rails reading materials I should read?
[20:46:18] tubbo: a service object is basically a class that does a single job.
[20:46:21] simplyianm: Other than style guids
[20:46:28] tubbo: simplyianm: i said POODR earlier, there's also Rails 4 in Action
[20:46:33] tubbo: simplyianm: !r4ia
[20:46:33] helpa: simplyianm: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[20:47:48] barnex: tubbo: do I need a special kind of structure instead of just a .rb file in a random subdir of app for this to work in Rails 4?
[20:48:02] yaymukund: has joined #RubyOnRails
[20:48:09] Lightsword: has joined #RubyOnRails
[20:48:12] tubbo: barnex: not sure, where are you trying to call it?
[20:48:16] simplyianm: this is kind of a related question, but are there any good feeds that I can read full of content on how to write better code?
[20:48:26] barnex: in rails console so far
[20:48:33] simplyianm: And just how to be a better programmer, not stuff like library releases etc
[20:48:40] barnex: tubbo: in rails console: NameError: uninitialized constant Reporters
[20:49:05] simplyianm: And by feeds I mean an HN-like website
[20:49:22] x1337807x: has joined #RubyOnRails
[20:49:28] tubbo: simplyianm: well HN is a good start :)
[20:49:43] simplyianm: That has more than just programming stuff tho
[20:49:51] simplyianm: Is there something just focused on programming?
[20:49:58] x1337807x: has joined #RubyOnRails
[20:50:05] tubbo: https://lobste.rs/ is pretty nice too
[20:50:22] tubbo: one nice thing is tags: https://lobste.rs/t/programming
[20:50:35] dtrumpet89: has joined #RubyOnRails
[20:50:47] paulcsmith__: has joined #RubyOnRails
[20:50:49] tubbo: simplyianm: i also read stuff by people like tenderlove, martin fowler, etc.
[20:50:52] simplyianm: Do you think learning FP (Haskell/Clojure) would help a lot in becoming better?
[20:50:56] Anakat: has joined #RubyOnRails
[20:51:07] tubbo: how do you define "better"?
[20:51:17] tubbo: that's a totally subjective term
[20:51:18] simplyianm: Being able to write better, more maintainable code
[20:51:23] barnex: tubbo: I think it's because the file is in subdirectory, the subdirectory name gets recognized by rails c as a constant, but it doesn't contain anything
[20:51:28] simplyianm: remove better from that definition lol
[20:51:32] simplyianm: Just writing maintainable, clean code
[20:51:38] barnex: tubbo: when I put my module file in app/modules/ it works great
[20:51:44] dtrumpet89: has left #RubyOnRails: ()
[20:51:45] philcrissman: tubbo: HN? On how to write better code?
[20:51:49] barnex: tubbo: So I guess I'm missing something about ruby modules
[20:51:53] simplyianm: I've never taken the time to learn more than zip/reduce/map
[20:52:04] daneo: has joined #RubyOnRails
[20:52:10] simplyianm: Is that going to help me become better at Ruby and programming?
[20:52:17] simplyianm: Or should I focus more on some other aspect
[20:52:18] tubbo: barnex: hmm...well you definitely shouldn't be structuring your code like app/classes, app/modules, etc.
[20:52:22] tubbo: barnex: why not app/reporters?
[20:52:38] simplyianm: I feel like i'm hitting a wall in my growth of learning
[20:52:39] tubbo: barnex: but instead of using the Reporters::WhateverReporter namespace, just call it WhateverReporter
[20:52:59] barnex: tubbo: well, reporters looks like a thing lower in abstract structure than 'models' or 'views'
[20:53:15] tubbo: simplyianm: haha, one of my old bosses used to say "Enumerable#each is a code smell"
[20:53:25] tubbo: like if you're using each() and you're not in a template, you're doing it wron
[20:53:35] tubbo: there's a better method on Enumerable to do what you want without having to create local vars
[20:53:37] barnex: not that 'modules' is an interesting name that adds anything, you're probably right
[20:53:54] Radar: simplyianm wants to be the very best
[20:53:56] _Speeder: has joined #RubyOnRails
[20:53:57] Radar: like no one ever was
[20:53:58] tubbo: barnex: i'd definitely keep it simple with regards to rails autoloading. it's a strange beast.
[20:54:05] tubbo: Radar: GO GO POWER RANGERS
[20:54:06] Radar: to learn them all is his real test
[20:54:06] simplyianm: i think i can get a lot better
[20:54:08] byonic: simplyianm: I've heard a lot of people say learning FP is well worth doing and makes you a better programmer, and I'm sure that's true. But IMO if your goal is to write better ruby, the most efficient thing to do is to practice writing better ruby
[20:54:10] baweaver: has joined #RubyOnRails
[20:54:18] simplyianm: thanks byonic
[20:54:21] SeanLazer: has joined #RubyOnRails
[20:54:24] Radar: +1000 byonic
[20:54:26] simplyianm: I feel like i haven't learned anything in the past year
[20:54:34] Radar: simplyianm: Did you read Rails 4 in Action yet?
[20:54:41] simplyianm: Radar: on my reading list
[20:54:56] simplyianm: I've gone to tons of hackathons and stuff, picked up a few new frameworks, but it still feels like the same reading docs and writing shitty code
[20:54:56] Radar: guaranteed to teach you things or else your money back
[20:55:01] barnex: tubbo: yeah, you're right. That 'modules' directory adds nothing and makes loading worse.
[20:55:13] tubbo: simplyianm: you can sorta work functional concepts into ruby. oh you should also check out the old Destroy All Software screencasts, i'm a big fan of how gary bernhardt writes code.
[20:55:22] Radar: simplyianm: Knowing that the code is shitty is stage 2 of competence :)
[20:55:25] tubbo: philcrissman: hey you're still on IRC! ;)
[20:55:30] simplyianm: Radar: good lol
[20:55:36] simplyianm: I'll buy your book
[20:55:37] philcrissman: tubbo: yeah, sometimes. :D
[20:55:52] Radar: simplyianm: there is a big gap between stages 1 and 2, and then an even bigger gap between 2 and 3.
[20:56:16] simplyianm: Radar: and to cross that gap, what should I do?
[20:56:19] simplyianm: Just continue to write code?
[20:56:19] barnex: it's like naming my directory 'things' or 'code' or 'files' ;3
[20:56:24] Radar: simplyianm: Keep practiing.
[20:56:38] simplyianm: I guess i haven't written nearly enough ruby
[20:56:45] simplyianm: that's prob why
[20:57:05] tubbo: barnex: app/files/codes/hacks
[20:57:12] tubbo: that's where my best code is stored
[20:57:47] barnex: app/files/codes/hacks/not_porn/really_not_porn
[20:58:28] barnex: when I sort out the autoloading issue I'll totally make that directory and put all my code there
[20:58:34] simplyianm: what do y'all think of http://www.amazon.com/The-Well-Grounded-Rubyist-David-Black/dp/1933988657
[20:58:39] barnex: and porn everyone else
[20:58:40] tubbo: barnex: "the" autoloading issue? ;)
[20:58:44] Radar: simplyianm: It's a great book
[20:58:48] Radar: read that before reading R4IA
[20:58:49] barnex: everywhere
[20:59:03] simplyianm: also I've been recommended "Metaprogramming Ruby"
[20:59:38] tubbo: also a good book but wait until you're a little more comfortable with the syntax
[20:59:47] barnex: with great metaprogramming comes great responsibility.
[20:59:51] barnex: Although it's a good book
[20:59:56] neanderslob: hi all, I'm trying to figure out how to establish parameters in simple_form inputs by using variables
[20:59:56] tubbo: respect the rules that you break ;)
[21:00:12] neanderslob: my specific question is here: https://gist.github.com/BigMcLargeHuge/9807aa65106892a70321
[21:00:50] neanderslob: any tips would be appreciated :-)
[21:00:53] tubbo: neanderslob: did you ever try f.input @field.to_sym? :)
[21:01:15] tubbo: if @field = 'username', then that would basically be saying f.input 'username', right?
[21:01:31] nettoweb: has joined #RubyOnRails
[21:01:53] jniziol: has joined #RubyOnRails
[21:02:11] neanderslob: tubbo: that's right
[21:02:21] neanderslob: tubbo: and to_sym would make sense now that you mention it
[21:03:18] tubbo: you just gotta make sure @field is always set to an actual field on @user
[21:03:50] garrypolley: has joined #RubyOnRails
[21:03:52] syzygy_: has joined #RubyOnRails
[21:04:07] neanderslob: tubbo: so would I be correct in guessing @field.map(&:to_sym) ?
[21:04:08] ur5us: has joined #RubyOnRails
[21:04:09] arathald: has joined #RubyOnRails
[21:04:27] tubbo: neanderslob: that implies @field is an array
[21:04:35] tubbo: you can't map() a string i don't think
[21:05:10] Pupeno: has joined #RubyOnRails
[21:05:15] poetin_: has joined #RubyOnRails
[21:05:29] neanderslob: tubbo: ah, that makes sense; I've only used it on an array before
[21:05:31] paulcsmith__: has joined #RubyOnRails
[21:05:43] tubbo: you can just call .to_sym on a string
[21:06:02] x-light: has joined #RubyOnRails
[21:06:20] neanderslob: tubbo: I would also need to tack on a colon to the contents of the variable, right?
[21:06:37] moretti: has joined #RubyOnRails
[21:07:38] tubbo: 'username'.to_sym is :username
[21:09:17] neanderslob: tubbo: gotcha, I'll just read up on the to_sym method so I understand
[21:09:27] neanderslob: tubbo: thanks much!
[21:09:42] watchtheblur: has joined #RubyOnRails
[21:10:05] slava__: I am mapping rails models to existing database table, and creating associations. I have a table called projects which has many project_objects. BUT there are different types of project_objects. So when I run Project.all.first.milestones, I want it to only give me the project_objects that has a field type = 'milestones'. Any suggestions on how to do that?
[21:10:26] porkqpain: has joined #RubyOnRails
[21:10:30] jmignault: has joined #RubyOnRails
[21:11:05] hutch78: has joined #RubyOnRails
[21:11:20] slava__: all.first.objects would return all of project_objects.. while .milestones would only return project_objects that have type = 'Milestone'. hopefully it makes sense.
[21:11:20] Frem: has joined #RubyOnRails
[21:11:29] hutch78: FML???. cant do anything right today.. trying to simple check if something is an array and getting an error ???NoMethodError (undefined method `is_a' for ["541", "", "96"]:Array):???
[21:11:57] barnex: hutch78: trying to check if something is an array seems already wrong :P
[21:12:01] ciree: has_many milestones through: 'TableName', conditions: 'type = Milestone'
[21:12:02] bricker: hutch78: http://ruby-doc.org/core-2.2.2/Object.html#method-i-is_a-3F
[21:12:14] slava__: nice thanks!
[21:12:15] ciree: the conditions part is wrong, look up the syntax
[21:12:55] hutch78: barnex: the problem is, sometimes the thing i am checking is a string, other times its an array
[21:13:21] barnex: yeah, that's a problem
[21:13:25] hutch78: thing.count game me ???ArgumentError (wrong number of arguments (0 for 1+)):"
[21:13:26] slava__: ciree, default_scope :conditions => {:deleted => false}
[21:13:30] barnex: just saying that's not a great solution :P
[21:13:37] jfarmer: hutch78 The method is "is_a?" not "is_a"
[21:14:20] Valien: has joined #RubyOnRails
[21:14:32] creature: has joined #RubyOnRails
[21:14:39] jfarmer: Why is the thing you're receiving sometimes a string and sometimes an array?
[21:14:54] jfarmer: That's weird and if you have control over how the data is entering, you should prevent that.
[21:15:02] x1337807x: has joined #RubyOnRails
[21:15:06] nik_-_: has joined #RubyOnRails
[21:15:07] aguynamedben: has joined #RubyOnRails
[21:15:34] eggoez: has joined #RubyOnRails
[21:15:37] hutch78: its an e-commerce app where sometimes they populate multiple products into the cart (array), sometimes they populate only one (string)
[21:16:05] bricker: If only there was a language where you had to be explicit about which type of object you're working with
[21:16:09] _djbkd: has joined #RubyOnRails
[21:16:29] jfarmer: hutch78 When it's an Array, what is it an array of?
[21:16:38] jfarmer: I mean semantically
[21:17:00] hutch78: an array of strings
[21:17:05] jfarmer: Semantically
[21:17:07] kurtf: has joined #RubyOnRails
[21:17:10] jfarmer: What do those strings represent?
[21:17:16] hutch78: product id's
[21:17:23] hutch78: technically variant id's
[21:17:39] pjammer: has joined #RubyOnRails
[21:17:49] jfarmer: Use the Array method to guarantee it's always an Array
[21:17:58] jfarmer: Array("14") # => ["14"]
[21:18:01] futilegames: has joined #RubyOnRails
[21:18:10] jfarmer: Array(["14", "15"]) # => ["14", "15"]
[21:18:32] ndrei: has joined #RubyOnRails
[21:19:00] arBmind: has left #RubyOnRails: ()
[21:19:08] baweaver: has joined #RubyOnRails
[21:19:15] hutch78: hmm, i need to think about the effects that will have elsewhere in the app
[21:19:24] jfarmer: Also read http://avdi.org/talks/confident-code-rubymidwest-2011/confident-code.html
[21:19:25] hutch78: there are a lot of places in the app that expect that to be a string
[21:19:50] jfarmer: Either a thing expects a single id or a list of ids
[21:19:58] jfarmer: or it's built to handle both
[21:20:03] x1337807x: has joined #RubyOnRails
[21:20:12] Zadrel: hello there, anyone could point me to a solution to reject a specific record from a .each loop? eg. reject if @product.id==@current_product.id
[21:20:26] thebatu1: has joined #RubyOnRails
[21:20:27] hutch78: jfarmer: i was going for handling both
[21:21:00] rhizome: Zadrel: why not remove it in advance?
[21:21:06] jfarmer: Array(input).each do { |variant_id| handle_variant(variant_id) }
[21:21:07] skarn: has joined #RubyOnRails
[21:21:10] jfarmer: Is what I'm suggesting
[21:21:19] jfarmer: er, extra do there
[21:21:44] jfarmer: Zadrel http://ruby-doc.org/core-2.1.0/Enumerable.html#method-i-reject
[21:22:08] jfarmer: (probably not the real solution to whatever problem you're trying to solve, but the literal answer to your question)
[21:22:43] momomomomo: has joined #RubyOnRails
[21:22:46] gniquil: has joined #RubyOnRails
[21:24:20] terrellt: has joined #RubyOnRails
[21:25:27] iamjarvo: has joined #RubyOnRails
[21:25:39] Zadrel: this is what i'm trying to do -- @category.children.all_active.each.reject{|i| if (i.id==@subcategory.id)} do |sc| -- @subcategory==current_category_child
[21:26:14] Zadrel: returned unexpeted "}"
[21:27:02] Zadrel: rhizome: sorry, but i don't know what is to remove in advance :/ googled it but no success
[21:27:23] jfarmer: Zadrel That syntax makes no sense
[21:27:30] edgarjs_: has joined #RubyOnRails
[21:28:12] workmad3: has joined #RubyOnRails
[21:28:29] Zadrel: jfarmer: sry, i'm new to rails yet and i'm on trial and error politics :(
[21:29:08] momomomomo: has joined #RubyOnRails
[21:29:50] Zadrel: jfarmer: the --@subcategory==current_category_child-- is just to tell you that the variable is equal to the current child of the form
[21:30:08] jfarmer: Sorry, I don't really understand you.
[21:30:13] barnex: is model a good place to validate params?
[21:30:27] jfarmer: Well depends on what you mean by "validate params"
[21:30:27] barnex: well, what are validations then? :D
[21:30:42] jfarmer: Model validations are there to ensure data integrity
[21:30:43] barnex: well, I have some models that aren't activerecords, but do queries for me
[21:30:50] jfarmer: and have no knowledge that they came from user-submitted params
[21:31:01] barnex: and I'm looking for a place where I can validate, that the question asked is correct
[21:31:07] iliketurtles: has joined #RubyOnRails
[21:31:15] barnex: so it seems to be sane idea
[21:31:16] jfarmer: The model should ensure data integrity
[21:31:24] rickmasta: has joined #RubyOnRails
[21:31:32] iliketurtles: has joined #RubyOnRails
[21:31:34] barnex: well, if I ask SQL a malformed question I get garbage out
[21:31:54] barnex: so from some points of view it does
[21:32:04] moretti_: has joined #RubyOnRails
[21:32:16] jfarmer: The model should have no awareness that it's running inside a web app.
[21:32:22] jfarmer: It all hinges on what you mean by "validate params"
[21:32:35] jfarmer: The phrase "params" is a web-ism
[21:32:40] barnex: I get you
[21:32:47] Zadrel: jfarmer: i'll try again ok? i have this array of child objects(childs of Category object) and when i call the .each loop i need to exclude the child that is being treated in the form (if the id from the child being editted is 1, then this child should be out of the loop)
[21:32:56] barnex: how about my model gets arguments hash for a query and responds with exceptions, that are handled by controller
[21:32:57] jfarmer: Zadrel Sorry, you'll have to get help from someone else.
[21:33:00] barnex: and displayed in a view?
[21:33:05] barnex: that seems mvc
[21:33:10] Zadrel: jfarmer: ok, thx
[21:33:36] barnex: in my 4+ years of coding rails this is going to be the best app ever
[21:33:37] asheinfeld: has joined #RubyOnRails
[21:33:46] barnex: because of those chats :-)
[21:33:50] barnex: too bad I can't put it on github
[21:34:15] barnex: Everything is correct so far and no shortcuts were taken. See how long that lasts :-)
[21:34:27] seank_: has joined #RubyOnRails
[21:35:24] ciree: Zadrel: @category.children.all_active.reject { |child| child.id == 1}
[21:35:29] frank_o: has joined #RubyOnRails
[21:35:48] ciree: where you substitute 1 for the subcategory ID that you actually want to not include
[21:36:42] ciree: you don't need to do each then reject, they both enumerate over your collection
[21:37:27] ciree: assuming children is an association, all_active is a scope
[21:38:18] Zadrel: ciree: you're assuming right, thx
[21:38:22] philcris_: has joined #RubyOnRails
[21:38:59] karimb: has joined #RubyOnRails
[21:39:43] m0r0n: has joined #RubyOnRails
[21:39:48] Zadrel: ciree: but the syntax you gave me is generating *compile error unexpected kENSURE, expecting $end* in line 38, my file have 37 lines, is this syntax different in Rails 3?
[21:40:13] ciree: nope, shouldn't be, can you post a gist/pastebin of your code?
[21:40:18] philcris_: has joined #RubyOnRails
[21:40:22] ciree: reject is vanilla ruby
[21:40:28] Zadrel: ciree: sure, brb
[21:41:21] philcrissman: has joined #RubyOnRails
[21:43:15] Zadrel: ciree: here, let me know if you need anything else https://gist.github.com/rmatuoka/aaa23d313f9c22b12c30
[21:43:59] ciree: what is sc supposed to be there?
[21:44:27] Zadrel: sc should be de variable that stores each object
[21:44:39] hahuang65: has joined #RubyOnRails
[21:44:53] ciree: make it a do
[21:44:56] Zadrel: ciree: inside the iteration of the loop *
[21:44:58] frank_o: Greetings Radar :))
[21:45:12] ciree: @category.children.all_active.reject { |child| child.id == @subcategory.id} do |sc|
[21:45:41] Zadrel: ciree: done, rose unexpected kDO, expecting kEND error
[21:46:19] baweaver: has joined #RubyOnRails
[21:47:28] foucist: has joined #RubyOnRails
[21:47:46] hnanon: This scope has been giving me problems all day: https://gist.github.com/anonymous/dcb593a2ec90b67e99d0
[21:48:08] ciree: make a new line, declare the result of @category.children.all_active.reject { |child| child.id == @subcategory.id} in a variable, then do the do block
[21:48:29] ciree: but at this point you really need a refactor, that view is probably a mess lol
[21:48:32] hnanon: I'm getting the error: undefined local variable or method `current_user' for #<Class:0x007f39
[21:48:43] Zadrel: ciree: i'll try, thz
[21:49:39] iamjarvo: has joined #RubyOnRails
[21:49:47] Zadrel: ciree: worked perfectly, thx :D
[21:49:53] philcris_: has joined #RubyOnRails
[21:49:56] ciree: and, you didn't actually have to do that
[21:49:59] Zadrel: ciree: i think i need more cofee
[21:50:03] ciree: could have added a .each
[21:50:09] Pathfinder: has joined #RubyOnRails
[21:50:15] ciree: @category.children.all_active.reject { |child| child.id == @subcategory.id}.each do |sc|
[21:50:47] Zadrel: ciree: did, worked too :D
[21:50:55] Scripore: has joined #RubyOnRails
[21:50:55] wethu: has joined #RubyOnRails
[21:50:59] philcris_: has joined #RubyOnRails
[21:52:04] Radar: the view is definitely a mess :)
[21:52:05] ciree: hnanon, I take it your using devise
[21:52:10] philcris_: has joined #RubyOnRails
[21:52:16] ciree: do you have a before_filter to authenticate the current_user?
[21:52:20] Radar: hnanon: You can't refer to current_user in models.
[21:52:31] hnanon: I'm using Sorcery.
[21:52:32] Zadrel: ciree: now i have another issue, are you still willing to help me? this one is a little bit more complex
[21:52:35] ciree: Radar: I don't think he is, hes passing the current user to the model
[21:52:39] ciree: Zadrel, I can try ;)
[21:52:39] Radar: hnanon: You should redefine the scope as a class method and then pass in current user to that method.
[21:52:59] Radar: ciree: https://gist.github.com/anonymous/dcb593a2ec90b67e99d0#file-dc-rb-L1-L4
[21:53:00] Radar: ciree: not here
[21:53:14] Radar: hnanon: https://gist.github.com/anonymous/dcb593a2ec90b67e99d0#file-dc_controller-rb-L2-L3
[21:53:18] Radar: hnanon: What is the point of those two lines?
[21:53:27] Radar: why is params[:range][:start_date] not returning the correct date?
[21:53:39] Radar: That should at least return a String representation of the date, which you can then pass to Date.parse
[21:54:07] hnanon: Radar: The dates are returning correctly.
[21:54:33] Radar: hnanon: The code you're using to turn them into Date objects is about 100chr too long
[21:54:37] hnanon: Those two lines are for form params for the dates.
[21:55:21] jfarmer: has joined #RubyOnRails
[21:55:46] moretti: has joined #RubyOnRails
[21:55:58] garrypolley_: has joined #RubyOnRails
[21:56:02] nfk: has joined #RubyOnRails
[21:56:02] Radar: :(((((((((((
[21:56:07] Radar: ACTION recommends good code
[21:56:15] Radar: ACTION watches in disdain as hnanon ignores advice
[21:56:16] ferr: has joined #RubyOnRails
[21:56:16] zendrix: has joined #RubyOnRails
[21:56:23] Radar: ACTION wonders why he ever bothers to give advice to hnanon 
[21:56:30] hnanon: Radar: I'm not ignoring you at all...
[21:56:37] frank_o: ACTION recommends forem <3
[21:56:39] Radar: params[:range][:start_date] SHOULD return at least a String representation of the date.
[21:56:56] Radar: The code in your controller for start_date + end_date is overly complex and it should be reduced.
[21:57:01] frank_o: (to basically everyone he meets)
[21:57:05] Radar: frank_o: thank you :)
[21:58:04] Zadrel: ciree: remember the line 4 from my gist? there i'm trying to store the relationship of the active subcategory with other subcategories in aanother table called related_categories. the tricky thing is that the records to be related are in the same table of the active subcategory. i'm making it easy to follow?
[21:58:09] seank__: has joined #RubyOnRails
[21:58:31] Tokenizer: has joined #RubyOnRails
[21:58:40] hnanon: Radar: I'm just trying to get everything working before refactoring.
[21:58:59] Radar: hnanon: This refactoring will take a minute, tops.
[21:59:12] hnanon: Radar: I'll try now.
[21:59:42] barnex: Ok, I broke autoloading, please help me. What I'm trying to do is get app/presenters/shifts_presenter.rb autoloaded.
[21:59:48] ciree: Zadrel: what are you asking me specifically, database structure?
[22:00:05] barnex: the shifts_presenter.rb contains only one class: class ShiftsPresenter
[22:00:41] ciree: if you have a table with two columns, category_id, related_id to represent the related categories
[22:00:48] barnex: yet rails console gives me: NameError: uninitialized constant ShiftsPresente
[22:00:53] ciree: you'd have an association on your category model
[22:00:54] Zadrel: ciree: sry, this is a hard question for me to answer bewcouse i'm not sure too. i'm trully sory for not being able to give you the answer that you need
[22:01:05] sloggerkhan: has joined #RubyOnRails
[22:01:12] ciree: has_many related_categories through: 'related_categories'
[22:01:28] Tokenizer: hi, I'm having this very odd issue on staing environment where my logs are empty, only a couple of sql statements get logged ... I've copied pretty much verbatim everything from development.rb just to be sure.... here's my staging config: http://pastie.org/private/hhlkrifx3tnbousrdhclq
[22:01:55] allcentury: has joined #RubyOnRails
[22:02:09] Zadrel: ciree: iactually it have has_many :categories, :through => :related_categories
[22:02:43] hnanon: Radar: start_date = Date.parse(params[:range][:start_date])
[22:02:55] Zadrel: ciree: and yes, all the association is following the recommended standards,
[22:02:58] Radar: hnanon: Yes, I think that will work if params[:range][:start_date] isn't already a date.
[22:03:11] hnanon: Radar: error on that line: no implicit conversion of nil into String
[22:04:06] weaksauce: I don't think it's called refactoring if you are still trying to get it to work.
[22:04:32] TheNet: do I really have to use a passwordless sudo with capistrano and passenger?
[22:05:08] hnanon: weaksauce: date ranges worked, just were messy.
[22:06:01] seank_: has joined #RubyOnRails
[22:06:05] jenrzzz_: has joined #RubyOnRails
[22:06:44] chipotle: has joined #RubyOnRails
[22:07:42] Tokenizer: hi, I'm having this very odd issue on staing environment where my logs are empty, only a couple of sql statements get logged ... I've copied pretty much verbatim everything from development.rb just to be sure.... here's my staging config: http://pastie.org/private/hhlkrifx3tnbousrdhclq
[22:08:35] darrencauthon: has joined #RubyOnRails
[22:08:35] bricker: has joined #RubyOnRails
[22:08:58] creature: has joined #RubyOnRails
[22:09:25] darrenca_: has joined #RubyOnRails
[22:09:37] bricker1: has joined #RubyOnRails
[22:09:41] philcris_: has left #RubyOnRails: ()
[22:10:10] philcrissman: has joined #RubyOnRails
[22:11:18] codepete: has joined #RubyOnRails
[22:11:34] spyderman4g63: has joined #RubyOnRails
[22:11:50] hnanon: Radar: By the way, I'm using the date_select helper.
[22:11:55] hnanon: If that matters.
[22:13:43] _seanc_: has joined #RubyOnRails
[22:16:18] blackhuey: has joined #RubyOnRails
[22:17:23] platosha: has joined #RubyOnRails
[22:18:44] Aeyrix: Does anyone know of a ruby gem to make it not be 5??C?
[22:19:29] weaksauce: gem 'california'
[22:21:01] frank_o: yeah if you can live without water
[22:21:38] weaksauce: oh we have water.
[22:21:44] weaksauce: just not enough for almonds
[22:22:10] Aeyrix: Thanks guys it worked.
[22:22:27] frank_o: heard about those yeah..
[22:22:32] Aeyrix: I just started six start-ups and got employed by an angel investment company.
[22:22:33] tubbo: in other news it's hot over here
[22:22:35] tubbo: gem install norway
[22:22:57] michael_mbp: has joined #RubyOnRails
[22:23:04] Scriptonaut: gem install 'PNW' for some moderate weather
[22:23:11] Scriptonaut: gem install PNW*
[22:23:42] Scriptonaut: apparently we're in a drought too, but it's been raining pretty constantly so I dunno
[22:24:05] Scriptonaut: pacific northwest
[22:24:11] Scriptonaut: western WA specifically
[22:24:26] tubbo: if it's not raining every day then it's a drought as far as seattle is concerned ;)
[22:25:52] assembledbits: has joined #RubyOnRails
[22:25:53] prereflect: has joined #RubyOnRails
[22:26:00] assembledbits: Hey guys, is this not the proper syntax? <a href="<%= project.url %>" target="_blank">
[22:26:04] foucist: weaksauce: plenty for the almonds.. screw the people
[22:26:39] Spami: has joined #RubyOnRails
[22:26:49] Scriptonaut: assembledbits: looks fine as long as there's a closing tag
[22:26:54] bricker1: has left #RubyOnRails: ()
[22:26:58] Pathfinder: has joined #RubyOnRails
[22:27:14] Aeyrix: assembledbits: That depends on a lot of things, but we're missing a bit of html there.
[22:27:22] bricker: has joined #RubyOnRails
[22:27:29] bricker: assembledbits: !xy
[22:27:29] helpa: assembledbits: http://mywiki.wooledge.org/XyProblem
[22:27:34] bricker: assembledbits: please explain your actual problem
[22:27:37] tubbo: is there a way i can get the elasticsearch-rails client to log out every HTTP request it makes against my ES server?
[22:27:41] Aeyrix: Fucking goddammit
[22:28:09] Aeyrix: Do you guys get a free blow job when you use that command or what?
[22:28:19] foucist: Aeyrix: which command
[22:28:36] fgo: has joined #RubyOnRails
[22:28:40] Aeyrix: It's a garbage rhetoric.
[22:29:06] bricker: Aeyrix: you are entitled to your opinion
[22:29:07] Aeyrix: Thank even.
[22:29:31] tubbo: assembledbits: you know about link_to?
[22:29:39] assembledbits: yeah, no, I solved that issue
[22:29:49] assembledbits: as long as it was the right syntax
[22:29:52] tubbo: assembledbits: glad we could be of assistance :D
[22:30:04] Aeyrix: Yeah sorry we were too busy arguing about whether or not the XY problem is bs.
[22:30:07] assembledbits: New issue, I want to do a loop, but the first item has to be in a different block of HTML
[22:30:22] bricker: Aeyrix: I think it's a great analogy and something I wish more people understood
[22:30:23] tubbo: assembledbits: i mean, "right syntax" is relative. it won't blow up but i wouldn't accept that code into my project, because link_to project.url, target: '_blank' is much easier to read.
[22:30:27] bricker: my co-worker is the worst offender
[22:30:39] Aeyrix: Sorry I can't link anything, I'm on the phone, but .tap is the array function you're looking for.
[22:30:44] Aeyrix: Hopefully someone else can link.
[22:30:49] bricker: I have to sit there for like 4 minutes and ask "why?" "why?" "why?" until he explains the problem he's actually having
[22:30:54] Aeyrix: bricker: I'll blog about how garbage it is.
[22:30:54] foucist: Aeyrix: i do it all the time.. i have X problem, but i ask about Y problem because i'm tryign to simplify for others
[22:31:03] Aeyrix: Yeah foucist
[22:31:06] bricker: Aeyrix: and I won't read it
[22:31:07] foucist: but half the time it doens't work out
[22:31:08] Aeyrix: Sometimes people don't care.
[22:31:10] assembledbits: tubbo: changed it to link_to just for you
[22:31:11] Aeyrix: Good, bricker.
[22:31:17] Aeyrix: Proves my point.
[22:31:35] benlieb: Can someone help me with a rescue_from issue? In the following code, my rescue_from StandardError is catching my NedException before it gets to the rescue_from NedException method: https://gist.github.com/pixelterra/92062bea5d35f60efd24
[22:31:39] foucist: proves how?
[22:31:39] bricker: Aeyrix: lol
[22:31:57] benlieb: I don't really understand why or how to ensure that StandardError rescueing happens last
[22:32:02] Aeyrix: Proves that people blindly parrot a garbage rhetoric because, idk, maybe an op said it first.
[22:32:11] workmad3: has joined #RubyOnRails
[22:32:34] sye: has joined #RubyOnRails
[22:32:46] Aeyrix: Sorry, people who overuse XY over and over again irritate the hell out of me.
[22:32:50] rhizome: are we doing meta-irc now
[22:32:51] bricker: Aeyrix: whether or not it's garbage is opinion, but I'm not "blindly" repeating it. I agree with it.
[22:32:51] Aeyrix: Sometimes it is true.
[22:32:56] Aeyrix: This isn't one of those times.
[22:33:07] Aeyrix: Ok bricker I believe you mate. :^)
[22:33:29] SteenJobs: has joined #RubyOnRails
[22:33:42] Aeyrix: assembledbits: Did you find the function I was talking about?
[22:33:50] garrypolley: has joined #RubyOnRails
[22:33:52] IanVorn: has joined #RubyOnRails
[22:33:54] Holek: has joined #RubyOnRails
[22:33:58] baweaver: has joined #RubyOnRails
[22:34:03] jenrzzz: has joined #RubyOnRails
[22:34:05] victorkohl: has joined #RubyOnRails
[22:34:06] Holek: has joined #RubyOnRails
[22:34:40] bricker: Aeyrix: how is .tap going to solve that problem for him? Do you mean .shift?
[22:34:50] crevax: has joined #RubyOnRails
[22:34:54] Aeyrix: I didn't. I'm fairly sure it's .tap.
[22:35:02] Aeyrix: One sec. I'm still on my phone.
[22:35:08] Aeyrix: Pretty difficult for me heh.
[22:35:27] garrypolley: has joined #RubyOnRails
[22:35:51] bricker: Aeyrix: .tap performs an operation on an object and then returns the object. He wants to remove the first element of an array and display it separately from the rest.
[22:36:16] tubbo: assembledbits: :shipit:
[22:36:29] Aeyrix: It yields the object to the block then returns it.
[22:36:41] bricker: Aeyrix: correct. How does that help here?
[22:36:43] tubbo: yeah but it doesn't pop that object off the loop
[22:36:44] Zadrel: hewllo there! can anyone help? http://stackoverflow.com/questions/30632019/has-many-through-chage-the-default-attribute-for-association-ruby-1-8-7
[22:36:47] tubbo: err, collection
[22:36:51] tubbo: so he'd iterate over it twice
[22:37:03] workmad3: first, *rest = some_ary
[22:37:04] tubbo: i think you can do collection.pop though...
[22:37:11] tubbo: there ya go workmad3 got it
[22:37:13] bricker: tubbo: it's .shift
[22:37:25] Aeyrix: workmad3: that's what I wanted lmao
[22:37:31] Aeyrix: Idk where .tap came from.
[22:37:36] SteenJobs: has left #RubyOnRails: ()
[22:37:45] tubbo: tap is weird
[22:37:47] workmad3: Aeyrix: splat, not tap ;)
[22:37:52] bricker: <%= array.shift %> ... <%= array.each ... %>
[22:37:52] Radar: workmad3: you're up late
[22:37:53] DCio: has joined #RubyOnRails
[22:38:01] Tobarja: has joined #RubyOnRails
[22:38:13] Aeyrix: workmad3: Haha that's it
[22:38:17] Aeyrix: I need coffee
[22:38:19] workmad3: Radar: it's not *that* late... it's not even midnight yet!
[22:38:31] bricker: tubbo: you're weird
[22:38:44] arBmind1: has joined #RubyOnRails
[22:38:44] workmad3: bricker: of course he is... he's on IRC in 2015 :P
[22:38:51] Radar: workmad3: I only say that as someone who was in the land of ZZZZ last night around 9pm
[22:38:52] assembledbits: This is what I have, it's not working: https://gist.github.com/j0ntsang/38b5d71bdce4253c98a4
[22:38:54] bricker: workmad3: indeed
[22:39:11] Radar: Our payment processor went down two-and-a-half days in a row and they were... stressful
[22:39:12] bricker: assembledbits: use shift as I suggested above
[22:39:39] tubbo: Radar: how does that happen?
[22:39:40] Radar: Sleep has cured all. So today is puppies, rainbows and kittens for everyone
[22:39:49] Radar: tubbo: Upstream issues with a bank here in AU called NAB.
[22:39:51] weaksauce: benlieb it seems that the rescue code is last in first called.
[22:39:56] workmad3: Radar: how about baby hamsters instead? https://scontent-lhr3-1.xx.fbcdn.net/hphotos-xat1/t31.0-8/11312792_10155640298760402_2670499989355066223_o.jpg
[22:39:58] syzygy_: has joined #RubyOnRails
[22:39:59] SteenJobs: has joined #RubyOnRails
[22:40:21] tubbo: so would you say australia got the "NAB-hammer"?
[22:40:22] weaksauce: benlieb but the docs are a bit ugly for this particular function
[22:40:23] GnuYawk: has joined #RubyOnRails
[22:40:30] Radar: tubbo: hahaha yes
[22:40:46] benlieb: weaksauce: yes I think I've come to that conclusion
[22:40:53] SteenJobs: has joined #RubyOnRails
[22:40:58] weaksauce: benlieb https://github.com/rails/rails/blob/f62fb985b6a7b90872148f0786219c9cc94c9356/activesupport/lib/active_support/rescuable.rb#L86
[22:41:03] benlieb: a bit counter-intuitive, but I think I can deal
[22:41:05] SteenJobs: hey eveyone!
[22:41:12] duderonomy: has joined #RubyOnRails
[22:41:15] SteenJobs: been a while
[22:41:23] workmad3: tubbo: better than fucking, austria: https://goo.gl/maps/v9eiw
[22:41:29] weaksauce: benlieb and also line 72 in that file.
[22:42:06] porkqpain: has joined #RubyOnRails
[22:42:09] SteenJobs: i???m using devise and have an admin:boolean column in my Users table - what???s the best way to dynamically set the root URL depending on whether the user is an admin or not?
[22:42:21] tubbo: workmad3: wat
[22:42:28] tubbo: why are all the streets named fucking
[22:42:42] tubbo: oh yeah meet me at the corner of fucking, fucking and fucking
[22:43:27] codepete: has joined #RubyOnRails
[22:43:32] asheinfeld: has joined #RubyOnRails
[22:43:43] workmad3: tubbo: one of the content guys raised a question about 'Fucking, Austria' appearing in the list of locations in the database :)
[22:43:49] DCio: hey anyone familiar with the devise gem?
[22:44:07] workmad3: tubbo: to which they got pointed to that map link and told we were just slurping the data from google
[22:44:23] baweaver: has joined #RubyOnRails
[22:44:38] tubbo: workmad3: haha
[22:44:42] Radar: DCio: No, hardly anyone uses it.
[22:44:55] assembledbits: I'm getting the error undefined method `shift' for #...
[22:44:56] Radar: DCio: That's why it only has 13,000 stars on GitHub
[22:44:59] Radar: Seriously, nobody has used it
[22:45:01] Radar: assembledbits: Code or ban
[22:45:02] barnex: can I easily get copy of an array with parameter added?
[22:45:13] barnex: like not mutating version of <<?
[22:45:22] workmad3: Radar: you forgot to turn on your sarcasm font again
[22:45:40] SteenJobs: yikes. a lot more tension here since my last appearance.
[22:45:46] hypnosb: has joined #RubyOnRails
[22:46:13] DCio: im a total noob trying to figure out how to add methods to the users model
[22:46:28] Radar: DCio: Can you explain what you're trying to do and how it's not working?
[22:46:28] workmad3: DCio: you open up app/models/user.rb and add methods ;)
[22:46:31] tubbo: define them :)
[22:47:02] philcris_: has joined #RubyOnRails
[22:47:09] DCio: so i have a database of users with subscription information. The admin panel needs to have a list of all users by subscription type
[22:47:10] Scriptonaut: I'm using the desk gem(https://github.com/chriswarren/desk), and for some reason my code works fine on the staging server, and it was working fine on my coworkers dev machine when we were pairing, but on mine I get this when I query the api: https://gist.github.com/robins35/42c4c9d2964afba20ae4
[22:47:20] tubbo: SteenJobs: set the root url? what do you mean by that?
[22:47:27] DCio: originally i put the stuff to get that data in the controller for that specific page on the admin panel
[22:47:36] DCio: but then i realized its not the "rails way"
[22:47:40] Scriptonaut: I thought it was a gem issue, played around with that a bit, but wasn't quite sure what to do
[22:47:55] SteenJobs: tubbo: meaning if a user who is not an admin and a user who is an admin both login, i want them redirected to two different home pages.
[22:47:58] Scriptonaut: doesn't seem like anyone on google has had the same error
[22:48:04] DCio: and that all that stuff should be taken care of in the model or something
[22:48:41] TheNet: is this a good guide for deploying with capistrano?
[22:48:43] TheNet: https://gorails.com/deploy/ubuntu/14.04
[22:48:44] Radar: DCio: Can you show us some code?
[22:48:45] tubbo: SteenJobs: what's your root route set to now?
[22:48:50] Radar: TheNet: !try
[22:48:50] helpa: TheNet: Why don't you try it and find out for yourself?
[22:48:57] TheNet: Radar: I did.
[22:49:14] TheNet: Radar got some errors
[22:49:16] weaksauce: TheNet https://leanpub.com/deploying_rails_applications
[22:49:30] weaksauce: that has a good section on cap
[22:49:36] SteenJobs: tubbo: match 'clients/home' => 'clients/home#index', :as => :client_root (clients are users in this case, gonna change it back to users eventually)
[22:49:39] assembledbits: This code says shift is not a method for the record: https://gist.github.com/j0ntsang/38b5d71bdce4253c98a4
[22:49:39] workmad3: SteenJobs: easiest way is to have a HomeController that has an action that redirects based on whether the user is an admin or not
[22:50:02] SteenJobs: workmad3: right i figured i would just have somehting like current_user.admin? and then a redirect
[22:50:02] workmad3: SteenJobs: you can also use that to display a landing page for unauthenticated users too
[22:50:06] Radar: TheNet: "Got some errors"
[22:50:19] Radar: assembledbits: What is @projects
[22:50:22] SteenJobs: workmad3: just not sure how to implement said home controller
[22:50:33] Zadrel: anyone help me? http://stackoverflow.com/questions/30632019/has-many-through-chage-the-default-attribute-for-association-ruby-1-8-7
[22:50:34] tubbo: SteenJobs: rails generate controller home
[22:50:35] Radar: assembledbits: No stacktrace for the error makes me a sad panda too
[22:50:38] DCio: Radar: http://pastebin.com/YhPU3Bwb
[22:50:40] SteenJobs: tubbo: hahaha
[22:50:43] Aeyrix: 9pm bedtime represent Radar
[22:50:45] workmad3: SteenJobs: root to: "home#index" in your routes
[22:50:49] assembledbits: it's coming from public controller def index
[22:50:49] assembledbits: @category = Category.find_by_id(1)
[22:50:49] assembledbits: @projects = @category.projects.sorted
[22:50:51] Radar: Sorry Zadrel, all our operators are currently busy right now
[22:50:53] Radar: assembledbits: !gist
[22:50:53] helpa: assembledbits: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[22:50:54] workmad3: SteenJobs: and then have your conditional in the index action ;)
[22:50:59] SteenJobs: workmad3: right right
[22:51:00] Radar: assembledbits: Do not post code in the channel :(
[22:51:03] Radar: assembledbits: Stacktrace too.
[22:51:05] SteenJobs: workmad3: it???s been a while for me!!!
[22:51:25] Zadrel: Radar: ok, sry
[22:51:36] Radar: DCio: that code looks like it would be better in a controller.
[22:51:36] SteenJobs: workmad3: although i???ll be here plenty over the summer as i get back into the swing of things. had to put coding on a break for a semester.
[22:51:50] assembledbits: Updated the gist
[22:52:24] hnanon: Radar, can I call current_user from the model if it's passed by the controller?
[22:52:32] Radar: assembledbits: !gist-usage
[22:52:32] helpa: assembledbits: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[22:52:37] Radar: hnanon: Yes.
[22:52:52] DCio: Radar: Ok! So just to get a better idea of the way MVC works, what kind of code would go in a model?
[22:52:57] Radar: SteenJobs: Welcome back.
[22:53:04] SteenJobs: Radar: thanks brother!!
[22:53:13] SteenJobs: Radar: it???s truly a pleasure.
[22:53:34] Radar: DCio: Not that :) That code is collecting information for presentational purposes and so it should go in a controller.
[22:53:43] workmad3: ^^ or a view helper
[22:53:46] Radar: DCio: Model code should be responsible only for manipulating model information
[22:54:00] Radar: workmad3: It's calling out to a model so I would normally put that code in a controller
[22:54:40] philcrissman: has joined #RubyOnRails
[22:54:43] workmad3: Radar: true... but I could forsee it being passed a user collection instead of being hardcoded with users, at which point it's much more suited to view helper IMO ;)
[22:54:54] _djbkd: has joined #RubyOnRails
[22:54:54] DCio: Radar: gotchya, thanks! Im a noob to rails but i need to learn fast because i got contracted by some company to make their website... LOL!
[22:54:54] workmad3: *hardcoded with User.find_each
[22:55:08] Radar: DCio: Sounds good :) It's easy enough to learn.
[22:56:15] mary5030: has joined #RubyOnRails
[22:56:52] edwinvdgraaf: has joined #RubyOnRails
[22:58:15] jenrzzz: has joined #RubyOnRails
[22:58:17] hypnosb: has joined #RubyOnRails
[22:58:59] Lightsword: has joined #RubyOnRails
[23:00:10] goodcodeguy: has joined #RubyOnRails
[23:00:18] one_zero: has joined #RubyOnRails
[23:00:58] Exuma: has joined #RubyOnRails
[23:01:13] mordocai: has joined #RubyOnRails
[23:01:18] workmad3: ok, it's now past midnight, I guess I should head to bed :)
[23:02:03] simplyianm: has joined #RubyOnRails
[23:02:05] Radar: gnight workmad3
[23:02:06] workmad3: night all :)
[23:02:08] annlewis: has joined #RubyOnRails
[23:02:13] SalexW: has joined #RubyOnRails
[23:02:18] mark[oz]: has joined #RubyOnRails
[23:03:20] scottmatheina: has joined #RubyOnRails
[23:05:23] Aeyrix: has joined #RubyOnRails
[23:05:35] hnanon: has joined #RubyOnRails
[23:09:21] thebatu1: has joined #RubyOnRails
[23:09:48] momomomomo: has joined #RubyOnRails
[23:10:18] edwinvdgraaf: has joined #RubyOnRails
[23:11:22] rickmasta: has joined #RubyOnRails
[23:11:48] syzygy_: has joined #RubyOnRails
[23:20:26] Rubie: has joined #RubyOnRails
[23:25:46] hnanon: has joined #RubyOnRails
[23:26:20] Anakat: has joined #RubyOnRails
[23:27:03] fmcgeough: has joined #RubyOnRails
[23:27:46] hutch78: has joined #RubyOnRails
[23:29:29] Holek: has joined #RubyOnRails
[23:29:48] x-light: SteenJobs: Where you been?
[23:29:53] fgo: has joined #RubyOnRails
[23:29:57] x-light: SteenJobs: and wb ;)
[23:30:32] carterparks: has joined #RubyOnRails
[23:31:09] ogpastaling: has joined #RubyOnRails
[23:31:12] carterparks: anybody ever see odd behavior when using nested non-db attributes (i.e. attr_accessor)? https://gist.github.com/carter/c22a687abbf964e645a3
[23:32:59] carterparks: the cc_number field used to be a db field but now it is attr_accessor
[23:33:17] carterparks: and i confirmed that the nested attributes worked before i removed the db field
[23:33:58] ekain: has joined #RubyOnRails
[23:37:23] ramfjord: has joined #RubyOnRails
[23:39:04] SteenJobs: has joined #RubyOnRails
[23:39:09] bricker: carterparks: you're setting the attributes locally but then loading the attributes from the database
[23:39:18] bricker: carterparks: you need to save it to the database at some point
[23:39:26] carterparks: bricker: right i totally get that
[23:39:33] twilling: has joined #RubyOnRails
[23:39:47] carterparks: but shouldn't i be able to access that?
[23:40:00] bricker: No, because of what I said above
[23:40:08] RegulationD: has joined #RubyOnRails
[23:40:14] carterparks: i realize they won't persist (i don't want to persist the cc_number)
[23:40:15] bricker: attributes= just updates a hash, it doesn't update all your associations an everything
[23:40:39] carterparks: well i deal with similar results using update_attributes
[23:41:26] kinduff: has joined #RubyOnRails
[23:41:34] carterparks: shouldn't i be able to assign the non-db attributes and then access them immediately?
[23:41:40] Lightsword: has joined #RubyOnRails
[23:42:01] bricker: carterparks: it depends if the association has been loaded or not, and even then I wouldn't trust it
[23:42:27] bricker: non-db attributes are just in memory and memory in rails apps gets thrown away like moldy bread
[23:43:27] codepete: has joined #RubyOnRails
[23:43:40] carterparks: well to some extent yes. maybe not exactly in the way you describe it. if i wasn't dealing with associations then i could guarantee that the attr_accessor attributes would last on a particular instance throughout the request
[23:44:04] SteenJobs: any idea why when using devise i would get an undefined method admin? for user????
[23:44:11] bricker: carterparks: it works like that usually, but you're going through two different associations
[23:44:17] Radar: SteenJobs: likely that admin? is not defined on Usere
[23:44:30] Radar: SteenJobs: We'll need to see a way to reproduce the issue.
[23:44:33] bricker: carterparks: it's likely that something is being loaded from the database and overriding your virtual attributes. That's easy to see, just tail your logs
[23:44:45] Ropeney: has joined #RubyOnRails
[23:44:50] SteenJobs: Radar: ha i realize, but i added an admin:boolean column to my users table so in theory the method should exist - which it does in console interestingly enough
[23:44:58] Radar: SteenJobs: where doesn't it exist?
[23:45:02] Radar: In your tests?
[23:45:13] Radar: If so, that'd be because you didn't run your migrations on your test DB yet
[23:45:19] SteenJobs: Radar: when running locally, and i try to login, i encounter the error
[23:45:31] SteenJobs: NoMethodError in Devise::SessionsController#Create
[23:45:42] SteenJobs: Radar: whatevs, i???ll keep plugging away at it
[23:45:53] carterparks: bricker: silly me i should have checked that right away
[23:45:54] Lightsword: has joined #RubyOnRails
[23:45:57] carterparks: bricker: that's exactly what's going on
[23:45:59] baweaver: has joined #RubyOnRails
[23:46:04] bricker: This is why I always think twice before entering my credit card number into a website that's not amazon or google etc.
[23:46:08] carterparks: i'm just going to have to abandon nested attributes for this
[23:46:13] bricker: junior devs handling my credit card info... yikes
[23:46:19] bricker: carterparks: yeah sounds like it
[23:46:37] neanderslob: hello, is there a way to use somethng like .where() in an each loop to only iterate through rows that match a certain criteria?
[23:46:43] carterparks: bricker: i'm fixing the errors of someone before me
[23:46:44] Aeyrix: bricker: Anything that isn't going through Paypal or Stripe doesn't get my card details.
[23:46:58] carterparks: Aeyrix: and you seriously verify that everywhere you order?
[23:47:02] Aeyrix: carterparks: Yep.
[23:47:03] bricker: neanderslob: http://ruby-doc.org/core-2.2.0/Array.html#method-i-select
[23:47:07] third_whitness: has joined #RubyOnRails
[23:47:31] thiagovsk: has joined #RubyOnRails
[23:47:48] Anakat_: has joined #RubyOnRails
[23:47:50] neanderslob: bricker: thanks, will have a look
[23:47:53] mordocai: has joined #RubyOnRails
[23:47:55] hnanon: Radar: https://gist.github.com/anonymous/18a8cdb0378ead63a5e2
[23:48:07] Radar: SteenJobs: Stacktrace for error please
[23:48:13] Radar: SteenJobs: Did you try restarting your server?
[23:48:17] SteenJobs: Radar: yessir! (to both)
[23:48:18] hnanon: Radar: Same error: undefined local variable or method `current_user' for #<Class:0x...
[23:48:44] Radar: bbl, fire has started
[23:48:45] SteenJobs: Radar: but as a warning, the project i???m working on was started by someone else so i have the usual nightmares of using someone elses code. gimme a minute.
[23:48:47] Radar: not actual fire
[23:48:55] bricker: Radar: lol
[23:49:22] bricker: Radar: I almost called Australian 911
[23:50:25] hnanon: Is it because I can't use current_user in an sql query?
[23:51:15] Aeyrix: hnanon: It's because `current_user` is not defined.
[23:52:03] carterparks: has left #RubyOnRails: ()
[23:52:47] hnanon: Aerix: For the outer method: def self.reconciliation(start_date, end_date, current_user), it's working fine, though?
[23:53:07] hnanon: I mean I'm actually able to get the current_user.customer.id.
[23:53:21] hnanon: But for the sql, it's not defined.
[23:55:16] neanderslob: bricker: not sure that's quite it. I'm basically looking to do something that will allow me to loop through a subset of an array
[23:55:35] bricker: neanderslob: http://ruby-doc.org/core-2.2.2/Enumerable.html#method-i-select
[23:55:47] bricker: http://ruby-doc.org/core-2.2.0/Array.html#method-i-select
[23:56:13] bricker: [1,2,3].select { |i| i > 1 } #=> [ 2,3 ]
[23:56:56] neanderslob: bricker: something like Array.where(column: "value").each
[23:57:46] bricker: neanderslob: @users.select { |user| user.role == "moderator" }
[23:58:57] neanderslob: bricker: ah, ok; must have misunderstood the docs, I'll try that
[23:59:03] mist: has joined #RubyOnRails
[23:59:04] Papierkorb: has joined #RubyOnRails
[23:59:55] jwaldrip_: has joined #RubyOnRails