« Back to channel list

#RubyOnRails - 08 February 2016

« Back 1 day Forward 1 day »
[00:00:26] tildes: has joined #RubyOnRails
[00:00:37] pawnbox: has joined #RubyOnRails
[00:06:07] waka: has joined #RubyOnRails
[00:06:13] K_r3aPeR: has joined #RubyOnRails
[00:10:05] ferr: has joined #RubyOnRails
[00:15:10] sleungcy: has joined #RubyOnRails
[00:16:06] Jon30: has joined #RubyOnRails
[00:16:53] Jon30: hey guys, does anybody have experience with active admin? I am trying to figure out how Batch Actions works? I am unable to select multiple products from this page: http://demo.activeadmin.info/admin/products
[00:26:24] smathy: The vast majority of us have sworn off AA Jon30 - sorry.
[00:27:07] Jon30: smathy what's a good alternative?
[00:28:23] kies^: has joined #RubyOnRails
[00:28:39] one_zero: has joined #RubyOnRails
[00:28:58] smathy: A lot of people are finding Administrate is a much better pattern, everything's out in the open so easier to customize and just to see what's going on.
[00:29:43] exchgr`: has joined #RubyOnRails
[00:29:44] DEA7TH_: has joined #RubyOnRails
[00:30:18] FooMunki_: has joined #RubyOnRails
[00:30:29] _Tariq_: has joined #RubyOnRails
[00:33:48] chouhoulis: has joined #RubyOnRails
[00:34:57] DoubleMalt: has joined #RubyOnRails
[00:36:32] chipotle: has joined #RubyOnRails
[00:37:03] peterevjan: has joined #RubyOnRails
[00:38:01] Spami: has joined #RubyOnRails
[00:39:21] roshanavand: has joined #RubyOnRails
[00:43:18] arashb: has joined #RubyOnRails
[00:44:43] yoongkang: has joined #RubyOnRails
[00:44:45] mhoungbo: has joined #RubyOnRails
[00:45:35] quazimodo: has joined #RubyOnRails
[00:45:37] quazimod1: has joined #RubyOnRails
[00:48:28] rhizome: layout current_user.company.to_sym
[00:50:25] pawnbox: has joined #RubyOnRails
[00:50:26] ElFerna: has joined #RubyOnRails
[00:52:03] ur5us: has joined #RubyOnRails
[00:54:21] sevenseacat: has joined #RubyOnRails
[00:58:34] Devalo: has joined #RubyOnRails
[00:59:09] nerium: has joined #RubyOnRails
[00:59:14] nerium: has left #RubyOnRails: ()
[01:00:19] floror: has joined #RubyOnRails
[01:03:39] ElFerna: has joined #RubyOnRails
[01:15:55] sleungcy: has joined #RubyOnRails
[01:20:18] pawnbox: has joined #RubyOnRails
[01:23:38] peterevjan: has joined #RubyOnRails
[01:24:01] barhum2013: has joined #RubyOnRails
[01:28:22] kies^: has joined #RubyOnRails
[01:28:59] RegulationD: has joined #RubyOnRails
[01:31:44] EMCHAMP_: has joined #RubyOnRails
[01:33:59] rafaelfranca: has joined #RubyOnRails
[01:34:33] chouhoulis: has joined #RubyOnRails
[01:45:58] yoongkang: has joined #RubyOnRails
[01:46:47] wldcordeiro: has joined #RubyOnRails
[01:47:11] _Tariq: has joined #RubyOnRails
[01:49:22] srinidhi: has joined #RubyOnRails
[01:52:07] DmitryBochkarev: has joined #RubyOnRails
[01:53:41] barhum2013: has joined #RubyOnRails
[01:59:04] OxADD1DEAD: has joined #RubyOnRails
[01:59:48] pawnbox: has joined #RubyOnRails
[02:01:16] peterevjan: has joined #RubyOnRails
[02:03:25] chouhoulis: has joined #RubyOnRails
[02:08:59] chouhoulis: has joined #RubyOnRails
[02:16:57] sleungcy: has joined #RubyOnRails
[02:19:12] JoshGlzBrk: has joined #RubyOnRails
[02:21:24] gavinhughes: has joined #RubyOnRails
[02:27:20] kies^: has joined #RubyOnRails
[02:27:34] duderono_: has joined #RubyOnRails
[02:29:38] mices: has joined #RubyOnRails
[02:29:46] mices: has joined #RubyOnRails
[02:29:55] pawnbox: has joined #RubyOnRails
[02:33:39] gavinhughes: has joined #RubyOnRails
[02:34:28] peterevjan: has joined #RubyOnRails
[02:34:53] peterevjan: has joined #RubyOnRails
[02:45:21] arashb: has joined #RubyOnRails
[02:49:52] OxADD1DEAD: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")
[02:54:17] roshanavand: has joined #RubyOnRails
[02:55:46] bronson: has joined #RubyOnRails
[02:56:53] barhum2013: has joined #RubyOnRails
[02:57:48] Cohedrin_: has joined #RubyOnRails
[02:59:42] pawnbox: has joined #RubyOnRails
[02:59:59] Devalo: has joined #RubyOnRails
[03:02:12] rogue_koder: has joined #RubyOnRails
[03:06:28] rhizome: bunch of football fans in this channel
[03:07:19] dexter-tzu: has joined #RubyOnRails
[03:08:20] barhum2013: has joined #RubyOnRails
[03:08:27] NBarnes: I'm an owl fan, and I am very interested in this Superb Owl that people keep tweeting about.
[03:08:36] NBarnes: Even if they keep typoing it.
[03:09:42] sevenseacat: twitter won't stfu about the superbowl.
[03:13:40] peterevjan: has joined #RubyOnRails
[03:14:36] rubyonrails079: has joined #RubyOnRails
[03:16:16] smoitra: has joined #RubyOnRails
[03:17:37] sleungcy: has joined #RubyOnRails
[03:18:17] speakingcode: has joined #RubyOnRails
[03:18:27] konsolebox: has joined #RubyOnRails
[03:19:10] speakingcode: has joined #RubyOnRails
[03:23:48] IrishGringo: has joined #RubyOnRails
[03:23:58] kies^: has joined #RubyOnRails
[03:24:06] peterevjan: has joined #RubyOnRails
[03:24:45] codelahoma: has joined #RubyOnRails
[03:25:53] rogue_koder: has joined #RubyOnRails
[03:26:13] jgpawletko: has joined #RubyOnRails
[03:27:03] zkvc: has joined #RubyOnRails
[03:28:56] speakingcode: has joined #RubyOnRails
[03:29:31] pawnbox: has joined #RubyOnRails
[03:30:37] baash05: has joined #RubyOnRails
[03:31:20] `aspiRe: has joined #RubyOnRails
[03:31:29] yoongkang: has joined #RubyOnRails
[03:32:39] peterevjan: has joined #RubyOnRails
[03:33:38] hfp: Hi, I'm scraping a webpage with a job and I'd like to check in a test that the model created by the job contains the right data. If I use a factory with `build` and match with `eq`, the test fails because the ids, created_at, updated_at and the instance id dont match. How can I test the job creates the model and that it has the correct data in it?
[03:39:51] baweaver: has joined #RubyOnRails
[03:42:18] Ropeney: hfp: If your testing the contents of the data, maybe that should be your test?
[03:42:23] kp666: has joined #RubyOnRails
[03:44:08] _3by8: Anyone have experience with Git? I just changed the .gitignore file to include database.yml since the settings are different on my development machine vs the remote server now when I issue git pull on the remote server, I think it wants to delete the database.yml file. How can I avoid that?
[03:45:23] arup_r: has joined #RubyOnRails
[03:45:58] comm64x: has joined #RubyOnRails
[03:47:35] jgpawletko_: has joined #RubyOnRails
[03:53:16] comm64x: has left #RubyOnRails: ()
[03:54:43] comm64x: has joined #RubyOnRails
[03:54:57] comm64x: would you say that the paths in your navigation are a function of your routes in mathematical terms , e.g. f(x)
[03:54:58] hfp: Ropeney: Yeah I guess I should have one test per field instead of testing all the fields at once
[03:55:28] comm64x: am I getting that right or am I backwards
[03:58:04] dcunit3d: has joined #RubyOnRails
[03:59:12] comm64x: or are your routes a function of the paths in your naviation
[03:59:30] pawnbox: has joined #RubyOnRails
[03:59:44] DonOtreply: has joined #RubyOnRails
[04:00:09] comm64x: I get like this sometimes and the only place that I can ever find decent answers is on irc lol
[04:01:09] comm64x: I'm thinkin its the earlier one
[04:02:32] sevenseacat: i don't get the question
[04:02:41] jgpawletko: has joined #RubyOnRails
[04:02:50] jgpawletko: has left #RubyOnRails: ()
[04:02:56] sevenseacat: the links in your navigation will use your route helpers, yes
[04:03:08] kirillzh: has joined #RubyOnRails
[04:05:55] comm64x: nevermind its not critical, I wasnt certain as to one or the other and wanted someone to verify my thought as accurate or not
[04:07:28] arup_r: comm64x: those routes helpers are there to create a url ( relative/absolute based on usage ) to your controller action.. that's it
[04:07:46] _Tariq: has joined #RubyOnRails
[04:08:45] comm64x: I understand how routes work ...it was just a thought I had and wasnt sure of something
[04:08:48] JoshGlzBrk: has joined #RubyOnRails
[04:09:05] comm64x: i may be too mathematical lol
[04:10:39] moeabdol: has joined #RubyOnRails
[04:10:43] safetypin: has joined #RubyOnRails
[04:10:54] barhum2013: has joined #RubyOnRails
[04:11:03] stannard: has joined #RubyOnRails
[04:12:08] IrishGringo_: has joined #RubyOnRails
[04:12:38] treaki: has joined #RubyOnRails
[04:13:03] stardiviner: has joined #RubyOnRails
[04:16:07] _Tariq: has joined #RubyOnRails
[04:16:34] moeabdol1: has joined #RubyOnRails
[04:16:45] braincras: has joined #RubyOnRails
[04:17:20] sleungcy: has joined #RubyOnRails
[04:17:51] riskish: has joined #RubyOnRails
[04:20:32] djbkd: has joined #RubyOnRails
[04:21:34] tego101: has joined #RubyOnRails
[04:23:08] IrishGringo: has joined #RubyOnRails
[04:25:49] comm64x: has left #RubyOnRails: ()
[04:26:21] peterevjan: has joined #RubyOnRails
[04:28:30] Jon30: https://github.com/thoughtbot/guides/tree/master/style/rails --- "Avoid member and collection routes." but.. but why??
[04:29:24] sevenseacat: ACTION shrugs
[04:35:06] Axy: has joined #RubyOnRails
[04:36:15] coderMe: has joined #RubyOnRails
[04:36:34] tildes: has joined #RubyOnRails
[04:38:14] askhat: has joined #RubyOnRails
[04:38:42] peterevjan: has joined #RubyOnRails
[04:39:08] funnel: has joined #RubyOnRails
[04:39:20] pawnbox: has joined #RubyOnRails
[04:40:01] coderMe: has joined #RubyOnRails
[04:40:01] peterevjan: has joined #RubyOnRails
[04:43:37] JoshGlzBrk: has joined #RubyOnRails
[04:43:38] Radar: My issue with style guides like this is that they don't give reasonings as to why
[04:44:00] Radar: https://github.com/bbatsov/ruby-style-guide is better for this reason
[04:45:58] duderonomy: has joined #RubyOnRails
[04:47:03] arashb: has joined #RubyOnRails
[04:47:09] stardiviner: has joined #RubyOnRails
[04:48:08] sevenseacat: there are some things I don't entirely agree with in that guide either, but will concede if others really feel strongly about them
[04:48:13] Eswar: has joined #RubyOnRails
[04:49:01] sevenseacat: like https://github.com/bbatsov/ruby-style-guide#indent-conditional-assignment i hate that kind of indentation
[04:49:07] IrishGringo_: has joined #RubyOnRails
[04:49:20] moei: has joined #RubyOnRails
[04:49:39] ziyadb: has joined #RubyOnRails
[04:50:08] coderMe: has joined #RubyOnRails
[04:52:04] sevenseacat: Radar: zomg stop copyin me
[04:54:55] kies^: has joined #RubyOnRails
[04:56:00] askhat: has joined #RubyOnRails
[04:56:09] seaworthy: has joined #RubyOnRails
[04:57:43] arup_r: has joined #RubyOnRails
[04:57:59] IrishGringo: has joined #RubyOnRails
[05:00:53] pawnbox: has joined #RubyOnRails
[05:01:05] IrishGringo: has joined #RubyOnRails
[05:01:27] Devalo: has joined #RubyOnRails
[05:06:14] techsethi: has joined #RubyOnRails
[05:07:58] kirillzh: has joined #RubyOnRails
[05:11:18] hahuang65: has joined #RubyOnRails
[05:11:20] arup_r: has joined #RubyOnRails
[05:14:20] AnonRecluse13: has joined #RubyOnRails
[05:15:44] sleungcy: has joined #RubyOnRails
[05:15:51] Eswar: has joined #RubyOnRails
[05:19:16] askhat: has joined #RubyOnRails
[05:21:34] srinidhi: has joined #RubyOnRails
[05:24:24] Pathfinder: has joined #RubyOnRails
[05:24:49] waka: has joined #RubyOnRails
[05:26:03] askhat: has joined #RubyOnRails
[05:26:18] safetypin: has joined #RubyOnRails
[05:28:52] IrishGringo: has joined #RubyOnRails
[05:29:02] askhat: has joined #RubyOnRails
[05:30:25] RegulationD: has joined #RubyOnRails
[05:34:46] barhum2013: has joined #RubyOnRails
[05:36:32] xardion: has joined #RubyOnRails
[05:37:02] roshanavand: has joined #RubyOnRails
[05:37:41] IrishGringo: has joined #RubyOnRails
[05:45:13] Limix: has joined #RubyOnRails
[05:46:45] arup_r: has joined #RubyOnRails
[05:47:45] barhum2013: has joined #RubyOnRails
[05:49:53] Jon30: i am using dragonfly with config.action_dispatch.rack_cache = true, and i am using image.thumbnail('300x300>').url, and basically the first time the image tries to load, the browser gets a 404 error, but after reloading the page, the images load fine
[05:51:15] Devalo: has joined #RubyOnRails
[05:53:06] stannard: has joined #RubyOnRails
[05:53:07] dionysus69: has joined #RubyOnRails
[05:55:17] shantefa: has joined #RubyOnRails
[05:56:18] shantefa: Could anyone recommend a way to build javascript dynamically from rails?
[05:56:19] coderMe: has joined #RubyOnRails
[05:59:11] arup_r: shantefa: What you want to build using JS ?
[05:59:30] arup_r: or what kind of code?
[05:59:51] shantefa: arup_r: i want to dynamically build a javascript library from rails
[06:00:10] shantefa: injecting certain params from my webapp into the js code
[06:00:27] jgt4: has joined #RubyOnRails
[06:01:26] quazimodo: has joined #RubyOnRails
[06:01:28] quazimod1: has joined #RubyOnRails
[06:03:20] iamjhu: has joined #RubyOnRails
[06:03:56] ferr: I have have a Program model which has many price lists, in html view when program is selected, I need to choose from one of its price lists, how would I do that?
[06:05:36] ur5us: has joined #RubyOnRails
[06:07:17] techsethi: has joined #RubyOnRails
[06:07:30] arup_r: ferr: you need to make 2 dropdowns, where one will be dependent on the other.. something like that
[06:08:16] ferr: Ok, that is fine, but I need to update price lists drop down according to the selection of the program, that is where I struggle
[06:09:29] arup_r: shantefa: if you code inside the view like using a http://apidock.com/rails/ActionView/Helpers/AssetTagHelper/javascript_include_tag , then using ERB tool you can do it. But those JS codes are app/assets/javasctipts dir, you can't AFAIK
[06:09:50] arup_r: ferr: Using JQuery/JS code you can do it.
[06:11:57] arup_r: ferr: you need to arrange the dom of the second dropdown which is dependent on the first one, so that a value change to the first, will help your JS to hide and show required options from the second dropdown
[06:12:27] ferr: I haven't written a single line of JS, but thanks, I'll take a look
[06:15:06] DubiousCarrot: has joined #RubyOnRails
[06:16:46] shantefa: arup_r: ok cool, thanks for the advice
[06:18:13] ur5us: has joined #RubyOnRails
[06:18:18] darkxploit: has joined #RubyOnRails
[06:27:25] levifig: has joined #RubyOnRails
[06:27:58] barhum2013: has joined #RubyOnRails
[06:29:04] stardiviner: has joined #RubyOnRails
[06:33:26] zz_timnovinger: has joined #RubyOnRails
[06:34:46] ensyde: has joined #RubyOnRails
[06:34:48] t_p: has joined #RubyOnRails
[06:39:39] rvanlieshout: has joined #RubyOnRails
[06:42:12] arooni-mobile: has joined #RubyOnRails
[06:43:25] moeabdol2: has joined #RubyOnRails
[06:45:24] barhum2013: has joined #RubyOnRails
[06:49:39] arashb: has joined #RubyOnRails
[06:53:29] ur5us: has joined #RubyOnRails
[06:58:29] bronson_: has joined #RubyOnRails
[07:01:54] intrigueD: has joined #RubyOnRails
[07:01:54] baash05: has left #RubyOnRails: ()
[07:01:58] intrigueD: has joined #RubyOnRails
[07:02:40] yoongkang: has joined #RubyOnRails
[07:03:57] techsethi: has joined #RubyOnRails
[07:08:10] hahuang61: has joined #RubyOnRails
[07:10:29] scepticulous: has joined #RubyOnRails
[07:12:51] solars: has joined #RubyOnRails
[07:14:20] quazimodo: has joined #RubyOnRails
[07:14:25] quazimod1: has joined #RubyOnRails
[07:15:07] nocontrol: has joined #RubyOnRails
[07:15:14] nocontrol: can anyone please help ? http://stackoverflow.com/questions/35221886/export-foreman-workers-from-rails-app-to-systemd
[07:15:37] ur5us: has joined #RubyOnRails
[07:15:51] Spami: has joined #RubyOnRails
[07:16:11] rvanlieshout: nocontrol: systemd doesn't use /etc/init iirc
[07:16:13] sleungcy: has joined #RubyOnRails
[07:16:30] moeabdol3: has joined #RubyOnRails
[07:16:32] rvanlieshout: so if it's in /etc/init use 'start seriapp'
[07:17:20] exadeci: has joined #RubyOnRails
[07:17:21] rvanlieshout: that's upstart
[07:17:42] Glyphik: has joined #RubyOnRails
[07:17:53] nocontrol: rvanlieshout: you're right, I am running it again
[07:18:45] nocontrol: rvanlieshout: rvmsudo foreman export systemd -a seriapp -u deploy says I must specify a location
[07:19:54] moeabdol4: has joined #RubyOnRails
[07:20:02] rvanlieshout: https://github.com/ddollar/foreman/blob/59d87c91a2004e05f6b12d4b150dcb4c911eb31c/lib/foreman/export/systemd.rb
[07:20:09] rvanlieshout: find out what location holds those files for you
[07:21:19] rvanlieshout: there is a 'User unit directories' in the manpage
[07:21:22] comrad: has joined #RubyOnRails
[07:21:25] gingray: has joined #RubyOnRails
[07:21:36] codezomb: has joined #RubyOnRails
[07:21:41] rvanlieshout: pkg-config systemd --variable=systemduserunitdir
[07:21:43] barhum2013: has joined #RubyOnRails
[07:24:08] nocontrol: rvanlieshout: /usr/lib/systemd/user
[07:24:12] nocontrol: I can try that
[07:24:27] tego101: has joined #RubyOnRails
[07:25:58] ayonkhan: has joined #RubyOnRails
[07:29:35] nocontrol: rvanlieshout: same think
[07:29:48] nocontrol: rvanlieshout: I must be doing something entirely wrong
[07:29:51] rvanlieshout: did it create files?
[07:29:59] nocontrol: it always does
[07:30:07] rvanlieshout: where and what's the content?
[07:31:44] nocontrol: I did a ls /usr/lib/systemd/user and it's there
[07:31:59] nocontrol: several conf and target files
[07:32:57] Pazician: has joined #RubyOnRails
[07:32:57] Pazician: has joined #RubyOnRails
[07:33:10] JohnBat26: has joined #RubyOnRails
[07:33:13] rvanlieshout: gits the content
[07:33:24] rvanlieshout: , command used to start en full error
[07:33:27] nocontrol: rvanlieshout: If I do systemctl start seriapp I get an access denied error
[07:33:40] nocontrol: so I must run it with sudo or rvmsudo
[07:33:46] rvanlieshout: so you must debug
[07:33:50] rvanlieshout: not just assume things
[07:34:35] nocontrol: am I supposed to run it with sudo or not ?
[07:34:44] rvanlieshout: don't know unless you've debugged this
[07:34:49] rvanlieshout: don't just try things
[07:35:01] nocontrol: where should I start
[07:35:13] rvanlieshout: wit the full error
[07:35:15] rvanlieshout: and content of the file
[07:35:23] yardenbar: has joined #RubyOnRails
[07:36:18] nocontrol: which one ?
[07:36:29] rvanlieshout: the one failing
[07:37:34] nocontrol: the conf file has only two lines start and stop on runlevel
[07:37:41] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[07:39:15] jeanre: has joined #RubyOnRails
[07:40:05] jeanre: has joined #RubyOnRails
[07:40:24] nocontrol: rvanlieshout: https://gist.github.com/chrisvel/8e86b63c192efa2ad4c1
[07:40:41] aganov: has joined #RubyOnRails
[07:41:24] rvanlieshout: so this file doesn't really start anything
[07:41:24] Radar: ACTION missed the part where this was Rails
[07:41:34] rvanlieshout: it's not. it's generated by whenever
[07:41:36] Cervajz: has joined #RubyOnRails
[07:43:55] Cervajz_: has joined #RubyOnRails
[07:44:17] nocontrol: rvanlieshout: check the command I did to run it
[07:44:20] futilegames: has joined #RubyOnRails
[07:44:38] nocontrol: Radar: it's mixed because it has foreman, but If it offends this room I'll shut up
[07:44:46] rvanlieshout: nocontrol: you didn't git any error yet
[07:44:50] Radar: nocontrol: it's more so that we can't reproduce it
[07:45:02] qurve: has joined #RubyOnRails
[07:45:17] qurve: Anyone have a gem they like for generating a styleguide within a rails app in development mode?
[07:45:27] qurve: hologram looked pretty good, but I want something that just hooks directly into rails.
[07:46:17] nocontrol: rvanlieshout: I added the error
[07:46:25] tego101: has joined #RubyOnRails
[07:46:52] rvanlieshout: nocontrol: you gisted files A and tried to start B
[07:47:59] nocontrol: rvanlieshout: I added an ls to the folder also, not sure what else https://gist.github.com/chrisvel/8e86b63c192efa2ad4c1
[07:48:15] rvanlieshout: nocontrol: what did you try to start?
[07:48:21] rvanlieshout: what service?
[07:48:24] rvanlieshout: read that error
[07:48:41] Radar: sudo systemctl start serial-app
[07:48:47] Radar: Shouldn't that be serial-api?
[07:48:50] MaDErroR123: has joined #RubyOnRails
[07:48:57] ferr: Order belongs to program/bath/procedure which each has many price lists, how do I assign price_list to order? https://gist.github.com/Fercell/abac2504da8964fbdd2f
[07:49:04] rvanlieshout: and now you've just included sudo again.. without reading or knowing why
[07:49:10] nocontrol: Failed to start serial-api.service: Unit serial-api.service failed to load: No such file or directory.
[07:49:18] rvanlieshout: ferr: directly? you can't
[07:49:28] nocontrol: rvanlieshout: you're right about the error but foreman doesn't generate a .service file
[07:49:38] nocontrol: rvanlieshout: it might be the root of the error
[07:49:39] rvanlieshout: nocontrol: no. cause it's separate services
[07:50:05] ferr: rvanlieshout: I use polymorphic association
[07:50:07] nocontrol: rvanlieshout: If I do without sudo, then Failed to start serial-api.service: Access denied
[07:50:19] rvanlieshout: nocontrol: but there is no serial-api.service
[07:50:20] rvanlieshout: to start with
[07:50:56] ferr: Shall I do price_list has_many orders, as: :orderable
[07:50:59] nocontrol: there's no .service because foreman doesn't generate it but when I try to start it I get an access denied
[07:51:02] MaDErroR123: has joined #RubyOnRails
[07:51:26] rvanlieshout: ferr: order has no direct relationship with price_list, so rails couldn't know wat of 3 relationships it should use
[07:51:35] rvanlieshout: nocontrol: why would want to start it if it doesn't exist?
[07:52:13] ferr: rvanlieshout: how would u solve this issue then
[07:52:18] nocontrol: rvanlieshout: I am lost between foreman that generates the files automatically and a file that hasn't been generated
[07:52:35] rvanlieshout: ferr: if i would give you a price_list and the request to add it to an order. how would you do that?
[07:52:46] rvanlieshout: nocontrol: there is no service serial-api and there won't be one
[07:52:53] nocontrol: rvanlieshout: so either foreman puts the service file elsewhere or it doesn't work well and I am trying to run a non existing service
[07:53:01] rvanlieshout: you have serial-api-clock-1, serial-api-web-1 and serial-api-worker-1
[07:53:07] nocontrol: rvanlieshout: is it normal ?
[07:53:16] nocontrol: rvanlieshout: yes but .target runs them all
[07:53:17] rvanlieshout: what would a service serial-api do?
[07:53:26] nocontrol: rvanlieshout: start them
[07:53:27] rvanlieshout: so how would one start target files with systemd?
[07:53:31] ferr: rvanlieshout: I would store price list id
[07:53:33] nocontrol: rvanlieshout: at least the puma server
[07:54:09] ferr: in orders table
[07:54:11] rvanlieshout: ferr: program, batch or procedure?
[07:54:24] rvanlieshout: oh. so you order has a direct relationship with a price list?
[07:54:30] ferr: No it does not
[07:54:35] rvanlieshout: so then where?
[07:54:45] nocontrol: rvanlieshout: even If I try to run systemctl start serial-api-web-1.service I get the same error
[07:54:45] rvanlieshout: if your order has a price_list_id it has a direct relationship with price_list
[07:54:45] ferr: orders table price_list_id
[07:54:57] rvanlieshout: nocontrol: same error being the permission denid?
[07:55:11] rvanlieshout: could that not be caused by the fact that you created those files with rvmsudo while you shouldn't have?
[07:55:13] nocontrol: rvanlieshout: without sudo yes
[07:55:30] rvanlieshout: who is the owner of serial-api-web-1.service
[07:55:36] ferr: rvanlieshout: it does not have price_list_id column
[07:55:51] rvanlieshout: ferr: so where would you store it?
[07:56:05] ferr: It is already stored in program/bath/procedure table
[07:56:44] rvanlieshout: then why are we assigning a new one?
[07:57:07] arBmind: has joined #RubyOnRails
[07:57:56] ferr: Program/bath/procedure each has many price lists while order can only have one
[07:58:00] nocontrol: rvanlieshout: If run foreman without rvmsudo/sudo -> ../.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/fileutils.rb:1450:in `unlink': Permission denied @ unlink_internal - /usr/lib/systemd/user/serial-api.target (Errno::EACCES)
[07:58:41] yoongkang: has joined #RubyOnRails
[07:58:45] ferr: User needs to select the price list which should be stored on the order
[07:58:50] qurve: Uh, sanity check, is rubygems down? I can't bundle/install but I'm not sure if it's just me or not.
[07:59:31] sevenseacat: the website seems okay
[08:00:10] Radar: http://status.rubygems.org/
[08:00:18] rvanlieshout: nocontrol: remove those files first
[08:00:24] sevenseacat: ACTION bookmarks
[08:00:31] Radar: no tweets about it
[08:00:38] Radar: qurve: looks like it's a "just you" problem
[08:00:53] rvanlieshout: ferr: but you just told me there is no direct relationship
[08:00:54] qurve: I think something in my docker broke.
[08:00:59] DoubleMalt: has joined #RubyOnRails
[08:01:29] nocontrol: rvanlieshout: I did and tried foreman again and now I get the same error but with `initialize': Permission denied @ rb_sysopen
[08:01:41] ferr: there is no direct relationship, but there is relationship through programs/baths/procedures. Is this direct?
[08:01:43] rvanlieshout: nocontrol: did you read about systemd?
[08:02:00] rvanlieshout: and how it works?
[08:02:05] Eswar: has joined #RubyOnRails
[08:02:34] ferr: Could you please check my models? https://gist.github.com/Fercell/abac2504da8964fbdd2f
[08:02:49] nocontrol: rvanlieshout: to be honest no, but I did for foreman
[08:04:18] rvanlieshout: i'm not that familiar with user services and their permissions
[08:04:20] jas02: has joined #RubyOnRails
[08:04:33] rvanlieshout: but i just don't like adding sudo when things fail before knowing if we need that
[08:05:21] rvanlieshout: ferr: so you're not asking your user for a price list for an order, but for an orderable
[08:05:45] nocontrol: rvanlieshout: anything to suggest ?
[08:05:58] ferr: rvanlieshout: I'm sorry, yes, I am asking for an orderable
[08:06:14] rvanlieshout: nocontrol: their documentation
[08:06:36] p1k: has joined #RubyOnRails
[08:07:01] DubiousCarrot: has joined #RubyOnRails
[08:07:52] arBmind: has joined #RubyOnRails
[08:08:02] p1k: is there a nice way to introspect that set of migrations that make up a particular table
[08:09:24] djbkd: has joined #RubyOnRails
[08:09:47] arBmind1: has joined #RubyOnRails
[08:10:44] nocontrol: rvanlieshout: anything else ?
[08:11:01] cjk101010: has joined #RubyOnRails
[08:11:02] rvanlieshout: nocontrol: nothing found?
[08:11:10] matthewd: rvanlieshout: Isn't interacting with systemd the prototypical case for when you should actually be using sudo? You're asking socratic questions, but you seem to be very clearly implying it's the wrong thing to do. :/
[08:11:12] futilegames: has joined #RubyOnRails
[08:11:29] rvanlieshout: matthewd: sudo for user based services?
[08:11:48] Radar: rvanlieshout: Services are started by root, but run as the user.
[08:12:03] Radar: Am I wrong there?
[08:12:15] rvanlieshout: trying to have nocontrol find it in the manual of it
[08:12:45] darutoko: has joined #RubyOnRails
[08:12:57] nocontrol: I am desperately confused
[08:13:06] Radar: nocontrol: agree
[08:13:13] Cervajz: has joined #RubyOnRails
[08:13:19] Radar: Here's one upstart file that I have: https://gist.github.com/radar/977444c5a378f3422f97
[08:13:31] rvanlieshout: yeah. but upstart != systemd
[08:13:32] Radar: (and I just noticed it has a wrong comment, but whatever)
[08:13:38] barhum2013: has joined #RubyOnRails
[08:13:39] nocontrol: Radar: I dumped upstart
[08:14:00] nocontrol: nothing personal, I read that it's been replaced by systemd
[08:14:00] Radar: Right, but my point is that they might act similarly to one another.
[08:14:11] Radar: I restart that with `sudo service railsbot restart`
[08:14:33] nocontrol: I can't find anything similar https://wiki.debian.org/systemd
[08:15:02] Cervajz_: has joined #RubyOnRails
[08:17:32] matthewd: rvanlieshout: I didn't see any mention of using --user / a per-user systemd instance... and foreman is trying to install into what I assume (hope!) is a root-owned directory
[08:17:39] nocontrol: foreman doesn't have permissions, with sudo it is wrong but some say it's right to use it but it fails to find a .service file that foreman is supposed to generate but it doesn't but wait - it doesn't need a service because it runs three services from a .target
[08:17:43] nocontrol: that's the problem :(
[08:18:24] rvanlieshout: nocontrol: there is nothing wrong with a target file
[08:18:31] rvanlieshout: ok. create those things as root again
[08:18:39] rvanlieshout: and verify that it switches to the correct user
[08:18:45] rvanlieshout: before starting them
[08:18:50] rvanlieshout: if not, it shouldn't be created as root
[08:19:01] sleungcy: has joined #RubyOnRails
[08:19:09] shahidbscs: has joined #RubyOnRails
[08:19:25] shahidbscs: Morning: https://gist.github.com/shahidbscs/5ecb200f77a7a38deadf
[08:19:54] nocontrol: rvanlieshout: and verify that it switches to the correct user = ?
[08:20:05] rvanlieshout: nocontrol: read the content of the file
[08:20:07] rvanlieshout: understand what it does
[08:20:15] nocontrol: the target ?
[08:20:21] rvanlieshout: any file it creates
[08:20:24] IrishGringo: has joined #RubyOnRails
[08:20:29] shahidbscs: I have issue with params, on debug its return correct value but on def return {}
[08:20:40] shahidbscs: here is gist https://gist.github.com/shahidbscs/5ecb200f77a7a38deadf
[08:21:06] rvanlieshout: shahidbscs: add the full request log
[08:23:35] sandstrom: has joined #RubyOnRails
[08:25:11] Devalo: has joined #RubyOnRails
[08:26:52] prgmmr: has joined #RubyOnRails
[08:28:24] futilegames: has joined #RubyOnRails
[08:28:48] Cervajz: has joined #RubyOnRails
[08:29:21] arup_r: has joined #RubyOnRails
[08:29:23] nocontrol: rvanlieshout: did an ls /usr/lib/systemd/user -ll and found out the other ones are symlinks to another directory, for example shutdown.target -> /lib/systemd/system/shutdown.target
[08:29:50] nocontrol: rvanlieshout: so I did a rvmsudo foreman export systemd /lib/systemd/system -a serial-api -u pi
[08:29:50] p1k: Radar: so I guess SchemaDumper has a table method but it's actually a nested definition within tables
[08:30:07] p1k: so I'd need to extract it out to use it ~ which could be nicer i guess, but does work
[08:30:34] nocontrol: and then I did a sudo systemctl start serial-api which failed because it asked for .service
[08:30:43] agoldboi: has joined #RubyOnRails
[08:30:52] nocontrol: rvanlieshout: finally I did a sudo systemctl start serial-api.target and it seems it's running so that's the right folder
[08:31:01] rvanlieshout: as the right user?
[08:31:10] nocontrol: rvanlieshout: rvmsudo
[08:31:16] rvanlieshout: running as the right user
[08:31:24] nocontrol: no way to run it without sudo
[08:31:46] rvanlieshout: but is it running as the right user
[08:31:57] rvanlieshout: not related to how you've started it
[08:32:01] nocontrol: hmmm how can I find it
[08:32:11] rvanlieshout: back in 10. try something with ps
[08:33:12] roshanavand: has joined #RubyOnRails
[08:33:29] nocontrol: rvanlieshout: only thing I could find with ps aux is pi 566 0.0 0.3 4976 3388 ? Ss 08:12 0:00 /lib/systemd/systemd --user
[08:33:36] nocontrol: so I suppose it runs as the right one ?
[08:36:04] chouhoulis: has joined #RubyOnRails
[08:38:04] nocontrol: but again it seems running but puma no
[08:38:09] shahidbscs: thanks rvanlieshout: gist update with log
[08:38:20] shahidbscs: https://gist.github.com/shahidbscs/5ecb200f77a7a38deadf
[08:38:29] nocontrol: rvanlieshout: God, I wonder how cloud66 and heroku are doing this
[08:38:40] nocontrol: I hope there was another way to set this up
[08:42:22] darkxploit: has joined #RubyOnRails
[08:43:57] rvanlieshout: shahidbscs: that's not a request log
[08:44:10] rvanlieshout: also your debug results don't include a 'tags'
[08:44:24] rvanlieshout: nocontrol: so it's running as root
[08:44:32] rafaelfranca: has joined #RubyOnRails
[08:44:37] rvanlieshout: do the generated files contain anything what would make them run as an other user?
[08:44:46] nocontrol: rvanlieshout: bundle exec
[08:44:57] nocontrol: nothing else
[08:45:04] shahidbscs: its include @tags_params={}
[08:45:10] nocontrol: I can let only bundle exec puma execute
[08:45:11] rvanlieshout: so that's why it's running as the wrong user
[08:45:21] nocontrol: rvanlieshout: that's = ?
[08:45:25] rvanlieshout: find out how you should tell systemd to run things as a given user
[08:45:55] nocontrol: rvanlieshout: there's a -u username attribute and I've added
[08:46:08] rvanlieshout: i've really got no clue about what that does
[08:46:10] nocontrol: but maybe bundler or puma are installed with rvmsudo
[08:46:22] nocontrol: I always install them with rvmsudo
[08:46:38] shahidbscs: rvanlieshout and also in tags_params you can see the Rails.logger.debug result
[08:46:41] rvanlieshout: you shouldn't be using sudo when using bundler in production
[08:47:04] rvanlieshout: shahidbscs: include the full request log (again)
[08:47:06] rvanlieshout: and inspect params
[08:47:09] nocontrol: rvanlieshout: it starts to make sense
[08:47:29] rvanlieshout: and inspect params.permit(tags: [:id, :label])
[08:47:35] nocontrol: rvanlieshout: so you're saying that bundler (even bundle exec) must be run as another user ?
[08:48:07] rvanlieshout: as the app user
[08:48:27] rvanlieshout: that's why 'bundle install --deployment --without development test' installs gems in a local folder
[08:48:30] rvanlieshout: not using sudo
[08:48:57] MaDErroR123: has joined #RubyOnRails
[08:49:30] nocontrol: rvanlieshout: at least it works and I have something to build on
[08:49:39] shahidbscs: rvanlieshout: by inspecting params.permit(tags: [:id, :label]) it return {"tags"=>nil}
[08:49:52] nocontrol: rvanlieshout: man thank you SO MUCH for spending time on something not even 50% Rails
[08:49:56] rvanlieshout: shahidbscs: and params.inspect?
[08:50:05] rvanlieshout: nocontrol: it's not even 5% rails :)
[08:50:24] nocontrol: rvanlieshout: agree. Appreciation is all I can give.
[08:50:44] Deck-: has joined #RubyOnRails
[08:51:38] shahidbscs: rvanlieshout: updated on gist
[08:53:28] rvanlieshout: shahidbscs: http://patshaughnessy.net/2014/6/16/a-rule-of-thumb-for-strong-parameters
[08:54:06] rvanlieshout: so you've got tags: [:id, :label]
[08:54:22] rvanlieshout: section 'To Permit an Array, Pass a Hash'
[08:54:27] rvanlieshout: could you add an indented version of the params?
[08:54:53] _3by8: has joined #RubyOnRails
[08:55:25] shahidbscs: my apology I'm just a new on rails. let me try to read link
[08:55:31] _3by8: As I'm typing in ActionMailer stuff here, my IDE is recommending methods named deliver_method_name and create_method_name. Does deliver_method_name do the same thing as method_name.deliver_now?
[08:55:38] rvanlieshout: yeah. i always need a reference when it comes down to strong params
[08:57:18] arBmind: has joined #RubyOnRails
[08:57:59] askhat: has joined #RubyOnRails
[09:01:02] mdw: has joined #RubyOnRails
[09:01:54] matthewd: _3by8: Those (deliver_foo, create_foo) are the older method names, IIRC
[09:02:07] neilfse: has joined #RubyOnRails
[09:03:18] defsdoor: has joined #RubyOnRails
[09:04:13] jsrn_: has joined #RubyOnRails
[09:04:24] jeanre: has joined #RubyOnRails
[09:05:15] marr: has joined #RubyOnRails
[09:05:37] _3by8: matthewd: so everybody uses deliver_now now
[09:05:41] _3by8: got it! thanks
[09:05:55] rvanlieshout: deliver_later
[09:06:41] jeanre: has joined #RubyOnRails
[09:06:47] shahidbscs: rvanlieshout: apology lit bit confuse, could you be specific for this line please params.permit(tags: [:id, :label])[:tags] || {}
[09:07:48] rvanlieshout: specific about what?
[09:09:07] techsethi: has joined #RubyOnRails
[09:09:59] shahidbscs: mean what should I do on this line to fix
[09:10:13] shahidbscs: this is only one line def
[09:10:19] rvanlieshout: dunno. find it hard to debug without a proper debug log
[09:10:21] matthewd: shahidbscs: You need to look closer at what's actually going on
[09:10:41] rvanlieshout: away for 30 min
[09:10:43] matthewd: shahidbscs: And don't over-trim things just to make them more confusing
[09:10:48] dopamean_: has joined #RubyOnRails
[09:10:56] mark2: has joined #RubyOnRails
[09:11:17] matthewd: shahidbscs: Your "Debug result" doesn't contain the whole line from the debug log, and that's making it unclear
[09:11:46] nocontrol: has joined #RubyOnRails
[09:11:58] berserk_ren: has joined #RubyOnRails
[09:12:01] agoldboi: has joined #RubyOnRails
[09:12:17] shahidbscs: matthewd: here you can see https://gist.github.com/shahidbscs/5ecb200f77a7a38deadf
[09:12:21] nocontrol: rvanlieshout: I used to setup my projects with nginx & passenger. Now that I moved to the puma & foreman track (using cloud66 at work) do I still need nginx ?
[09:12:41] rvanlieshout: nocontrol: do you want puma to serve static assets?
[09:12:47] rvanlieshout: anyway. off for a while
[09:13:01] matthewd: [19:41:16] <matthewd> shahidbscs: Your "Debug result" doesn't contain the whole line from the debug log, and that's making it unclear
[09:13:11] nocontrol: matthewd: do you have any idea ?
[09:13:22] nocontrol: matthewd: it's just a theoretical question
[09:13:24] msyvich: has joined #RubyOnRails
[09:13:45] marr: has joined #RubyOnRails
[09:14:54] baweaver: has joined #RubyOnRails
[09:15:08] shahidbscs: matthewd: on gist I create a file 'full_request_log' which contain full params.inpect result
[09:15:53] shahidbscs: and on 'Debug result' it only contain inspect result of params[:tags].inspect not whole params
[09:16:08] matthewd: shahidbscs: But it's not the whole line
[09:16:47] shahidbscs: my apology, I din't get your mean with whole line here
[09:17:17] matthewd: nocontrol: Personally I prefer to leave static file serving to nginx.. but it's certainly possible to run without it
[09:17:33] nocontrol: matthewd: so both of them must be setup ?
[09:17:53] nocontrol: matthewd: I remember when I had to setup passenger with nginx and was really a pain
[09:17:55] matthewd: shahidbscs: The 'Debug result' doesn't contain "@shahidtest1@base_business_saver", for example
[09:18:22] shahidbscs: oh this is just comments I wrote to find inside log file
[09:18:33] nocontrol: matthewd: but I don't know the differences nginx/puma because they both appear to be webservers
[09:19:16] shahidbscs: matthewd: I just updated again gist with last Debug result with full line
[09:20:37] matthewd: shahidbscs: Great... now look closely at the value being shown there
[09:20:59] shahidbscs: yes, in debug its working
[09:21:15] matthewd: shahidbscs: No, look closer
[09:21:23] shahidbscs: the problem is when I'm calling tags_params it return {}
[09:21:25] matthewd: Every character is significant
[09:21:46] _3by8: How can I troubleshoot ActionMailer? My mail.log isn't showing me any mails sent. One function is working but none of the others are. Am I missing something simple?
[09:21:50] matthewd: (especially the ones you'd previously discarded)
[09:22:25] ur5us: has joined #RubyOnRails
[09:23:10] shahidbscs: matthewd: it should not return [:tags] ?
[09:24:05] matthewd: shahidbscs: What is the class of the following? "foo"
[09:24:53] DoubleMalt: has joined #RubyOnRails
[09:24:55] barhum2013: has joined #RubyOnRails
[09:25:40] dopamean_: has joined #RubyOnRails
[09:26:48] Devalo: has joined #RubyOnRails
[09:27:02] _3by8: I'm passing an instance variable to a private function in a controller to send a mail but the mailer function is never called. Why is that?
[09:27:51] shahidbscs: matthewd: class UserBusinessesController < ApplicationController
[09:29:10] matthewd: shahidbscs: No, "foo" is not a UserBusinessesController. It's a String.
[09:29:29] sevenseacat: ACTION is blinking a *lot*
[09:29:37] _3by8: https://gist.github.com/threebyeight/c9beb1bf84f5c45db46d
[09:29:40] _3by8: That's not working...
[09:30:00] sevenseacat: _3by8: !didntwork
[09:30:00] helpa: _3by8: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[09:30:10] shahidbscs: matthewd: my apology, i just new to rails so some time not get the technical terms
[09:30:43] _3by8: sevenseacat: If I call the mailer function in that block of code "update order", it doesn't work. If I call it outside, it's fine. Wondering why. I'm guessing I don't understand something about Ruby.
[09:30:57] sevenseacat: _3by8: that doesnt answer the question
[09:31:00] Cervajz__: has joined #RubyOnRails
[09:31:00] sevenseacat: what "doesnt work"?
[09:31:13] _3by8: Oh, the mail is never sent.
[09:31:19] _3by8: I checked mail.log, nothing there.
[09:31:20] matthewd: shahidbscs: So, having agreed that's a string, what class is this? "{\"foo\": 1}"
[09:31:27] _3by8: It's like the function never gets called.
[09:31:38] sevenseacat: does it get called? your fake code doesnt make it clear
[09:31:50] sevenseacat: what is 'if condition is met'?
[09:31:52] _3by8: The order flags get updated and flash is set but that's all. The mailer function just sits there.
[09:31:56] RegulationD: has joined #RubyOnRails
[09:31:57] sevenseacat: is the condition actually met?
[09:32:11] _3by8: Yeah, I see the appropriate flash message.
[09:32:17] sevenseacat: well thats good, there's no order flags or flash message in that code
[09:32:22] sevenseacat: can you gist your real code?
[09:32:27] msyvich: has joined #RubyOnRails
[09:34:53] craysiii1: has joined #RubyOnRails
[09:35:15] _3by8: sevenseacat: https://gist.github.com/threebyeight/01793ea8f61062dae23b
[09:36:01] sevenseacat: so if you're seeing a flash message, then update_order returns false, and if it returns false, then no email is sent
[09:36:07] agoldboi: has joined #RubyOnRails
[09:37:19] sevenseacat: now you can look at why update_order is returning false
[09:37:56] sevenseacat: wait, which flash message are you seeing
[09:38:02] sevenseacat: I just noticed there's another one way down there
[09:38:03] tvw: has joined #RubyOnRails
[09:38:03] shahidbscs: matthewd: apology I still didn't get how to answer. by the way thank you so much
[09:38:04] jeanre: has joined #RubyOnRails
[09:38:08] chouhoulis: has joined #RubyOnRails
[09:38:14] Thouren: has joined #RubyOnRails
[09:38:20] jeanre: has joined #RubyOnRails
[09:39:04] matthewd: shahidbscs: That's a string too.
[09:39:49] _3by8: sevenseacat: within that block of code that returns true there's another flash message which I'm seeing. That's the only one I'm seeing.
[09:40:03] sevenseacat: no seriously, please answer the question
[09:40:06] _3by8: sevenseacat: oh, only read your first line :) yeah I'm seeing the important one.
[09:40:11] sevenseacat: there are two flash messages in that controller. which one are you seeing?
[09:40:18] shahidbscs: matthewd: so how should I return [:tags] here instead {} params.permit(tags: [:id, :label])[:tags] || {}
[09:40:24] _3by8: "order marked as shipped"
[09:40:53] sevenseacat: so where's the mailer code?
[09:41:35] srinidhi1: has joined #RubyOnRails
[09:42:51] _3by8: sevenseacat: so there's something about that bit of code that I noticed, it's an instance variable on line 28 but it shouldn't be. I just copy/pasted that line because I know that function works in my create definition. I'll Gist the mailer, sec.
[09:43:24] _3by8: https://gist.github.com/threebyeight/70f58136194836e48533
[09:43:56] sevenseacat: okay. can I see the logs that say this mailer method isnt being run?
[09:44:06] _3by8: It's just my mail.log, sec
[09:44:18] sevenseacat: no, the server logs
[09:44:37] _3by8: I should have checked that first, one second!
[09:45:01] _3by8: I just assumed if I didn't see sendmail trying to send it out then the function wasn't being called...
[09:45:13] sevenseacat: are you even using sendmail?
[09:45:36] nodejunkie: has joined #RubyOnRails
[09:45:39] _3by8: Why do you ask?
[09:45:46] sevenseacat: because its very unusual
[09:46:14] askhat: has joined #RubyOnRails
[09:46:44] stardiviner: has joined #RubyOnRails
[09:46:45] sevenseacat: I should stop making assumptions about people in this channel
[09:47:21] _3by8: Should I be using something other than sendmail? Is sendmail bad?
[09:47:37] matthewd: sendmail's not *that* unusual, is it? :/
[09:48:11] sevenseacat: pleeeeease can we get back to the logs
[09:48:13] rvanlieshout: hmm. we use sendmail in most of our projects
[09:48:17] rvanlieshout: but hey. what sevenseacat wrote :)
[09:48:19] sevenseacat: like, the actual problem
[09:48:27] CornishPasty: I've not used sendmail in the last 5 years :P
[09:49:11] lipoqil: has joined #RubyOnRails
[09:49:47] askhat: has joined #RubyOnRails
[09:51:25] askhat: has joined #RubyOnRails
[09:51:49] _3by8: sevenseacat: https://gist.github.com/threebyeight/b8457ff426c3327de45a
[09:52:19] arashb: has joined #RubyOnRails
[09:54:37] sevenseacat: this is in production?
[09:54:49] _3by8: sevenseacat: yes.
[09:55:02] sevenseacat: can we debug it in development?
[09:55:12] andrew9184: has joined #RubyOnRails
[09:55:24] stannard: has joined #RubyOnRails
[09:56:03] _3by8: sevenseacat: sure, if I just stop nginx and unicorn and prefix it with RAILS_ENV=development will that work?
[09:56:04] sergey_makagon: has joined #RubyOnRails
[09:56:33] Cervajz: has joined #RubyOnRails
[09:56:42] sevenseacat: don't run public-facing apps in development. ever.
[09:56:44] _3by8: I tried getting it into development mode earlier but I have no idea how... I know how to do it with WEBrick but that's it.
[09:56:57] _3by8: sevenseacat: security risk?
[09:56:59] sevenseacat: debug it on your own computer, in development.
[09:57:08] _3by8: sevenseacat: my ISP has port 25 blocked.
[09:57:28] _3by8: sendmail won't send anything as a result.
[09:57:40] sevenseacat: you dont actully send email in development
[09:57:47] Cervajz: has joined #RubyOnRails
[09:57:49] sevenseacat: do you not have a development environment...?
[09:57:59] CornishPasty: ACTION pats sevenseacat
[09:58:01] _3by8: I do, on my machine here, I've got WEBrick running on port 3000
[09:58:17] sevenseacat: great, let's debug this code there. can you gist the logs from running the action there?
[09:58:27] _3by8: Sure, one moment.
[09:58:36] _3by8: The stuff from development.log?
[09:59:06] _3by8: Give me a sec.
[10:00:30] arBmind: has joined #RubyOnRails
[10:00:59] dcunit3d: has joined #RubyOnRails
[10:01:29] yoongkang: has joined #RubyOnRails
[10:01:52] _3by8: sevenseacat: https://gist.github.com/threebyeight/309530e08ccaebad7d23
[10:02:17] sevenseacat: looks like the email is sending just fine.
[10:02:30] sevenseacat: your production mail config might be incorrect.
[10:02:34] FooMunki: has joined #RubyOnRails
[10:02:46] _3by8: It's sending emails from one function, just not the other... I'm going to try restarting nginx
[10:03:28] floror: has joined #RubyOnRails
[10:03:51] sevenseacat: https://gist.github.com/threebyeight/309530e08ccaebad7d23#file-gistfile1-txt-L53 is interesting though
[10:03:59] sevenseacat: unrelated i think, but interesting
[10:04:12] barhum2013: has joined #RubyOnRails
[10:04:39] _3by8: That is interesting and all I had to do was restart! Why is it forcing me to restart the HTTP server?
[10:04:43] askhat_: has joined #RubyOnRails
[10:05:20] _3by8: About those unpermitted parameters...
[10:05:49] sevenseacat: uh.... did you change the code without restarting the server? :)
[10:06:07] rvanlieshout: in production
[10:06:48] askhat: has joined #RubyOnRails
[10:07:53] _3by8: I've never had to do that in my development environment! lol
[10:08:08] rvanlieshout: you know the difference between a development and a production environment?
[10:08:10] dcunit3d: has joined #RubyOnRails
[10:08:47] _3by8: Yeah one is called "development" and the other is called "production", right?
[10:09:15] lessless: has joined #RubyOnRails
[10:09:21] gavit: _3by8: development has 'frequent' changes, so it allows updates without restarting :)
[10:09:36] _3by8: gavit: I knew that, obviously, thanks anyways though!
[10:09:52] _3by8: gavit: thanks for the pro-tip.
[10:09:53] rvanlieshout: it's not really 'allowing updates without restarting'
[10:10:15] gavit: _3by8: similar to that there are numerous other differences. A production server doesn't 'run' with errors in the code, while the dev environment runs, but throws you errors
[10:11:01] _3by8: gavit: I actually did know that.
[10:11:03] gavit: Anyone know where I can find a 'tutorial' or documentation on how to make a ror generator which creates several models?
[10:11:30] sevenseacat: ACTION sits thinking about _3by8 randomly making changes to production code wondering why they're not doing anything
[10:11:35] _3by8: rvanlieshout: would you mind telling me more?
[10:11:35] universa1: gavit: http://guides.rubyonrails.org/generators.html ?!
[10:11:40] Pathfinder_: has joined #RubyOnRails
[10:11:44] sevenseacat: this is a terrifying mental train of thought.
[10:11:50] _3by8: sevenseacat: you're having a blast thinking about it I'm sure but before I'm through with you, you'll be completely bald.
[10:12:07] rvanlieshout: _3by8: start with diff-ing config/environments/development.rb and config/environments/production.rb
[10:12:31] sevenseacat: _3by8: you'll be banned from here long before that happens.
[10:12:49] _3by8: sevenseacat: you'll need proof that I was purposely trying to bald you before that happens.
[10:13:14] sevenseacat: I wouldn't push it.
[10:13:43] askhat: has joined #RubyOnRails
[10:14:09] _3by8: rvanlieshout: "in the development environment your application's code is reloaded on every request"... enlightening.
[10:14:31] gavit: universa1: I read that, am even trying to read what devise is doing, but I think I need something in between.
[10:14:52] rvanlieshout: _3by8: did you diff those two files?
[10:14:57] universa1: gavit: so you know how to create a single model?
[10:15:22] _3by8: rvanlieshout: I don't want to read any man pages right now so I'm just doing a side-by-side comparison with two windows open.
[10:16:14] rvanlieshout: _3by8: that diff should guide you
[10:16:15] askhat: has joined #RubyOnRails
[10:16:15] gavit: universa1: no, I know how to make an initializer file and how to ask for a model name
[10:16:32] wethu: has joined #RubyOnRails
[10:16:43] roshanav_: has joined #RubyOnRails
[10:17:07] rafaelfranca: has joined #RubyOnRails
[10:17:54] SiliconDon: has joined #RubyOnRails
[10:18:01] Cervajz__: has joined #RubyOnRails
[10:18:53] universa1: gavit: so if you got a model file you just need to invoke the rails model generator... and hwo to invoke another generator method should be findable. have a look at the resource generator
[10:20:53] rrawlins: has joined #RubyOnRails
[10:21:08] _3by8: sevenseacat: you know that if/else block I showed you earlier that contained that OrderMailer bit? Let's say I have multiple blocks like that all pertaining to different keys that may be found as a param. Can you think of a cleaner way to do that? Maybe just say 2-3 words and I'll Google them?
[10:21:17] sleungcy: has joined #RubyOnRails
[10:21:33] astrofog: has joined #RubyOnRails
[10:21:34] _3by8: Should I be using 'case'?
[10:21:34] sevenseacat: _3by8: i wouldnt write anything that even remotely resembled that code.
[10:21:40] _3by8: sevenseacat: lol
[10:21:58] _3by8: sevenseacat: what part of Ruby would I want to investigate to clean that up?
[10:22:09] sevenseacat: _3by8: probably the getting started guide
[10:22:36] askhat: has joined #RubyOnRails
[10:23:28] _3by8: Let's see, I've got... Design Patterns in Ruby, Eloquent Ruby, The Well-grounded Rubyist, Practical Object-Oriented Design in Ruby and a few others... which should I read first?
[10:23:29] gregf_: has joined #RubyOnRails
[10:23:42] atmosx: has joined #RubyOnRails
[10:23:49] sevenseacat: the well grounded rubyist
[10:24:19] _3by8: That'll be my next project after I finish this.
[10:25:04] askhat: has joined #RubyOnRails
[10:25:12] gavit: ACTION is curious. _3by8 is this the code sevenseacat wouldn't touch: https://gist.github.com/threebyeight/70f58136194836e48533 ?
[10:25:33] sevenseacat: honestly, I don't want to be any kind of responsible for what you're doing
[10:26:03] techsethi: has joined #RubyOnRails
[10:26:04] _3by8: gavit: nope, it was this: https://gist.github.com/threebyeight/01793ea8f61062dae23b
[10:26:28] _3by8: sevenseacat: you share in the risk, you share in the riches
[10:26:38] sevenseacat: _3by8: hell no.
[10:27:19] _3by8: It's fairly secure, I think. I've covered all of my bases and made sure that someone at least as clever as I am can't access information they're not supposed to. There's checks everywhere...EVERYWHERE!
[10:27:37] sevenseacat: ACTION bites tongue
[10:27:59] chridal: https://gist.github.com/5c8625f2595f88da1314
[10:27:59] gavit: _3by8: https://gist.github.com/threebyeight/01793ea8f61062dae23b#file-gistfile1-txt-L27 <- Why isn't this handled in a model?
[10:28:02] chridal: could that cause me any grief?
[10:28:13] ElFerna: has joined #RubyOnRails
[10:28:20] universa1: chridal: what is that?
[10:28:22] chridal: With two 'has_many :flags'? Or is it fine because of 'as: taggable'
[10:28:38] Grundell_: has joined #RubyOnRails
[10:28:41] chridal: Yea, sorry. Should give some context.
[10:29:12] chridal: So I have a user that can create flags, but he can also become flagged. The flags model has a polymorphic 'flaggable'. So a user both has_many flags because he is flaggable, but also because he can create flags.
[10:29:20] _3by8: gavit: so the function that updates a flag should be a function of the model?
[10:29:56] universa1: chridal: two associations by the same name won't work.
[10:29:58] chridal: So I was wondering is this going to cause me any grief since there's two has_many relations with the same name
[10:30:01] gavit: I would rather the User-model check if it's shipped I think
[10:30:12] universa1: chridal: how should the "computer" decide which flags you mean?
[10:30:20] chridal: universa1: So the 'as: :flaggable' won't help me then either, no?
[10:30:24] matthewd: chridal: What would you expect user.flags to return then?
[10:30:35] chridal: Well that was my concern.
[10:30:46] chridal: I thought maybe it picked the one without the as: on it
[10:30:47] gavit: shipped? = current_user.process_me(params)
[10:30:57] _3by8: gavit: do you mean order model?
[10:31:00] universa1: chridal: why would you have the second one then?
[10:31:21] chridal: universa1: Don't I need that in order for the polymorphic part to work properly?
[10:31:28] gavit: _3by8: yeah, sorry that sounds even better ;)
[10:31:43] universa1: chridal: no.
[10:31:58] gavit: order.process(current_user, params)
[10:32:00] universa1: chridal: belongs_to :flaggable, polymorphic: true
[10:32:22] gavit: and move the checks in there
[10:32:47] _3by8: gavit: so rather than trying to check to see if I'm trying to update the model, just update the model first, then check to see if it's been flagged as shipped?
[10:33:08] chridal: universa1: Yea, I was just wondering how the Flag model decided on which models could be in the flaggable column and then I reckoned it might be the relation on the other side.
[10:33:21] chridal: So it basically doesn't care which model you put in the flaggable column then?
[10:33:29] universa1: chridal: it doesn't care.
[10:33:37] chridal: I see. Thanks.
[10:35:12] gavit: _3by8: well, the model doesn't need to update. https://gist.github.com/gavit/a0748d77bfa62502d3b1
[10:35:55] gavit: _3by8: I prefer LOGIC in my models. the controller should just do as the user says
[10:36:09] askhat: has joined #RubyOnRails
[10:36:31] _3by8: gavit: I understand.
[10:36:51] gavit: what to do with the data should be determined by the models
[10:37:22] gavit: you want to go check the status of your packag: sure go ahead, but you haven't placed an order yet so they can't help you, but go if you want to
[10:38:07] jorrin: has joined #RubyOnRails
[10:39:07] chouhoulis: has joined #RubyOnRails
[10:39:57] _3by8: Well the parameter flag there is to tell the controller to update the order but what you're saying is that I should process that change through some logic built into the model, right?
[10:40:38] _3by8: So for example of the parameter key "shipped" exists and it's set to true and you're an admin then a shipping email gets sent
[10:41:25] _3by8: Is that the right way to do it?
[10:43:57] tvw: has joined #RubyOnRails
[10:44:05] scepticulous: has joined #RubyOnRails
[10:44:10] yoongkang: has joined #RubyOnRails
[10:44:38] Pro|: has joined #RubyOnRails
[10:45:11] Pro|: Hi, is it possible to eagerload files in development mode but still use autoloading changes?
[10:45:32] matthewd: Pro|: Why do you want to do that?
[10:46:33] rvanlieshout: and read about spring
[10:46:41] Pro|: because of problems with jruby
[10:46:53] matthewd: Pro|: cache_classes=false eager_load=true might work, maybe?
[10:47:05] Pro|: i'll try that, thanks
[10:47:08] matthewd: Err.. what problems would they be?
[10:47:31] Pro|: actually, at least before_eager_load callback wont be called if cache_classes is false
[10:47:39] helpa: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[10:48:32] Pro|: not that i want to use the before_eager_load callback but i'm afraid that might indicate the before_eager_loadis not caleld
[10:49:33] techsethi: has joined #RubyOnRails
[10:50:00] Tempesta: has joined #RubyOnRails
[10:50:28] Pro|: "Rails will eager load on boot if cache classes is enabled"
[10:51:09] Pro|: yes, but i want to eager_load even if it isn't enabled
[10:51:16] DonOtreply: has joined #RubyOnRails
[10:51:34] rvanlieshout: i think you just need to fix your environment
[10:52:15] matthewd: Pro|: You're asking help to implement a workaround you've decided might fix your original problem. I'd like to understand the original problem.
[10:56:33] mdw: has joined #RubyOnRails
[10:57:37] roshanavand: has joined #RubyOnRails
[11:00:08] bronson_: has joined #RubyOnRails
[11:02:17] gavit: _3by8: I'm not even sure it should be a param
[11:03:08] gavit: _3by8: https://en.wikipedia.org/wiki/Finite-state_machine
[11:03:26] gavit: _3by8: I'd probably have an order_state
[11:03:30] PedramT: has joined #RubyOnRails
[11:03:37] _3by8: gavit: what would be the proper way to update a specific attribute of a record? Right now it's literally just a button with a link to the path that updates the record based on the param.
[11:04:15] gavit: _3by8: can you be more concrete?
[11:04:21] Pumukel: has joined #RubyOnRails
[11:04:49] gavit: you mean a link 'ship me' updates an attribute 'shipped' to true?
[11:05:26] _3by8: gavit: https://gist.github.com/threebyeight/09684aa2111ae43f8d84
[11:12:12] Grundell_: has joined #RubyOnRails
[11:12:39] eGGsha: has joined #RubyOnRails
[11:13:39] gavit: I dislike the idea of specifying true/false to shipped? I would probably put the current_date_time as shipped_date and do a function def shipped? shipped_date.present? end
[11:14:11] gavit: but the updating the attribute with a link isnt bad
[11:14:46] gavit: you need to check that I can't change other attributes as well though
[11:15:39] gavit: ACTION isn't very strong in ror (yet), but something tells me its a bit off. Just can't think of anything. so for now I guess it's good :)
[11:15:58] baweaver: has joined #RubyOnRails
[11:19:40] kknight: has joined #RubyOnRails
[11:20:59] FooMunki: has joined #RubyOnRails
[11:21:58] kknight: bundle install give this error https://gist.github.com/aj07/da499a26ac49099663a9
[11:24:22] kknight: anyone there?
[11:24:57] dionysus69: has joined #RubyOnRails
[11:25:18] fsteim: has joined #RubyOnRails
[11:28:23] Devalo: has joined #RubyOnRails
[11:28:29] kknight: bundle install give this error https://gist.github.com/aj07/da499a26ac49099663a9
[11:30:48] msyvich: has joined #RubyOnRails
[11:31:35] PedramT: has joined #RubyOnRails
[11:31:37] msyvich: has joined #RubyOnRails
[11:33:02] msyvich: has joined #RubyOnRails
[11:33:27] dramagods: has joined #RubyOnRails
[11:34:28] srinidhi: has joined #RubyOnRails
[11:34:45] askhat: has joined #RubyOnRails
[11:39:54] chouhoulis: has joined #RubyOnRails
[11:40:25] Ergo: has joined #RubyOnRails
[11:40:58] roshanav_: has joined #RubyOnRails
[11:41:35] PedramT: has joined #RubyOnRails
[11:41:51] arup_r: has joined #RubyOnRails
[11:41:56] gavit: rm /home/ankit/.rvm/gems/ruby-2.2.1/cache/nokogiri-1.6.7.1.gem
[11:44:20] rvanlieshout: are you sure?
[11:46:29] atmosx: has joined #RubyOnRails
[11:49:42] yfeldblum: has joined #RubyOnRails
[11:51:33] PedramT: has joined #RubyOnRails
[11:53:16] smoitra: has joined #RubyOnRails
[11:54:44] DEA7TH: has joined #RubyOnRails
[11:57:50] Eswar: has joined #RubyOnRails
[11:59:28] rodfersou: has joined #RubyOnRails
[11:59:36] jeanre: has joined #RubyOnRails
[12:00:23] roshanavand: has joined #RubyOnRails
[12:01:34] PedramT: has joined #RubyOnRails
[12:02:38] ElFerna: has joined #RubyOnRails
[12:06:54] MaDErroR123: has joined #RubyOnRails
[12:07:04] benxlr8: has joined #RubyOnRails
[12:09:35] roshanavand: has joined #RubyOnRails
[12:10:46] nhhagen: has joined #RubyOnRails
[12:12:11] njero: has joined #RubyOnRails
[12:16:42] codedmart: has joined #RubyOnRails
[12:16:57] Grundell_: has joined #RubyOnRails
[12:18:26] lessless: Hey, folks, how to get a backtrace of the AR method call: Realty.joins(:address).select('realties.id, addresses.coordinates::geometry').first.coordinates ?
[12:18:34] rafaelfranca: has joined #RubyOnRails
[12:18:47] codedmart: has joined #RubyOnRails
[12:18:55] lessless: There is a possible bug in rgeo-postgis-adapter and I don't know where to start looking for it
[12:19:08] rvanlieshout: lessless: a backtrace?
[12:19:09] msyvich: has joined #RubyOnRails
[12:19:13] rvanlieshout: what's a backtrace of an AR method call
[12:19:22] matthewd: lessless: http://tenderlovemaking.com/2016/02/05/i-am-a-puts-debuggerer.html
[12:19:23] rvanlieshout: Realty.joins(:address).select('realties.id, addresses.coordinates::geometry').to_sql
[12:19:58] lessless: rvanlieshout, Yeah, I want to see what methods were executed
[12:20:26] lessless: rvanlieshout, not an sql, the same backtrace that you get when there is an exception
[12:20:53] sevenseacat: lessless: your question doesnt quite make sense
[12:21:16] njero: hey.. does rackup depend on bundler and gemfile? Iam trying to run faye with thin. However if thin and faye gem is not in the gemfile it's not loading. It throws gem load error
[12:21:40] njero: but it's available in the gem list
[12:22:52] neohunte1: has joined #RubyOnRails
[12:23:01] lessless: sevenseacat, ok, here is a more detail description: there is possible a bug in activerecord-postgis-adapter https://github.com/rgeo/activerecord-postgis-adapter/issues/210 - as you can see in some cases query returns SphericalPointImpl and in another CAPIPointImpl
[12:23:12] lessless: though the result should be the same in both casses
[12:23:42] lessless: I want to find the exact place where this decision is made
[12:24:16] sevenseacat: then you better start stepping through the source code
[12:24:25] sevenseacat: from where you call that method
[12:25:05] neohunte1: has joined #RubyOnRails
[12:26:41] sevenseacat: and i wish you a lot of luck
[12:30:58] berserk_ren: has joined #RubyOnRails
[12:34:01] askhat: has joined #RubyOnRails
[12:34:39] hive-mind: has joined #RubyOnRails
[12:34:58] lessless: sevenseacat, I tried to apply TracePoint tip form the article tp = TracePoint.new(:call) do |x| p x if x.inspect.match(/geo/) end but no luck :(
[12:35:28] lessless: there is no call which occurred from the file which path contains "geo"
[12:35:50] sevenseacat: i dont know what that does, but i suspect its not what you think it does
[12:40:51] chouhoulis: has joined #RubyOnRails
[12:41:56] Cork: has joined #RubyOnRails
[12:42:02] greg: has joined #RubyOnRails
[12:42:35] greg: bundle install give this error https://gist.github.com/aj07/da499a26ac49099663a9
[12:44:01] Nucky: has joined #RubyOnRails
[12:44:17] pwnd_nsfw: greg, try gem update ?
[12:44:30] dramagods: has joined #RubyOnRails
[12:44:49] greg: means bundle update
[12:46:14] pwnd_nsfw: or uninstall the gem and try again
[12:46:54] tknz: has joined #RubyOnRails
[12:47:38] rvanlieshout: greg: remove that file
[12:47:42] greg: how do uninstall
[12:47:53] greg: oh that file i have cloned
[12:47:59] rvanlieshout: rm /home/ankit/.rvm/gems/ruby-2.2.1/cache/nokogiri-1.6.7.1.gem
[12:48:58] vedu: Hello. Any ideas on this question: http://stackoverflow.com/questions/35270063/parseerror-while-trying-to-handle-a-cros-request ? Been stuck on it for 2 days :(
[12:49:15] solars: quick factorygirl question: if I have something like this: https://gist.github.com/solars/d8929f74dc508970da45 does anyone know how I could use a factory on the object p to dry up the two budget creations?
[12:50:14] t_p: has joined #RubyOnRails
[12:51:04] rvanlieshout: vedu: what's the postdata you're sending?
[12:52:58] vedu: rvanlieshout: Sec. will log it right now
[12:53:29] kknight: has joined #RubyOnRails
[12:54:35] vedu: rvanlieshout: ok I am sending [object Object] . Thanks for this
[12:55:55] EdwardIII: hey, is there a way i can use an ActiveRecord::Base model so i can get all the validation stuff, utils etc but not persist it to the db?
[12:55:58] arashb: has joined #RubyOnRails
[12:56:03] EdwardIII: or is that pointless?
[12:56:09] morfin: hey fox_mulder_cp, how many code yu wrote for that simple blog?
[12:56:10] sevenseacat: EdwardIII: use ActiveModel, not ActiveRecord
[12:56:52] EdwardIII: sevenseacat: that is beautiful, thanks
[12:57:01] rvanlieshout: EdwardIII: and find a method you want on api.rubyonrails.org
[12:57:09] rvanlieshout: see where is it from and include that
[12:57:39] morfin: what ActiveModel do?
[12:59:53] rvanlieshout: morfin: open the api and find out
[13:01:10] morfin: i mean i still can use ActiveRecord::Base as base class i think fr models
[13:01:22] Ergo^: has joined #RubyOnRails
[13:01:25] morfin: ActiveModel seems to be more hm advanced
[13:01:43] kknight: https://gist.github.com/aj07/df47f705e6b60b19746b
[13:01:56] kknight: why this error came
[13:02:03] sevenseacat: kknight: yep, we saw it the first five times you asked it
[13:02:23] kknight: this is different one
[13:02:26] stannard: has joined #RubyOnRails
[13:02:55] sevenseacat: kknight: you're missing the development libraries you need
[13:03:22] kknight: whats the procedure to fix it
[13:03:31] kknight: i have run bundle update
[13:03:41] morfin: install libmagickwand-dev
[13:03:56] morfin: it will install depending linmagickcore-dev
[13:03:56] rvanlieshout: kknight: switch to mini_magick :)
[13:04:10] rvanlieshout: is (imo) a way better approach to ImageMagick then RMagick
[13:04:10] morfin: if you're on Ubuntu
[13:05:25] sevenseacat: morfin is right if you're on ubuntu
[13:06:25] morfin: i had that problem before on my development machine )
[13:06:53] rvanlieshout: morfin: rmagick is a wrapper to imagemagick using compiled stuff
[13:06:58] rvanlieshout: mini_magick just uses the command line tools
[13:07:00] morfin: yes i know )
[13:07:20] morfin: basically imagemagick is very powerful library
[13:07:47] humbledaisy: has joined #RubyOnRails
[13:07:53] rvanlieshout: so use mini_magick
[13:08:04] msyvich: has joined #RubyOnRails
[13:09:11] moeabdol: has joined #RubyOnRails
[13:09:24] morfin: but it depends on native library as well )
[13:09:34] rvanlieshout: not on the develmopent libraries
[13:10:22] rvanlieshout: also won't break if you upgrade imagemagick-devel
[13:11:15] morfin: i have a question would you recommend use wickedpdf and wkhtmltopdf?
[13:11:49] atm0sphere: has joined #RubyOnRails
[13:12:06] atm0sphere: rvanlieshout: You have requested:
[13:12:08] atm0sphere: rails = 4.2.4
[13:12:09] msyvich: has joined #RubyOnRails
[13:12:11] atm0sphere: The bundle currently has rails locked at 4.0.0.
[13:12:13] atm0sphere: Try running `bundle update rails`
[13:12:15] atm0sphere: Run `bundle install` to install missing gems.
[13:12:20] atm0sphere: how to unlock this one
[13:12:34] rvanlieshout: 14:12 < atm0sphere> Try running `bundle update rails`
[13:12:48] morfin: over other gems trying to implement PDF
[13:13:02] atm0sphere: i have tried
[13:13:03] rvanlieshout: i like both prawn and wickedpdf
[13:13:05] rvanlieshout: different purpose
[13:13:10] rvanlieshout: atm0sphere: and what did that do?
[13:13:13] EdwardIII: hrm i've got all the params allowed, but rails still says ActiveModel::ForbiddenAttributesError
[13:13:14] rvanlieshout: also, what's in your Gemfile?
[13:13:31] atm0sphere: in gemfile there is 4.0.0
[13:13:44] atm0sphere: and my amchine has 4.2.4
[13:13:56] rvanlieshout: Gemfile or Gemfile.lock?
[13:14:14] rvanlieshout: and why do you have a version constraint in Gemfile?
[13:14:27] rvanlieshout: imo you shouldn't have any version constraint in gemfile unless there is a reason for it
[13:14:32] bers: has joined #RubyOnRails
[13:14:32] _Tariq: has joined #RubyOnRails
[13:14:33] rvanlieshout: and that reason is documented in that file
[13:14:39] EdwardIII: ah disregard that
[13:14:51] rvanlieshout: EdwardIII: disgregard what?
[13:15:08] EdwardIII: what i said previously about params
[13:15:20] EdwardIII: when gisting up the example i noticed i had an erronous implicit return somewhere
[13:15:21] morfin: only reason is breaking updates?
[13:15:41] rvanlieshout: morfin: then there should be a link to a github issue
[13:15:53] morfin: like if you go from 1.0 to 1.1 nothing will work
[13:16:07] morfin: yes probably better comment that
[13:16:11] rvanlieshout: then it would be '< 1.1' # because it breaks foobar, see =>
[13:16:29] rvanlieshout: we reject merge requests that contain version constraints without reason
[13:17:38] atm0sphere: rvanlieshout: changed the version of rails in gefile.lock noe bundle install?
[13:17:49] rvanlieshout: atm0sphere: revert your changes in Gemfile.lock
[13:17:54] rvanlieshout: you shouldn't edit that file yourself
[13:18:02] rvanlieshout: remove the version constraint in Gemfile and run bundle update rails
[13:18:22] IrishGringo: has joined #RubyOnRails
[13:18:45] atm0sphere: bundle update rails give same error
[13:19:20] rvanlieshout: !gist your full Gemfile, Gemfile.lock and error plz
[13:19:20] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[13:19:39] atm0sphere: i cant think how those gemfile with rails 4.0.0 version come on rails4.2.4
[13:19:50] rvanlieshout: atm0sphere: because you requested it to update?
[13:20:10] atm0sphere: budle update rails
[13:20:21] atm0sphere: anyway m posting on gist
[13:23:04] atm0sphere: rvanlieshout: https://gist.github.com/aj07/614514c60a2b16f41d80
[13:23:21] atm0sphere: there i ahve posted those three thing
[13:23:37] daveok: has joined #RubyOnRails
[13:23:56] rvanlieshout: atm0sphere: you have a version constraint in Gemfile
[13:24:07] rvanlieshout: rails cannot be updated to anything except what's in there
[13:24:22] atm0sphere: then how to fix it
[13:24:27] rvanlieshout: remove that version constraint
[13:24:30] rvanlieshout: for the fifth time
[13:24:38] rvanlieshout: edit the file
[13:24:40] rvanlieshout: not Gemfile.lock
[13:24:52] rvanlieshout: and read about bundler and Gemfile
[13:24:57] atm0sphere: change it to rails 4.2.4
[13:25:06] rvanlieshout: or to nothing
[13:25:11] rvanlieshout: is there a contraint applicable?
[13:25:22] rvanlieshout: read about why you have a Gemfile and a Gemfile.lock
[13:25:24] EdwardIII: hrm what's the standard practice if params.get doesn't validate? do a rescue and redirect?
[13:25:43] eGGsha: has joined #RubyOnRails
[13:25:59] atm0sphere: you told to edit in .lock file thats why i have done
[13:26:13] arup_r: EdwardIII: what do you mean by that ?
[13:26:22] barhum2013: has joined #RubyOnRails
[13:26:24] rvanlieshout: atm0sphere: i told you to _not_ edit the .lock file :)
[13:26:27] EdwardIII: params.require.permit sorry
[13:26:32] arup_r: how are you validating params.get ?
[13:26:35] EdwardIII: i.e. if the form validation fails?
[13:26:44] rvanlieshout: EdwardIII: you render the form again if form validation fails
[13:26:49] arup_r: ok, then show the user error inside a flash ?
[13:26:51] EdwardIII: e.g. if you're doing this, but they didn't set a depart date: params.require(:stay_detail).permit(:arrival_date, :depart_date, :adults, :number_of_rooms)
[13:27:01] atm0sphere: i have not edited only edited gemfile then run bundle install and it says nokogiri error
[13:27:06] arup_r: EdwardIII: what rvanlieshout said and me :)
[13:27:26] EdwardIII: but if i hack the url it throws an exception
[13:27:52] rvanlieshout: EdwardIII: what exception?
[13:28:19] EdwardIII: param is missing or the value is empty: stay_detail
[13:28:26] neohunte1: has joined #RubyOnRails
[13:28:45] rvanlieshout: what exception?
[13:29:00] dcunit3d: has joined #RubyOnRails
[13:29:02] matthewd: EdwardIII: Why is that a problem? / What are you trying to solve?
[13:29:09] pawnbox: has joined #RubyOnRails
[13:29:14] daveok: quick question: Should the auth token rendered by csrf_meta_tags, form_authenticity_token, and form_tag/form_for all be the same value?
[13:29:34] EdwardIII: rvanlieshout: ActionController::ParameterMissing
[13:29:35] atm0sphere: why bundle lock at older version?
[13:29:41] EdwardIII: matthewd: i want to see if the validation is working
[13:29:54] rvanlieshout: EdwardIII: if you don't want it to fail on that you might not want to use require
[13:29:57] Devalo: has joined #RubyOnRails
[13:30:25] neohunte1: has joined #RubyOnRails
[13:31:02] neohunter: has joined #RubyOnRails
[13:32:05] askhat: has joined #RubyOnRails
[13:33:32] RegulationD: has joined #RubyOnRails
[13:33:52] eugenijusr: has joined #RubyOnRails
[13:33:55] eugenijusr: has left #RubyOnRails: ()
[13:34:09] daveok: anyone here know of any reason why I'd be getting intermittent InvalidAuthenticityToken exceptions on a production instance?
[13:34:13] arup_r: EdwardIII: can you gist the log and controller first ?
[13:34:50] arup_r: daveok: what actions caused this error ?
[13:35:35] EdwardIII: arup_r: https://gist.github.com/EdwardIII/b0d5abf371751be13885#file-f-rb-L7
[13:35:36] humbledaisy: has joined #RubyOnRails
[13:35:37] daveok: error only appears for post requests - any post requests
[13:35:56] rvanlieshout: daveok: then somebody is not supplying the correct authenticity token
[13:36:11] arup_r: EdwardIII: thannks and the error stack also
[13:36:34] arup_r: daveok: is is ajax form submit or html form submit
[13:37:07] _Tariq: has joined #RubyOnRails
[13:37:08] pawnbox: has joined #RubyOnRails
[13:37:11] daveok: rvanlieshout: agreed - but it happens 25+ times a day, on seemingly random clients
[13:37:31] EdwardIII: arup_r: https://gist.github.com/EdwardIII/b0d5abf371751be13885#file-err
[13:37:48] daveok: arup_r: no ajax, it's just regular form_for and form_tag forms
[13:38:04] arup_r: EdwardIII: great.. now the form through which you are capturing the data, add it in gist..
[13:38:10] arup_r: I know the answer
[13:38:26] EdwardIII: just to be clear
[13:38:31] EdwardIII: this is when i'm hacking at the urls on the results page
[13:38:38] arup_r: no form ?
[13:38:43] EdwardIII: it's an edge case, but i think i'd rather show a friendly error rather than 500
[13:38:47] EdwardIII: if i don't chop the url it works fine
[13:38:52] rvanlieshout: EdwardIII: then don't use .require
[13:39:08] EdwardIII: and check the return from params?
[13:39:16] arup_r: EdwardIII: your POST data has to to come inside the root key `stay_detail`
[13:39:23] EdwardIII: yeah it does
[13:39:39] arup_r: you are not sending that I am sure. That's the only reason of this error
[13:39:39] EdwardIII: i can do a normal & validated POST just fine, i'm looking at when it fails
[13:39:56] EdwardIII: yeah that's exactly right, i'm hacking the querystring in my browser
[13:40:23] arup_r: EdwardIII: just send data like stay_detail[adults]=value like that
[13:40:45] arup_r: all values has to comet by wrapping root key with the field name like ^^
[13:41:25] chouhoulis: has joined #RubyOnRails
[13:41:55] arup_r: as per your strong parameter declaration.
[13:42:30] daveok: arup_r: about 75% of the InvalidAuthenticityToken requests have no cookie at the time the initial request is logged. This made me think that people just had cookies disabled. But the other 25% DO have cookies, and therefore rails should be able to pull the auth_token from the session and validate it against the token in the form. But, for some reason, it fails at doing that.
[13:42:49] arup_r: if you remove require, and do just `permit`, then this error will be gone for forever, and something new may come as per the model validation etc
[13:44:36] arup_r: daveok: generally if it is form_for/_tag , Rails have a hidden field for auth_token, and on form submitions thet value also comes.. no idea how cookie can affect here.. or you may be correct. I don't know cookie and authtoken
[13:44:55] arup_r: sorry not token authentication_key
[13:45:28] dramagods: has joined #RubyOnRails
[13:47:01] daveok: arup_r: Sorry, should have said session_id, not cookie. If the client has cookies disabled, then there will be no session id, no session maintenance, and the auth_token sent by the form will NEVER match the auth_token generated in the new session created by rails.
[13:47:47] daveok: arup_r: which is why I'm so confused by the issue :( if there is a session id, then it should work correctly. But it doesn't, sometimes :p
[13:49:47] daveok: arup_r: I have configured my Rails.logger to include the session_id in every log line. In 75% of these IAT exceptions, this session_id is missing, which I take to mean 'no cookie'.
[13:50:15] jkamenik: has joined #RubyOnRails
[13:51:00] dramagods: has joined #RubyOnRails
[13:51:47] barhum2013: has joined #RubyOnRails
[13:51:49] arup_r: daveok: now things went beyond my sill ... :p I should be quiet now
[13:52:07] jeanre: has joined #RubyOnRails
[13:52:17] arup_r: daveok: what is IAT ?
[13:52:40] daveok: arup_r: sorry, InvalidAuthentictyToken :p
[13:54:18] Eswar: has joined #RubyOnRails
[13:55:29] arup_r: EdwardIII: all is working now? :)
[13:55:36] arup_r: I was waiting for your reply..
[13:56:53] EdwardIII: arup_r: i'm gonna check out not using require
[13:57:22] greg: has joined #RubyOnRails
[13:58:13] greg: is it good if one rollback to previous version of rails i.e from 4.2.4 to 4.0.0
[13:58:28] IrishGringo_: has joined #RubyOnRails
[13:58:53] nickjj: has joined #RubyOnRails
[13:59:04] greg: Do i face some bigger challaenges?
[13:59:26] nickjj_: has joined #RubyOnRails
[14:00:41] greg: rvanlieshout?
[14:00:56] rvanlieshout: why would you want to rollback?
[14:00:59] PedramT: has joined #RubyOnRails
[14:01:41] arup_r: EdwardIII: use postman plugin to test from browsers.. if you using it already ignore me. :)
[14:01:43] jeanre: has joined #RubyOnRails
[14:02:03] greg: rvanlieshout: because the app which m working on is on 4.0.0
[14:02:11] rvanlieshout: so there is a good reason to upgrade
[14:02:13] rvanlieshout: not to downgrade
[14:02:15] EdwardIII: arup_r: i tend to use httpie, but sample principle
[14:02:25] arup_r: but if you are making the query string by hand in url, it will never be a POST or anything.. always GET.. just saying
[14:02:32] arup_r: EdwardIII: ok, np
[14:03:13] neohunter: has joined #RubyOnRails
[14:03:15] greg: rvanlieshout: can there any way that for particular app we use particular version irrespective of what is instlalled on oue machine
[14:04:00] Jasaka: has joined #RubyOnRails
[14:04:03] rvanlieshout: greg: set it in Gemfile
[14:04:17] vedu: What is the correct way to make another asynchronous API call in a controller action? Creating a new thread and executing the code there is fine, or I should use a rails worker queue
[14:05:14] greg: that is what i have done 5 times still gave error
[14:05:49] EdwardIII: ah man model validation in rails is so much smoother than in symfony
[14:05:54] EdwardIII: like 20x quicker and better
[14:05:57] rvanlieshout: greg: what error?
[14:06:02] rvanlieshout: and how did you start your app?
[14:07:26] greg: m sending on gist
[14:07:49] DubiousCarrot: has joined #RubyOnRails
[14:08:36] greg: https://gist.github.com/aj07/3f48f7681465b5b9fc04
[14:09:13] greg: there oon typing subl i went to gemfile and changed the version of rails to 4.2.4
[14:09:27] greg: rvanlieshout:
[14:09:40] msyvich: has joined #RubyOnRails
[14:11:12] arup_r: has joined #RubyOnRails
[14:11:53] neohunter: has joined #RubyOnRails
[14:12:10] Grundell_: has joined #RubyOnRails
[14:12:39] rvanlieshout: greg: but you don't want 4.2.4?
[14:12:40] sankaber: has joined #RubyOnRails
[14:12:59] Grundell_: has joined #RubyOnRails
[14:13:00] rvanlieshout: ah. follow instructions
[14:13:07] rvanlieshout: after changing that version number run bundle update rails
[14:13:52] greg: then it gives Bundler::GemspecError: Could not read gem at /home/ankit/.rvm/gems/ruby-2.2.1/cache/nokogiri-1.6.7.1.gem. It may be corrupted.
[14:13:53] greg: An error occurred while installing nokogiri (1.6.7.1), and Bundler cannot
[14:13:53] greg: continue.
[14:13:53] greg: Make sure that `gem install nokogiri -v '1.6.7.1'` succeeds before bundling.
[14:14:17] greg: whereas nokogiri is not when i check gemfile
[14:14:36] rvanlieshout: you did remove that file?
[14:14:38] greg: rvanlieshout
[14:14:46] rvanlieshout: and nokogiri is a dependency of an other gem you're using
[14:14:59] roshanavand: has joined #RubyOnRails
[14:15:30] rvanlieshout: 13:47 < rvanlieshout> greg: remove that file
[14:15:37] PedramT: has joined #RubyOnRails
[14:15:42] rvanlieshout: as bundle is telling you
[14:16:11] greg: which file
[14:16:13] n1lo: has joined #RubyOnRails
[14:16:14] peeja: has joined #RubyOnRails
[14:16:20] rvanlieshout: the one that is corrupt
[14:16:45] daveok: has joined #RubyOnRails
[14:16:46] M-shine: has joined #RubyOnRails
[14:16:59] greg: nokogiri isnot in gemfile
[14:17:12] rvanlieshout: 15:14 < rvanlieshout> and nokogiri is a dependency of an other gem you're using
[14:17:15] rvanlieshout: 15:15 < sevenseacat> of rails
[14:17:34] rvanlieshout: also the error states /home/ankit/.rvm/gems/ruby-2.2.1/cache/nokogiri-1.6.7.1.gem is corrupt
[14:18:16] agoldboi: has joined #RubyOnRails
[14:18:46] greg: yes reply please how to get out of these corruot file
[14:19:17] rafaelfranca: has joined #RubyOnRails
[14:19:32] greg: its not in gemfile of the app m using
[14:19:50] rvanlieshout: 15:17 < rvanlieshout> 15:14 < rvanlieshout> and nokogiri is a dependency of an other gem you're using
[14:19:53] rvanlieshout: 15:17 < rvanlieshout> 15:15 < sevenseacat> of rails
[14:19:57] fryguy: please stop saying the same thing over and over and try deleting the file
[14:20:39] daveok: greg: rails can still use it, even if it's not in the gemfile. You need to delete it from the system, add it to the gemfile, and do a 'bundle install'
[14:20:44] EdwardIII: is this really dumb? https://gist.github.com/EdwardIII/6a4ed0afa9e6f708529c
[14:20:46] yoongkang: has joined #RubyOnRails
[14:21:04] PedramT_: has joined #RubyOnRails
[14:21:10] rvanlieshout: EdwardIII: if you're not going to provide multiple languages no
[14:21:26] EdwardIII: i will in the future, but i haven't checked out what i need to use to do that yet
[14:21:42] rvanlieshout: maybe use enum
[14:21:51] EdwardIII: this test seems to fail though? https://gist.github.com/EdwardIII/6a4ed0afa9e6f708529c
[14:21:56] MaDErroR123: has joined #RubyOnRails
[14:22:17] arthropododo: has joined #RubyOnRails
[14:22:31] daveok: EdwardIII: I'd just put the invalid_titles array right in the inclusion: { in: ['Mr', 'Mrs'] }
[14:22:42] dopamean_: has joined #RubyOnRails
[14:22:48] greg: rm /home/ankit/.rvm/gems/ruby-2.2.1/cache/nokogiri-1.6.7.1.gem is this cmd needed to run rvanlieshout
[14:22:49] rvanlieshout: also try it in a console, just to see what happens
[14:22:50] daveok: EdwardIII: or change valid_titles to VALID_TITLES, to make it a const
[14:23:20] EdwardIII: daveok: i need to use them elsewhere though, e.g. in the Customer form
[14:23:37] rvanlieshout: greg: i would expect so
[14:23:50] greg: then bundlw install right?
[14:24:01] rvanlieshout: nope. bundle update rails
[14:24:01] daveok: then I'd go for the const
[14:24:07] rvanlieshout: as the output told you :)
[14:24:20] daveok: EdwardIII: then you do Customer::VALID_TITLES to access it
[14:24:27] IrishGringo: has joined #RubyOnRails
[14:24:37] greg: rvanlieshout: ok
[14:25:18] EdwardIII: daveok: gave that a spin but the test still fails: https://gist.github.com/EdwardIII/6a4ed0afa9e6f708529c
[14:25:37] rvanlieshout: EdwardIII: reproduce that in a console
[14:25:46] rvanlieshout: and see if .valid? returns false where you expect it
[14:25:52] ql6wlld: has joined #RubyOnRails
[14:25:54] EdwardIII: https://gist.github.com/EdwardIII/6a4ed0afa9e6f708529c#file-out
[14:25:59] daveok: EdwardIII: lol dude, you're not giving a valid title in the test!
[14:26:03] EdwardIII: .valid is returning true
[14:26:10] daveok: ah, sorry.
[14:26:21] EdwardIII: the title isn't valid?
[14:26:42] rvanlieshout: also consider using shoulda_matchers
[14:26:44] rvanlieshout: they are awesome
[14:26:47] rvanlieshout: for tests like these
[14:27:10] EdwardIII: title is coming out "King of new york"
[14:27:16] floror: has joined #RubyOnRails
[14:27:19] rvanlieshout: verified or assumed?
[14:27:43] EdwardIII: rvanlieshout: https://gist.github.com/EdwardIII/6a4ed0afa9e6f708529c#file-t-rb-L7
[14:27:49] greg: rvanlieshout: when i run bundle update rails it is again doing something Installing nokogiri 1.6.7.1 with native extensions
[14:27:54] CornishPasty: sevenseacat: did you/someone write a book about testing in rails? I can't remember the title
[14:28:03] helpa: Rails 4 Test Prescriptions - a great introduction to testing in Ruby and Rails, including both minitest and rspec. https://pragprog.com/book/nrtest2/rails-4-test-prescriptions
[14:28:22] EdwardIII: rvanlieshout: https://gist.github.com/EdwardIII/6a4ed0afa9e6f708529c#file-out-L35
[14:28:25] Ropeney: has joined #RubyOnRails
[14:28:26] sevenseacat: I really recommend it, its a great book.
[14:28:33] sevenseacat: and no, I didn't write that one :)
[14:28:44] CornishPasty: Why do I like physical books so much? They're so expensive :(
[14:28:47] rvanlieshout: EdwardIII: excellent. checked the api doc for that inclusion? don't use that notation often enough
[14:28:54] rvanlieshout: greg: as it should, but does it work?
[14:29:04] CornishPasty: It's normally like $30+ for the book, then ~$15 for delivery and taxes and ugh
[14:29:08] daveok: EdwardIII: try replacing .create with .new
[14:29:14] sevenseacat: thats why i only buy ebooks now
[14:29:23] sevenseacat: though i do miss flicking through pages
[14:29:23] CornishPasty: Yeah, but I like books :P
[14:29:28] EdwardIII: daveok: same result
[14:29:37] daveok: EdwardIII: k, had to be sure :p
[14:29:41] greg: rvanlieshout: yes but got new error
[14:30:11] EdwardIII: rvanlieshout: not the api doc, but i did see this and it seemed to DWIM: http://guides.rubyonrails.org/active_record_validations.html#inclusion
[14:30:30] rvanlieshout: that eems valid
[14:30:30] daveok: EdwardIII: is there any chance there's another Customer model someplace, that's being used instead of the one you're working with?
[14:30:32] rvanlieshout: tried it with new?
[14:30:40] CornishPasty: Oh that website is bad
[14:30:42] rvanlieshout: and what daveok wrote
[14:30:46] EdwardIII: daveok: don't think so, this is a new, little project
[14:30:51] askhat: has joined #RubyOnRails
[14:31:04] daveok: EdwardIII: throw some bad code in there, just to be sure.
[14:31:13] PedramT: has joined #RubyOnRails
[14:31:16] sankaber: has joined #RubyOnRails
[14:31:22] CornishPasty: Good job I don't live in Northern Ireland or I wouldn't be able to buy that book, sevenseacat :P
[14:31:36] CornishPasty: Seems that way
[14:31:37] greg: rvanlieshout: https://gist.github.com/aj07/b118d411d3a62d366523
[14:31:39] CornishPasty: They only have "Great Britain"
[14:31:47] sevenseacat: onya pragprog
[14:31:51] CornishPasty: Not "United Kingdom"
[14:31:51] EdwardIII: daveok: pretty sure this means it isn't getting stomped, right? https://gist.github.com/EdwardIII/6a4ed0afa9e6f708529c#file-out2
[14:32:01] EdwardIII: daveok: although i guess you mean the other way around
[14:32:02] rvanlieshout: greg: you're missing dependencies needed for RMagick
[14:32:08] rvanlieshout: either install them or switch to mini_magick
[14:32:11] greg: i have same version of rmagic in gemfile still it throws error
[14:32:19] arup_r: EdwardIII: Are you getting the expected behavior with that piece of code in the Rails console.. ?
[14:32:32] greg: you told for mininmagic i think
[14:32:46] arup_r: forget test. What Rails console is saying with the same attempt ?
[14:33:14] daveok: EdwardIII: weird. Remove the Customer:: part from your inclusion line. That's only necessary when accessing it from outside Customer
[14:33:16] EdwardIII: rvanlieshout: yep tried with .new
[14:34:02] EdwardIII: arup_r: hmm trying it in the console it does actually seem to give the expected result
[14:34:19] EdwardIII: daveok: same result
[14:34:20] devdazed: has joined #RubyOnRails
[14:34:54] arup_r: EdwardIII: that means your test have something messed up.. which for any reason don't know the updated code
[14:35:21] EdwardIII: i am calling it with: ruby -I"lib:test" test/models/customer_test.rb
[14:35:26] drbayer: has joined #RubyOnRails
[14:35:29] EdwardIII: lemme try with rake test
[14:35:37] maxz: has joined #RubyOnRails
[14:35:39] EdwardIII: same result with rake test
[14:35:53] EdwardIII: is this something to do with my tests being outside my /app dir?
[14:36:06] greg: rvanlieshout: while installing magic it says https://gist.github.com/aj07/b118d411d3a62d366523
[14:36:24] daveok: EdwardIII: nope, tests are always in the /test dir, afaik
[14:36:26] dramagods: has joined #RubyOnRails
[14:36:47] EdwardIII: hrm ok. then how am i breaking this heh
[14:37:43] daveok: EdwardIII: your "assert false, customer.valid?" looks wrong to me for some reason. Do me a favour and put a "puts customer.valid?" immediately before?
[14:38:07] tego101: has joined #RubyOnRails
[14:39:00] EdwardIII: https://gist.github.com/EdwardIII/6a4ed0afa9e6f708529c#file-out-L20
[14:39:18] EdwardIII: so it's actually working heh
[14:39:47] daveok: so your assert line is wrong, for whatever reason
[14:40:08] daveok: I'm afraid I've no idea what it should look like :p
[14:40:25] CornishPasty: EdwardIII: look at http://guides.rubyonrails.org/testing.html#available-assertions
[14:40:46] CornishPasty: you want "assert_not customer.valid?" I think
[14:40:53] greg: CornishPasty: https://gist.github.com/aj07/b118d411d3a62d366523
[14:41:02] PedramT: has joined #RubyOnRails
[14:41:02] ferr: has joined #RubyOnRails
[14:41:14] daveok: EdwardIII: it should be assert_equal, instead of just assert
[14:41:39] EdwardIII: ah ok. wonder where i got that idea from
[14:42:01] EdwardIII: sorry guys, thanks for pointing me in the right direction!
[14:42:19] chouhoulis: has joined #RubyOnRails
[14:42:58] CornishPasty: greg: http://stackoverflow.com/a/5207041 might help you
[14:43:43] rvanlieshout: greg: you don't have dependencies you need for rmagick
[14:43:48] rvanlieshout: read the rmagick documentation
[14:44:15] rvanlieshout: http://rmagick.rubyforge.org/install-faq.html#prereq
[14:44:25] rvanlieshout: oh. old version
[14:44:40] rvanlieshout: http://rmagick.rubyforge.org/install-faq.html#imprereq
[14:45:40] IrishGringo: has joined #RubyOnRails
[14:47:01] pawnbox: has joined #RubyOnRails
[14:47:43] njero: hey can anyone help me with rackup faye.. i"m trying to setup faye ruby server. I followed raynbates railcast. But thin server is not loading without adding it to the gemfile. Why is that? shud it be loading from env gemset?
[14:50:32] polishdub: has joined #RubyOnRails
[14:51:00] PedramT: has joined #RubyOnRails
[14:51:29] jeanre: has joined #RubyOnRails
[14:52:31] fryguy: n_e_o: no
[14:53:40] njero: fryguy: but its throwing require': cannot load such file -- faye (LoadError)
[14:53:59] fryguy: n_e_o: is the gem installed and part of the bundle
[14:54:01] msyvich: has joined #RubyOnRails
[14:54:06] floror: has joined #RubyOnRails
[14:54:08] rvanlieshout: and are you using bundle exec to run that thing?
[14:54:12] jtong: has joined #RubyOnRails
[14:54:18] njero: yeah.. first it was..
[14:54:31] rvanlieshout: then it's not using the Gemfile
[14:54:44] njero: rvanlieshout: nope..just rackup faye.ru -s thin -o 0.0.0.0 -E production -d
[14:54:52] rvanlieshout: yeah. exactly
[14:55:43] njero: initially i added it to bundle and installed.. Later i removed it. But it's still in the gemset on same env
[14:56:07] pawnbox: has joined #RubyOnRails
[14:56:09] fryguy: gemsets are very misleading and largely useless if you are using bundler
[14:58:34] njero: is there a way i can fix this?
[14:58:45] rvanlieshout: properly use bundler :)
[14:58:48] rvanlieshout: anyway.. heading home
[14:58:50] rvanlieshout: back tomorrow
[14:58:53] adavia: has joined #RubyOnRails
[14:59:15] njero: u mean add them back to Gemfile?
[14:59:34] rvanlieshout: yes, and run it using bundler
[14:59:44] stardiviner: has joined #RubyOnRails
[15:00:42] maesitos: has joined #RubyOnRails
[15:00:58] PedramT: has joined #RubyOnRails
[15:01:54] treehug88: has joined #RubyOnRails
[15:02:04] bronson_: has joined #RubyOnRails
[15:03:32] pusewicz: has joined #RubyOnRails
[15:03:55] dionysus69: has joined #RubyOnRails
[15:03:58] EdwardIII: heh the monkey patching in rails is a bit scary but it beautiful to be able to say Date.today + 5.days
[15:04:22] adaedra: You mean 5.days.from_now ? :p
[15:04:41] NBarnes: has joined #RubyOnRails
[15:04:54] EdwardIII: ACTION vomits with pleasure
[15:05:28] dramagods: has joined #RubyOnRails
[15:06:05] mdw: has joined #RubyOnRails
[15:06:33] qejk: has joined #RubyOnRails
[15:07:03] ravster: has joined #RubyOnRails
[15:07:59] benxlr8: has joined #RubyOnRails
[15:08:54] pyemkey: has joined #RubyOnRails
[15:10:14] thorgi: Is there a gem or core function that builds nested 'errors' hash for all associated models? E.g. if Model1 has_many of Model2, Model1.validate will just put 'Model2 is invalid' in Model1.errors
[15:11:08] PedramT: has joined #RubyOnRails
[15:11:51] scepticulous: when I use ams (serializers) explicitly like UserSerializer.new(User.all,adapter: :json_api).as_json it does not return json api format. when i do render :json => User.all it does.
[15:12:51] scepticulous: the output of the first example looks like: {"object" => } instead of {data: => {...} } and it ignores the configured attributes. any hints ?
[15:13:04] Grundell_: has joined #RubyOnRails
[15:14:59] rubyonrailed: has joined #RubyOnRails
[15:15:09] njero: scepticulous: Try ActiveModel::ArraySerializer.new(User.all, {each_serializer: UserSerializer,..options})
[15:16:06] scepticulous: n_e_o: I will
[15:16:09] dramagods: has joined #RubyOnRails
[15:16:50] EdwardIII: hrm if i want to take the get params and sort of heh, how do i put this, massage them into a POST form, how would i do that?
[15:17:24] EdwardIII: currently i have this, but i also want a hidden form in there for stay_details (which exists in the view too): https://gist.github.com/EdwardIII/4e50a2badb0cb3979c3e
[15:18:26] scepticulous: n_e_o: same issue with a single object ( User.first ) in addition to that uninitialized constant ActiveModel::ArraySerializer
[15:18:38] baweaver: has joined #RubyOnRails
[15:21:04] PedramT: has joined #RubyOnRails
[15:22:38] scepticulous: even though the class is defined in the path the gem is loaded from ...
[15:23:16] momomomomo: has joined #RubyOnRails
[15:23:19] barhum2013: has joined #RubyOnRails
[15:23:37] agoldboi: has joined #RubyOnRails
[15:23:57] njero: scepticulous: which version are you working on? It's fine on 0.8.3
[15:25:49] scepticulous: well actually 0.10.rc4 to have proper jsonapi support
[15:26:01] safetypin: has joined #RubyOnRails
[15:26:19] scepticulous: in the new version it seems to be ActiveModel::Serializer::ArraySerializer
[15:27:00] msyvich: has joined #RubyOnRails
[15:27:03] Ropeney: has joined #RubyOnRails
[15:27:22] scepticulous: array serializer causes the same behavior as using the regular one with one or more instances
[15:27:55] mary5030: has joined #RubyOnRails
[15:28:07] stardiviner: has joined #RubyOnRails
[15:28:33] DmitryBochkarev: has joined #RubyOnRails
[15:29:29] askhat: has joined #RubyOnRails
[15:30:21] mary5030: has joined #RubyOnRails
[15:31:17] smathy: has joined #RubyOnRails
[15:31:17] Devalo: has joined #RubyOnRails
[15:32:31] Frem: has joined #RubyOnRails
[15:34:30] safetypin: has joined #RubyOnRails
[15:35:09] scepticulous: n_e_o: oh I see. I am suppost to use "ActiveModel::SerializableResource" . I thought that was an example name ....
[15:36:11] fluxsource: has joined #RubyOnRails
[15:36:40] njero: scepticulous: i'm not familiar with latest releases
[15:37:31] wldcordeiro: has joined #RubyOnRails
[15:37:32] arashb: has joined #RubyOnRails
[15:38:04] msyvich: has joined #RubyOnRails
[15:41:05] PedramT: has joined #RubyOnRails
[15:41:32] IrishGringo: has joined #RubyOnRails
[15:42:38] yoongkang: has joined #RubyOnRails
[15:42:52] chouhoulis: has joined #RubyOnRails
[15:43:15] lexileo: has joined #RubyOnRails
[15:43:45] a1fa: how do you deal with two resource routes, one being plural and one being singular
[15:44:09] tubbo: a1fa: what do you mean, like having `resource :user` and `resources :users` in the same project?
[15:44:20] tubbo: a1fa: you just do that :)
[15:44:31] a1fa: i did that, but helpers dont get created for the singular
[15:44:36] tubbo: you can make as many routes to the same controller
[15:44:48] tubbo: a1fa: yeah, it won't generate a singular resource route iirc, but you can just add it after you generate.
[15:45:18] a1fa: ok, i'll do that
[15:45:27] a1fa: the plural one took all singular ones
[15:45:31] EdwardIII: heh hrm ok here's a problem
[15:46:02] tubbo: a1fa: haha yeah...also remember to `rake routes | grep $your_singular_route_name` to make sure you're getting the right URLs.
[15:46:21] tubbo: also, `resource :search, only: [:show]` resolves to the controller SearchesController, not SearchController
[15:46:24] tubbo: which is a little confusing
[15:46:30] fsteim: has joined #RubyOnRails
[15:47:22] darkxploit: has joined #RubyOnRails
[15:48:16] antonmur: has joined #RubyOnRails
[15:48:22] jgt4: has joined #RubyOnRails
[15:48:38] EdwardIII: how do i make button_to dwim? https://gist.github.com/EdwardIII/b8068577f5b09cb7b811
[15:48:54] EdwardIII: it's converting stay_detail into just sort of flat text
[15:49:07] jgpawletko_: has joined #RubyOnRails
[15:49:31] EdwardIII: i'm just trying to get the querystring, add a bit to it, then send it through onto the next stage via a form
[15:49:55] Devalo: has joined #RubyOnRails
[15:50:24] jas02: has joined #RubyOnRails
[15:51:21] mdw: has joined #RubyOnRails
[15:52:15] srinidhi: has joined #RubyOnRails
[15:54:34] stardiviner: has joined #RubyOnRails
[15:55:13] Fire-Dragon-DoL: has joined #RubyOnRails
[15:55:47] EdwardIII: ah, looks like it's a known issue with button_to: http://stackoverflow.com/a/23881153/3486297
[15:55:55] PedramT: has joined #RubyOnRails
[15:55:56] smathy: Hey FooBarWidget, the search has filters now, thanks :)
[15:57:43] macsteps: has joined #RubyOnRails
[15:58:05] tubbo: what is dwim
[15:59:01] kies^: has joined #RubyOnRails
[15:59:15] bpr_admin: has joined #RubyOnRails
[16:00:18] rafaelfranca: has joined #RubyOnRails
[16:00:27] EdwardIII: tubbo: 'do what i mean'
[16:00:34] EdwardIII: it just flattens nested elements down to strings
[16:00:48] EdwardIII: i guess i'll just rewrite it with form_for
[16:00:52] EdwardIII: shame, button_to was perfect
[16:00:55] tubbo: EdwardIII: that is a whole different level of laziness :P
[16:01:04] tubbo: it's like meta-lazy
[16:01:24] a1fa: tubbo: +1 ditto. thank youi
[16:01:32] Timberwo|f: has joined #RubyOnRails
[16:01:42] atmosx: has joined #RubyOnRails
[16:01:53] tubbo: EdwardIII: hold on a sec let's just take a step back...thinking you can still accomplish what you want with button_to.
[16:01:55] EdwardIII: isn't that what frameworks are all about?
[16:02:04] EdwardIII: less code = less bugs!
[16:02:09] EdwardIII: (sometimes!)
[16:02:18] sonofdirt: has joined #RubyOnRails
[16:02:26] jahbrewski: has joined #RubyOnRails
[16:02:33] neohunter: has joined #RubyOnRails
[16:02:37] bpr_admin: I did something stupid, and ran the command "rake db:migrate" now after running that, when I try to deploy this heroku app into AWS EB, I get this error: Could not load database configuration. No such file - ["config/database.yml"] ... there is not supposed to be a database.yml in the source of this application. apparently the deployment is supposed to run that, but I have no idea what
[16:02:38] bpr_admin: that means. anyone have insight or a direction you can point me?
[16:03:07] tubbo: EdwardIII: it's definitely a +1 of THIS framework, but i wouldn't necessarily say that "all frameworks" are about less code. see: Struts
[16:03:32] EdwardIII: right or sinatra i guess
[16:03:33] tubbo: EdwardIII: you seem to be passing params to button_to improperly. you just need to pass them in the same hash as the rest of the stuff.
[16:03:40] EdwardIII: hrm really?
[16:04:04] tubbo: EdwardIII: button_to '/search/book', booking_params(rate).merge(method: 'get')
[16:04:28] EdwardIII: ACTION tries
[16:05:15] griffindy: has joined #RubyOnRails
[16:05:40] EdwardIII: tubbo: heh looks a little fubar: https://gist.github.com/EdwardIII/5fd45266a2e16341ac28
[16:05:45] smathy: bpr_admin, heroku adds a database.yml for you, regular VPS hosts don't do this. I'm not sure about EB - but from the looks of it, it's acting like a regular VPS and so expects database.yml to be provided by you.
[16:06:02] EdwardIII: tubbo: i'm pretty sure that params => {}, is right, it's just that it can't handle nested hashes
[16:06:11] baweaver: has joined #RubyOnRails
[16:06:17] EdwardIII: because some guy i've never heard of said so on SO
[16:07:00] EdwardIII: the real, best metalazy way to write this is to get the source for button_to, write in deep support, then do a PR heh
[16:07:11] PlasmaStar: has joined #RubyOnRails
[16:07:15] scepticulous: has joined #RubyOnRails
[16:07:19] chouhoulis: has joined #RubyOnRails
[16:07:34] EdwardIII: or maybe at this point i should quit using querystrings and start putting it in session
[16:08:28] MaDErroR123: has joined #RubyOnRails
[16:08:38] chouhoulis: has joined #RubyOnRails
[16:10:17] IrishGringo_: has joined #RubyOnRails
[16:11:31] bpr_admin: smathy: well, I think I messed it up after I ran that command, because I didn't get that error before when I was deploying
[16:11:40] Cork: has joined #RubyOnRails
[16:11:52] jkamenik: has joined #RubyOnRails
[16:12:56] Bloomer: has joined #RubyOnRails
[16:13:29] smathy: bpr_admin, running that rake task generates a db/schema.rb, the presence of that lets Rails know that it needs a DB.
[16:14:04] smathy: bpr_admin, if you hadn't run that then your app would have just failed at some other point.
[16:14:25] ferr: has joined #RubyOnRails
[16:14:34] corioliss: has joined #RubyOnRails
[16:14:46] Jon30: has joined #RubyOnRails
[16:15:28] tubbo: EdwardIII: well the guys who made the framework say that's a load of bullshit, so: http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-button_to
[16:15:37] chipotle: has joined #RubyOnRails
[16:15:56] smathy: bpr_admin, I'm assuming that your app actually needs a DB - perhaps your app doesn't need a DB at all? In that case you might be able to just remove db/schema.rb from your app and re-deploy.
[16:15:58] tubbo: EdwardIII: oh wait I'm wrong!
[16:16:25] tubbo: EdwardIII: yeah it might be that button_to can't handle nested params, which is very strange to me...could be rails/rails pull request material :)
[16:16:54] EdwardIII: tubbo: i'm tempted, but i have a feeling it's probably that way for a reason
[16:17:00] EdwardIII: tubbo: i'll have a crack at it one evening, see what they say
[16:17:09] tubbo: EdwardIII: if it is, they'll tell you what that reason was
[16:17:12] EdwardIII: i'm brand new so whatever i do will also probably be wrong for a million reasons heh
[16:17:40] sandstrom: has joined #RubyOnRails
[16:17:42] tubbo: assuming that the issue will still be around in a year from now, by the time you actually can PR to rails i think you'll still be able to solve it
[16:18:37] EdwardIII: heh what do you mean?
[16:18:42] bpr_admin: smathy: I looked at the github source (master and unchanged) and my local source they both havethe schema.rb file. Is there another place that might have been edited to make the application look for the .yml file upon deployment?
[16:18:43] EdwardIII: it takes them 1yr to review pull requests?
[16:19:37] kknight: has joined #RubyOnRails
[16:21:05] sandstrom: has joined #RubyOnRails
[16:21:59] tubbo: EdwardIII: it will be at least a year before you have the capability of submitting pull requests to rails/rails, if that's what you want to do.
[16:22:04] ornerymoose: has joined #RubyOnRails
[16:22:07] EdwardIII: tubbo: ah ok
[16:22:08] tubbo: just because the code is a little complex
[16:22:17] EdwardIII: tubbo: how do people contrib at the moment? email a patch to th emailing list?
[16:22:22] EdwardIII: i'm sure there's an faq on this, sorry heh
[16:22:31] tubbo: EdwardIII: <tubbo> ... submitting pull requests to rails/rails, ...
[16:23:06] tubbo: https://help.github.com/articles/using-pull-requests/
[16:23:12] tbuehlmann: there's a guide about contributing to rails: http://guides.rubyonrails.org/contributing_to_ruby_on_rails.html
[16:24:31] ornerymoose: Hi, I have an app that simulates a garage having cars: https://github.com/ornerymoose/GarageApp . In my seeds.rb file, I create 5 cars with a stall_number. How would I get these stall_number strings to show up in my garage _form.html.erb fields_for section? Relevant for loop code is line 18 here: https://github.com/ornerymoose/GarageApp/blob/master/app/controllers/garages_controller.rb
[16:25:02] griffindy: has joined #RubyOnRails
[16:27:05] EdwardIII: tubbo: but i'm confused. you said you can't do pull requests for one year, but the guide says basically 'do a pull request' with some other guidelines, and when i said what's the current process you sent the link for 'do a pull request' on github?
[16:27:15] symbol: has joined #RubyOnRails
[16:27:29] tubbo: EdwardIII: ...i never said you can't do pull requests for one year.
[16:27:38] tubbo: EdwardIII: a pull request is a thing you do on github, or with git.
[16:27:52] tubbo: i don't really feel like explaining the basics of git to you right now, github has a lot of amazing articles on the subject.
[16:28:04] askhat: has joined #RubyOnRails
[16:28:07] EdwardIII: but i know how git, github and pull requests work
[16:28:13] EdwardIII: i just don't understand why it will take 1yr
[16:29:50] disgrntld: has joined #RubyOnRails
[16:29:51] Rubie: has joined #RubyOnRails
[16:30:30] treaki: has joined #RubyOnRails
[16:31:43] udiudi: has joined #RubyOnRails
[16:32:44] kknight: has joined #RubyOnRails
[16:32:59] udiudi: Hi, anyone knows if its possible to switch sessions store from cookie to redis and keep everyone logged in?
[16:34:20] tubbo: EdwardIII: i never said it would.
[16:34:31] assember: has joined #RubyOnRails
[16:34:40] smathy: bpr_admin, well you will know that from your git history. If no files were changed then your local db:migrate did nothing to affect your deploy.
[16:34:44] andrew-l: has joined #RubyOnRails
[16:34:47] tubbo: EdwardIII: i said you will probably ready to submit pull requests (because you'll be good enough at ruby by that point) within the year.
[16:34:59] RegulationD: has joined #RubyOnRails
[16:35:21] EdwardIII: it's just a small change, i'll have a fiddle this week and see if anyone in here wants to feedback on why it sucks
[16:36:53] B1n4r10: has joined #RubyOnRails
[16:37:42] DmitryBochkarev: has joined #RubyOnRails
[16:38:55] smathy: ornerymoose, looks like you're doing everything right, what's happening.
[16:39:58] ornerymoose: smathy, since it???s for i in 1..5 and :stall_number => i, it???s passing in values of 1,2,3,4 and 5. Not the actual strings from the seeds.rb file.
[16:40:00] lacrymology: has joined #RubyOnRails
[16:41:01] ornerymoose: Here is a screenshot of what currently occurs in garage???s _form.html.erb http://i.imgur.com/5tX2us8.png
[16:42:24] smathy: ornerymoose, oh I see. Not sure if I understand what you want here because this isn't going to be production code, but for just now if you replace that for loop in your controller with just `@garage.cars = Car.all` then you will get what you want in your New form.
[16:43:17] sandstrom: has joined #RubyOnRails
[16:43:18] IrishGringo: has joined #RubyOnRails
[16:43:56] ornerymoose: Ah I see, interesting. Thank you: if this were to eventually be production code, what would be the proper way to go about it?
[16:43:58] [Butch]: has joined #RubyOnRails
[16:45:46] DonOtreply: has joined #RubyOnRails
[16:46:45] a1fa: tubbo: ahh.. the routes are killing me
[16:46:55] a1fa: No route matches [PATCH] "/blackouts"
[16:47:18] a1fa: the route shows up in rake routes | grep blackouts, and its under the "blackouts_path"
[16:47:41] a1fa: i did have to adjust the form_for to include url: blackouts_path
[16:47:50] sonofdirt: has joined #RubyOnRails
[16:47:51] a1fa: it was trying to go into singular path
[16:48:16] symbol: has joined #RubyOnRails
[16:48:17] a1fa: patch 'blackouts/:id' => 'blackouts#update'
[16:48:26] a1fa: that's my route
[16:49:06] a1fa: i think is see where the problem is
[16:49:38] bpr_admin: smathy: that's what I thought too, and I looked at the diffing in my pushes, and didn't see anything, which is why it's such a mystery to me that when I deploy it now wants that .yml file
[16:50:37] a1fa: <%= form_for @blackouts, url: blackouts_path do |f| %>
[16:50:42] a1fa: ^ i think this is my problem
[16:51:09] a1fa: blackouts_path(@blackouts) submits a patch to blackouts.:id insted of blackouts/:id
[16:51:36] smathy: ornerymoose, to build the cars dynamically like you're doing in that for loop.
[16:51:42] a1fa: so i think i can just change the route to patch 'blackouts/:id' => 'blackouts#update'
[16:51:54] a1fa: err.. patch 'blackouts/' => 'blackouts#update'
[16:51:58] a1fa: and that should fix my problem
[16:52:07] dopamean_: has joined #RubyOnRails
[16:52:11] andrew-l: hi - i'm stubbing out an object rspec and not getting consistent results when i change my implementation. basically, the stub works when the implementation works on the object directly, but the stub doesn't work when the implementation works on a variable of objects... any ideas? (gist here: https://gist.github.com/a-leung/c960d220a3528f4c7c7b )
[16:53:00] IrishGringo: has joined #RubyOnRails
[16:53:04] smathy: ornerymoose, ...because you'll only be able to attach those existing Cars to one Garage, so with the `@garage.cars = Car.all` code, the next time someone comes to that new page and saves it the 5 cars will be attached to the new garage (and consequently, detached from the first garage).
[16:53:10] smathy: ornerymoose, each new garage will "steal" the cars from the previous one.
[16:53:33] ornerymoose: ahhh, makes sense
[16:53:47] Glyphik: has joined #RubyOnRails
[16:53:50] lexiMon: has joined #RubyOnRails
[16:53:56] a1fa: ...but that does not pass the id
[16:54:07] moeabdol: has joined #RubyOnRails
[16:54:09] tetraktys: has joined #RubyOnRails
[16:54:15] hobodave: has joined #RubyOnRails
[16:54:53] smathy: bpr_admin, the mystery to me is actually why it ever didn't require that file, as I said, all normal VPS hosting providers will require that file.
[16:55:11] smathy: bpr_admin, heroku is the odd one out here because it writes it for you.
[16:55:12] a1fa: sooo.. back to form_for
[16:55:59] diegoviola: has joined #RubyOnRails
[16:58:26] Limix: has joined #RubyOnRails
[16:59:00] soahccc: Does anyone know on which basis these "login from unrecognized location" mails work on? Just the full IP/cookie would result in one mail per login so I'm guessing /24 check with maybe user agent?
[16:59:20] a1fa: so i am at a loss why "blackouts_path(@blackouts)" would be adding a dot instead of a slash
[16:59:47] a1fa: so instead of blackouts/:id it renders as blackouts.:id
[17:00:04] sonofdirt: has joined #RubyOnRails
[17:00:55] sandstrom: has joined #RubyOnRails
[17:00:59] tetraktys: has joined #RubyOnRails
[17:01:00] a1fa: what am i missing here?
[17:02:05] a1fa: stackoverflow experts think its because of missing :as
[17:05:40] a1fa: note to future self, dont try to mix/match pluralized routes with the same singular route
[17:07:34] msyvich: has joined #RubyOnRails
[17:08:26] Rubie: has joined #RubyOnRails
[17:08:41] moeabdol: has joined #RubyOnRails
[17:09:40] pawnbox: has joined #RubyOnRails
[17:10:15] symbole: has joined #RubyOnRails
[17:11:15] rogue_koder: has joined #RubyOnRails
[17:12:51] chipotle_: has joined #RubyOnRails
[17:14:15] gambl0re: has joined #RubyOnRails
[17:14:19] arup_r: has joined #RubyOnRails
[17:14:47] DonOtreply: has joined #RubyOnRails
[17:15:17] soahccc: a1fa: yes with :as you can change the (base)name of the route do avoid naming collisions. scopes or namespaces also can help with that
[17:16:08] solars: has joined #RubyOnRails
[17:16:25] msyvich: has joined #RubyOnRails
[17:19:37] EdwardIII: hrm if you're using simple_form_for and you want to include a hidden value... is it right that you have to populate that manually?
[17:19:52] sandstrom: has joined #RubyOnRails
[17:21:13] smathy: EdwardIII, assuming you mean populate the value, only if it's not an attribute of the object passed to the form.
[17:23:12] EdwardIII: smathy: these are coming out without a value: https://gist.github.com/EdwardIII/dd87988958a45364140e#file-f-erb-L5-L6
[17:23:27] EdwardIII: but a @stay_request definitely has a value for arrival_date
[17:23:34] smathy: EdwardIII, ah right, you're not using the simple_form methods.
[17:23:53] EdwardIII: ah i should be doing it differently?
[17:23:54] smathy: EdwardIII, stay_request_builder.input :arrival_date, type: :hidden
[17:25:06] IrishGringo: has joined #RubyOnRails
[17:26:08] EdwardIII: smathy: thanks for the pointer, still seem to be no values though? https://gist.github.com/EdwardIII/dd87988958a45364140e
[17:26:17] EdwardIII: that's the output: https://gist.github.com/EdwardIII/dd87988958a45364140e#file-f-html
[17:26:54] msyvich: has joined #RubyOnRails
[17:27:04] EdwardIII: haha ah wait disregard that i'm being super stupid
[17:27:14] treehug88: has joined #RubyOnRails
[17:27:28] syath: has joined #RubyOnRails
[17:27:37] EdwardIII: it's actually just displaying it normally?
[17:28:11] askhat: has joined #RubyOnRails
[17:28:27] EdwardIII: ah ha, it's :as :hidden
[17:28:34] smathy: Oh, sorry - yes.
[17:28:35] EdwardIII: thanks smathy
[17:28:59] mag42c: has joined #RubyOnRails
[17:29:21] brycesenz: has joined #RubyOnRails
[17:29:44] Limix: has joined #RubyOnRails
[17:30:08] aarkerio: has joined #RubyOnRails
[17:31:58] JohnBat26: has joined #RubyOnRails
[17:32:12] lexiMon: has joined #RubyOnRails
[17:32:22] JohnBat26: has joined #RubyOnRails
[17:32:57] AzaToth: has joined #RubyOnRails
[17:34:29] EdwardIII: hrm weird, it's a big ol' form, the only thing that gets saved in the db is the title. i don't have params for any of the customer details, funny how it's only saving that one
[17:34:43] RegulationD: has joined #RubyOnRails
[17:35:40] chridal: I'm using scope with joins(:users), but how can I state which column I want it to join on? Right now it is defaulting to user_id, but I want another column
[17:35:55] chridal: https://gist.github.com/871aaa2f1511dba0d210https://gist.github.com/871aaa2f1511dba0d210
[17:36:15] chridal: This is my code. I want to join on blockee_id instead of user_id from blocked_users table
[17:37:01] bpr_admin: smathy: so I copied and renamed the database.yml.dist file to database.yml, and I'm still getting the error: Could not load database configuration. No such file - ["config/database.yml"]
[17:37:41] smathy: bpr_admin, and you pushed that to your repo?
[17:38:01] bpr_admin: yes, pushed to the repo and did a commit to the application
[17:38:09] brycesenz: chridal - there is a "foreign_key" option that you can specify
[17:39:14] SanguineAnomaly: has joined #RubyOnRails
[17:39:32] chridal: brycesenz: What's the syntax for it? I'm struggling to find any good documentation on this topic
[17:39:33] sandstrom: has joined #RubyOnRails
[17:39:50] brycesenz: chridal - http://guides.rubyonrails.org/association_basics.html
[17:40:02] brycesenz: chridal - you can find an example of it in section 2.10
[17:40:16] smathy: bpr_admin, what are you using to deploy? Capistrano?
[17:40:17] chridal: Aha! Now I found my error...
[17:40:33] chridal: I misunderstood the syntax and thought join(:user) was the User table.
[17:40:46] chridal: But as soon as I switched to the association inside join() it was just fine.
[17:40:50] chridal: Thanks for pointing me in that direction.
[17:41:01] EdwardIII: hrm i just wanna setup requirements so my StayDetail can save the details for a Customer against it (one StayDetail has one Customer)
[17:41:04] brycesenz: chridal - no worries. glad you found the bug!
[17:41:11] teaearlgraycold: So I have this weird CSS issue. In development my Bootstrap 3 buttons have ~5px of spacing between each of them, but in production they have no spacing. What's odd is that in both cases neither has a specified margin property.
[17:41:28] EdwardIII: but this is just totally wrong: https://gist.github.com/EdwardIII/2a511a4b23d9404b7d1e#file-c-rb-L47
[17:41:38] bpr_admin: smathy: this is on a linux box and we deploy to AWS Elastic Beastalk, so my command is "eb deploy"
[17:41:44] EdwardIII: i see stuff like accepts_nested_attributes_for but i'm not sure that's right
[17:42:01] teaearlgraycold: Setting margin-right: 5px; just /adds/ to the existing margins in development, so I'm not sure what's going on
[17:42:32] bpr_admin: smathy: I'm a VMware Administrator tasked with porting this rails app to EB
[17:42:56] DonOtreply: has joined #RubyOnRails
[17:43:34] smathy: bpr_admin, you might need to talk to Amazon then, this `eb` tool is theirs I assume, and you need to understand it better I think.
[17:44:03] smathy: bpr_admin, with capistrano, for example, it just grabs the config/database.yml from your repo, so whatever you have there is deployed to your prod server.
[17:44:09] smathy: bpr_admin, it sounds like `eb` is doing something peculiar.
[17:44:21] yoongkang: has joined #RubyOnRails
[17:44:43] mikecmpbll: has joined #RubyOnRails
[17:44:47] teaearlgraycold: Oh, elastic beanstalk
[17:45:09] brycesenz: EdwardIII - I think that your declaration for those strong_params is incorrect. Can you inspect what the actual params coming in from your form are?
[17:46:27] EdwardIII: brycesenz: almost certainly heh: https://gist.github.com/EdwardIII/2a511a4b23d9404b7d1e#file-gistfile1-txt
[17:46:33] smathy: EdwardIII, the API docs for anaf have a prelude that explains the strong params setup: http://devdocs.io/rails/activerecord/nestedattributes/classmethods#method-i-accepts_nested_attributes_for
[17:46:38] teaearlgraycold: bpr_admin: this seems to have something about the database.yml in it: http://superuser.com/questions/510593/elastic-beanstalk-rails-application-with-git-source-and-deploy-hooks
[17:46:42] arup_r: I am jobless now. So anybody if looking for any part time/ full time dev let me know please. I need one. ( Sorry to say you people here )
[17:47:01] cschneid_: has joined #RubyOnRails
[17:47:08] EdwardIII: smathy: but is that necessary if it's just a 1 to 1 type thing?
[17:47:10] brycesenz: EdwardIII - see the comment I made on your gist
[17:47:11] symbole: has joined #RubyOnRails
[17:47:16] bpr_admin: in the docs, my 2 options are deploy rails app and deploy a sinatra app, as far as I know, this is a rails application
[17:47:27] safety_cut: has joined #RubyOnRails
[17:47:52] smathy: EdwardIII, is what necessary? Doing things the right way? Yes.
[17:48:09] EdwardIII: brycesenz: cool i'll give that a spin... then just save the StayDetail and let rails do the rest? is accepts_nested_attributes_for required here too?
[17:48:19] baweaver: has joined #RubyOnRails
[17:48:21] EdwardIII: smathy: i mean it looks more like it's for the other side of the relationship
[17:48:34] EdwardIII: smathy: like the other side of a one-to-many
[17:49:03] smathy: EdwardIII, too many pronouns, anyway you've been given the code that you would have learnt from the docs now.
[17:49:04] baweaver: has joined #RubyOnRails
[17:49:43] EdwardIII: smathy: not sure i see the connection between the code on http://devdocs.io/rails/activerecord/nestedattributes/classmethods#method-i-accepts_nested_attributes_for and the code in the comment on the gist?
[17:50:35] brycesenz: EdwardIII - there are a few places worth checking as you debug this (use pry, or puts statements if you're really hacky): 1) Make sure that you're getting the correct output from customer_params. 2) Make sure that saving the object with those params does what you want it to. Then you can stitch it all together.
[17:51:09] sbarg: has joined #RubyOnRails
[17:51:26] SanguineAnomaly: has joined #RubyOnRails
[17:51:59] lemur: has joined #RubyOnRails
[17:52:01] drbayer: has joined #RubyOnRails
[17:52:15] Sadin: has joined #RubyOnRails
[17:52:16] adre: has joined #RubyOnRails
[17:53:52] lxsameer: has joined #RubyOnRails
[17:53:54] ornerymoose: has joined #RubyOnRails
[17:54:42] EdwardIII: brycesenz: thanks for the pointers, working through it now
[17:56:14] smathy: EdwardIII, as I said - look in the prelude to that anaf docs for the strong parameters setup you need (which is what has since been given to you by brycesenz).
[17:59:06] PedramT: has joined #RubyOnRails
[17:59:42] mordocai: has joined #RubyOnRails
[17:59:50] tildes: has joined #RubyOnRails
[18:00:00] ElFerna: has joined #RubyOnRails
[18:00:08] brycesenz: EdwardIII - you will have a much better time in Rails if you make sure that you understand the expected output of each bit of Rails "magic". Otherwise, when things behave unexpectedly, you're lost on where to start looking.
[18:00:32] wldcordeiro: has joined #RubyOnRails
[18:01:06] mordocai: I'm looking at using https://github.com/thoughtbot/scenic for work, but I thought back a few months ago I might have heard something about rails 5 bringing native database view support? Am I mis-remembering?
[18:01:23] EdwardIII: thanks brycesenz, smathy - got it saving now
[18:01:37] EdwardIII: brycesenz: that makes sense, yes
[18:02:06] iamjhu: has joined #RubyOnRails
[18:02:26] symbol: has joined #RubyOnRails
[18:03:46] sbarg: has left #RubyOnRails: ()
[18:04:05] adre: has joined #RubyOnRails
[18:04:18] rogue_koder: has joined #RubyOnRails
[18:04:18] mdw: has joined #RubyOnRails
[18:05:03] sandstrom: has joined #RubyOnRails
[18:07:36] Scriptonaut: has joined #RubyOnRails
[18:08:09] Scriptonaut: if I pass params to the build method, and the params have an :id param, will it look up the id and use that one, or will it just create a new one?
[18:08:16] smathy: mordocai, I don't remember that being mentioned.
[18:08:33] smathy: Scriptonaut, !try
[18:08:33] helpa: Scriptonaut: Why don't you try it and find out for yourself?
[18:08:55] mordocai: smathy: Alright, probably just wishful thinking. Scenic it is then :)
[18:10:46] treehug88: has joined #RubyOnRails
[18:11:24] Scriptonaut: it doesn't seem to
[18:11:40] brycesenz: smathy - we've been using that pattern (from the Scenic documentation) for database views for a few years now and loving it, though I'd never heard of that gem. It makes me kind of excited to know that thoughtbot came to a similar conclusion. DB views are the best!
[18:12:56] smathy: brycesenz, yeah, same.
[18:13:33] mordocai: We've been using no pattern for our db views for years and it makes me sad. But we'll be moving to the scenic gem, so we have that.
[18:13:58] mordocai: I had mentioned such a pattern a few times in passing since I started a few months ago but never went as far as implementing it
[18:15:13] netzfisch: has joined #RubyOnRails
[18:15:26] a1fa: ugh... does cancancan tie into model as awell as controller?
[18:15:50] a1fa: it looks like cancancan can not operate without a matching model
[18:16:29] a1fa: but abilities are only tied to the controller
[18:17:43] a1fa: ie: if i add load_and_authorize_resource into controller i get uninitialized constant
[18:17:53] sandstrom: has joined #RubyOnRails
[18:19:08] brycesenz: a1fa - look into use "AbstractController::Callbacks". That's what I've done for cases where the model name can't be derived from the controller name
[18:19:34] a1fa: brycesenz: will look it up. it appears load_and_authorize_resource takes "class" method
[18:19:52] djbkd: has joined #RubyOnRails
[18:20:09] visudo: has joined #RubyOnRails
[18:23:50] rikkipitt: has joined #RubyOnRails
[18:24:35] ddv: has joined #RubyOnRails
[18:25:45] bronson_: has joined #RubyOnRails
[18:26:09] askhat: has joined #RubyOnRails
[18:26:34] jeanre: has joined #RubyOnRails
[18:26:49] freezevee: has joined #RubyOnRails
[18:27:48] freezevee: I tried to upgrade to Rails 5 beta 2 and when bundle install -> Could not find gem 'rails (>= 5.0.0.beta2, ~> 5.0)' in any of the gem sources listed in your Gemfile or available on this machine.
[18:27:51] freezevee: any ideas ?
[18:28:04] DoubleMalt: has joined #RubyOnRails
[18:28:14] freezevee: install it from github master branch ?
[18:28:24] safety_cut: has joined #RubyOnRails
[18:29:12] msyvich: has joined #RubyOnRails
[18:29:16] shaundavio: has joined #RubyOnRails
[18:29:18] sandstrom: has joined #RubyOnRails
[18:30:28] shaundavio: Hey there. How can I declare a belongs_to association that applies to more than one record type? Do I need to have a base class that those records descend from that has the belongs_to?
[18:31:32] a1fa: ended up creating a new model, because i need specific validations done anyhow
[18:31:38] rakm: has joined #RubyOnRails
[18:32:12] shaundavio: In other words, I have a Foo and Bar that both has_one Config. How do I declare the association from the Config side?
[18:32:29] fryguy: shaundavio: polymorphic associations
[18:32:48] rikkipitt: hey everyone, a client is using svgs for the project logos - how should I "CMS" them? Text field or file upload?
[18:32:56] rikkipitt: anyone got a preference on it?
[18:33:04] rikkipitt: they are a design company
[18:33:24] moeabdol1: has joined #RubyOnRails
[18:34:00] aarkerio: file upload sounds easier
[18:34:44] nozpheratu: has joined #RubyOnRails
[18:34:56] shaundavio: fryguy: thanks, any idea where i can find moreinfo on that?
[18:35:15] PedramT: has joined #RubyOnRails
[18:35:19] shaundavio: fryguy: nevermind, found it in the guide :)
[18:36:16] baweaver: has joined #RubyOnRails
[18:36:21] gambl0re: has joined #RubyOnRails
[18:36:21] gambl0re: has joined #RubyOnRails
[18:36:35] meoblast001: has joined #RubyOnRails
[18:41:08] kknight: has joined #RubyOnRails
[18:41:44] EdwardIII: hrm hidden_field(:signup, :pass_confirm) looks like you should be able to say hidden_field(:signup, 'hello') but that seems to result in: undefined method `merge' for "hello":String
[18:42:03] intrigueD: has joined #RubyOnRails
[18:42:11] EdwardIII: i guess if it's not a symbol indicating a field on your model it figures you're passing in options
[18:42:14] fox_mulder_cp: has joined #RubyOnRails
[18:42:34] fryguy: EdwardIII: you probably want hidden_field_tag
[18:43:49] EdwardIII: fryguy: i did give that a try, but it seems to get the wrong field names? e.g. if i say <%= hidden_field_tag :room_id, room.id %> i get a tag with the name="room_id" but i need name="stay_detail[rateplan_id]"
[18:44:10] fryguy: so then you probably do want hidden_field
[18:44:14] fryguy: read the documentation about it
[18:44:56] EdwardIII: fryguy: i read the api docs, but couldn't figure out how to force a value into it: http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-hidden_field
[18:45:19] fryguy: value is one of the options you can pass into the hash
[18:45:30] fryguy: you should be setting it on the object that is from_for though
[18:46:25] roshanavand: has joined #RubyOnRails
[18:46:42] EdwardIII: it is from_form but i'm not sure setting it on the object is the right move. there's just one StayDetail, but i loop through a bunch of rows so you can choose with thing you want to add next. like this: https://gist.github.com/EdwardIII/4c44c01c27ac76aedae8#file-build-erb-L16
[18:46:46] herpless: has joined #RubyOnRails
[18:46:48] Wolland: has joined #RubyOnRails
[18:46:51] EdwardIII: form_for rather
[18:48:21] rogue_koder: has joined #RubyOnRails
[18:48:53] smathy: freezevee, you can't have the ~> 5.0 in there, put "< 6.0" if you really think you need that functionality right now.
[18:48:53] sandstrom: has joined #RubyOnRails
[18:49:05] EdwardIII: i better roll, thanks for the pointers fryguy
[18:50:25] rikkipitt: has joined #RubyOnRails
[18:51:22] momomomomo: has joined #RubyOnRails
[18:52:00] srinidhi: has joined #RubyOnRails
[18:52:11] kknight: ActionController::UrlGenerationError in Websites#index how to fix it?
[18:52:39] intrigueD: Are there any useful guides for working with ActiveSupport::Duration (conversion,storage,etc), that anyone here knows of?
[18:53:39] intrigueD: Or guidelines even...
[18:54:39] pipework: intrigueD: Probably just the professional-level documentation.
[18:55:04] smathy: rikkipitt, file upload.
[18:56:11] ramortegui: has joined #RubyOnRails
[18:56:14] smathy: kknight, not enough information to even guess.
[18:56:26] shilon: has joined #RubyOnRails
[18:57:22] kknight: where to paste screenshot i want to show you ?
[18:58:59] kknight: https://gist.github.com/aj07/e4c9a4001207309be51f smathy?
[18:59:41] djbkd: has joined #RubyOnRails
[18:59:47] pipework: kknight: Do you have a route for that?
[19:00:20] godzillaenlacasa: has joined #RubyOnRails
[19:01:00] maesitos: has joined #RubyOnRails
[19:01:12] djbkd: has joined #RubyOnRails
[19:01:47] kknight: pasting it
[19:02:57] kknight: pipework: https://gist.github.com/aj07/9e22ffb87bd9444bc8b9
[19:03:40] pipework: kknight: Run `rake routes` in your terminal and find the 'create_banner_text` line and paste it here.
[19:03:56] tetraktys: has joined #RubyOnRails
[19:06:27] kknight: create_banner_text_website GET /websites/:id/create_banner_text(.:format) websites#create_banner_text
[19:06:28] kknight: change_section_background_website GET /websites/:id/change_section_background(.:format) websites#change_section_background
[19:06:49] sandstrom: has joined #RubyOnRails
[19:07:10] pipework: kknight: The route is then "create_banner_text_website_path(@website.id)" I think.
[19:07:23] pipework: Unless @website has #to_param defined.
[19:08:00] mary5030: has joined #RubyOnRails
[19:08:27] kknight: explain little
[19:08:58] benlieb: has joined #RubyOnRails
[19:09:16] tetraktys: Hey guys, i'm trying to do a very simple render json: "something" in this gist: https://gist.github.com/joostvanrijn/77794bf0ac8ff68f28c4 but it keeps returning the described error. For some reason the app still tries to render a (non existing) template
[19:09:26] roshanavand: has joined #RubyOnRails
[19:11:50] yqfvwal: has joined #RubyOnRails
[19:12:04] pipework: tetraktys: You didn't set your format correctly. In your routes, add the json format.
[19:12:28] underplank: has joined #RubyOnRails
[19:12:55] mordocai: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")
[19:13:01] momomomomo: has joined #RubyOnRails
[19:13:21] rikkipitt: has joined #RubyOnRails
[19:13:45] rikkipitt: cheers smathy
[19:13:53] jsrn_: has joined #RubyOnRails
[19:14:11] KensoDev: has joined #RubyOnRails
[19:14:18] underplank: Hi all. Im using sinatra and rspec. In my sinatra app i???ve got some instance variables that I would like to override in my app. But as rspec instansiates the app on the fly when I do a ???get /foo??? call, I cant pre-set these. Is there a way to tell rspec/Rack::Test to insert some variables into the instansiation of the app?
[19:15:17] tubbo: underplank: you could read them as methods (with `attr_accessor`), then explicitly set their values with RSpec.
[19:15:36] tubbo: so instead of calling @foo in your app, call foo, and make attr_reader :foo so it can be exposed as a public method
[19:15:48] FLeiXiuS: has joined #RubyOnRails
[19:15:49] tubbo: in rspec, you can do allow(your_app).to receive(:foo).and_return 'the mocked value'
[19:16:06] underplank: ahh.. ok.. i???ll give that a shot
[19:18:27] emachnic: has joined #RubyOnRails
[19:19:06] ElFerna: has joined #RubyOnRails
[19:19:09] ur5us: has joined #RubyOnRails
[19:20:25] hcnewsom: has joined #RubyOnRails
[19:21:17] DonOtreply: has joined #RubyOnRails
[19:24:03] nunchuck: has joined #RubyOnRails
[19:24:28] markkraemer: has joined #RubyOnRails
[19:25:19] askhat: has joined #RubyOnRails
[19:25:26] kies^: has joined #RubyOnRails
[19:25:49] arup_r: has joined #RubyOnRails
[19:26:01] underplank: has joined #RubyOnRails
[19:26:31] markkraemer: has left #RubyOnRails: ()
[19:28:23] sandstrom: has joined #RubyOnRails
[19:30:55] jmfurlott: has joined #RubyOnRails
[19:32:19] manfrin: has joined #RubyOnRails
[19:33:27] dopamean1: has joined #RubyOnRails
[19:34:40] arup_r: has left #RubyOnRails: ()
[19:37:03] arup_r: has joined #RubyOnRails
[19:37:10] SteenJobs: has joined #RubyOnRails
[19:37:18] Pazician: has joined #RubyOnRails
[19:38:12] ravster: has joined #RubyOnRails
[19:39:39] Coldblackice: has joined #RubyOnRails
[19:41:12] FooMunki: has joined #RubyOnRails
[19:42:15] djbkd: has joined #RubyOnRails
[19:43:44] _djbkd: has joined #RubyOnRails
[19:43:54] tetraktys: has joined #RubyOnRails
[19:44:15] arup_r: Nucky: ^^ :)
[19:44:52] sandstrom: has joined #RubyOnRails
[19:44:54] yoongkang: has joined #RubyOnRails
[19:45:13] hobodave: has joined #RubyOnRails
[19:45:13] fox_mulder_cp: oh. i like drbd and replica. two commands and your services just works on another country datacenter
[19:45:29] intrigueD: ACTION waves at fox_mulder_cp and arup_r
[19:45:38] Cohedrin: has joined #RubyOnRails
[19:46:13] arup_r: ACTION also waves to intrigueD and fox_mulder_cp and Nucky
[19:46:17] fox_mulder_cp: oh, i cry - i can't see how many people downloads my repo from github ((
[19:46:27] fox_mulder_cp: arup_r: recursive wave?^)
[19:46:50] fox_mulder_cp: Radar: how are u after flying?
[19:46:59] arup_r: my internet is so slow that I am cloning since 3 mins
[19:47:55] prgmmr: has joined #RubyOnRails
[19:48:15] fox_mulder_cp: arup_r: i have a 10g on work (ISP) and 100mbit at home for a some dollars
[19:48:39] arup_r: it is India, internet is worst.
[19:48:41] fox_mulder_cp: but i knows about low speed internet in us/europe (
[19:49:15] prgmmr: Any good tutorials on creating APIs in Rails, and to he able to call from iOS app?
[19:49:17] fox_mulder_cp: and very gold price (
[19:49:30] tubbo: prgmmr: you can call any API from an iOS app.
[19:49:54] fox_mulder_cp: prgmmr: u can call any api from ANY platform app
[19:49:56] tubbo: there are a lot of tutorials for that, not sure which are the "best" ones honestly
[19:50:58] prgmmr: tubbo: I thought so, new question then, any good tutorials on creating API in Rails?
[19:51:23] underplank: has joined #RubyOnRails
[19:51:48] dexter-tzu: has joined #RubyOnRails
[19:53:06] prgmmr: I just trying to find a easy to follow guide
[19:53:17] arup_r: has joined #RubyOnRails
[19:54:12] pyemkey: has joined #RubyOnRails
[19:54:23] shilon: has joined #RubyOnRails
[19:55:20] djbkd: has joined #RubyOnRails
[19:55:59] sandstrom: has joined #RubyOnRails
[19:56:04] fox_mulder_cp: prgmmr: in rails5 api start a native, as i knows
[19:57:47] tscrypter: has joined #RubyOnRails
[19:58:21] safety_cut: has joined #RubyOnRails
[19:58:33] Scriptonaut: I have a person model, person has_many details. I'm trying to find people that have more than one detail with name "instagram". How would I form taht query? Right now I'm doing: Person.joins(:details).where("COUNT(details.name = 'instagram') > 1"), but it's not working
[19:58:41] Scriptonaut: could someone give me a hand with the query?
[19:58:41] ql6wlld: has joined #RubyOnRails
[19:59:28] Scriptonaut: when I execute the above query, I get: ActiveRecord::StatementInvalid: PG::GroupingError: ERROR: aggregate functions are not allowed in WHERE LINE 1: ...."id" AND "details"."detailable_type"
[19:59:37] fox_mulder_cp: Scriptonaut: person.details.where(name: 'instagram').count ?
[19:59:58] Scriptonaut: no, I want to find the people that have more than one detail named "instagram"
[20:00:18] intrigueD: prgmmr: What do you want to know? Are you going to be using rails-api?
[20:00:21] Scriptonaut: that query y ou just posted would just return the number of details a single person had named instagram
[20:01:04] fox_mulder_cp: Scriptonaut: yep. if count 1+ -> 2 details named instagram..
[20:01:23] prgmmr: intrigueD: not sure yet, I was also wondering If using Sinatra would be a good idea or is thr built in Rails api better
[20:01:28] baweaver: has joined #RubyOnRails
[20:01:41] Scriptonaut: fox_mulder_cp: I'm trying to find a collection of people who have more than one detail named "instagram"
[20:01:45] Scriptonaut: that's the query I want
[20:02:06] intrigueD: prgmmr: It really depends what you are trying to do
[20:02:48] fox_mulder_cp: Scriptonaut: om.
[20:02:55] PedramT: has joined #RubyOnRails
[20:04:19] prgmmr: intrigueD: I need to be able to communicate with Postgresql as in create, delete update etc. And also need to be able to query data back to the iOS app.
[20:04:21] tvw: has joined #RubyOnRails
[20:05:02] intrigueD: prgmmr: Have you created RoR web apps before?
[20:05:33] prgmmr: Not entirely.
[20:05:51] roshanavand: has joined #RubyOnRails
[20:05:53] fox_mulder_cp: prgmmr: api - json|xml|soap get/post reuests
[20:06:27] fox_mulder_cp: prgmmr: my bash script connects with docker daemon via it's api
[20:07:34] intrigueD: prgmmr: What are you leaning towards? I wouldn't worry too much about the decision...
[20:07:45] intrigueD: I'd rather get going on the project :D
[20:07:53] Scriptonaut: just in case anyone is wondering, I figured it out. this is the query that works: Person.joins(:details).where(details: {name: "instagram"}).group('people.id').having("count (details.id) > 1")
[20:08:11] fox_mulder_cp: Scriptonaut: thanks
[20:09:43] prgmmr: intrigueD: that's what I was thinking just wanna get started, I was looking at Sinatra, doesn't seem too hard. Is Sinatra good tool? Is it different than rails?
[20:10:13] sloggerkhan: has joined #RubyOnRails
[20:10:51] fryguy: it's very different from rails
[20:10:58] doublemalt_: has joined #RubyOnRails
[20:11:03] codelahoma: has joined #RubyOnRails
[20:11:29] sloggerkhan: Is there any reason not to patch TrueClass and FalseClass so that they have to_i methods?
[20:12:34] fryguy: SloggerKhan: except for the general sentiment of "don't monkey patch core objects" and then fact that semantically to_i doesn't make sense, not much reason
[20:12:41] fryguy: you might break some random gems, who knows
[20:13:03] shilon: has joined #RubyOnRails
[20:13:37] RegulationD: has joined #RubyOnRails
[20:13:45] sandstrom: has joined #RubyOnRails
[20:13:47] SteenJobs: has joined #RubyOnRails
[20:14:15] prgmmr: intrigueD: then I'll probably stick to Rails
[20:14:51] intrigueD: prgmmr: OK :)
[20:15:18] intrigueD: prgmmr: Then you'll be able to get help in here
[20:15:43] prgmmr: intrigueD: where should I start? Any guides?
[20:15:50] intrigueD: prgmmr: I'm using rails-api for my current project
[20:15:59] sloggerkhan: It drives me crazy because one of my projects involves a lot of (simple) math based on whether various flags are T/F and I always want to just write them as one liners and the lack of boolean to_i means they end up being giant multi-line things.
[20:16:06] bronson_: has joined #RubyOnRails
[20:16:33] RegulationD: has joined #RubyOnRails
[20:18:15] tetraktys: has joined #RubyOnRails
[20:19:54] baweaver: has joined #RubyOnRails
[20:21:03] safety_cut: has joined #RubyOnRails
[20:22:52] askhat: has joined #RubyOnRails
[20:24:03] macsteps: has joined #RubyOnRails
[20:24:05] yfeldblum: has joined #RubyOnRails
[20:24:10] rhizome: SloggerKhan: sounds like a refactor candidate
[20:24:53] tetraktys: has joined #RubyOnRails
[20:25:08] Cohedrin: has joined #RubyOnRails
[20:26:53] yoongkang: has joined #RubyOnRails
[20:28:11] mary5030: has joined #RubyOnRails
[20:28:44] netzfisch: has joined #RubyOnRails
[20:30:59] theery: has joined #RubyOnRails
[20:32:39] [Butch]_: has joined #RubyOnRails
[20:33:11] roshanavand: has joined #RubyOnRails
[20:35:56] shilon: has joined #RubyOnRails
[20:38:54] floror: has joined #RubyOnRails
[20:40:10] tetraktys: has joined #RubyOnRails
[20:40:53] baweaver: has joined #RubyOnRails
[20:41:25] djbkd: has joined #RubyOnRails
[20:41:55] ElFerna: has joined #RubyOnRails
[20:42:08] thezanke: has joined #RubyOnRails
[20:42:08] thezanke: has joined #RubyOnRails
[20:42:57] macsteps: has joined #RubyOnRails
[20:43:08] Scriptonaut: in activerecord, how would I use an OR in my where query? I want to grab all details that's name isn't "email" or "phone"
[20:43:29] Scriptonaut: Detail.where.not(name: "email").where.not("name: "phone")
[20:43:34] Scriptonaut: that would probably work, but it looks bad
[20:44:07] intuxicated: has joined #RubyOnRails
[20:44:29] arup_r: has joined #RubyOnRails
[20:45:06] neohunter: how I can create a route that redirect all that matches /folder/*
[20:45:22] arup_r: Scriptonaut: use SQL,,, rails 5 has that method.. but in Rails 4 use .where(exp = ? or exp2 = ?, v1, v2)
[20:45:23] Cohedrin: has joined #RubyOnRails
[20:45:30] arup_r: as an example
[20:46:18] arup_r: neohunter: match "/folder/*", via: :get, to "controller_name#action" ?
[20:48:04] rubyonrailed: has joined #RubyOnRails
[20:48:04] beingjohnm: What is the best way to go about creating a model with no database table? I need a model "Plan". Each user is going to have a single plan but plan will be full of methods that gather data from other models.
[20:48:58] beingjohnm: I see I can create a model that isn't from ActiveRecord::Base but then I can't use has_one in hte user model and belongs_to in the Plan model.
[20:49:42] Scriptonaut: arup_r: thank you
[20:49:43] arup_r: beingjohnm: just create a file by hand plan.rb that's it
[20:49:44] rubyonra_: has joined #RubyOnRails
[20:50:08] arup_r: inside the models/ dir or if you want inside the services/ dir
[20:50:13] arup_r: whatever you want
[20:50:21] arup_r: it is PORO
[20:51:05] DoubleMalt: has joined #RubyOnRails
[20:51:15] beingjohnm: arup_r: yeah, did that.
[20:51:39] beingjohnm: but I still want it to belong_to user and that is where I get an error
[20:52:30] beingjohnm: arup_r: and I can't user "class Plan < ActiveRecord::Base" without there being a table
[20:52:52] beingjohnm: and it seems like I need the ActiveRecord::Base to be able to use belongs_to
[20:53:19] arup_r: I know.. a PORO can behave like model when you do like http://guides.rubyonrails.org/active_model_basics.html .. but those associations are part of active record
[20:53:44] ElFerna: has joined #RubyOnRails
[20:53:55] wldcordeiro: has joined #RubyOnRails
[20:54:30] arup_r: beingjohnm: associations are there to handle relationships between table.. and your class has no mapping with a table.. so trying to add belongs_to or any associations meaning less
[20:55:00] baweaver: has joined #RubyOnRails
[20:55:03] arup_r: and that's why ActiveModel don't have those features..
[20:56:28] arup_r: beingjohnm: you can create your own method like def user; <and put here own logic> ; end
[20:56:36] beingjohnm: arup_r: thanks. I guess I'll just work around by making user an attr_accessor inside Plan
[20:56:37] arup_r: or something like that
[20:59:56] maxx88: has left #RubyOnRails: ()
[21:00:04] gingray: has joined #RubyOnRails
[21:01:20] momomomomo: has joined #RubyOnRails
[21:02:09] safety_cut: has joined #RubyOnRails
[21:03:15] tetraktys: has joined #RubyOnRails
[21:04:58] Cohedrin: has joined #RubyOnRails
[21:05:09] Scriptonaut: arup_r: I was thinking, couldn't I also do this? Detail.where.not(name: ['email', 'phone'])
[21:05:13] Scriptonaut: is that the same thing?
[21:05:27] Scriptonaut: I want all the details that don't have name 'email' or name 'phone'
[21:05:29] arup_r: Scriptonaut: that is NOT IN in SQL term
[21:05:36] Scriptonaut: what do you mean
[21:06:00] arup_r: your query will work
[21:06:17] Cohedrin: has joined #RubyOnRails
[21:06:33] baublet: has joined #RubyOnRails
[21:06:37] maxx88: has joined #RubyOnRails
[21:08:37] neohunter: get '/wp-content/*', to: redirect('https://google.com/') is not working... why? i got 404
[21:10:48] neohunter: get '/test'... does work
[21:11:42] fox_mulder_cp: neohunter: why i see #wordpress on #RoR ?
[21:11:59] neohunter: you are not seeing WP, you are seeing a string
[21:12:06] neohunter: i dont have wordpress
[21:13:03] neohunter: get '/testing/*', to: redirect('https://google.com/') is not working... why? i got 404
[21:13:14] nfk|laptop: has joined #RubyOnRails
[21:13:15] Cohedrin: has joined #RubyOnRails
[21:14:57] fox_mulder_cp: neohunter: what log says?
[21:15:21] neohunter: Started GET "/testing/test/algo" for 127.0.0.1 at 2016-02-08 16:09:32 -0500
[21:15:21] neohunter: Processing by ApplicationController#error_404 as HTML
[21:15:30] Cohedrin: has joined #RubyOnRails
[21:16:44] Cohedrin: has joined #RubyOnRails
[21:22:30] askhat: has joined #RubyOnRails
[21:22:43] kirillzh: has joined #RubyOnRails
[21:22:47] brycesenz: has joined #RubyOnRails
[21:27:05] bronson_: has joined #RubyOnRails
[21:28:06] lexileo: has joined #RubyOnRails
[21:29:07] gmas: has joined #RubyOnRails
[21:30:48] zackzorman: has joined #RubyOnRails
[21:32:02] benlieb: has joined #RubyOnRails
[21:32:11] ElFerna: has joined #RubyOnRails
[21:32:53] Grav: has joined #RubyOnRails
[21:33:13] Grav: has left #RubyOnRails: ()
[21:34:17] tenderlove: has joined #RubyOnRails
[21:36:11] keekri: has joined #RubyOnRails
[21:41:04] nfk|laptop: has joined #RubyOnRails
[21:44:05] existensil: does /testing/test redirect?
[21:44:21] momomomomo: has joined #RubyOnRails
[21:44:26] existensil: oh, that was 30 minutes ago. you might have figured it out
[21:47:27] gremly: has joined #RubyOnRails
[21:48:42] yereby: has joined #RubyOnRails
[21:51:33] tetraktys: has joined #RubyOnRails
[21:54:04] fox_mulder_cp: update my blog app for properly comments showing, so good night
[21:56:22] existensil: has joined #RubyOnRails
[21:57:12] djbkd: has joined #RubyOnRails
[21:57:24] yoongkang: has joined #RubyOnRails
[21:58:02] DonOtreply: has joined #RubyOnRails
[22:03:58] djbkd: has joined #RubyOnRails
[22:09:31] bronson_: has joined #RubyOnRails
[22:10:15] macsteps: has joined #RubyOnRails
[22:10:58] maesitos: has joined #RubyOnRails
[22:11:40] intrigueD: has joined #RubyOnRails
[22:11:40] intrigueD: has joined #RubyOnRails
[22:12:13] momomomomo: has joined #RubyOnRails
[22:12:54] Devalo: has joined #RubyOnRails
[22:13:22] maesitos_: has joined #RubyOnRails
[22:15:10] wethu: has joined #RubyOnRails
[22:16:05] robbyoconnor: has joined #RubyOnRails
[22:16:29] maesitos: has joined #RubyOnRails
[22:18:44] jmfurlott: has joined #RubyOnRails
[22:19:51] jeanre: has joined #RubyOnRails
[22:20:32] robbyoconnor: has joined #RubyOnRails
[22:21:12] rubyonrailed: has joined #RubyOnRails
[22:21:54] maesitos: has joined #RubyOnRails
[22:22:08] xnp70: has joined #RubyOnRails
[22:22:16] fwaokda: My object stores a column as "decimal", but my user's want to type in Mixed Numbers (ie: 31 7/8). When I access my params in the update action I see the value still as the mixed number -- but if I try access it from the "before_save" callback it has already been converted to a decimal. How can I access the value and convert to decimal properly myself?
[22:22:20] xnp70: has left #RubyOnRails: ()
[22:22:25] askhat: has joined #RubyOnRails
[22:23:11] rubyonra_: has joined #RubyOnRails
[22:24:19] febuiles: has joined #RubyOnRails
[22:25:04] brycesenz: has joined #RubyOnRails
[22:25:32] ElFerna: has joined #RubyOnRails
[22:27:13] smathy: fwaokda, just override the attribute setter and convert it there.
[22:27:46] kirillzh: has joined #RubyOnRails
[22:28:16] fwaokda: smathy, ahhh ok thanks let me try that!
[22:28:44] craysiii: has joined #RubyOnRails
[22:30:30] rhizome: use a string
[22:31:06] tetraktys: has joined #RubyOnRails
[22:31:56] djbkd: has joined #RubyOnRails
[22:32:04] StaticVoid: I need to store elapsed time. Right now I'm using a Time field, but that doesn't work, as an elapsed time of '00:01' ends up being "12:01".... how can I still store it as time but not translate the hours?
[22:33:06] yfeldblum: has joined #RubyOnRails
[22:33:45] IrishGringo: has joined #RubyOnRails
[22:35:03] smathy: StaticVoid, elapsed time is just a number, not a time.
[22:35:29] smathy: StaticVoid, eg. # of seconds.
[22:35:37] SteenJobs: has joined #RubyOnRails
[22:36:41] StaticVoid: smathy: It comes in from a tracking app in a CSV and is listed like "00:59:30" - so elapsed time of 59 minutes and 30 seconds. But if I display that in a view, it shows as '12:50:30'
[22:37:45] StaticVoid: I guess I could recalculate it in actual elapsed seconds and store that as an integer.... let me think about that.
[22:37:47] smathy: StaticVoid, right because you're converting it to a Time object, don't do that.
[22:38:03] smathy: Either leave it as a string, or convert it to an integer of seconds.
[22:38:28] StaticVoid: smathy: yup, that's the only thing I can do. thanks!
[22:38:36] p8m: has joined #RubyOnRails
[22:39:41] smathy: StaticVoid, np.
[22:41:38] johnflux: has joined #RubyOnRails
[22:43:01] lacrymology: has left #RubyOnRails: ()
[22:44:34] rhizome: use epoch time
[22:47:04] drbayer: has joined #RubyOnRails
[22:49:11] Pazician: has joined #RubyOnRails
[22:50:04] drbayer_: has joined #RubyOnRails
[22:50:09] dtordable: what's the real meaning of epoch?
[22:50:10] SteenJobs: has joined #RubyOnRails
[22:50:29] rhizome: what do you mean?
[22:50:57] rhizome: unix epoch time? number of seconds since jan 1, 1970
[22:51:02] dtordable: why it is said epoch?
[22:51:28] dtordable: I knew what is it
[22:51:40] rhizome: it is defined by periods of time in which unix existed
[22:52:10] dtordable: but never asked myself why is epoch
[22:52:26] rhizome: "epoch" refers to the time it began more than the fact that it's counted in seconds
[22:52:33] lessless: has joined #RubyOnRails
[22:53:21] smathy: Right "epoch time" is the number of seconds since the UNIX epoch.
[22:54:13] fryguy: has joined #RubyOnRails
[22:54:24] dtordable: have to translate the word epoch
[22:55:04] baweaver: has joined #RubyOnRails
[22:55:43] dtordable: with a translation I get it!!!
[22:55:48] superlou: has joined #RubyOnRails
[22:56:00] ferr: has joined #RubyOnRails
[22:56:08] baweaver: has joined #RubyOnRails
[22:58:18] yoongkang: has joined #RubyOnRails
[23:00:44] mostlybadfly: has joined #RubyOnRails
[23:01:13] manfrin: has joined #RubyOnRails
[23:03:27] codedmart: has joined #RubyOnRails
[23:07:28] quazimodo: has joined #RubyOnRails
[23:07:35] febuiles: has left #RubyOnRails: ()
[23:07:44] rapha: has left #RubyOnRails: ("bye!")
[23:10:25] nodejunkie: has joined #RubyOnRails
[23:11:11] benlieb: has joined #RubyOnRails
[23:13:52] fwaokda: when overriding a setter for an attribute for a model do i need to do anything more then writing a method with the same name of my attribute?
[23:14:52] wldcordeiro: has joined #RubyOnRails
[23:14:52] Devalo: has joined #RubyOnRails
[23:17:11] kpwarr_: Hello, I am having an issue where to do with setting my RAILS_ENV variable. my environment.rb sets it to what I want it to be, and if I look at the value in the console, it shows the expected value, and yet, in my controllers ENV['RAILS_ENV'] does not evaluate to the expected value, and rails seems to be using the wrong config file from /config/environments
[23:17:22] smathy: fwaokda, well, same name plus an =
[23:19:07] macsteps: has joined #RubyOnRails
[23:19:38] fwaokda: smathy, thanks
[23:20:09] smathy: ...and just call super with your adjusted argument.
[23:20:44] ornerymoose: has joined #RubyOnRails
[23:21:21] askhat: has joined #RubyOnRails
[23:21:33] tetraktys: has joined #RubyOnRails
[23:22:44] zerg_lurker: has joined #RubyOnRails
[23:25:47] zerg_lurker: Hey folks, I'm looking for help with a problem I'm having. I'm using the pragmatic programmers book titled agile web development with rails 4, I get the most awful error message i've ever seen when I run rake test:functionals
[23:26:23] shilon: has joined #RubyOnRails
[23:26:46] fwaokda: smathy, like this? https://gist.github.com/daveomcd/a7158378ace3ac6894c9 -- I know the logic doesn't make sense but just trying to understand. I've tried it a couple of ways and can't get byebug to trigger for the getter, only setter.
[23:28:17] tetraktys: has joined #RubyOnRails
[23:28:30] smathy: fwaokda, super without any arguments will call it with the arguments provided TO the current method.
[23:30:00] zerg_lurker: Error message + source here http://pastebin.com/QgpP9D7y
[23:30:03] smathy: fwaokda, I put a comment on how to code what you have there. Remove `attr_accessor :value` because that'll mask the getter provided by ActiveRecord.
[23:31:08] zerg_lurker: I wasn't aware pastebin loaded slowly. Thanks for the notification.
[23:31:09] fwaokda: smathy, ahh ok thanks for the help
[23:31:25] smathy: fwaokda, np.
[23:32:33] johnflux_: has joined #RubyOnRails
[23:40:02] ElFerna: has joined #RubyOnRails
[23:42:06] baweaver: has joined #RubyOnRails
[23:44:31] rrolt: has joined #RubyOnRails
[23:48:05] blackmesa: has joined #RubyOnRails
[23:48:55] intrigueD: has joined #RubyOnRails
[23:49:54] xnp70: has joined #RubyOnRails
[23:52:39] xnp70: has left #RubyOnRails: ()
[23:53:10] macsteps: has joined #RubyOnRails
[23:54:55] rubyonrails961: has joined #RubyOnRails
[23:55:07] denisinla: has joined #RubyOnRails
[23:55:56] denisinla: has left #RubyOnRails: ()
[23:57:16] Ropeney: has joined #RubyOnRails
[23:58:54] yoongkang: has joined #RubyOnRails
[23:59:21] one_zero: has joined #RubyOnRails