« Back to channel list

#RubyOnRails - 23 February 2016

« Back 1 day Forward 1 day »
[00:05:19] RTG`: has joined #RubyOnRails
[00:05:50] ur5us: has joined #RubyOnRails
[00:07:18] kies^: has joined #RubyOnRails
[00:12:50] SteenJobs: has joined #RubyOnRails
[00:16:01] flashpoint9: has joined #RubyOnRails
[00:19:14] aloneintheworld: has joined #RubyOnRails
[00:19:54] aloneintheworld: Anyone succesfully using CanCanCan and Refile gem for uploads? I can’t get new files being uploaded when using ‘load_and_authorize_resource’
[00:23:28] Scripore: has joined #RubyOnRails
[00:28:09] bronson: has joined #RubyOnRails
[00:28:43] joshkovach: has joined #RubyOnRails
[00:28:47] ppinkerton: has joined #RubyOnRails
[00:32:59] centrx: has joined #RubyOnRails
[00:36:00] ElFerna: has joined #RubyOnRails
[00:36:19] treaki_: has joined #RubyOnRails
[00:36:51] Scripore: has joined #RubyOnRails
[00:36:58] jeanlinux: has joined #RubyOnRails
[00:37:08] _Tariq: has joined #RubyOnRails
[00:37:10] jeanlinux: has joined #RubyOnRails
[00:39:00] jeanlinux: has joined #RubyOnRails
[00:39:11] n1lo: has joined #RubyOnRails
[00:40:06] joshkovach: has joined #RubyOnRails
[00:40:10] nettoweb: has joined #RubyOnRails
[00:43:48] sled: has joined #RubyOnRails
[00:44:25] claytonzaugg: has joined #RubyOnRails
[00:49:06] ElFerna: has joined #RubyOnRails
[00:49:13] cabargas: has joined #RubyOnRails
[00:51:33] hahuang65: has joined #RubyOnRails
[00:52:19] DoctorMonocular: has joined #RubyOnRails
[00:54:47] sevenseacat: has joined #RubyOnRails
[00:55:34] neanderslob: has joined #RubyOnRails
[00:55:52] nettoweb: has joined #RubyOnRails
[00:59:47] RTG`: has joined #RubyOnRails
[00:59:57] joshkovach: has joined #RubyOnRails
[01:01:03] sleungcy: has joined #RubyOnRails
[01:02:19] argv0: has joined #RubyOnRails
[01:02:22] bryyy: has joined #RubyOnRails
[01:02:33] kichawa: why db:create want to access to postgres database?
[01:05:09] ppinkerton: has joined #RubyOnRails
[01:05:18] manfrin: has joined #RubyOnRails
[01:09:41] bronson: has joined #RubyOnRails
[01:10:55] korzybski: has joined #RubyOnRails
[01:12:37] joshkovach: has joined #RubyOnRails
[01:13:17] Scripore: has joined #RubyOnRails
[01:13:49] smathy: kichawa, because config/database.yml tells it to.
[01:14:42] kichawa: no, there is no postgres set as database :<
[01:14:53] kichawa: i dont know why
[01:15:04] kichawa: i use pgsql
[01:15:12] kichawa: i create new role, new datebase
[01:15:21] kichawa: then i want to make db:create
[01:15:36] matthewd: kichawa: It's necessary to connect to an existing database in order to create a new one
[01:15:52] matthewd: The default database is named postgres, so that's what we connect to
[01:17:31] kichawa: so should i take access to 'postgres' datebase?
[01:17:55] matthewd: Yes.. or create the database yourself
[01:18:16] kichawa: is it necessary?
[01:18:31] kichawa: oh, as above
[01:18:46] kichawa: i've created the new role and the new datebase!
[01:19:25] mahna: has joined #RubyOnRails
[01:19:38] kichawa: production: adapter: postgresql database: test
[01:20:07] matthewd: If the 'test' database already exists, then you don't need to run db:create
[01:20:18] mahna: Any idea why `@request` would be nil in an IntegrationTest? I'm trying to set headers per: http://edgeguides.rubyonrails.org/testing.html#setting-headers-and-cgi-variables
[01:20:19] aloneintheworld: has joined #RubyOnRails
[01:20:46] mahna: Once a `get` or `post` is issues in the test, both `@request` and `@response` are populated.
[01:22:02] Ropeney: kichawa: gist your database.yml and the SQL you used to create the database/roles without passwords
[01:22:12] mahna: (5.0.0beta2, btw)
[01:22:19] godzillaenlacasa: has joined #RubyOnRails
[01:22:19] kichawa: http://paste.ofcode.org/rFtiHx6WNNTCXkba68byJD
[01:23:30] matthewd: mahna: Maybe: get articles_url, headers: { 'Accept' => 'text/plain, text/html' }
[01:23:55] matthewd: mahna: If that works, plzdo PR a fix to the guide
[01:24:59] kichawa: http://paste.ofcode.org/7h3pJKfD35mWBMXP8LdFTS
[01:25:36] Ropeney: kichawa: so you don't need db:create since you've created it, move on :)
[01:26:18] kichawa: matthewd: k, i dont need to run create, but the proper msg should be "the datebase already exists"
[01:26:40] kichawa: why db:create want to connect to 'postgres' datebase ?!
[01:26:56] matthewd: kichawa: Because that's how PostgreSQL works
[01:28:07] matthewd: mahna: @request should actually be populated before the request -- the code in the guide should work as is
[01:28:11] mahna: matthewd: That works, thank you!
[01:28:25] kichawa: oh, it seems rails set up the @config
[01:29:01] badoo: has joined #RubyOnRails
[01:29:15] matthewd: mahna: Can you please http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#create-an-executable-test-case and file an issue, so we can make sure the @request form works too?
[01:29:47] mahna: matthewd: Wouldn't work in an API app for me, so I had also created a "regular" test app and checked the var in a generated controller test.
[01:34:49] SeanLazer: has joined #RubyOnRails
[01:35:35] kichawa: guys, how does rails init to create a datebase?
[01:35:59] _djbkd: has joined #RubyOnRails
[01:38:12] aloneintheworld: has joined #RubyOnRails
[01:40:10] aloneintheworld: has joined #RubyOnRails
[01:40:57] sudoubuntu: has joined #RubyOnRails
[01:47:38] DoctorMonocular: has joined #RubyOnRails
[01:49:04] slash_nick: kichawa: examine the file you've got at config/database.yml... that's what rails uses when creating a database
[01:49:35] nfk: has joined #RubyOnRails
[01:49:40] veloutin: has joined #RubyOnRails
[01:54:29] ppinkerton: has joined #RubyOnRails
[01:57:02] SteenJobs: has joined #RubyOnRails
[01:58:26] rubyonrailed: has joined #RubyOnRails
[01:58:59] sankaber: has joined #RubyOnRails
[01:59:28] aadam21: has joined #RubyOnRails
[02:04:42] IFrank00: has joined #RubyOnRails
[02:05:55] arBmind1: has joined #RubyOnRails
[02:07:58] jeanre: has joined #RubyOnRails
[02:07:58] jeanre: has joined #RubyOnRails
[02:09:06] Mdrz_92: has joined #RubyOnRails
[02:09:47] kirillzh: has joined #RubyOnRails
[02:10:07] baweaver: has joined #RubyOnRails
[02:10:29] Megamos: has joined #RubyOnRails
[02:16:13] seaworthy: has joined #RubyOnRails
[02:16:13] seaworthy: has joined #RubyOnRails
[02:16:25] dopamean_: has joined #RubyOnRails
[02:16:59] DEA7TH: Would this file be ignored? db/migrate/20140313192112_create_customers.rb~
[02:17:16] DEA7TH: I strongly suspect it's been ignored the whole time. also RubyMine didn't show it
[02:18:20] bronson: has joined #RubyOnRails
[02:19:45] sevenseacat: likely so, it's a tempfile.
[02:23:08] RegulationD: has joined #RubyOnRails
[02:25:01] rafaelfranca: has joined #RubyOnRails
[02:26:41] ppinkerton: has joined #RubyOnRails
[02:29:28] benlieb: has joined #RubyOnRails
[02:33:29] SeanLazer: has joined #RubyOnRails
[02:36:34] sankaber: has joined #RubyOnRails
[02:38:41] Technodrome: has joined #RubyOnRails
[02:39:10] IFrank00: has joined #RubyOnRails
[02:39:37] suffice: has joined #RubyOnRails
[02:39:38] josephkokenge: has joined #RubyOnRails
[02:40:57] ppinkerton: has joined #RubyOnRails
[02:42:39] ensyde_: has joined #RubyOnRails
[02:44:50] suffice: has joined #RubyOnRails
[02:45:48] aadam21: has joined #RubyOnRails
[02:46:43] bricker: has joined #RubyOnRails
[02:49:26] KensoDev: has joined #RubyOnRails
[02:51:09] DmitryBochkarev: has joined #RubyOnRails
[02:58:47] aloneintheworld: has joined #RubyOnRails
[03:00:26] goodcodeguy: has joined #RubyOnRails
[03:03:31] benlieb_: has joined #RubyOnRails
[03:04:13] aadam21: has joined #RubyOnRails
[03:05:07] nattyPablo: has joined #RubyOnRails
[03:10:06] Radar: How awesome is Sidekiq? Sidekiq is very awesome.
[03:10:17] Radar: This has been a PSA by Radar.
[03:11:09] ur5us_: has joined #RubyOnRails
[03:16:35] tomoyuki28jp: has joined #RubyOnRails
[03:17:42] tomoyuki28jp: How can I get an error line number in *.js.coffee file? I've tried the coffee-script-source gem, but it does nothing to me :(
[03:19:34] sudoubuntu: has joined #RubyOnRails
[03:20:18] chagel: has joined #RubyOnRails
[03:20:40] benlieb: has joined #RubyOnRails
[03:26:08] ur5us: has joined #RubyOnRails
[03:27:07] _Tariq: has joined #RubyOnRails
[03:27:08] puff: has joined #RubyOnRails
[03:27:35] aloneintheworld: has joined #RubyOnRails
[03:28:42] ppinkerton: has joined #RubyOnRails
[03:29:29] bronson: has joined #RubyOnRails
[03:31:21] puff: Good evening.
[03:31:30] Chagel_: has joined #RubyOnRails
[03:36:31] chagel: has joined #RubyOnRails
[03:39:29] sankaber: has joined #RubyOnRails
[03:39:40] arup_r: has joined #RubyOnRails
[03:41:32] quazimodo: has joined #RubyOnRails
[03:41:38] chagel: has joined #RubyOnRails
[03:43:01] jeanlinux: has joined #RubyOnRails
[03:43:16] droptone: Question: I've got an AngularJS project with a Rails backend giong, and it's working great, but I'd like to see the API calls show up in the Rails 4.2 development log
[03:43:21] droptone: Is that possible to enable?
[03:44:21] sankaber: has joined #RubyOnRails
[03:44:46] sevenseacat: if the angular JS is hitting a Rails API they should already be there
[03:45:19] _3by8: has joined #RubyOnRails
[03:45:22] droptone: They are, let me check again.
[03:45:28] _3by8: I know this is completely off-topic but I need someone's opinion (and I have no idea where else I can ask and get an answer quickly) preferably someone who is African-American or black American or whatever you prefer. Anyways, I used the term "black community" in the context of wondering what the "black community's" opinion about something is and was basically called a racist. Am I wrong? Whisper me please.
[03:46:15] droptone: sevenseacat: ahh, I was tail -f'ing the wrong log
[03:46:18] droptone: They are there, thank you.
[03:46:31] chagel: has joined #RubyOnRails
[03:50:25] puff: Good evening, I'm trying to decipher a rails app that somebody else wrote.
[03:50:41] puff: _3by8: Seriously?
[03:50:53] DmitryBochkarev: has joined #RubyOnRails
[03:51:07] _3by8: puff: yeah, I was told not to use that term because it's "othering" was the exact word they used.
[03:51:38] chagel: has joined #RubyOnRails
[03:52:37] droptone: Question: I'm trying to write a custom route for this form to execute an update. Should I use "patch" or "put"?
[03:52:46] droptone: Here is the route, it's a single line of code so I assume it's OK not to gist it:
[03:52:49] droptone: put 'update_fan_profile/:id' => 'fan_profiles#update_fan_profile', defaults: { format: :json }
[03:53:01] droptone: I see it in rake:routes output, but should it be patch instead of put?
[03:54:07] sevenseacat: rails will accept either for a typical update action.
[03:54:32] aloneintheworld: has joined #RubyOnRails
[03:54:35] sevenseacat: in HTTP semantics, put is used for replacing a whole object with another object, while patch is used for updating part of an existing object
[03:54:41] puff: _3by8: I'm not black but I'll give you some feedback on the topic, but should do so via pm.
[03:54:47] sevenseacat: use whatever is more appropriate.
[03:54:54] sevenseacat: yes, please do take it to PM.
[03:55:15] kdough: droptone: PATCH has been the primary method for updates since Rails 4.0 (via http://weblog.rubyonrails.org/2012/2/26/edge-rails-patch-is-the-new-primary-http-method-for-updates/)
[03:55:45] sevenseacat: whether thats correct or not is a different story
[03:56:02] cabargas: has joined #RubyOnRails
[03:56:52] aadam21: has joined #RubyOnRails
[03:56:56] lessless: has joined #RubyOnRails
[03:58:58] chagel: has joined #RubyOnRails
[03:59:38] droptone: So if a rails route sees an HTTP PUT method, it'll know to route to PATCH I presume?
[03:59:55] droptone: Because my angular app is sending $http.put
[04:00:08] sevenseacat: no. put and patch are separate.
[04:00:19] droptone: Oh, I see, I didn't realize PATCH was also an http METHOD
[04:01:18] srinidhi: has joined #RubyOnRails
[04:03:57] chagel: has joined #RubyOnRails
[04:04:27] bricker: has joined #RubyOnRails
[04:07:16] krz: has joined #RubyOnRails
[04:07:28] ylluminarious: has joined #RubyOnRails
[04:07:38] dmz: has joined #RubyOnRails
[04:07:38] dmz: has joined #RubyOnRails
[04:07:39] Glyphik: has joined #RubyOnRails
[04:08:58] chagel: has joined #RubyOnRails
[04:11:11] rohit: has joined #RubyOnRails
[04:11:32] ylluminarious: has joined #RubyOnRails
[04:11:44] fedexo: has joined #RubyOnRails
[04:13:48] braincrash: has joined #RubyOnRails
[04:15:42] htmldrum: has joined #RubyOnRails
[04:17:13] chagel: has joined #RubyOnRails
[04:19:47] fedexo: has joined #RubyOnRails
[04:21:24] josephkokenge: has joined #RubyOnRails
[04:21:49] jeanre: has joined #RubyOnRails
[04:21:49] jeanre: has joined #RubyOnRails
[04:22:16] chagel: has joined #RubyOnRails
[04:26:38] RegulationD: has joined #RubyOnRails
[04:27:12] chagel: has joined #RubyOnRails
[04:28:13] aloneintheworld: has joined #RubyOnRails
[04:28:56] pawnbox: has joined #RubyOnRails
[04:31:40] quazimodo: morningfternoon
[04:33:29] w0rd-driven: has joined #RubyOnRails
[04:33:31] rohit: has joined #RubyOnRails
[04:33:32] chagel: has joined #RubyOnRails
[04:33:55] kies^: has joined #RubyOnRails
[04:37:04] arup_r: completed 2 years in Rails.. :)
[04:38:31] chagel: has joined #RubyOnRails
[04:38:48] jetpack_joe: has joined #RubyOnRails
[04:42:17] benlieb: has joined #RubyOnRails
[04:44:15] jeanlinux: has joined #RubyOnRails
[04:44:38] Eswar: has joined #RubyOnRails
[04:44:50] RahulT: has joined #RubyOnRails
[04:45:14] DEA7TH: This causes 2 queries, how can I make it 1 instead? a = Address.where(id: 1); a.size; a
[04:45:25] DEA7TH: First it queries for count since where is lazy
[04:45:32] matthewd: DEA7TH: .load
[04:45:53] SeanLazer: has joined #RubyOnRails
[04:46:05] matthewd: Or .to_a, if you're happy to then work with a raw array
[04:46:45] Radar: a = Address.where(id: 1); a.count
[04:46:50] _Tariq: has joined #RubyOnRails
[04:47:06] Radar: I think that's only one query because a isn't being inspect'd or to_a'd.
[04:48:19] DEA7TH: the problem was that I needed to first check the size/count, then use the record. load solved it
[04:48:23] benlieb: has joined #RubyOnRails
[04:50:25] sled: has joined #RubyOnRails
[04:51:07] barhum2013: has joined #RubyOnRails
[04:51:59] duncannz: has joined #RubyOnRails
[04:52:32] drupald_: has joined #RubyOnRails
[04:55:10] treaki: has joined #RubyOnRails
[04:55:26] speaking1ode: has joined #RubyOnRails
[04:57:02] chagel: has joined #RubyOnRails
[04:58:08] benlieb: has joined #RubyOnRails
[05:00:03] aloneintheworld: has joined #RubyOnRails
[05:01:01] apotry: has joined #RubyOnRails
[05:01:12] hnanon: has joined #RubyOnRails
[05:01:54] _djbkd: has joined #RubyOnRails
[05:02:04] aadam21: has joined #RubyOnRails
[05:03:10] hnanon: How can I get all jobs where the status is "active" and the category (an associated model) is "ruby", for example? I tried the following:
[05:03:16] chagel: has joined #RubyOnRails
[05:03:29] krzkrz: has joined #RubyOnRails
[05:03:36] hnanon: @jobs = Job.where(status: "active).joins(:category).where(categories: { name: "ruby" })
[05:04:11] htmldrum: has joined #RubyOnRails
[05:04:22] hnanon: Nevermind; My category id is nil :/
[05:05:17] IrishGringo: has joined #RubyOnRails
[05:06:50] Radar: Deploying a Sprockets 2.12.3 -> 3.5.2 upgrade at 4pm in the afternoon. Good idea or worst idea?
[05:08:12] sevenseacat: Radar: awesome idea
[05:08:15] chagel: has joined #RubyOnRails
[05:08:21] pawnbox: has joined #RubyOnRails
[05:09:11] baweaver: has joined #RubyOnRails
[05:11:31] Coldblackice: has joined #RubyOnRails
[05:16:35] chagel: has joined #RubyOnRails
[05:18:56] quazimodo: namecheap's being weird with CNAME records
[05:20:22] ppinkerton: has joined #RubyOnRails
[05:21:03] benlieb: has joined #RubyOnRails
[05:21:44] benlieb_: has joined #RubyOnRails
[05:22:11] quazimodo: hrm I can't decide if I should store a page's dynamic JS filters as query strings in url or persist the to DB
[05:22:22] quazimodo: and refer to the filter in the page route
[05:22:32] quazimodo: i guess ill try both and see which wins
[05:26:35] Scripore: has joined #RubyOnRails
[05:29:33] bronson: has joined #RubyOnRails
[05:32:26] ayonkhan: has joined #RubyOnRails
[05:32:28] arup_r: has joined #RubyOnRails
[05:35:35] rubyonrailed: has joined #RubyOnRails
[05:38:24] rubyonrailed: has joined #RubyOnRails
[05:38:44] aloneintheworld: has joined #RubyOnRails
[05:39:45] rubyonrailed: has joined #RubyOnRails
[05:50:48] ppinkerton: has joined #RubyOnRails
[05:53:17] cheeti: has joined #RubyOnRails
[05:54:07] tetraktys: has joined #RubyOnRails
[05:54:14] cheeti: hi how to run multiple system commands one after another in ruby
[05:54:28] baweaver: what have you tried?
[05:55:03] cheeti: only first one is executing when i am writing system(command) system(command)
[05:56:12] jfelchner: has joined #RubyOnRails
[05:56:19] baweaver: so what do you need system commands for?
[05:57:34] cheeti: baweaver to execute two commands one after another to run arachni scan
[05:58:23] baweaver: http://ruby-doc.org/core-2.3.0/Kernel.html#method-i-system - and what is it returning?
[05:58:51] bricker: has joined #RubyOnRails
[05:58:51] baweaver: brakeman might be easier to use and setup if you're just scanning your app
[05:58:56] tvw: has joined #RubyOnRails
[06:00:25] cheeti: baweaver i am using two commands one for start scan and anothe to generate xml report from afr report. scan is running and afr generating but trans form from afr to xml command not running
[06:00:34] worstcase: has joined #RubyOnRails
[06:00:59] sdwrage: has joined #RubyOnRails
[06:01:14] baweaver: are you sure the file is done?
[06:01:34] droptone: Does update_attributes automatically commit the changes to the object?
[06:01:36] cheeti: baweaver yes its saving also
[06:01:45] baweaver: droptone: yep
[06:01:50] droptone: Thank you baweaver.
[06:01:53] baweaver: attributes= though....
[06:02:24] baweaver: run them in your shell, see if that works
[06:02:42] intrigueD: has joined #RubyOnRails
[06:03:51] baweaver: where are you finding the commands to run?
[06:04:23] cheeti: baweaver from arachni
[06:04:32] baweaver: that's a given
[06:04:55] baweaver: what commands are you running exactly and where did you find those commands?
[06:14:29] chagel: has joined #RubyOnRails
[06:19:38] chagel: has joined #RubyOnRails
[06:20:23] jeanre: has joined #RubyOnRails
[06:20:23] jeanre: has joined #RubyOnRails
[06:24:29] chagel: has joined #RubyOnRails
[06:27:16] konsolebox: has joined #RubyOnRails
[06:28:35] droptone: Question: Does anyone know why rails is saying fan_profile_update_attribues is an unknown method in this controller action: https://gist.github.com/anonymous/42e156b718e4cce18424
[06:28:57] Scient: because its an unknown method
[06:29:05] sevenseacat: where are you defining it?
[06:29:13] Scient: you are trying to do fan_profile.update_attributes
[06:29:27] Scient: but for some reason you are using an underscore where you should be calling a method instead
[06:29:31] sevenseacat: aww I wasn't going to give it away that easily
[06:29:35] chagel: has joined #RubyOnRails
[06:29:36] dopie: has joined #RubyOnRails
[06:29:56] aadam21: has joined #RubyOnRails
[06:30:02] benlieb: has joined #RubyOnRails
[06:30:28] droptone: Oh good heavens, what an obvious typo.
[06:30:30] emachnic: has joined #RubyOnRails
[06:30:32] arup_r: droptone: need some good sleep... :D
[06:30:32] droptone: Thank you Scient.
[06:30:52] sevenseacat: also, what on earth are you trying to rescue there?
[06:30:52] droptone: haha, isn't that the truth.
[06:31:02] Scient: yeah that rescue will never be called
[06:31:08] bronson: has joined #RubyOnRails
[06:31:09] Scient: as update_attributes never raises an exception :)
[06:31:24] droptone: Well, it's an API call, so if someone submits an invalid FanProfile id via the API
[06:31:33] droptone: the rescue is generated, unless I'm missing something.
[06:31:41] droptone: And thus the 422 unprocessable is returned.
[06:31:59] sevenseacat: generated by what?
[06:32:04] baweaver: it almost sounds like it can't find it
[06:32:08] baweaver: like a missing resource
[06:32:37] sevenseacat: well thats true, you'll get an exception if the FanProfile cant be found, but then the rescue will raise a NoMethodError
[06:32:39] droptone: Well I haven't tested but I assume the FanProfile.find(id that doens't exist)
[06:32:42] droptone: followed by an update_attributes
[06:32:52] droptone: is a slightly ghetto but funtional way to rescue the invalid ID, no?
[06:32:56] droptone: I suppose I could do a nil? check
[06:33:02] droptone: and just generate the 422 that way.
[06:33:03] sevenseacat: no, because what are you then calling errors on
[06:33:07] sevenseacat: in the rescue block
[06:33:17] sevenseacat: it will never be nil
[06:33:17] baweaver: that, and the begin isn't needed there
[06:34:05] droptone: Well in rails console if I do a test = FanProfile.find(1243)
[06:34:12] droptone: an non-existant id
[06:34:18] sevenseacat: it will raise an exception, yes
[06:34:21] droptone: ActiveRecord throws a RecordNotFound exception
[06:34:40] sevenseacat: so what do you do in your rescue block, you try to use the object that raised the exception because it couldnt be found
[06:35:07] sevenseacat: what does fan_profile.errors do if fan_profile couldnt be loaded?
[06:35:12] droptone: Well if a rescue is called at this point I'm wasn't concerned with the details of the error, I just wanted it to throw the error, since this should only occur if the user sends malformed or invalid data to the API
[06:35:22] droptone: Throw the 422
[06:35:29] sevenseacat: you'll get a 500
[06:35:41] sevenseacat: because fan_profile is undefined
[06:36:45] droptone: And that wouldn't be rescued?
[06:36:57] droptone: the begin / rescue block surrounding it
[06:37:04] lxsameer: has joined #RubyOnRails
[06:37:06] droptone: I'm just doing a generic rescue
[06:37:10] sevenseacat: given the exception would be thrown inside the rescue block, how?
[06:37:46] droptone: Well all that should exist within the rescue block is the json 422 response
[06:38:01] arup_r: droptone: you shouldn't rescue your own wrong code given exceptions. That doesn't make any sense
[06:38:02] enitiz: has joined #RubyOnRails
[06:38:03] sevenseacat: so again, how can you call fan_profile when it's undefned?
[06:38:27] baweaver: let it crash on find
[06:38:34] baweaver: rails will return a 404 record not found
[06:38:37] baweaver: which is valid
[06:38:48] arup_r: you are calling a method, which you never defined, and then trying to rescue, Does it make sense ?
[06:38:53] sami: has joined #RubyOnRails
[06:39:11] arup_r: yeah 404 is ok. But not to rescue the NoMethod error.
[06:39:24] sevenseacat: they arent rescuing the no method error
[06:39:29] sevenseacat: hence a 500 error
[06:39:42] baweaver: also, use update instead of update_attributes and strong params
[06:40:12] arup_r: baweaver: update and update_attributes are alias, No ?
[06:40:14] droptone: But if an invalid id is submitted, shouldn't the initial fan_profile = FanProfile.find() call throw the ActiveRecord not found exception within the begin block, which should generate the exception, thus throwing control to the recue block, which returns the 422?
[06:40:15] baweaver: if model.update(strong_params); render good else render bad.errors end
[06:40:47] sevenseacat: droptone: yes, and when that rescue block throws another exception?
[06:40:58] sevenseacat: which it does given for about the hundredth time, fan_profile is not defined
[06:41:00] droptone: I see, I"m including the reference to fan_profile in the json call
[06:41:03] droptone: I see what you're saing.
[06:41:15] droptone: Yes, I gotcha, thank you.
[06:41:49] baweaver: https://gist.github.com/anonymous/42e156b718e4cce18424#gistcomment-1704726
[06:42:05] baweaver: don't use rescue for flow control
[06:42:41] droptone: Yes but, in your profile = FanProfile.find(params[:id])
[06:42:51] droptone: ActiveRecord throws a "RecordNotfound" exception
[06:42:55] droptone: if an invalid id is passed
[06:43:04] baweaver: that's good
[06:43:11] droptone: So the if / else wouldn't execute in your code?
[06:43:30] droptone: Whats' the recommended method for returning a 422 unprocessable on any error?
[06:43:33] baweaver: if it's not found you get a nice semantical 404 error
[06:43:46] droptone: huh, it would 404?
[06:44:00] techsethi: has joined #RubyOnRails
[06:44:02] baweaver: never use rescue unguarded if you can help it
[06:44:12] baweaver: it shoves too many possible errors under the carpet
[06:44:23] baweaver: ...where they rot and stink up your app
[06:44:28] acosonic: has joined #RubyOnRails
[06:44:30] droptone: That's strange though, I suppose I don't understand why that would generate a 404
[06:44:35] droptone: oh I see, becuase it wouldn't return a response at all
[06:45:26] DEA7TH: this doesn't work? TripItem.where(trip: Trip.where(completed: true).select(:id))
[06:45:28] jeanlinux: has joined #RubyOnRails
[06:45:35] DEA7TH: I get ERROR: subquery has too many columns
[06:45:46] DEA7TH: but Trip.where(completed: true).select(:id) works on its own
[06:45:49] sevenseacat: DEA7TH: !debug
[06:45:49] helpa: DEA7TH: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[06:46:06] DEA7TH: I have provided my full code snippet, what more do you want?
[06:46:09] rhizome: DEA7TH: why are you doing that
[06:46:19] DEA7TH: rhizome: I want to do it in a single query
[06:46:21] sevenseacat: DEA7TH: read the gist
[06:46:31] DEA7TH: sevenseacat: oh my bad
[06:46:33] aganov: has joined #RubyOnRails
[06:46:53] DEA7TH: rhizome: select all TripItems whose Trip is completed
[06:46:54] rhizome: contemplate "@trip.trip_items"
[06:47:23] rhizome: Trip.completed.pluck(:id)
[06:47:32] sevenseacat: ACTION shrugs and goes back to work
[06:47:43] rhizome: i have two tacos in me
[06:47:59] baweaver: rhizome: how horrible
[06:48:00] arup_r: DEA7TH: use .pluck() instead of .select
[06:48:04] baweaver: you should have at least 3
[06:48:15] acosonic: Hi all, what's the best way to generate PDF's from rails?
[06:48:16] DEA7TH: I know, but with pluck() it's 2 queries then
[06:48:21] arup_r: TripItem.where(trip_id: Trip.where(completed: true).pluck(:id))
[06:48:23] rhizome: contemplate, not hang your existence on it
[06:48:31] baweaver: acosonic: wickedpdf seems to be the most used
[06:48:47] arup_r: DEA7TH: then use `.joins`
[06:48:53] norc: has joined #RubyOnRails
[06:49:15] acosonic: baweaver: ok I'll try that
[06:49:18] arup_r: I use this 2 queries pattern a lot. When joins need, i use it
[06:49:36] Guest84244: has left #RubyOnRails: ()
[06:49:44] norc: has joined #RubyOnRails
[06:49:55] norc: Hi, is there a way from inside a delayed_job to identify which queue it was placed on?
[06:50:03] droptone: Here's an issue. Right now, because of the nature of this Angular model, it's passing all attributes of the model, so my code is throwing a ForbiddenAttributesError
[06:50:21] arup_r: droptone: filter out ?
[06:50:23] droptone: I suppose this is more of a form issue, since it's passing everything about the model as params, presumably including id and what not, and thus strong_params are failing.
[06:50:26] droptone: Yeah, I need to filter those out.
[06:50:26] arup_r: with strong params
[06:50:26] norc: Or should I simply encode this information into the object I intend to enqueue?
[06:50:53] droptone: Well I've got my strong params set for everything except id, the foreign_key id, created_at, and updated_at
[06:51:05] arup_r: That error comes when you say AR to save a value with a attribute, but the actual table have no such column
[06:51:19] ppinkerton: has joined #RubyOnRails
[06:51:24] droptone: Is there a quick way I could show the specific params the model doesn't like in the development logs?
[06:51:45] norc: Or let me start with my issue.
[06:52:07] arup_r: yes sevenseacat User(name, email) and User.find(1).update(dob: "some date") will throw the error
[06:52:10] droptone: Without having to launch a supplemental logger and output the errors.
[06:52:13] DEA7TH: it's still 2 queries with Trip.joins(:trip_items). I'll try other variations with joins
[06:52:17] Tempesta: has joined #RubyOnRails
[06:52:32] arup_r: DEA7TH: joins is not a 2 queries
[06:52:46] rhizome: has left #RubyOnRails: ("have fun everybody")
[06:52:52] DEA7TH: arup_r: This takes 2 queries: Trip.joins(:trip_items).where(completed: true)[0].trip_items
[06:53:06] DEA7TH: I'll probably need map(&:trip_items) instead
[06:53:20] DEA7TH: but it should work with [0]
[06:53:21] norc: I have an API that has a 200 req/s rate limit, and I have 4 credentials for that API. Currently I have over 50,000 requests that need to be handled.
[06:53:22] arup_r: use .selct("trip_items.*")
[06:53:25] arup_r: DEA7TH: ^^
[06:53:50] arup_r: Trip.joins(:trip_items).where(completed: true).limit(1).select("trip_items.*")
[06:54:20] arup_r: DEA7TH: follow baweaver. That works too.
[06:54:34] arup_r: but that is also 2 queries.. :)
[06:54:42] rvanlieshout: has joined #RubyOnRails
[06:54:43] baweaver: Outer joins
[06:54:45] baweaver: not really.
[06:54:50] norc: So right now Im using delayed_job to process these requests for a single credential pair.
[06:54:54] DEA7TH: arup_r: that returns an array of Trips. Afterwards, using [0].trip_items does 2 queries
[06:55:17] norc: But I have no idea how to do this with 4 workers seperately (because each worker needs to use a different credential pair)
[06:55:22] arup_r: don't use that [0].trip_items things
[06:55:25] DEA7TH: I think I have something working with includes now
[06:55:28] baweaver: norc: bind it to the object is your best shot
[06:55:31] strongcode: Does anyone know why my rake tasks on a heroku instance would fail about 70% of the time with NameError: Unitialized constant?
[06:55:35] strongcode: they run locally 100% of the time
[06:55:35] baweaver: or make a Job model that stores it
[06:55:40] arup_r: that is comvered by .limit(1).select("..")
[06:56:08] DEA7TH: Trip.joins(:trip_items).includes(:trip_items).where(completed: true).select('trip_items.*')[1].trip_items
[06:56:11] arup_r: strongcode: show the rake task as a jist
[06:56:12] DEA7TH: this is 1 query
[06:56:13] norc: baweaver: What do you mean by "binding it to the object" ?
[06:56:19] Surt_Q: has joined #RubyOnRails
[06:56:36] arup_r: joins and includes both at the same tie ? Use either one
[06:56:54] DEA7TH: either one doesn't work
[06:57:01] strongcode: arup_r https://gist.github.com/anonymous/4a092d72414808e5179f
[06:57:03] norc: baweaver: Do you mean the object that is enqueued?
[06:57:12] kmckelvin: has joined #RubyOnRails
[06:57:13] arup_r: DEA7TH: what is wrong with JUST this `Trip.joins(:trip_items).where(completed: true).limit(1).select("trip_items.*")` ?
[06:57:22] baweaver: you probably want to keep track of what was processed where
[06:57:37] DEA7TH: removing either the joins or includes results in 2 queries or not working
[06:57:40] baweaver: so either bind to the object itself or make a jobs model to keep track of it if you need to know.
[06:57:54] norc: baweaver: Ah gotcha.
[06:57:55] arup_r: just run that in console. what I said and see what it is doung
[06:57:58] DEA7TH: arup_r: returns Trip, not TripItem
[06:58:09] norc: baweaver: Ill simply encode the information into the enqueued object and place them into different queues then.
[06:58:25] arup_r: DEA7TH: Oh, you are in same gotcha. It looks like that, as Rails inspect works like that
[06:58:37] baweaver: I did something similar with ActiveJob and Sidekiq
[06:58:43] arup_r: DEA7TH: Trip.joins(:trip_items).where(completed: true).limit(1).select("trip_items.*")[0].attributes
[06:58:48] arup_r: Now.. see
[06:59:30] DEA7TH: arup_r: that's really odd! yes it works
[07:00:12] arup_r: Not odd, as I said. with `.select()` it hides lot inside. it don't show the all but less there in the inspect tool
[07:00:49] DEA7TH: so let's call that `ti`. ti = that_query_there
[07:00:52] arup_r: strongcode: Are you sure when it is failing, then the passed name constant does exist
[07:00:55] DEA7TH: ti.trip doesn't work
[07:01:05] DEA7TH: NoMethodError: undefined method `trip' for #<Trip:0x007fa343a43510>
[07:01:21] arup_r: yes, it will not work
[07:01:21] DEA7TH: not sure if it would work for my use case
[07:01:30] DEA7TH: but I'll probably want to access its attributes
[07:01:31] strongcode: arup_r the same job has both succeeded and failed before
[07:01:38] arup_r: No it will not. It is not a Trip object really
[07:01:40] strongcode: passing the same job name
[07:01:42] DEA7TH: I want to replace code with lots of includes which also queries lots of columns
[07:01:55] DEA7TH: I'd rather go with includes().joins()
[07:01:56] arup_r: DEA7TH: you use `.includes`.
[07:02:02] arup_r: not joins then
[07:02:31] DEA7TH: without joins it's double query
[07:03:06] strongcode: arup_r could it be that the the dyno is sleeping, and whe the rake task is running the rails app hasn't auto-loaded all the models yet? Wild guess but only reason I can think of
[07:03:15] strongcode: like its running faster than cache/memmory warmup
[07:03:35] artto: has joined #RubyOnRails
[07:03:46] strongcode: FWIW, running manually with `heroku run rake run_job NAME=whatever` works fine
[07:05:17] strongcode: actually i just had a failure with running manually
[07:05:28] strongcode: then ran it again, exact same command, and it worked
[07:06:26] baweaver: task name: :environment
[07:06:37] baweaver: forces it to load the env first
[07:06:44] baweaver: that'd probably fix it.
[07:06:56] baweaver: Spring will hide that type of error fairly well
[07:07:50] strongcode: thanks baweaver, i'll try that
[07:10:03] srinidhi: has joined #RubyOnRails
[07:10:36] strongcode: after reading a bit more, I think that may have been the problem
[07:10:43] arup_r: has joined #RubyOnRails
[07:10:44] ur5us: has joined #RubyOnRails
[07:10:47] pyemkey: has joined #RubyOnRails
[07:11:04] arup_r: DEA7TH: 2 queries are not that bad. N + 1 is bad.
[07:11:36] DEA7TH: arup_r: Fair enough. But what is so bad about .joins.includes?
[07:11:49] speaking1ode: has joined #RubyOnRails
[07:12:06] arup_r: no idea. I never used it that pattern
[07:12:59] DEA7TH: it does look a bit worrying:
[07:13:23] DEA7TH: SQL (2.5ms) SELECT trip_items.*, "trips"."id" AS t0_r0, "trips"."date" AS t0_r1, "trips"."start_time" AS t0_r2, "trips"."completed" AS t0_r3, "trips"."driver_account_id" AS t0_r4 etc......
[07:14:38] chagel: has joined #RubyOnRails
[07:15:29] baweaver: outer joins
[07:15:35] yfeldblum: has joined #RubyOnRails
[07:16:22] baweaver: http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
[07:18:34] DEA7TH: I don't even need any of the trip attributes, but as long as it's readable and runs fast...
[07:19:31] rvanlieshout: DEA7TH: what do you want?
[07:19:50] rvanlieshout: cause left join in most cases is slower then 2 queries
[07:19:53] DEA7TH: rvanlieshout: the query is retrieving trip.id, trip.date, trip.start_time etc. and I don't need any of those
[07:20:05] rvanlieshout: so what do you need?
[07:20:17] DEA7TH: it runs instantaneously, my DB will probably never have more than 20-50k records in any table
[07:20:25] DEA7TH: just the trip items
[07:20:33] DEA7TH: trip_items*
[07:21:25] rvanlieshout: TripItem.all ?
[07:21:40] rvanlieshout: or what trip items?
[07:21:49] DEA7TH: trip items whose trip_item.trip.completed == true
[07:22:07] rvanlieshout: TripItem.joins(:trip).where(trips: { completed: true })
[07:22:48] S1kx: has joined #RubyOnRails
[07:22:51] DEA7TH: huh, I tried that but with _trip_ instead of _trips_ and it failed
[07:22:53] DEA7TH: yay it works
[07:23:20] DEA7TH: rvanlieshout: trips is the DB name?
[07:23:45] mark3: has joined #RubyOnRails
[07:24:58] rvanlieshout: you could use Trip.table_name => { completed: true } ish
[07:25:01] jeanre: has joined #RubyOnRails
[07:25:01] jeanre: has joined #RubyOnRails
[07:25:31] DEA7TH: I got the idea from here: http://guides.rubyonrails.org/active_record_querying.html
[07:26:26] DEA7TH: in the example, the table name is plural in the joins too so it was unclear
[07:26:38] moeabdol: has joined #RubyOnRails
[07:26:54] jeanlinux: has joined #RubyOnRails
[07:27:16] jeanlinux: has joined #RubyOnRails
[07:30:13] chagel: has joined #RubyOnRails
[07:30:47] banister: has joined #RubyOnRails
[07:34:44] Surt_Q: has joined #RubyOnRails
[07:35:05] chagel: has joined #RubyOnRails
[07:35:18] mhoungbo: has joined #RubyOnRails
[07:35:54] smoitra: has joined #RubyOnRails
[07:40:13] chagel: has joined #RubyOnRails
[07:40:37] ppinkerton: has joined #RubyOnRails
[07:45:05] chagel: has joined #RubyOnRails
[07:50:13] chagel: has joined #RubyOnRails
[07:51:22] comrad: has joined #RubyOnRails
[07:51:46] yfeldblum: has joined #RubyOnRails
[07:53:50] quazimodo: has joined #RubyOnRails
[07:54:47] kirillzh: has joined #RubyOnRails
[07:55:05] chagel: has joined #RubyOnRails
[07:55:43] pawnbox: has joined #RubyOnRails
[07:56:04] Surt_Q: has joined #RubyOnRails
[07:59:17] gce: has joined #RubyOnRails
[07:59:54] aadam21: has joined #RubyOnRails
[08:00:15] chagel: has joined #RubyOnRails
[08:02:28] gce: has joined #RubyOnRails
[08:03:06] artto: has joined #RubyOnRails
[08:05:05] quazimodo: Clone Heroku DB
[08:05:05] chagel: has joined #RubyOnRails
[08:05:06] quazimodo: Discuss RubyMotioClone Heroku DB
[08:05:06] quazimodo: Discuss RubyMotioClone Heroku DB
[08:05:09] quazimodo: shit, sorry
[08:07:00] darutoko: has joined #RubyOnRails
[08:07:25] roscoeswetsuit: has joined #RubyOnRails
[08:07:57] roscoeswetsuit: has left #RubyOnRails: ()
[08:10:15] chagel: has joined #RubyOnRails
[08:10:50] jas02: has joined #RubyOnRails
[08:11:10] Macaveli: has joined #RubyOnRails
[08:13:34] gce: has joined #RubyOnRails
[08:14:48] ppinkerton: has joined #RubyOnRails
[08:15:11] chagel: has joined #RubyOnRails
[08:15:53] mr-spoon: has joined #RubyOnRails
[08:16:14] solars: has joined #RubyOnRails
[08:16:56] pawnbox: has joined #RubyOnRails
[08:18:41] gce: has joined #RubyOnRails
[08:18:43] DmitryBochkarev: has joined #RubyOnRails
[08:20:05] chagel: has joined #RubyOnRails
[08:22:23] Pazician: has joined #RubyOnRails
[08:22:23] Pazician: has joined #RubyOnRails
[08:22:38] baweaver: has joined #RubyOnRails
[08:24:55] banister: has left #RubyOnRails: ()
[08:25:01] banisterfiend: has joined #RubyOnRails
[08:27:29] DEA7TH: has joined #RubyOnRails
[08:27:57] mrbubbles: has joined #RubyOnRails
[08:28:37] srinidhi: has joined #RubyOnRails
[08:30:12] banisterfiend: is there a way to find the status of a job in activejob?
[08:32:25] ppinkerton: has joined #RubyOnRails
[08:33:03] jeanlinux: has joined #RubyOnRails
[08:33:22] DEA7TH: has joined #RubyOnRails
[08:34:28] bronson: has joined #RubyOnRails
[08:35:42] Palsson: has joined #RubyOnRails
[08:37:26] kmckelvin: has joined #RubyOnRails
[08:40:48] sled: has joined #RubyOnRails
[08:44:03] aweis: has joined #RubyOnRails
[08:45:04] mikecmpbll: has joined #RubyOnRails
[08:49:32] timmyBsd: has joined #RubyOnRails
[08:51:58] norc: Hi, I manually tried a GET on the favicon asset path generated by favicon_link_tag which returns a 200 OK but no image. The weird thing is I do not see this request in my rails log at all.
[08:52:03] norc: What the heck is going?
[08:52:06] solars: quick question, how can I sanitize (sql injection) a param within the code, not a query?
[08:53:22] edwinvdgraaf: has joined #RubyOnRails
[08:53:22] norc: solars: Can you provide a code snippet of what you are trying to do?
[08:53:58] DmitryBochkarev: has joined #RubyOnRails
[08:54:53] norc: solars: for simple things AR like #where you can use ? in your query and then pass additional arguments which get sanitized and interpolated
[08:54:55] yardenbar: has joined #RubyOnRails
[08:55:40] norc: e.g. Model.where('foo = ?', my_param)
[08:56:24] norc: Though the better version of this would be Model.where(foo: my_param)
[08:56:26] norc: solars: http://guides.rubyonrails.org/security.html#sql-injection
[08:57:33] mikecmpbll: has joined #RubyOnRails
[08:58:06] johnflux: has joined #RubyOnRails
[08:59:05] tbuehlmann: solars, there's this: `ActiveRecord::Base.sanitize(string)`
[08:59:05] laith: has joined #RubyOnRails
[09:00:00] lxsameer: has joined #RubyOnRails
[09:00:01] marr: has joined #RubyOnRails
[09:00:21] solars: thanks guys
[09:03:52] qejk: has joined #RubyOnRails
[09:05:13] arup_r: has joined #RubyOnRails
[09:05:43] arup_r: ember slack group has 3000+ people. omg! .. where are we? :/
[09:06:29] jeanlinux: has joined #RubyOnRails
[09:10:25] aadam21: has joined #RubyOnRails
[09:13:07] chridal_: has left #RubyOnRails: ()
[09:13:17] rubyonrailed: has joined #RubyOnRails
[09:13:25] chridal: has joined #RubyOnRails
[09:17:34] laith: has joined #RubyOnRails
[09:19:23] jsrn_: has joined #RubyOnRails
[09:19:56] AzaToth: has joined #RubyOnRails
[09:24:34] tetraktys: has joined #RubyOnRails
[09:26:26] acosonic: Can anyone update this plugin https://github.com/twinslash/redmine_chilli_pdf so it works with Redmine 3.2 ?
[09:26:43] norc: Back to my issue. Why cant I see requests to my asset served favicon in my rails log at all? Im in development mode with asset debugging turned on
[09:26:55] norc: acosonic: Sure. Want to hear my going rate?
[09:27:09] acosonic: norc: what's your rate?
[09:28:07] norc: acosonic: That was meant sarcastically because a great deal of people coming into these channels expect people to work for them for free.
[09:28:14] norc: Im sorry if that is not the case here.
[09:28:27] acosonic: it's not for me, but for community, open-source :)
[09:28:37] ddv: acosonic: oh why don't you do it yourself then
[09:29:14] acosonic: ddv: I tried migrating some other plugins, but routing is killing me
[09:29:44] norc: acosonic: There is basically 3 ways you can get this done. Ask the maintainer to port it for you, port it yourself or hire someone to do it. ;-)
[09:30:07] acosonic: and how much is usual rails developer per hour fee?
[09:30:23] arup_r: acosonic: what is the issue there ?
[09:30:56] norc: acosonic: Something around 50-150EUR/USD per hour is realistic, depending on skill and expertise.
[09:31:15] aadam21: has joined #RubyOnRails
[09:31:30] Ergo: has joined #RubyOnRails
[09:31:32] tbuehlmann: norc, do you have an nginx/apache in front that serves assets directly?
[09:31:54] norc: tbuehlmann: Nope, Im serving everything through unicorn directly.
[09:32:22] acosonic: arup_r: I don't know about this PDF plugin, haven't tried it with 3.2, I was just trying to do some customizations, and realised that Redmine uses some ITCPDF library which does not seem very flexible... And realised that wicked PDF is much better...
[09:32:51] arup_r: ok. so you tried it already ?
[09:33:21] acosonic: arup_r: I'll give this one try right now
[09:33:36] ppinkerton: has joined #RubyOnRails
[09:34:18] arup_r: yes, try in a feature branch, and see if it works or not first
[09:37:46] sandstrom: has joined #RubyOnRails
[09:38:25] superJen96: has joined #RubyOnRails
[09:39:52] norc: tbuehlmann: Im silly, I just realised I was not seeing any assets in my log - which reminded me that I plugged in the quiet_assets gem.
[09:40:46] Pumukel: has joined #RubyOnRails
[09:42:44] loechel: has joined #RubyOnRails
[09:43:35] vedu: Hello. I need a OAuth provider for my rails api + mobile clients. Which is better among opro and doorkeeper?
[09:44:15] snowy: has joined #RubyOnRails
[09:48:53] tbuehlmann: norc, great!
[09:49:26] kitsuneyo: has joined #RubyOnRails
[09:49:28] Eswar: has joined #RubyOnRails
[09:50:12] kitsuneyo: i want to update to ruby 2.3 from 2.2.1, is it pretty safe to do so?
[09:50:37] Pumukel: has joined #RubyOnRails
[09:51:57] aadam21: has joined #RubyOnRails
[09:54:07] techsethi: has joined #RubyOnRails
[09:58:31] aweis: has joined #RubyOnRails
[09:58:36] bruce_lee: has joined #RubyOnRails
[09:58:36] bruce_lee: has joined #RubyOnRails
[09:59:34] p1k: has joined #RubyOnRails
[10:00:23] p1k: I'm getting an out of range for ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Integer with limit 4 Error on very rare occasions which are absolutely not reproducible
[10:00:57] p1k: I'm on AR 4.2.5 and the problems cited in this post: http://stackoverflow.com/questions/28095568/rangeerror-for-simple-integer-assignment-in-rails-4-2-0-that-should-be-caught-by don't seem to apply
[10:01:22] p1k: that is I have no idea how to hit type-casting without validation happening first but apparently on certain occasions it is possible (although it should be a deterministic process ? )
[10:01:43] chagel: has joined #RubyOnRails
[10:02:00] techsethi_: has joined #RubyOnRails
[10:02:11] arBmind: has joined #RubyOnRails
[10:05:43] nettoweb: has joined #RubyOnRails
[10:06:56] ppinkerton: has joined #RubyOnRails
[10:09:09] tetraktys: has joined #RubyOnRails
[10:10:46] artto: has joined #RubyOnRails
[10:16:24] shibly: has joined #RubyOnRails
[10:16:31] shibly: has left #RubyOnRails: ()
[10:17:09] ElFerna: has joined #RubyOnRails
[10:19:04] rubyonrails392: has joined #RubyOnRails
[10:24:13] kitsuneyo: has joined #RubyOnRails
[10:27:33] solars: is it possible to use pluck with a single record query? obviously find_by().pluck doesn't work
[10:29:16] pawnbox: has joined #RubyOnRails
[10:30:04] laith: has joined #RubyOnRails
[10:30:38] jeanre: has joined #RubyOnRails
[10:30:38] jeanre: has joined #RubyOnRails
[10:31:14] jeanlinux: has joined #RubyOnRails
[10:33:42] aadam21: has joined #RubyOnRails
[10:33:50] lipoqil: has joined #RubyOnRails
[10:34:50] pawnbox: has joined #RubyOnRails
[10:34:53] arup_r: has joined #RubyOnRails
[10:36:45] bronson: has joined #RubyOnRails
[10:46:22] sevenseacat: it doesnt make sense to do so
[10:47:05] sevenseacat: do you mean to select instead?
[10:49:39] solars: ah I think that would work, thank you
[10:51:48] Eswar: has joined #RubyOnRails
[10:53:58] banisterfiend: how do i access redis in my background job? messing with $redis doesn't appear to work ..
[10:54:24] norc: banisterfiend: sidekiq? resque?
[10:55:51] norc: banisterfiend: Sidekiq.redis is the key because of connection pooling.
[10:57:14] banisterfiend: norc i've actually just been accessing redis directly $redis.sadd "curriculum:copy", @curriculum.id
[10:57:33] banisterfiend: but $redis.srem("curriculum:copy", id) doesn't appera to remove the element..
[10:57:41] banisterfiend: (calling the latter inside an activejob background task)
[10:58:38] defsdoor: has joined #RubyOnRails
[10:59:25] trinaldi: has joined #RubyOnRails
[10:59:47] norc: banisterfiend: Why are you interacting with redis directly anyhow?
[11:00:15] banisterfiend: norc i'm just using it as a key-value store as its primary use-case, not using it for scheduling background jobs :)
[11:00:57] norc: banisterfiend: Are you doing some kind of redis sharding?
[11:02:59] norc: banisterfiend: This might or might not be related, but its a large design improvement anyhow: Get rid off that global variable
[11:07:41] norc: (In fact redis-rb even provides you with Redis.current as a clean albeit undocumented solution to this)
[11:08:06] wmdrossard: has joined #RubyOnRails
[11:08:48] raunicolae: has joined #RubyOnRails
[11:12:05] drbayer: has joined #RubyOnRails
[11:12:50] czerasz: has joined #RubyOnRails
[11:14:50] cgfbee: has joined #RubyOnRails
[11:15:06] Eswar: has joined #RubyOnRails
[11:16:52] acosonic: what would be proper way to resolve this? http://apaste.info/i9s
[11:17:39] moeabdol: has joined #RubyOnRails
[11:18:12] trosborn: has joined #RubyOnRails
[11:18:14] adaedra: Did you try the provided command?
[11:19:16] chagel: has joined #RubyOnRails
[11:20:04] franzip: has joined #RubyOnRails
[11:20:21] acosonic: adaedra: why would I update it when my version is newer?
[11:21:21] sevenseacat: and thats the problem
[11:21:28] adaedra: Because your gemfile wants something that satisfies '~> 0.6.11'
[11:22:06] acosonic: so, what do I need to do to resolve it?
[11:22:14] sevenseacat: run the provided command
[11:24:17] acosonic: can't I just edit gemfile and put newer version in there?
[11:24:41] acosonic: I just did that looks OK
[11:24:46] allcentury: has joined #RubyOnRails
[11:24:51] sevenseacat: feel free to ignore us then
[11:26:12] acosonic: sevenseacat: hm didn't work, crashed :) let me try your way now...
[11:27:15] acosonic: sevenseacat: where can I lear what am I doing? The gem and changes of their version how that process occurs?
[11:27:38] adaedra: Try bundler docs
[11:27:40] Palsson: has joined #RubyOnRails
[11:27:43] sevenseacat: you want to learn what has changed in the gem? the gem's changelog will help with that
[11:29:23] acosonic: sevenseacat: no I want to know what happened, did bundler do something to files Gemfile in particular etc...
[11:29:46] quazimodo: has joined #RubyOnRails
[11:30:04] sevenseacat: whatever you did to get the gems out of sync, is what happened. we don't know what you did.
[11:30:27] acosonic: Hm, so bundling and updating of plugin now succeded, but Redmine crashed with follwing message... You specified: nokogiri (>= and nokogiri (>= 0) (Bundler::GemfileError)
[11:30:51] nachoman: has joined #RubyOnRails
[11:31:18] lxsameer: has joined #RubyOnRails
[11:32:01] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[11:32:41] ldnunes: has joined #RubyOnRails
[11:33:49] aadam21: has joined #RubyOnRails
[11:35:37] embasbm: has joined #RubyOnRails
[11:35:45] acosonic: ok so I'm trying to resolve situation where plugin asks for different versions of gems (older) than main app https://gist.github.com/acosonic/0a4126e8995641f36907
[11:36:17] sevenseacat: so you've got the same gem listed twice in your Gemfile
[11:37:00] acosonic: so should I just remove them?
[11:37:21] acosonic: I have them listed in main app's gemfile and plugin itself's gemfile...
[11:37:30] sevenseacat: the plugin doesn't need it if the main app has it
[11:37:32] embasbm: Hi everyone
[11:37:41] sevenseacat: what are you working on that still has plugins?
[11:37:57] embasbm: I've a weird "missing model" in rails app: User.count => 0, Admin.count => NoMethodError: undefined method `count' for Admin:Class)
[11:38:00] kgrz: has joined #RubyOnRails
[11:38:10] embasbm: all the migrations are ok, and the table is there
[11:38:12] sevenseacat: embasbm: whats Admin ?
[11:38:16] acosonic: sevenseacat: Redmine, ok I think I resolved it, restarting now...
[11:38:18] embasbm: an other model
[11:38:25] sevenseacat: embasbm: i dont think it is
[11:38:27] embasbm: sevenseacat
[11:38:33] sevenseacat: acosonic: yeah I'm not touching redmine with a ten foot pole. good luck.
[11:39:00] Ropeney: has joined #RubyOnRails
[11:39:03] sevenseacat: embasbm: do you have another class called Admin in your app?
[11:39:09] rodfersou: has joined #RubyOnRails
[11:39:23] acosonic: sevenseacat: hm, I think you are right, project does not look like it's in very good shape...
[11:39:43] embasbm: sevenseacat: yes, and I can sea the table in mysql prompt
[11:39:51] sevenseacat: the table is irrelevant
[11:39:55] sevenseacat: its the class you're after
[11:40:21] sevenseacat: if you have a non-AR class called Admin in your app, that explains why it doesnt respond to count
[11:40:50] laith: has joined #RubyOnRails
[11:41:04] embasbm: right, it's under models folder and it's an AR:Base child
[11:41:26] sevenseacat: embasbm: and you have no other?
[11:41:52] sevenseacat: nothing in lib, no controller namespace, nothing?
[11:42:33] embasbm: I think you just found it, it's not being shouwn because I got an other class in /lib,
[11:42:38] embasbm: I guess that's why
[11:42:51] sevenseacat: yeah if you've got two classes called the same thing, that's bound to cause confusion
[11:43:09] embasbm: true and make sense
[11:43:42] dEPy: has joined #RubyOnRails
[11:44:15] acosonic: arup_r: see, told ya, it's too complicated to update :(
[11:44:37] artto: has joined #RubyOnRails
[11:44:43] sandstrom: has joined #RubyOnRails
[11:45:05] dEPy: People. If I have a query like this my pagination fails cause calling ".count" on it produces invalid SQL. Any ideas around it?
[11:45:14] sevenseacat: dEPy: fix your query?
[11:45:24] embasbm: sevenseacat: +1
[11:45:28] dEPy: Never crossed my mind... O_o
[11:46:42] dEPy: I don't know how to fix it. That's why I'm asking.
[11:47:03] sevenseacat: well without seeing it, we don't know how to fix it either
[11:47:04] ql6wlld: has joined #RubyOnRails
[11:47:14] arup_r: what gem for pagination ?
[11:47:28] dEPy: Oh. Damn. I thought I gave the gist link.
[11:47:45] dEPy: Sorry! :) https://gist.github.com/depy/a266b4741e66b0e71f37
[11:48:10] sevenseacat: dEPy: and the error is?
[11:48:54] dEPy: Will paginate (I guess) will try running .count on it to get the number of results, which produces invalid SQL.
[11:49:13] dEPy: I would still like to have the same format of data so I can order it by tasks count
[11:51:07] mdw: has joined #RubyOnRails
[11:51:13] tetraktys: has joined #RubyOnRails
[11:51:43] dEPy: Well I could just write SQL, cast it to array and then paginate it. But I don't like that idea.
[11:53:26] Scripore: has joined #RubyOnRails
[11:54:49] arup_r: dEPy: add the error in gist
[11:55:13] arup_r: omg, my rails app has too many engines. how will I make progress here ? :/
[11:55:40] dEPy: Added error: https://gist.github.com/depy/a266b4741e66b0e71f37
[11:55:53] ferr: has joined #RubyOnRails
[11:56:05] dEPy: You can see it's trying to do: SELECT COUNT(users.*, COUNT(tasks.id) AS count) ........
[11:56:59] sled: has joined #RubyOnRails
[11:57:34] arup_r: rename as count to task_count and try
[11:59:17] adac: has joined #RubyOnRails
[11:59:32] adac: Running "bundle exec rake assets:precompile" is it somehow possible to detect within an initializer for example, that I called assets:precompile? If yes, how?
[11:59:46] jeanlinux: has joined #RubyOnRails
[12:00:13] norc: adac: What is your actual problem?
[12:00:57] sg19: has joined #RubyOnRails
[12:01:46] sg19: Hi. I am using ckeditor and I am getting this error: Refused to execute script from '/assets/ckeditor/lang/en.js?t=FB9E' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
[12:01:47] sg19: In development it was working fine for me. What is the problem here?
[12:02:03] adac: norc, It seems that assets:precompile does call the rails initializers, which contains a check if my database is online. And I wanted to skip that for assets:precompile
[12:02:47] dEPy: arup_r: noup, still the same. :/
[12:05:33] arup_r: dEPy: yeah, this is wrong expression `COUNT(users.*, COUNT(tasks.id) AS count)` ofcourse
[12:05:41] arup_r: what is the gem you are using ?
[12:05:45] dEPy: will_paginate
[12:06:20] arup_r: show your User model
[12:06:33] dEPy: But I think it won't matter. Since even just calling .count on that rails code does this. I guess I shouldn't put that stuff in select statement
[12:06:52] dEPy: arup_r: fields or assocs? or both?
[12:08:27] arup_r: show user.rb full file
[12:08:45] sandstrom: has joined #RubyOnRails
[12:12:44] zworks: has joined #RubyOnRails
[12:12:45] sandstrom: has joined #RubyOnRails
[12:12:46] hcnewsom: has joined #RubyOnRails
[12:12:52] IrishGringo: has joined #RubyOnRails
[12:14:38] eladmeidar: has joined #RubyOnRails
[12:15:18] pawnbox: has joined #RubyOnRails
[12:16:14] voobscout: has joined #RubyOnRails
[12:18:54] dEPy: arup_r: https://gist.github.com/depy/b7d8dc228c3f6a22d799
[12:21:07] FooMunki: has joined #RubyOnRails
[12:21:29] aadam21: has joined #RubyOnRails
[12:22:06] norc: adac: I think you could get away by invoking the sprockets task directly.
[12:22:23] Cohedrin: has joined #RubyOnRails
[12:23:22] chagel: has joined #RubyOnRails
[12:23:24] norc: adac: Although mm. No the more I look at sprockets it seems that Rails needs to be initialized for this to work at all.
[12:23:32] arup_r: dEPy: try in rails console just `User.select("users.*")` and see any error ?
[12:23:48] norc: adac: Which part does that check by the way?
[12:23:53] laith: has joined #RubyOnRails
[12:24:08] quazimodo: 5 days and SES hasn't verified my DKIM records!_S!SNH>R<UCG
[12:24:32] EdwardIII: hrm i'm going nuts trying to figure out how to get <%= form.button :submit %> to work with simple_form_form
[12:24:34] dEPy: arup_r: no, calling .count on it also no.
[12:24:42] EdwardIII: i don't suppose anyone has an example? i've tried every combination in the docs
[12:25:01] jschoolcraft: has joined #RubyOnRails
[12:25:21] sevenseacat: EdwardIII: what problem are you having?
[12:25:24] adac: norc, I think maybe like this it could work: http://stackoverflow.com/a/30172178
[12:25:25] baweaver: has joined #RubyOnRails
[12:25:32] dEPy: arup_r: but adding another COUNT in select statement of course breaks it
[12:25:42] dEPy: arup_r: that's actually fault of rails
[12:25:58] arup_r: no wait..
[12:26:35] arup_r: ok. Why `.client` there ? Is it doing anything ?
[12:26:50] dEPy: Just saying that the role should be 'client'
[12:26:52] EdwardIII: sevenseacat: https://gist.github.com/EdwardIII/f59b66ad45d979606539#file-err-L12
[12:27:12] dEPy: arup_r: try this: User.select("users.*, COUNT(users.id)").group("users.id").count
[12:27:15] dEPy: arup_r: breaks
[12:27:25] arup_r: yes. you can't have double count
[12:27:41] arup_r: that is not a valid SQL
[12:27:46] dEPy: arup_r: yea, so it's rails trying to wrap the whole select in COUNT like I though... :/
[12:28:19] arup_r: it is not Rails. User.select("users.*, COUNT(users.id)").group("users.id") is fine, why need the the last `.count`?
[12:28:46] dEPy: I don't, but will_paginate calls it :) so it can know how many pages there are :D
[12:29:45] sevenseacat: EdwardIII: ok, so your i18n format is incorrect
[12:30:20] TwinkleHood: has joined #RubyOnRails
[12:30:32] TwinkleHood: Hey, I have a tricky problem. I have a table with around 10mil records, the records in turn have a yml field. The problem is that a lot of them have corrupt yaml, and I need to filter which ones. Iterating with begin/rescue seems like a pretty intensive way to go about it, does someone have a sneaky idea?
[12:30:48] dEPy: arup_r: I could call to_a on the results and then paginate, but with around 10000 users it's reaaaaaly slow. :/
[12:30:58] arup_r: dEPy: do User.unscoped. and then everything and try ?
[12:31:04] dEPy: let me see
[12:31:25] dEPy: arup_r: same
[12:31:38] arup_r: show me the code you tried
[12:32:18] dEPy: arup_r: User.select("users.*, COUNT(tasks.id) AS count").client.joins("LEFT OUTER JOIN tasks ON users.id = tasks.client_id").group("users.id").order("count DESC")
[12:32:27] dEPy: User.unscoped......
[12:32:45] dEPy: Same error. Tries to wrap whole select with COUNT
[12:33:35] sevenseacat: EdwardIII: you want those translation keys to be used by default in the simple_form form, yeah? then they should be under simple_form, labels, stay_detail
[12:34:24] arup_r: i see same code
[12:34:37] Olipro: has joined #RubyOnRails
[12:36:37] voobscout: has joined #RubyOnRails
[12:37:25] EdwardIII: sevenseacat: ah that does fix it, thanks
[12:37:37] EdwardIII: sevenseacat: but i kind of thought simple_form might read the attrs from the model definition?
[12:37:53] EdwardIII: i mean that must be where it's getting it from by default. #human, i'm guessing
[12:38:05] sevenseacat: yes, it uses human_name for attribute names by default
[12:38:17] EdwardIII: but the model doesn't include :submit
[12:38:48] EdwardIII: mix and match!
[12:38:49] bronson: has joined #RubyOnRails
[12:39:21] laith: has joined #RubyOnRails
[12:40:30] royvandermeij: has joined #RubyOnRails
[12:40:51] p1k: has joined #RubyOnRails
[12:40:54] sudoubuntu: has joined #RubyOnRails
[12:41:20] krzkrz: has joined #RubyOnRails
[12:43:48] EdwardIII: sevenseacat: heh ok, i think it's chooisng a default 'create' action, the button says "Create Stay detail": https://gist.github.com/EdwardIII/f59b66ad45d979606539#file-en-yml-L7
[12:43:58] Cohedrin: has joined #RubyOnRails
[12:43:58] w0bni: What is the appropriate way to create an object from another controller?
[12:44:12] arup_r: I am using one Engine. And that Engine has a model account and my application has a model task. Now I want to make a association between them. How to modify the engine model ?
[12:44:22] w0bni: I want to be able to vote on songs by POSTing to /songs/1/vote/8, which should create a Vote object and save it
[12:44:48] sevenseacat: EdwardIII: buttons are a little different. see https://github.com/plataformatec/simple_form#i18n under "It's also possible to translate buttons, using Rails' built-in I18n support:"
[12:45:49] EdwardIII: sevenseacat: ah ha. it was a little confusing because there seemed to be like 3-4 different ways to update it
[12:45:54] EdwardIII: but that combo cracks it. thanks for the pointers
[12:45:54] vedu: Hello. How to decide an OAuth provider for my rails api + mobile clients. opro or doorkeeper?
[12:45:59] sevenseacat: yeah i18n can be a bit funky
[12:46:16] pawnbox: has joined #RubyOnRails
[12:47:04] tetraktys: has joined #RubyOnRails
[12:47:32] josephkokenge: has joined #RubyOnRails
[12:47:54] johnflux: has joined #RubyOnRails
[12:47:54] johnflux: has joined #RubyOnRails
[12:49:56] Scripore: has joined #RubyOnRails
[12:50:39] _Tariq: has joined #RubyOnRails
[12:50:42] workmad3: has joined #RubyOnRails
[12:51:49] hcnewsom: has joined #RubyOnRails
[12:52:58] nachoman: has joined #RubyOnRails
[12:53:00] unl0ckd: has joined #RubyOnRails
[12:53:54] konsolebox: has joined #RubyOnRails
[12:54:02] pawnbox: has joined #RubyOnRails
[12:56:47] goodcodeguy: has joined #RubyOnRails
[12:56:49] pyemkey: Hello. How would you name model which store urls for example to facebook, linkedin, pinterest etc. Would you call it Website with attribute url?
[12:57:14] Mchl: has joined #RubyOnRails
[12:57:45] rvanlieshout: pyemkey: what do you ask your user to provide?
[12:58:37] pyemkey: I'm asking to provide urls where others can find him
[12:58:40] goodcodeguy: has joined #RubyOnRails
[12:59:51] pyemkey: rvanlieshout: up
[13:01:01] artto: has joined #RubyOnRails
[13:01:18] pyemkey: up was wrong word, should be something like ^. Sorry for that.
[13:01:23] dionysus69: has joined #RubyOnRails
[13:01:47] rvanlieshout: ah. in that case 'url' ?
[13:01:55] htmldrum: has joined #RubyOnRails
[13:02:10] rvanlieshout: well.. that's what you ask the user
[13:02:32] rvanlieshout: so that's the name of the concept in this domain
[13:02:58] pyemkey: URL with attributes: name and url?
[13:03:16] rvanlieshout: that would be weird. maybe you should ask the user something different
[13:03:21] EdwardIII: sevenseacat: hrm ok so in one place i do <%= form.submit :reserve %>, it renders as 'reserve', but i can't seem to figure out where i put a translation for that heh
[13:03:25] rvanlieshout: like websites or social media pages
[13:03:31] rvanlieshout: social media urls
[13:04:18] sevenseacat: EdwardIII: same way as the submit button before, except instead of submit key, you probably need reserve key
[13:04:28] pyemkey: rvanlieshout: SocialMedia was what I looked for. Thank you so much :_)
[13:05:12] sled: has joined #RubyOnRails
[13:06:14] tetraktys: has joined #RubyOnRails
[13:06:41] EdwardIII: sevenseacat: i did give that a spin, but it still says "reserve", i.e. not Reserve: https://gist.github.com/EdwardIII/f59b66ad45d979606539
[13:07:45] voobscout: has joined #RubyOnRails
[13:08:04] xhoy: i have a string with "dear {first_name} {last_name} blabla", is there an easy way of replacing the {} with some object.stuf?
[13:08:18] sevenseacat: EdwardIII: oh right... maybe reserve should be under submit/stay_detail ?
[13:08:50] tbuehlmann: xhoy, very easy way: just substitute the strings with object stuff
[13:09:18] EdwardIII: sevenseacat: tried that too: https://gist.github.com/EdwardIII/f59b66ad45d979606539#file-en-yml-L44
[13:09:27] tbuehlmann: kind of advanced: use a template language like Liquid (https://github.com/Shopify/liquid) that's build for usecases like that
[13:10:02] xhoy: mm oke that sounds a little bit advanced :P for simply replacing a letter head :>
[13:10:57] EdwardIII: sevenseacat: i basically spammed it everywhere: https://gist.github.com/EdwardIII/f59b66ad45d979606539
[13:11:01] xhoy: "foo = %{foo}" % { :foo => 'bar' } #=> "foo = bar" <<<
[13:11:04] tbuehlmann: well, yeah. but just wait for the next requirements coming in :)
[13:11:07] aadam21: has joined #RubyOnRails
[13:11:18] xhoy: tbuehlmann: hahah thats true
[13:11:50] rickmasta: has joined #RubyOnRails
[13:12:11] tbuehlmann: but I don't disagree. if replacing simple strings suffices, great
[13:12:42] xhoy: well, i now have hash {firstname: proc(object.firstname)}
[13:13:31] solars: has joined #RubyOnRails
[13:13:43] daivyk: has joined #RubyOnRails
[13:16:17] ziyadb: has joined #RubyOnRails
[13:19:11] Karpah: has joined #RubyOnRails
[13:19:51] yottanami: has joined #RubyOnRails
[13:20:01] yottanami: Is anyway to set layout name in template?
[13:20:25] tbuehlmann: xhoy, just an example: https://gist.github.com/tbuehlmann/5004800b6bc623c45f58
[13:20:48] tbuehlmann: it's not _that_ advanced :)
[13:21:22] xhoy: it just that i dont know what vars are going to be used :>
[13:21:29] xhoy: but they have an option for that
[13:21:42] nattyPablo: has joined #RubyOnRails
[13:21:45] xhoy: could be fix for the render bug
[13:22:04] xhoy: workaround is a beter term
[13:22:06] umdstu: has joined #RubyOnRails
[13:22:35] quazimodo: has joined #RubyOnRails
[13:22:40] xhoy: ill give liquid a shot
[13:22:49] umdstu: i'm getting undefined method `stub_request` for webmock even though i've included the necessary `require` in the test_helper.rb file
[13:24:01] tbuehlmann: xhoy, you could also just use erb templates
[13:24:16] tbuehlmann: of if sending emails, the basic mailer templates
[13:24:19] xhoy: i was looking at that but liquid sound great ;>
[13:24:20] IFrank00: has joined #RubyOnRails
[13:24:54] tbuehlmann: liquid is great for when the user itself can create/change content and use variables
[13:25:04] xhoy: yeah they can :)
[13:25:12] xhoy: atleast now that its possible they should :>
[13:26:46] barhum2013: has joined #RubyOnRails
[13:27:21] laith1: has joined #RubyOnRails
[13:27:57] chi6rag__: has joined #RubyOnRails
[13:27:59] rikkipitt: has joined #RubyOnRails
[13:28:27] sled: has joined #RubyOnRails
[13:28:40] laith: has joined #RubyOnRails
[13:29:11] rikkipitt: Hey folks, can anyone help me? The following concern (with condition) works locally but not on Heroku: https://gist.github.com/rikkipitt/9b2beb573ec5aaead0cf
[13:29:11] jeanlinux: has joined #RubyOnRails
[13:29:30] _Tariq: has joined #RubyOnRails
[13:29:30] rikkipitt: is it caching the Geo.country_code variable?
[13:30:28] tbuehlmann: what does Geo.country_code return?
[13:30:57] rikkipitt: a string, e.g. "GB" or "US"
[13:31:26] tbuehlmann: if that is falsy, the default scope is not applied. might that be the problem?
[13:32:07] rikkipitt: possibly, just wondering why Heroku treats it differently to local development
[13:32:29] rikkipitt: Geo.country_code get set in a before_filter in the application_controller
[13:32:39] tbuehlmann: what is it on application startup?
[13:33:05] emoreno: has joined #RubyOnRails
[13:33:06] tbuehlmann: because that's the time when the default scope is applied. it's a one time thing that only happens once
[13:33:28] DmitryBochkarev: has joined #RubyOnRails
[13:33:29] voobscout: has joined #RubyOnRails
[13:33:35] emoreno: has left #RubyOnRails: ()
[13:33:39] Dbugger: has joined #RubyOnRails
[13:33:42] Dbugger: Hello everyone
[13:33:44] Dbugger: How are you all?
[13:33:57] rikkipitt: tbuehlmann: i thought as much, i assume locally everything gets reloaded
[13:34:05] umdstu: dbugger: oh, where do i begin...
[13:35:01] tbuehlmann: rikkipitt, yup
[13:35:06] Dbugger: umdstu, you tell me ;)
[13:35:11] Dbugger: I actually wanted to ask a question
[13:35:20] Dbugger: not specifically of Rails, but since I am here so often...
[13:36:02] Dbugger: I just started a new job, as web developer or so I thought, but last week my new boss told me that he wanted me to build a platform to do Data Mining on the company Data.
[13:36:29] Dbugger: After a couple hours, it was quite clear, that that is not exactly the competence of a web developer... and now I have to explain to my boss why :P
[13:36:58] _Tariq: has joined #RubyOnRails
[13:37:09] Dbugger: I was wondering if anyone could give me good arguments that I could present, for that
[13:37:18] Dbugger: Saying "it is not really my competences" is kinda lame :P
[13:38:31] tetraktys: has joined #RubyOnRails
[13:40:14] _Tariq: has joined #RubyOnRails
[13:40:18] EdwardIII: is there a way to turn a validation rule on/off on a model?
[13:40:41] EdwardIII: i have this model i pass around through different stages, works great, but on the very last stage i want to add a 't&cs' checkbox
[13:40:44] sled: has joined #RubyOnRails
[13:41:06] vedu: EdwardIII: you can add a :if lambda to a validation
[13:41:21] nocontrol: has joined #RubyOnRails
[13:41:58] EdwardIII: i guess i could add my own attribute: require_acceptance, set that in the final controller set, and check that in the if: lambda
[13:42:01] EdwardIII: i'll try that, thanks vedu
[13:44:30] tetraktys: has joined #RubyOnRails
[13:44:40] goodcodeguy: has joined #RubyOnRails
[13:44:48] SeanLazer: has joined #RubyOnRails
[13:45:57] _Tariq: has joined #RubyOnRails
[13:47:14] matthewd: EdwardIII: http://www.justinweiss.com/articles/a-lightweight-way-to-handle-different-validation-situations/
[13:47:40] ferr: https://gist.github.com/anonymous/5e327fa87bcd197c5528 how would I refactor this query?
[13:49:08] swerter_: has joined #RubyOnRails
[13:49:47] yellow5: has joined #RubyOnRails
[13:49:48] voobscout: has joined #RubyOnRails
[13:50:13] ramortegui: has joined #RubyOnRails
[13:50:52] mauro1254: has joined #RubyOnRails
[13:51:59] umdstu: dbugger: just tell him you're a web developer, not a data scientist
[13:52:42] Dbugger: umdstu, yeah, I guess that is what I will say, I was just wondering if I could give some more concrete examples why I cant do it..
[13:52:54] mauro1254: Hi guys, I need to normalize book titles in order to be able to sort them, which is the best approach? Is I18n.transliterate useful for this purpose?
[13:53:01] Scient: why arent you willing to learn though
[13:53:04] solars: what's the easiest way to get 16:00 on the next wednesday? are there any helpers? :)
[13:53:09] mauro1254: I don't know the language of the title
[13:53:13] Scient: seems like your first option is to say "i dont know how to do it"
[13:53:23] umdstu: or tell him you can write the web components to interact with the data-mined data, but someone else would need to write the actual mining platform. it's not web-related at all
[13:53:44] Scient: we has a similar situation where we needed a data warehouse/mining solution
[13:53:49] Scient: and we dont have a data scientist or anything
[13:54:06] sevenseacat: if you only did stuff you knew how to do all day, work would be a very boring place
[13:54:09] Scient: we had people learn it and one of our engineers built it with the help of our devops dude
[13:54:14] umdstu: dbugger: Scient that's also a valid response- "i dont know how". whether you're willing to attempt to learn it is another thing
[13:54:30] Scient: i would explain that you dont know how to do it, but you are willing to learn
[13:54:36] Scient: it just means it will take some time
[13:54:41] umdstu: personally though, I wouldn't want a web developer writing a data mining platform
[13:54:43] Scient: and you might not get it right the first time around
[13:54:51] umdstu: sure, he *could* put something together
[13:54:52] Scient: i dont know what a "web developer" even means
[13:54:56] Scient: there are developers...
[13:55:11] Scient: a web developer means he/she can only write code producing html?
[13:55:15] Scient: or what does that even mean :P
[13:55:28] adaedra: That he/she works with web-related technologies?
[13:55:28] umdstu: to me, a web developer doesn't typically have the science background
[13:55:37] Scient: are you saying that you are only able to write code for webapps, but if its any other kind of app you dont know how to do it?
[13:55:38] umdstu: and works only with web technologies
[13:55:44] sevenseacat: ACTION gets popcorn
[13:55:51] Scient: i dont think you need any science background here
[13:56:05] Scient: see a data mining app/platform is not the same thing as a data science/analytics tool
[13:56:13] umdstu: you're right, it's not required. but it helps in designing a platform from scratch
[13:56:22] Scient: sure, i dont know all the specific of your requirement there for the thing that needs to be built
[13:56:34] Scient: but it most likely is some sort of ETL/warehouse project
[13:56:49] umdstu: we dont know the specifics
[13:57:03] umdstu: clearly dbugger *doesn't know how* or is unwilling
[13:57:14] umdstu: and that's fine
[13:57:17] Scient: i absolutely detest the notion of "web developer" - sure you are working with mostly webapps and technologies
[13:57:26] Scient: but goddamn that does not mean you dont know how to write any other code
[13:57:30] Scient: code is just that - code
[13:57:42] umdstu: but in my head it's like this....
[13:58:11] hfp_work: has joined #RubyOnRails
[13:58:41] hfp: has joined #RubyOnRails
[13:58:57] umdstu: if you learned how to do development, only related to web technologies, such as one of those online 'schools' that teach said technologies, you're a web developer
[13:59:00] umdstu: you dont know much else.
[13:59:10] umdstu: now, people that are more than web developers are often called web developers
[13:59:15] umdstu: nothing you can do about that
[14:00:16] PedramT: has joined #RubyOnRails
[14:01:12] artto: has joined #RubyOnRails
[14:03:15] SeanLazer: has joined #RubyOnRails
[14:03:53] jeanlinux: has joined #RubyOnRails
[14:03:54] sled: has joined #RubyOnRails
[14:04:42] umdstu: Scient: but honestly this is the first time i've really thought of it so i' just pulled that all from the top of my head
[14:05:52] sankaber: has joined #RubyOnRails
[14:06:08] Scient: well I would agree that if you are a nodejs developer then you are pretty much useless and can call yourself a web developer.... :P
[14:06:53] ianfleeton: has joined #RubyOnRails
[14:08:08] voobscout: has joined #RubyOnRails
[14:08:10] adaedra: This popcorn is delicious.
[14:08:30] sevenseacat: adaedra: i put extra butter just for you.
[14:08:43] adaedra: Nice, thanks.
[14:09:25] Dbugger: got distracted
[14:10:08] nattyPablo: has joined #RubyOnRails
[14:10:09] Dbugger: my Math background sucks
[14:10:13] Dbugger: just so you all know :P
[14:11:20] rikkipitt: has joined #RubyOnRails
[14:11:26] Dbugger: Well, I think I am a web developer, because my main experience is building websites, so the proper paradigms and structures and best practices for those kind of projects, is what I know
[14:11:46] Dbugger: Besides, seems to me like data mining requires a certain kind of technical knoledge that I miss
[14:11:55] Dbugger: concepts, techniques and so on
[14:12:23] srinidhi: has joined #RubyOnRails
[14:13:25] akshat: has joined #RubyOnRails
[14:13:59] deur-: it all depends
[14:14:23] deur-: if you're working as a developer for a web agency that also happens to develop iOS or android apps
[14:14:38] deur-: and you have to provide an API, or even perform work to a mobile app itself
[14:14:48] deur-: are you then a web developer?
[14:14:59] deur-: are you a mobile developer?
[14:15:18] allcentury: has joined #RubyOnRails
[14:15:22] deur-: i'm all for keeping things simple, and just call yourself a developer
[14:15:38] deur-: or to follow in DHH's line of thinking a "software writer"
[14:15:51] deur-: you get asked to do something else, you learn
[14:15:53] deur-: and you adapt
[14:17:04] daveomcd: has joined #RubyOnRails
[14:17:05] deur-: there are fundamentals you can take with you in most, if not all, developing jobs spanning a few dozen languages
[14:17:16] voobscout: has joined #RubyOnRails
[14:18:14] rubyonrailed: has joined #RubyOnRails
[14:18:27] umdstu: duer- just call myself awesome, and leave it at that.
[14:18:29] tetraktys: has joined #RubyOnRails
[14:20:03] artto: has joined #RubyOnRails
[14:21:17] ppinkerton: has joined #RubyOnRails
[14:22:37] epochwolf: ACTION just calls himself a wolf and then calls it a day.
[14:23:04] PedramT: has joined #RubyOnRails
[14:23:45] PedramT_: has joined #RubyOnRails
[14:24:26] durexlw: has joined #RubyOnRails
[14:24:33] durexlw: afternoon all
[14:24:44] PedramT_: has joined #RubyOnRails
[14:26:22] PedramT__: has joined #RubyOnRails
[14:26:28] LuisC: has joined #RubyOnRails
[14:26:31] baweaver: has joined #RubyOnRails
[14:26:50] cpruitt: has joined #RubyOnRails
[14:26:54] bmalum: has joined #RubyOnRails
[14:27:09] PedramT__: has joined #RubyOnRails
[14:27:30] epochwolf: durexlw: morning. :)
[14:28:57] durexlw: epochwolf: I'm a man speaking from the future... by this noon we'll all have hooverboards!
[14:29:21] sevenseacat: ACTION thinks everyone should stop living in the past
[14:29:23] IFrank00: https://gist.github.com/Frank004/59f9eeaeebd0e5309352 How can I dry this up.
[14:29:34] aadam21: has joined #RubyOnRails
[14:30:54] FooMunki: has joined #RubyOnRails
[14:31:32] epochwolf: IFrank00: I wouldn't bother. It's not hurting anyone. Drying it up would just make it harder to read.
[14:32:06] epochwolf: Invest in a text editor with column editing. Like subliem.
[14:32:36] aadam21: has joined #RubyOnRails
[14:32:57] Oliphaunte: has joined #RubyOnRails
[14:33:08] durexlw: lol sevenseacat :)
[14:33:22] xhoy: i am using render_to_string and i hit this bug: https://github.com/rails/rails/issues/14173
[14:33:24] Ergo__: has joined #RubyOnRails
[14:33:33] xhoy: how can i reset it to use the "default" layout after a render to string?
[14:34:01] xhoy: (it now renders something without a header/footer ...)
[14:34:08] aloneintheworld: has joined #RubyOnRails
[14:34:36] croberts: has joined #RubyOnRails
[14:34:46] IFrank00: epochwolf, if I add 6 or more. @boo @foo @bar ........ ill have the same lines for all 6 or 7 . its ok ?
[14:35:16] epochwolf: IFrank00: that brings into question why you are paging that many things on the same page.
[14:35:19] ElFerna: has joined #RubyOnRails
[14:36:07] epochwolf: And yes, I would duplicate it that many times because you're probably doing something wrong.
[14:36:12] durexlw: IFrank00: I added a comment
[14:36:15] durexlw: you can dry it like that
[14:37:06] IFrank00: epochwolf, good answer
[14:37:07] lbwski: has joined #RubyOnRails
[14:37:16] IFrank00: durexlw, will look at it
[14:37:19] workmad3: IFrank00: I second epochwolf... it's not hurting you regarding readability or maintainability currently, and if you throw more pagers into that page, you'll want the excess duplication to stick out like a sore thumb saying 'hey, wtf am I doing here?'
[14:37:56] durexlw: anyway, I third epochwolf and workmad3 ... the code smells in the regard they're mentioning
[14:38:13] epochwolf: durexlw: I like your answer, it's better than doing meta programming to set the instance variables in a loop. :)
[14:38:43] workmad3: also consider that DRY is also expressed as 'each concept should have 1 representation in your codebase' and doesn't mean 'if 2 lines happen to look similar then I should move heaven and earth to de-dupe them'
[14:38:47] epochwolf: I hate people who use instance_variable_set and friends.
[14:38:52] mary5030: has joined #RubyOnRails
[14:38:58] sevenseacat: +1 to all of that
[14:39:05] epochwolf: workmad3: wise words.
[14:39:35] durexlw: epochwolf: many ways to rome I guess :)
[14:39:53] epochwolf: durexlw: but only 1 to paradise.
[14:40:21] workmad3: epochwolf: if there's only 1 way in or out, it's not my paradise :P
[14:40:23] epochwolf: IFrank00: you're welcome. :)
[14:40:24] durexlw: mm... I say a fey girls today that looked like a way to paradise... all 4 of them :)
[14:40:33] durexlw: *saw a few
[14:40:54] epochwolf: no, no. I'm a D&D fan. Fey girls is totally cool with me.
[14:40:58] workmad3: (I get nervous when all my exits can be easily blocked)
[14:41:09] bronson: has joined #RubyOnRails
[14:41:18] epochwolf: workmad3: 1 way in, many ways out.
[14:42:05] workmad3: epochwolf: pfft, any exit can become an entrance with a bit of imagination and effort
[14:42:13] epochwolf: ACTION throttles his proselytizing for a bit.
[14:42:34] sankaber: has joined #RubyOnRails
[14:42:37] workmad3: (explosives can help too)
[14:42:38] durexlw: workmad3: just don't think about that when you drop your soap the next time :)
[14:43:03] workmad3: durexlw: I was wondering if anyone would pick up on the barely concealed innuendo...
[14:43:23] durexlw: I seem to have a fine sense for those :)
[14:43:54] durexlw: Anyone know a fix for this: making an api, works all nice and dandy, but the xml, when I import it into excel, I get a new row for each tag in the xml... I kinda suspect it's an encoding issue, but I can't quite seem to lay my finger on it
[14:44:06] polishdub: has joined #RubyOnRails
[14:44:14] epochwolf: I'm trying very hard not to have a dirty mind... once thursday hits I'm not going to have a clean mind until tuesday.
[14:44:16] nzst: has joined #RubyOnRails
[14:44:20] workmad3: durexlw: I see two major problems there - XML and Excel...
[14:44:21] IFrank00: one quick question and was why I post it here.
[14:44:43] durexlw: epochwolf: I gave up trying :)
[14:44:52] hcnewsom: has joined #RubyOnRails
[14:45:05] durexlw: workmad3: financial departments kinda like excel
[14:45:15] durexlw: you have alternatives?
[14:45:25] epochwolf: durexlw: my family and church friends really apprecieate me not making dick jokes all day.
[14:45:43] workmad3: epochwolf: so mix it up and make some fart jokes too...
[14:45:44] cpruitt: epochwolf: +1
[14:45:46] durexlw: epochwolf: honor that request and start making jokes about cunts and boobs
[14:46:16] durexlw: hehe I like the way workmad3 is thinking :)
[14:46:26] voobscout: has joined #RubyOnRails
[14:47:07] durexlw: Anyone here has experience or thoughts about connecting excel to an api?
[14:47:10] workmad3: durexlw: re. alternatives: nope... but it's news to me that excel can directly import XML :D
[14:47:16] epochwolf: durexlw: ... it goes far deeper than that. I'm going to be at a furry convention thursday through monday. It's going to take me a good part of the next week to be normal around normal people afterwards. :P
[14:47:29] cpruitt: durexlw: I think we’d need a lot more info about what you’re doing. At least I would.
[14:47:45] epochwolf: durexlw: why not use csv for export to excel?
[14:48:00] workmad3: 'be normal' and 'normal people'... I've yet to see any real benefit to either of these...
[14:48:13] epochwolf: workmad3: I work in an office and I go to church. :P
[14:48:25] durexlw: epochwolf: cause i'm lazy and rails offers an 'render :xml' and not a 'render :csv'
[14:48:38] epochwolf: durexlw: stop that, use a proper export format. :P
[14:48:56] epochwolf: Or write render :csv
[14:49:02] workmad3: epochwolf: since when are offices a hive of normality? especially ones with coders? :D
[14:49:11] flashpoint9: has joined #RubyOnRails
[14:49:11] epochwolf: workmad3: I'm the only coder.
[14:49:16] durexlw: epochwolf: I don't want to export
[14:49:24] durexlw: want to connect directly
[14:49:42] workmad3: durexlw: you do want to export... export == the data leaves your rails system
[14:49:43] durexlw: hate exports and imports... I'm far too lazy for those
[14:49:52] epochwolf: durexlw: wait, the excel spreadsheet calls the rails app?
[14:49:58] durexlw: fair enough if that's the definition :)
[14:50:25] durexlw: epochwolf: the excel spreadsheet calls the rails app (api) for refreshing the data
[14:50:33] workmad3: durexlw: although it would probably be better to say 'use a proper representation' :)
[14:50:47] cpruitt: durexlw: Apart from the laziness… Can you fill us in on exactly what you’re doign with Excel & your API? What is making the request? Excel itself? How is that being done?
[14:50:52] epochwolf: durexlw: in that case, you'll need to do research and figure out what the hangup is.
[14:51:09] epochwolf: cpruitt: sounds like VBA to me.
[14:51:26] IFrank00: durexlw, https://gist.github.com/Frank004/59f9eeaeebd0e5309352 check the comment
[14:51:45] cpruitt: epochwolf: ah
[14:51:48] godzillaenlacasa: has joined #RubyOnRails
[14:51:51] Jasaka: has joined #RubyOnRails
[14:52:27] durexlw: cpruitt: I have a rails app that does two things: it scrapes a website and gives basic graphs about the data (financial data). For further analysis, people want to connect from excel. So I made an api so that excel can connect and refresh data without having to import files (not VBA, it's a direct import). All works well, except for the new line for each tag
[14:53:09] durexlw: it's due to the format of my xml: connecting another xml like this works just fine
[14:54:37] durexlw: IFrank00: I think you mean param[:bar][value]. If value is a symbol, it will work properly
[14:54:49] cpruitt: durexlw: Not really sure this is helpful but I’d curl (or otherwaise save) your API result (XML) as a static file & proof that for accuracy. Then use that file to test your VBA (or whatever) code. Compare it to whatever XML you have that is working. Modify / check encoding / troubleshoot the static file. When the static file works, you’ll know what to fix with your rails app. This is not a Rails / Excel thing, it’s either something w
[14:54:50] cpruitt: with your Rails app OR something wrong with the way Excel is interperiting it.
[14:55:29] IFrank00: durexlw, thank you :)
[14:55:52] rohit: has joined #RubyOnRails
[14:56:06] durexlw: cpruitt: completely agree: looking into the file binary, i see a difference and I think it's because of that, but I wouldn't know how to solve that with encoding
[14:56:15] durexlw: ... I know I'm giving not much info here
[14:56:26] durexlw: IFrank00: welcome :)
[14:56:30] durexlw: one sec... bbl
[14:56:39] cpruitt: durexlw: XML isn’t binary. Can you elaborate on the difference you see?
[14:56:42] epochwolf: durexlw: manually edit the broken file until it works.
[14:56:49] epochwolf: Use a hex editor. :)
[14:57:01] workmad3: epochwolf: that's evil :P
[14:57:06] diegoviola: has joined #RubyOnRails
[14:57:22] epochwolf: workmad3: that's how I troubleshoot bullshit with external applications.
[14:57:47] epochwolf: A hex editor is going to show you when unicode is being used.
[14:57:53] cpruitt: epochwolf: But he’s saying he has an instance of working XML, so whatever his Excel thing is doing it’s working in one case. I think he needs to isloate why one XML file works and another does not.
[14:58:22] epochwolf: cpruitt: that's why I suggested a hex editor. Find the bits that are causing a problem.
[14:58:35] cpruitt: epochwolf: A hex editor to edit XML?
[14:58:52] epochwolf: cpruitt: Mostly to see where unicode is happening.
[14:58:53] cpruitt: Maybe I’m grossly misunderstanding something here.
[14:59:08] IFrank00: durexlw, epochwolf have a great day.
[14:59:17] workmad3: cpruitt: he's talking about getting a raw byte stream to see exact differences
[14:59:29] cpruitt: epochwolf: Yeah… ok, I guess I can see that.
[14:59:40] workmad3: rather than being stuck with files in two encodings that look the same when displayed by an editor
[14:59:45] alexhartley: has joined #RubyOnRails
[14:59:45] epochwolf: I'm being completely honest. I've had to debug annoying things at the byte level before.
[15:00:06] epochwolf: Usually some unicode whitespace character from Word.
[15:00:15] epochwolf: I hate people that copy and paste from Word.
[15:00:17] workmad3: I don't tend to drop down to byte level for text files... I start by double-checking the encodings :)
[15:00:34] workmad3: but I've also had to deal with less XML shit feeding into weird backends than epochwolf
[15:00:37] epochwolf: workmad3: xml files don't have an encoding when on disk. :P
[15:01:09] workmad3: epochwolf: oh yeah... remind me that XML sucks :P
[15:01:11] tetraktys: has joined #RubyOnRails
[15:01:13] cpruitt: epochwolf: I’ve had the same issues. I’ve never needed to look at the file as binary but it also took me a very long time to isolate the problem. Mental note for next time.
[15:01:23] epochwolf: ACTION has a passing familarity with putting things into places where they don't belong.
[15:02:08] epochwolf: s/things/xml/
[15:02:32] n1lo: has joined #RubyOnRails
[15:02:48] gruntruk: has joined #RubyOnRails
[15:02:51] workmad3: yeah... that makes it better :P
[15:03:50] lacrymology: has joined #RubyOnRails
[15:05:00] bricker1: has joined #RubyOnRails
[15:05:03] xhoy: tbuehlmann: with liquid it would be wise to use some kind of editor (wysiwyg) any suggestions?
[15:05:17] artto_: has joined #RubyOnRails
[15:05:43] stannard_: has joined #RubyOnRails
[15:05:51] bbrowning_: has joined #RubyOnRails
[15:07:03] xhoy: newsly seems to be "dead" and jekyll seems a bit 'big' ?
[15:07:06] cabargas: has joined #RubyOnRails
[15:07:51] queequeg2: has joined #RubyOnRails
[15:07:51] mosez: has joined #RubyOnRails
[15:08:03] Dfoolz: has joined #RubyOnRails
[15:08:56] davidcelis: has joined #RubyOnRails
[15:08:56] davidcelis: has joined #RubyOnRails
[15:08:58] gthank: has joined #RubyOnRails
[15:08:59] gthank: has joined #RubyOnRails
[15:09:33] embasbm: has joined #RubyOnRails
[15:10:10] Dbugger: Im back from my meeting
[15:10:12] durexlw: cpruitt: epochwolf I'm using hex editor to see the differences... only difference I can see is that in an xml that works, I get a "0D 0A 20 20" and in an xml that has a new line for each row, I see "0A 20 20"
[15:10:12] Dbugger: I survived
[15:10:31] defsdoor: has joined #RubyOnRails
[15:10:32] durexlw: *offers dbugger a safe blanket*
[15:10:35] maqr: has joined #RubyOnRails
[15:10:41] Dbugger: durexlw, i need it
[15:10:45] Dbugger: I have a new task
[15:10:49] durexlw: that bad of a meeting huh
[15:11:08] Dbugger: I have to build ouw OWN custom Continuous Integration software :P
[15:11:25] durexlw: tasks are bad... they always keep the "keep a look on all our cheerleaders" to themselves, do they
[15:11:40] treehug88: has joined #RubyOnRails
[15:11:44] durexlw: dbugger: I wouldn't even get the assignment... what it's about?
[15:11:52] Dbugger: I just said :)
[15:12:06] durexlw: see, you lost me... good thing you went into the meeting
[15:12:07] Dbugger: I have to re-invent GitLab
[15:12:29] nattyPablo: has joined #RubyOnRails
[15:12:31] durexlw: ow, jeses, next time don't bug us with the small things will ya :p
[15:12:32] rafaelfranca: has joined #RubyOnRails
[15:12:43] durexlw: sounds great man
[15:12:45] epochwolf: durexlw: the line endings are wrong. You want \r\n instead of \n.
[15:13:06] durexlw: epochwolf: yeah, now I just need to figure out how
[15:13:55] epochwolf: durexlw: you could use an after filter to replace all \n's with \r\n?
[15:13:57] workmad3: dbugger: why do you need to build your own? :/
[15:14:27] Dbugger: workmad3, because apparently "when you use software built for others, you end up adapting yourself to the software, instead of the software adapting itself to your needs"
[15:14:35] Dbugger: translated, "because reasons"
[15:14:42] workmad3: dbugger: sounds like a major case of NIH syndrome
[15:15:00] durexlw: if it pays the bill...
[15:15:02] Dbugger: But that is very popular in Germany
[15:15:12] Dbugger: It pays the bill... but Im not sure I can even do that :P
[15:15:14] durexlw: who knows: you might invent the next best thing
[15:15:14] workmad3: and there's nothing wrong with adapting to the software, if it's something you don't actually give a shit about :)
[15:15:24] cpruitt: durexlw: Sorry, was away. +1 for epochwolf’s comment on line endings.
[15:15:40] durexlw: cpruitt: you have an idea how to do that?
[15:15:55] epochwolf: durexlw: did you not see my comment on an afterfilter?
[15:16:03] durexlw: the data comes from a model, so a db, I just call "to_xml" on the model
[15:16:06] chubijs: has joined #RubyOnRails
[15:16:09] cpruitt: durexlw: ^
[15:16:09] Dbugger: After 30 minutes of convincing, and quite some eye rolling, I managed to give me one-shot to try GitLab, but with the way they looked, I can already tell they will not be happy with it
[15:16:14] Dbugger: in the end, im gonna have to do it
[15:16:19] Dbugger: Time to find a new job
[15:16:21] workmad3: dbugger: grab jenkins and 'rebrand' it so it looks like something you made? :)
[15:16:38] durexlw: epochwolf: I did... but it seems kinda clumsy to have to do that... I don't like patching stuff
[15:16:39] Dbugger: workmad3, hahahaha, you are genious :D
[15:16:47] epochwolf: durexlw: it's not a patch.
[15:17:00] epochwolf: durexlw: it is a hacky thing to do but if it works...
[15:17:20] durexlw: epochwolf: can you say something more about the after filer. I never used it... you have a resource where I can read up on it?
[15:17:21] epochwolf: You're just making a change to one action on one controller. Don't do it for all requests.
[15:17:37] voobscout: has joined #RubyOnRails
[15:17:39] cpruitt: durexlw: It’s not a “patch” it’s making your output compatible with another platform that’s expecting a certain line ending
[15:17:39] durexlw: yeah, i get ya
[15:18:10] durexlw: I'll definately look into it. Thanks for the help guys!
[15:18:41] workmad3: ublJf2x3pessvoaHGbWr1f5tWc/OTt/t0MO2sE8PiKlL4dYX4wen6dGePeKLwy7xZItbKbwSqWsrKRmoU4uye9d3taSUfBPutvjpbzI3oYU/wAv3clj2a7Z97QdFvvUrW8ab09HddURJDFScnFxglmrRUtJaSTlKUr+bemhuey21nhcRTqcL2mucH+L6ZryQiSYToC2nNSSad00mnzT0ZcdHMAAAAAAAAAAAAAAAAAAAAAAAANX2goOVPeWtN71lxjZqS9HfobQNARP25wHvKMa0bOVKybWd6beXRSfo2cfhXGTjfR/vhw/dyVsZglCVSjJXhZ2XOnO6S6ZroRXjsLKhWqUn8Msnwa1TXmrO3iUl0hZVqvvR3YxabT7qk01yc963NNWeazKVKjkot3u
[15:18:47] workmad3: u69W24q123m2+bz0KOu9bRu0k3a7dlZatpZLglojFKberb+v/wAK6lO128XRq24X05pryaM+x8HGtO1SbhBRbbUVK7Xw5vu8c7S8j04/BUI04+6lN1d+W9F5r3eistxO7te9klexbSu9PA6+bklGL52u9eb0KKWd+P8AnmVhh5cUl5u30Vy+GHS1d/Jfm/0LRjtPxnyczDTuyV/Zvtn31D3Mn36Wl9XTenp+HySOvlJLXIgbZ+0KmHk5UZShJprevnZ2uraZtLgMVtStV/mVZz85N/Q61w2+sV/ymKP0xMp4hUTzTTXg7lxCfZjbU8NWjJN7ja348JRbzy5+JNdOSaTWaauvJlbV8ZaeNya567j0uABVpAAAAAAAAAAAAAAAAAAAAAGm7R4fuKqlnT/
[15:18:48] cpruitt: durexlw: http://cornel.bopp-art.com/lightcase/
[15:18:53] workmad3: F4wevpk+jI57d7O3owrwV3HuzsrtrWDVuq6x5EqbVxCp0ak2rpReXO+VvqQ7tLGVJuzbstIq/2WpatPJn5HKrgj3720X8PN6q3nl9wsKuL6JefF/oZrlUr3SydnZ+Nsvqdow1jt5GT8plt+n0x2hHgl8zu/T/AAHicrJNry3YmCjFdePMzWOkViOmHJnyWn+6Zla5yfJfVlJpy/FJv98kZGstfzz/ACLS2nHcqU5tNRbunlnnblmy5llSN0XKW8k+j8wTP1dFku+zzanvsMoN96l3X8vw/TLoRAjpewe1fcYqF3aFTuS5Ztbr6P7s55a7hu/H5/6eWInqfSZAUuVMr6UAAAAAAAAAAAAAAAAAAAAAavtN/wANV8o/90SKdqULO/Bks9oVfDVvl/NEcY
[15:18:55] rubyonrailed: has joined #RubyOnRails
[15:19:00] workmad3: mlvRa9DrjnTzvyGPzrDk55ZFqkenGU7Z9DyGl87PeltXKV+Es+vxfXPqVuVqK8XzWa6cPQspVFrrdAn3G18dbc8n+RSDtdP9tCos/Cyt5Z/Uq0nZvS1n4taeoQpPX06p8/EspO0rcJffgXXvmWVI3JP4ZGrF0WU3t5KXr5lAiPScOye1P4nDU5t95dyfzRt900+puSLPZltb3dd0ZPKqsvnim16q/0JSRivXUvrOJm/q4ot/tUAFWkAAAAAAAAAAAAAAAAAAHi2zG9Csv7JfYjeDzJTnFNNPRqzIy2jhHRqzpv4Xl4x+F+hejLyo9RLS7Ww1nfgzQzjZ2Owr09+LRzONpZ+WpppbcPn+Vj8beUfXkjIxNWk1wea/T1MpbWjdX4xz6cf16FpZa96Xwnl
[15:19:03] cpruitt: durexlw: http://guides.rubyonrails.org/action_controller_overview.html#after-filters-and-around-filters
[15:19:06] workmad3: ZpNejXk0Fuu67yvzs1cxwlcuja6voEfwtiwy6emTu75frmWtkilF2bXCX3RezG4NtWy8eRmm1chMwyYPESpzjOOUotSXmndE8bJx0a9GnVjpOKlbk2s4vxTuuhAaRJXst2neFTDy+B78PlllJdHb/d4HHNHrb1fxebxvNJ+/wDXegoVM73wAAAAAAAAAAAAAAAAAADme2mz96May1hlP5Xo+j+7OmMdekpRlGSupJprmnkxCtqxaNSi+JrNrYbj6m6x+FdKpKm/heXivhfVfmeatDei0d6z9ePyMW4msuQqQsy2Lse3GUbM8djvt4s196YVSaeSy4eHgX7pfYrYLzG1m4VUS4EJ8YU3SqACVUbbsrtB0MVSnw3lGXyyyf69DUXLqEu8iLR6XxX8bxZ9
[15:19:06] jeanlinux: has joined #RubyOnRails
[15:19:12] workmad3: BIqansvjPe4alJvNLdl5xy+qs+ptjG+rrO42AAJAAAAAAAAAAAAAAAACjKgDmu2OAvGNZLOPdl8r0fR/c5HiSfWpKcZRkrqSaa8GRttDCulOVN6xevNaqXp+ZessnJp/lDTbWw/xepp6tE6etDei0aOpCzsd6S8Pk4tW3H1rWih7KtHkeScDoy6mFAgEQnaoCKMJUkykXmUbENSVY7St7N8TenUp8mpLrk/sdmRp7Oq9q6X9UJR+0v8Ax+pJZjtHt9TxbeWKAAFWgAAAAAAAAAAAAAAAAAAA5ntjgLxVZLONoz+VvJ9G/qdMY61JSjKMldSTTXgwi0eUaRfezNdjqObNxtHBulOUHweT5rg/Sx4ayujvWXj58fdZainyZe8NcV6edzJh6yOk/uxViOp
[15:19:13] adavia: has joined #RubyOnRails
[15:19:18] workmad3: eWpgeR5quEcVdm3xOMjBc29EaitWcndk125Za0r12xQiUaLrWLWWcYn0wsz4emnxMMkXU5WZErY5iJ9uw7KXp4ii+G8l65ErkM7Fxm7KEtd1p28ne30JioVlOMZRd1JJp+DMt+30nDmPDUMgAKNYAAAAAAAAAAAAAAAAAAAAA0XajZXvYb8V34LT+qPLzWbXm+ZwdTIlhnIdqth2vWprJ5zilpzmvDn6lqzpm5GLyjcduKxMDXSg87G3qQPPKlZHeJePkxtNVjnmXU0ZsTTzMUTr8YJjVlJowyR6WYZxIJhhkWl8kWkqxL14KrZkn9g9q70HRk8496Hy8V0efUiiDsb/YW0XSqQqLWLv5riuqyOOSr1eFn8Z0mYGLC141IRnHNSSa6mUzvdAAAAAAAA
[15:19:19] ddv: workmad3: can you please gist this :p
[15:19:20] xhoy: workmad3: i cant choose....
[15:19:23] Dbugger: please dont post pornography in this channel
[15:19:24] workmad3: AAAAAAAAAAAAAApYqAOJ7Tdnty9Wku5rKK+DxX9v2OZrQy6Ets4TtZsxUqilFWhO7S4KXxLw1v6l62Y+RgiYm0ONxNM8LXM2+IpmtqwNFZeFlrpYiyZfHgXTgl+L0LOXx5JREaLZdOugsT5ETOilfJVYWXgZqDcXmjF7963K0sSnxK7iWiMdqe9JO7AbV3oyot/h70PL4l659XyOvRDGxca6NSFSGsWnbmuK6q66kyUKilGMlpJJryeZwvGpe5xM3nTU9wyAAo1AAAAAAAAAAAAAAAAAAAAAAa7b2B99RlFfiXej8y4ddOpsSjCJjaJMRA1mIgdf2q2f7us2vwz7y8H8S9Xf8A1HK452NFJ28Pl4/CZeNzUFfV/Y1lavKTsld8EVxlb1f7sbHZNL3bh
[15:19:24] xhoy: !gist workmad3
[15:19:26] arup_r: what's going on ?
[15:19:29] durexlw: he keeps on going :)
[15:19:30] workmad3: HdbnOzu03k27KMdZaZK2Yvfx6c+NxJzT76eCey5pb1SVuS4+p4lOpvbtGEpy03YU51JvpFN8uB0m3Nr0aK3Jp1a0km4RacY62U5Jpylld2air2vUs0cxPbFebdqqprK8adk7L4W0rLV5RjFeGt+Mzae3tY+Njx9Q6jCdnsbJJSjGnKyvGc6UZdI7zlpwsmXLspWUpKpGUcrxlHdmr55NRe+l42siPsRiFOpuThKfDeqNz9N+7YeGnCpGVGr7hNK+5Jwbkm80otJ5WWvDxK+M/u6zWs9w73+FlSmoy6NaSV7XTJd7NtvC0L/ANC9OH0sQj2Y7RVsRV/gsZL3tR54Wta099Rcvdzdu8pRVrvNSWrJ6wVBU6cIL4YqPorFpncalxxYfC8zHUs4AKtAAAAA
[15:19:36] cpruitt: workmad3: ??
[15:19:36] xhoy: arup_r: accedents happen :>
[15:19:36] workmad3: AAAAAAAAAAAAAAAAAAADU9pcB76i7K8od6PRZrqiKNp6+hNpGHbXYzpVG0u5PONlks849Psy9J1LFzcXnXcfHJbCwarYqCl+Fd5+Nr5fS3U2PtD297iSpUIx/iZ093e40qMrKVs7LetbnlrbKVOysd3FRVl3k14rdU3Zed/+lHB18Y8Ri8XWk7uVR2+RNxjbw3YRWXJEWjdtuvF1GL0x4KjJQaqO8pNtu9200lm+LEKNOjd7yinzfL6sxKEKU7yqNuWiebz42WiMW26Epuluxbynor2zjq+rJdmxw9eM470W2s1ndfR8P0MUaFqm+pt8Gm9P7cjHs3DyjTcJZNt6PPNc1oxFKEvd0IuVSpJKFNXk7vS/OXH/AABuexmBliNsYSMFdUZxnNrgqfeefm0
[15:19:42] workmad3: vVH0qcF7KexD2fRlVrpPE1rb/AB93BXagnzu22+L8kd6ik+1gAAAAAAAAAAAAAAAAAAAAAAAAAADBi8LCrFwqRUovg/y5MzgDiMZ2KlCpGrh5K8ZKSjPK9n+G9tGrrqQr2y2FV2fiqlSMWqM5vcbSst/ve5n/AEyWduaimr8PqE82MwFOqrVIKWVunLxXgTuVYpEdPlT/APQoytvRaatm438dVwzPNjtpttKEnGOetk5Pw4ryPpSp7P8AZ0nd4eD/ANMP/U2ez+zeEo293Qpxa4qKv62HknT5v7N9ito4yV6NKcU/+bVcqcLeLa3ms+CZOfYT2e4fZy3/AObiGmpVpcE9YwjpFX46vizsoq2hUjtIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIA
[15:19:48] xhoy: he is pasting an image
[15:19:48] workmad3: AEgAAAAAAAAAAP/9k=
[15:19:49] workmad3: that's what I meant
[15:19:50] xhoy: in hex :>
[15:19:51] workmad3: oops, sorry
[15:19:53] workmad3: that was meant to be an image link... somehow managed to get a data-url of it instead
[15:19:55] durexlw: hope he didn't paste a 7 meg image :)
[15:19:56] workmad3: http://upload.wikimedia.org/wikipedia/commons/5/57/USB_to_PS2_mouse_adapter.jpg
[15:19:59] workmad3: xhoy: base64
[15:20:00] durexlw: we'd be here till sunset :)
[15:20:06] Dbugger: That was a beautiful image
[15:20:23] durexlw: worth all lines of jibberish :)
[15:21:00] jas02: has joined #RubyOnRails
[15:21:12] workmad3: heh :) yup... serves me right for not double-checking an image link
[15:21:36] reckoner: has joined #RubyOnRails
[15:21:42] arup_r: I thought your account is hacked
[15:21:55] flashpoint9: has joined #RubyOnRails
[15:22:12] reckoner: coffee wasn't good yesterday. i'll try and be less grumpy today.
[15:22:25] cpruitt: Sigh… I honestly can’t look at this codebase and not want to cry… (offtopic vent)
[15:22:41] durexlw: cpruitt: what you up to?
[15:22:45] workmad3: cpruitt: similar situation here :(
[15:22:47] durexlw: sup reckoner
[15:22:50] maxdoubt: has joined #RubyOnRails
[15:23:02] reckoner: sup durexlw
[15:23:14] VeryBewitching: has joined #RubyOnRails
[15:23:15] epochwolf: durexlw: after_action :force_windows_lineendings; def force_windows_lineendings; response.body = response.body.sub("\n", "\r\n"); end
[15:23:20] cpruitt: durexlw: Client work. Never wants to pay to do it right so I’m working on a project based on a fork of a fork of a fork of a vaguely related prior project from years back.
[15:23:24] nzst`: has joined #RubyOnRails
[15:23:28] chouhoulis: has joined #RubyOnRails
[15:24:02] kies^: has joined #RubyOnRails
[15:24:07] durexlw: epochwolf: thans a ton man :) never used the response.body before, so you save me a few hours looking I guess :)
[15:24:09] solars: hi, can anyone tell me what this means: LoadError: Unable to autoload constant ErpResponse, expected /home/solars/.workspace/cpc/lib/erp_response.rb to define it - the file contains class ErpResponse
[15:24:29] durexlw: solars: this definately means something is wrong... it's an error you're getting
[15:24:32] epochwolf: durexlw: If it doesn't work, it's something like that. Took me some time to dig for it.
[15:24:35] dopamean_: has joined #RubyOnRails
[15:24:45] Oliphaunte: has joined #RubyOnRails
[15:24:50] durexlw: epochwolf: sure, thanks anyway!
[15:25:00] workmad3: solars: probably means there's something else going wrong with loading that file, but it's being masked by the autoload error
[15:25:02] epochwolf: durexlw: also, it's gsub, not sub.
[15:25:10] solars: workmad3, hmmm
[15:25:18] epochwolf: durexlw: also... gsub(/\r?\n/, "\r\n")
[15:25:29] epochwolf: Just in case there's a \r\n in the data.
[15:25:41] solars: workmad3, how could I find out?
[15:25:45] workmad3: solars: happens at times with autoloading... the file fails to load because of some gunk at the start/end, but the original error is swallowed by autoload and replaced with something like the one you see
[15:25:50] workmad3: solars: try to load that file directly in irb
[15:25:52] reckoner: i'm looking at rules or workflow engines if anyone has any recommendations.
[15:25:53] workmad3: see what happens
[15:26:04] durexlw: epochwolf: will try now :)
[15:26:22] epochwolf: reckoner: What kind?
[15:26:26] RegulationD: has joined #RubyOnRails
[15:26:41] solars: workmad3, it hasn't changed for a while, so everything should be fine. loading in erb works
[15:26:44] epochwolf: reckoner: or rather, what are you looking to do.
[15:26:53] jfelchner_: has joined #RubyOnRails
[15:27:18] reckoner: epochwolf we are putting our users through a funnel basically
[15:27:29] reckoner: rules engines are one way of doing that. e.g. mailers etc
[15:27:30] workmad3: solars: hmm... not sure then
[15:27:48] epochwolf: reckoner: so, you are looking for a state machine?
[15:28:12] workmad3: solars: the only other time I'm aware of that sort of crap happening with autoload is when you're autoloading around threads (autoloading isn't threadsafe)
[15:28:14] reckoner: eopochwolf not exactly, although i'm reading now why state machines != rules engines
[15:28:57] solars: workmad3, I'm just trying to start the console, so that should not be the cause.. weird
[15:29:04] durexlw: I hate excel in this departement :) must be something else... still same, although file now contains correct line endings
[15:29:26] B1n4r10: has joined #RubyOnRails
[15:29:42] workmad3: reckoner: sounds like you want some form of classifier
[15:29:52] gruntruk: hi, was wondering if anyone has experience doing multi-domain cookies in rails. specifically i’m trying to limit cookies so that they are only set and visible to the requesting domain vs. all domains but doing it dynamically given the application serves multiple domains. it’s pretty much exactly as described in older Rails 2.x article here,
[15:29:55] gruntruk: hi, was wondering if anyone has experience doing multi-domain cookies in rails. specifically i’m trying to limit cookies so that they are only set and visible to the requesting domain vs. all domains but doing it dynamically given the application serves multiple domains. it’s pretty much exactly as described in older Rails 2.x article here,
[15:30:03] reckoner: workmad3 i'm not sure yet. that's a good suggestion though.
[15:30:05] gruntruk: hi, was wondering if anyone has experience doing multi-domain cookies in rails. specifically i’m trying to limit cookies so that they are only set and visible to the requesting domain vs. all domains but doing it dynamically given the application serves multiple domains. it’s pretty much exactly as described in older Rails 2.x article here,
[15:30:06] gruntruk: https://szeryf.wordpress.com/2008/01/21/cookie-handling-in-multi-domain-applications-in-ruby-on-rails/ …
[15:30:07] gruntruk: but before_dispatch has been deprecated in favor of ActionDispatch::Callbacks I believe… however, i’m not sure how i can use this hook to dynamically change the session store as it doesn’t appear to give me necessary context to access underlying request.
[15:30:44] aloneintheworld: has joined #RubyOnRails
[15:31:01] tubbo: gruntruk: please stop spamming
[15:31:09] vedu: Hello. I am getting an error while running tests for my models. full code: https://gist.github.com/vedant1811/f3c391f34936c1773794
[15:31:18] gruntruk: tubbo: sorry, wasn’t my intent.
[15:31:38] tubbo: gruntruk: there's a history at logs.ryanbigg.com...you don't need to re-post your question :)
[15:31:43] Oliphaunte: has joined #RubyOnRails
[15:31:53] tubbo: hehe oh i see what happened
[15:32:00] tubbo: IRC cut you off after a certain message char lenght
[15:32:29] EdwardIII: hrm this is odd. in a erb template, when i say "<%= @stay_detail.booking_response.arrival_date.to_formatted_s(:month) %>" i get the whole response. when i do it in rails console, i get what i expect, "February",
[15:32:41] gruntruk: yeah, sorry. i think it cut me off, but still posted. in colloquy it just didn’t do anything. if it double posted, sorry. i split message up and entered and then it went through. sorry if it duplicated.
[15:32:41] tubbo: gruntruk: so you basically want to configure rails so that cookies from any subdomain still work as if they were on your exact domain?
[15:32:47] tubbo: no worries
[15:32:56] tubbo: colloquy is classic for mangling your text :D
[15:32:57] voobscout: has joined #RubyOnRails
[15:33:04] tubbo: s/classic/notorious
[15:33:33] gruntruk: correct. users are on different subdomains and domains. so if i grant a cookie to a given user, i want it only valid in their domain and not that of others the site serves.
[15:33:56] gruntruk: so :all in cookie store initializer is casting too wide a net i fear
[15:34:05] kdough: has joined #RubyOnRails
[15:34:30] EdwardIII: https://gist.github.com/EdwardIII/66f22727ff648804e98b <- this should work for a Date object, right?
[15:35:14] workmad3: EdwardIII: that would define two new date formats so you could go `some_date.to_s(:day)`
[15:35:33] workmad3: (or .to_s(:month) )
[15:35:44] EdwardIII: workmad3: to_s says: "*** ArgumentError Exception: wrong number of arguments (given 1, expected 0)"
[15:35:58] EdwardIII: and the method to_formatted_s seems to be missing
[15:36:28] workmad3: EdwardIII: sounds like you're not in a rails environment
[15:36:30] laith: has joined #RubyOnRails
[15:36:30] EdwardIII: it's intialised like d = Date.parse(self['arrival_date'])
[15:36:39] EdwardIII: heh i definitely am though
[15:36:53] EdwardIII: this is from breaking into the debugger inside a model
[15:36:57] EdwardIII: the page itself renders fine
[15:37:00] EdwardIII: rails is definitely loaded
[15:37:17] workmad3: EdwardIII: works perfectly for me in a rails console
[15:37:35] EdwardIII: yeah works fine for me too
[15:37:46] workmad3: EdwardIII: gist up more code?
[15:39:38] centrx: has joined #RubyOnRails
[15:39:50] EdwardIII: check this out: https://gist.github.com/EdwardIII/f7054d60447bf09f309f
[15:39:53] rubyonrailed: has joined #RubyOnRails
[15:40:16] workmad3: EdwardIII: ok... and the code that has the error?
[15:40:23] gruntruk: tubbo: i can wire up the before dispatch callback, and access the Rails.application.config.session_options, but i don’t see a way of getting at the underlying request so that i can change the :domain option before dispatching to rails
[15:41:11] tetraktys: has joined #RubyOnRails
[15:41:49] EdwardIII: workmad3: https://gist.github.com/EdwardIII/f7054d60447bf09f309f
[15:41:52] ElFerna: has joined #RubyOnRails
[15:42:02] emachnic: has joined #RubyOnRails
[15:42:04] reckoner: for anyone interested. here is a cool article on workflow patterns: http://workflowpatterns.com/patterns/control/index.php
[15:42:44] workmad3: EdwardIII: still not seeing the place where the error is coming in...
[15:43:19] EdwardIII: workmad3: here: https://gist.github.com/EdwardIII/f7054d60447bf09f309f#file-o-rb-L13
[15:43:21] tubbo: gruntruk: yeah i'm not sure how you'd do that either.
[15:44:25] gruntruk: if i wire up one, there’s no arguments passed into the callback
[15:44:36] bronson: has joined #RubyOnRails
[15:44:37] gruntruk: ActionDispatch::Callbacks.before i mean
[15:44:52] mustmodify: has joined #RubyOnRails
[15:47:31] mustmodify: So I use some APIs. And they sometimes result in errors even though things are generally ok. For instance, this one JSON endpoint sometimes 500s. When it does, I get an HTML error instead of a JSON error, which throughs HTTParty for a loop... net result is a MultiJSON::ParseError. I feel like I can't just "ignore" this error because what if their API totally goes down? I would want to know about that.
[15:47:44] ianfleeton: has joined #RubyOnRails
[15:47:51] EdwardIII: ok, i've fixed it, but i am very, very confused as to how this fixes it: https://gist.github.com/EdwardIII/f7054d60447bf09f309f/revisions?diff=split
[15:48:53] EdwardIII: ok, i've changed it back, what the heck
[15:49:01] EdwardIII: this must be some weird bug
[15:49:21] dopamean_: has joined #RubyOnRails
[15:49:58] ferr: Is 460 queries a lot for a single page?
[15:50:26] tubbo: mustmodify: if their API totally goes down, you'll most likely get a generic socket error like "Errno::ECONNREFUSED Connection Refused to shittyapi.terriblecompany.biz"
[15:50:57] tubbo: so it will be a different exception and not be rescued by `rescue MultiJSON::ParseError`. i typically rescue that error and return a default response.
[15:51:10] EdwardIII: hehe that should be the endpoint for so many api providers i've worked with
[15:51:22] mag42c: has joined #RubyOnRails
[15:53:25] banister: has joined #RubyOnRails
[15:56:17] vedu: Hello. rake test seems to be stuck at `SQLite3::ConstraintException: NOT NULL constraint failed`. Apparently it is calling the incorrect table. full error and code: https://gist.github.com/vedant1811/f3c391f34936c1773794
[15:56:37] vedu: Same statements run fine in rails console
[15:58:46] tubbo: vedu: your fixtures are messed up, probably null data where there should actually be data
[15:58:52] durexlw: How can I display a file, in stead of having it download?
[15:59:13] durexlw: So I made an xml, I want to output it in the browser, not download it
[15:59:13] mustmodify: tubby: shittyapi.terriblecompany.biz ... LOL
[15:59:35] vedu: tubbo: oh yes! I removed the data. Didn't know before_filter won't be run there
[15:59:37] MEATCHICKEN: has joined #RubyOnRails
[16:00:09] MEATCHICKEN: Model.new(foo: bar.first) vs Model.create(foo: bar.first) where foo is a polymorphic belongs_to
[16:00:13] MEATCHICKEN: is this intended?
[16:01:54] seaworthy: has joined #RubyOnRails
[16:01:58] seaworthy: has joined #RubyOnRails
[16:03:03] cpruitt: durexlw: Is your content type text/xml or something else?
[16:03:19] rickmasta: has joined #RubyOnRails
[16:03:51] mustmodify: tubbo: That would be true if the endpoint *went down* but I guess I also mean if they caught a bug and just started 500'ing all the time, instead of once a day.
[16:04:20] durexlw: cpruitt: I'm using an xlsx gem, so I'm a bit on the dark about that
[16:04:41] durexlw: I guess it registered the mime type somewhere as application/xlsx
[16:04:51] EdwardIII: mustmodify: is the response something that can be cached? i.e. old data is better than no data?
[16:05:29] cpruitt: That’s not going to display in the browser
[16:05:56] durexlw: cpruitt: so the mimetype makes if something displays in the browser or not?
[16:05:57] kmckelvi1: has joined #RubyOnRails
[16:06:15] cpruitt: durexlw: It is one thing that has an impact on it.
[16:06:26] MEATCHICKEN: Nvm^ - it was because you can't reference the association directly in a uniqueness validation
[16:06:26] cpruitt: But why are you trying to display that in a browser window?
[16:06:32] MEATCHICKEN: +10 to reading stack traces
[16:07:16] EdwardIII: aren't all chickens meat chickens?
[16:07:24] cpruitt: durexlw: Something sounds a little off about that particular requirement. Might be best to explain what need you’re trying to meet vs what you’re actually trying to do.
[16:07:33] durexlw: cpruitt: remember: I want to connect to the api directly from excel. So i don't want a download. Given the xml doesn't work, I can use another format that does work. This xlsx format works, but it downloads
[16:07:37] EdwardIII: also how would i say "get the current page url, but replace the :locale bit of it with the string 'de'"?
[16:07:53] reckoner: has left #RubyOnRails: ()
[16:08:35] cpruitt: durexlw: Don’t confuse browser behavior with general network data transfer. Excel is not a browser. It won’t behave like a browser.
[16:08:46] EdwardIII: hrm the answer was right there sorry, disregard that
[16:09:22] durexlw: cpruitt: I was just thinking the same... trying in production to see how excel responds to this one
[16:09:37] Frem: has joined #RubyOnRails
[16:09:50] mdw: has joined #RubyOnRails
[16:09:59] cschneid_: has joined #RubyOnRails
[16:10:12] cpruitt: durexlw: For example, regardless of the content type, if I curl a URL it’ll output to stdout or a file I specify. Browsers are specific applications that are trying to do what a user expects them to do with specific file types. That’s browser behavior, not internet behavior.
[16:10:17] mustmodify: has left #RubyOnRails: ()
[16:10:40] durexlw: cpruitt: yeah, thanks for pointing that out, I have that confused for sure
[16:11:01] durexlw: cpruitt: one more: you know of a method that gives all the content of a model in row? Like "Contract.column_names" gives one row with all the column names. Is there a similar method that gives all values of the current row of a model?
[16:11:01] PlasmaStar: has joined #RubyOnRails
[16:11:23] sandstrom: has joined #RubyOnRails
[16:12:32] cpruitt: durexlw: Well, you want the attribute values for an instance right? Not the class?
[16:13:05] durexlw: yeah, so .atributes.values
[16:13:14] cpruitt: durexlw: so you want @some_contract.attributes which will return a hash. If you want jsut the values you can do @some_contract.attributes.values
[16:13:17] cpruitt: Yeah that.
[16:13:41] durexlw: Just thought there would have been a direct method. Thanks man :)
[16:14:49] durexlw: cpruitt: no shit... connecting to this file from within excel, even drops the download screen
[16:14:53] durexlw: gotta love MS
[16:17:01] celly: has joined #RubyOnRails
[16:17:03] cpruitt: durexlw: Just to clarify: AR::Base::column_names exists because you’re operating on the class, not an instance. There are no attributes to access without an instance. It’s just there so you can get column names without doing some arbitrary query to get at them. It’s part of AR::ModelSchema
[16:17:05] dextertzu: has joined #RubyOnRails
[16:17:29] cpruitt: AR::Base::column_values wouldn’t make sense
[16:18:06] EdwardIII: some of this stuff in rails is so nice, just the little stuff
[16:18:12] durexlw: cpruitt: to be honest I didn't wonder if it would be a class or instance method. But indeed, very true what you say
[16:18:34] EdwardIII: <%=t '.adults', count: 2 %> so good
[16:18:36] FernandoBasso: has joined #RubyOnRails
[16:21:04] disgrntld: has joined #RubyOnRails
[16:22:02] jeanre: has joined #RubyOnRails
[16:22:02] jeanre: has joined #RubyOnRails
[16:22:59] ianfleeton: has joined #RubyOnRails
[16:23:21] cpruitt: durexlw: Yeah, just explaining why the method you mentioned exists, but not the other.
[16:24:30] durexlw: cpruitt: I appreciate appreciated it
[16:24:51] cpruitt: Though there’s an AR::Base#attribute_names but not AR::Base#attribute_values so… go figure.
[16:26:14] ss_much: has joined #RubyOnRails
[16:27:18] baweaver: has joined #RubyOnRails
[16:27:23] durexlw: cpruitt: thanks for the help
[16:27:36] durexlw: epochwolf: thanks too man :)
[16:27:41] durexlw: gotta rrun. Laterz all!
[16:28:18] pawnbox: has joined #RubyOnRails
[16:29:16] bricker: has joined #RubyOnRails
[16:30:04] alphaatom: has joined #RubyOnRails
[16:31:21] alphaatom: has joined #RubyOnRails
[16:33:03] EdwardIII: ok, more weird stuff
[16:34:26] laith: has joined #RubyOnRails
[16:35:06] baweaver: has joined #RubyOnRails
[16:36:02] umdstu: how do i post to a different controller in a controller test. seems like i can only specific the action for `this` controller
[16:36:36] arup_r: what do you mean by different controller ?
[16:37:20] arup_r: you can test the POST to that controller only, no need to test it from other controller.
[16:37:59] umdstu: arup_r: its for a setup method. I need to login first before the tests will pass
[16:38:30] arup_r: Are you using devise ?
[16:38:43] umdstu: custom written thing
[16:39:21] umdstu: i just need to `post(:login)`. it works in the sessions_controller_test.rb (obviously), but I need to do that in the setup for each other controller
[16:39:30] chipotle: has joined #RubyOnRails
[16:40:12] umdstu: clearly `post()` is not going to do what i need
[16:42:36] benlieb: has joined #RubyOnRails
[16:43:45] MEATCHICKEN: Does anyone run devise with a JSON API?
[16:44:47] safetypin: has joined #RubyOnRails
[16:46:42] bronson: has joined #RubyOnRails
[16:47:02] slash_nick: meatchicken: !guruhunt
[16:47:02] helpa: meatchicken: Rather than guru hunting and asking if someone has used this or that, just ask your question with as much detail as possible. Even if someone hasn't used X Y or Z, there's a high chance someone can help, but only if they have details to work with.
[16:48:04] MEATCHICKEN: I'm getting issues with controller sessions interfering with token authentication
[16:48:13] MEATCHICKEN: I can turn off sessions but I also have a web component for my application
[16:48:46] NeoHamled: has joined #RubyOnRails
[16:48:49] MEATCHICKEN: The issue being - once the mobile client deletes the token auth - they are still considered signed-in because devise/controller sessions
[16:49:33] ElFerna: has joined #RubyOnRails
[16:49:36] slash_nick: meatchicken: sounds like you'll want to destroy the devise token when the token auth is gone...
[16:49:56] aloneintheworld: has joined #RubyOnRails
[16:50:03] Abhijit: has joined #RubyOnRails
[16:50:32] Abhijit: is there any gem / framework to : allow users to discuss on items and depending upon current discusson result set order of item
[16:50:53] [Butch]: has joined #RubyOnRails
[16:51:23] brycesenz: has joined #RubyOnRails
[16:51:37] moeabdol1: has joined #RubyOnRails
[16:51:45] EdwardIII: it seems kinda like locale is getting chosen randomly heh, i'm confused
[16:52:01] EdwardIII: i rebooted as i was seeing such weird, weird weird stuff happening
[16:52:04] jeanlinux: has joined #RubyOnRails
[16:52:17] chipotle: has joined #RubyOnRails
[16:53:04] voobscout: has joined #RubyOnRails
[16:53:06] EdwardIII: this is what my setup looks like now: https://gist.github.com/EdwardIII/abc5ad994c1f55ed5308
[16:53:17] korzybski: has joined #RubyOnRails
[16:53:30] ElFerna: has joined #RubyOnRails
[16:54:36] EdwardIII: i think my inheritence looks good: https://gist.github.com/EdwardIII/abc5ad994c1f55ed5308#file-inheritence_looks_good
[16:54:42] slash_nick: Abhijit: that's very niche. I think you'll have to build that yourself.
[16:55:04] mhoungbo: has joined #RubyOnRails
[16:55:18] Abhijit: slash_nick, ok. do you think any other framework will have this?
[16:55:25] rikkipitt: has joined #RubyOnRails
[16:55:26] EdwardIII: it's always loading my nl.yml, whichever env i try and specify. also I18n.available_locales only ever returns :en, even though it's loading nl.yml?
[16:55:57] rikkipitt: Given a JSON postgres db column, how to I edit the data via a simple_form?
[16:57:09] chipotle: has joined #RubyOnRails
[16:58:56] tubbo: Abhijit: i don't believe so
[17:00:02] zichul: has joined #RubyOnRails
[17:00:55] slash_nick: Abhijit: it's a cool idea, and I can see where it'd be useful in a variety of applications... i'm not saying no one's built it ever, i'm just saying i really doubt anyone's packaged and released a solution :)
[17:01:13] zichul: has joined #RubyOnRails
[17:01:27] moeabdol2: has joined #RubyOnRails
[17:01:44] fabiozzfps: has joined #RubyOnRails
[17:02:07] Abhijit: ok. thanks all.
[17:02:16] Abhijit: will make it myself.
[17:02:41] Abhijit: slash_nick, tubbo where can i start on "gemifying" my app?
[17:02:43] EdwardIII: is it something to do with calling available_locales before setting it?
[17:03:00] Abhijit: slash_nick, tubbo can i make it easy for everyone without making it a gem?
[17:03:26] tubbo: Abhijit: i don't understand the question
[17:03:36] umdstu: Abhijit: gems are super easy to create, dont let them scare you!
[17:03:53] B1n4r10: has joined #RubyOnRails
[17:04:01] rakm: has joined #RubyOnRails
[17:04:16] tubbo: frankly, a gem or lib that does something similar to what you want probably _does_ exist, but using 3rd-party libraries isn't always the right solution for your actual problem
[17:04:16] Abhijit: tubbo, i was just thinking if instead of converting it into a gem, if i keep it as simple rails app will that be easy for everyone to use it in their app?
[17:04:25] Abhijit: umdstu, great.
[17:04:27] tubbo: Abhijit: how would i use a rails app in another rails app?
[17:04:42] Abhijit: ok so i will make it a gem.
[17:04:44] DoctorMonocular: has joined #RubyOnRails
[17:05:03] tubbo: Abhijit: you kind-of have to if you want people to be able to download it and incorporate it into their own projects.
[17:05:03] moeabdol3: has joined #RubyOnRails
[17:05:05] tubbo: Abhijit: !engines
[17:05:05] helpa: Abhijit: http://guides.rubyonrails.org/engines.html - Engines Guide - Written by Ryan Bigg
[17:05:15] Abhijit: sure. will do.
[17:05:20] TwinkleHood: has joined #RubyOnRails
[17:05:24] tubbo: that's how you would in theory create mountable components that can be incorporated into a rails app easily
[17:05:35] tubbo: be careful, gemifying everything can cause major problems
[17:05:49] josephkokenge: has joined #RubyOnRails
[17:06:25] Abhijit: i will report here once i make something basic.
[17:06:31] umdstu: tubbo: I need to call the Sessions#create method that my SessionsControllerTest uses to login in, say, my AccountsControllerTest < ...::TestCase. how would you do that?
[17:07:04] htmldrum: has joined #RubyOnRails
[17:07:24] tubbo: umdstu: in a test? you can just set the session directly.
[17:07:32] umdstu: tubbo: yes
[17:07:39] tubbo: `post :create, { param: 'value' }, { user_id: user.id }`
[17:07:44] tubbo: that second hash is the session params
[17:08:07] ppinkerton: has joined #RubyOnRails
[17:08:22] braincrash: has joined #RubyOnRails
[17:08:35] umdstu: right on. think i get it thanks
[17:10:11] slash_nick: Abhijit: GLHF :D
[17:11:49] umdstu: tubbo: thanks, i didn't realize there was a second hash param
[17:12:54] Abhijit: slash_nick, thanks.
[17:16:03] DEA7TH: has joined #RubyOnRails
[17:16:33] bobbobbins: has joined #RubyOnRails
[17:18:32] mhoungbo: has joined #RubyOnRails
[17:20:55] gambl0re: has joined #RubyOnRails
[17:20:55] gambl0re: has joined #RubyOnRails
[17:21:14] dopamean_: has joined #RubyOnRails
[17:22:26] maxx88: has joined #RubyOnRails
[17:22:50] arup_r: has joined #RubyOnRails
[17:23:00] chipotle: has joined #RubyOnRails
[17:24:11] cnk: has joined #RubyOnRails
[17:24:32] arup_r: I'm using mini test right now for my tests and a simple lib that converts the test results into markdown for API documentation. I want to make the documentation a little better like swagger or something that is formatted better. Do you know of anything?
[17:25:43] i: has joined #RubyOnRails
[17:26:02] Oliphaunte: has joined #RubyOnRails
[17:26:40] dionysus69: has joined #RubyOnRails
[17:27:09] dopamean1: has joined #RubyOnRails
[17:28:29] bobbobbins: Hi, I have to interact with an xml api...is there a gem or something that makes that easy? I saw rails-api, but it seems like that is if you are actually creating an api, I just need to get info from one every once in a while as part of my application.
[17:28:35] bronson: has joined #RubyOnRails
[17:28:44] DEA7TH: has joined #RubyOnRails
[17:29:04] ppinkerton: has joined #RubyOnRails
[17:29:24] centrx: bobbobbins, Probably use Nokogiri (XML parser/accesser)with an HTTP client like Faraday
[17:29:53] slash_nick: Anyone have any bits of code they'd share that'd answer this question: http://stackoverflow.com/questions/32177955/accepts-nested-attributes-for-destroy-all-not-included-in-array
[17:30:06] allcentury: has joined #RubyOnRails
[17:30:16] bobbobbins: centrx: thanks, I'll give that a go, I was checking out faraday, just wanted to make sure that was the way to go
[17:30:41] baweaver: has joined #RubyOnRails
[17:31:11] yardenbar: has joined #RubyOnRails
[17:31:27] centrx: bobbobbins, There are several options at https://www.ruby-toolbox.com/categories/http_clients but I chose Faraday recently for working with an API (JSON)
[17:31:46] cnk: bobbobbins: Faraday or possibly HTTPparty - it was good in its day but not sure if it is still the way to go
[17:31:54] cajone: has joined #RubyOnRails
[17:33:30] nickenchuggets: has joined #RubyOnRails
[17:33:30] nickenchuggets: has joined #RubyOnRails
[17:35:39] lidenbrock: has joined #RubyOnRails
[17:35:43] ppinkerton: has joined #RubyOnRails
[17:35:47] slash_nick: i know ya do... c'mon, gist what ya got :)
[17:37:31] centrx: def fibonacci( n )
[17:37:31] centrx: [ n ] if ( 0..1 ).include? n
[17:37:31] centrx: ( fibonacci( n - 1 ) + fibonacci( n - 2 ) ) if n > 1
[17:38:22] malcolmva: has joined #RubyOnRails
[17:38:29] tubbo: slash_nick: here's my entry http://pastebin.com/UsHQv7N1
[17:38:56] tubbo: dude for only $2.95 i can access pastebin
[17:39:06] tubbo: pastebin's* "special features"
[17:39:07] sudoubuntu: has joined #RubyOnRails
[17:39:32] jasmo2: has joined #RubyOnRails
[17:39:34] sled: has joined #RubyOnRails
[17:39:50] slash_nick: haha internets
[17:40:08] Scripore: has joined #RubyOnRails
[17:40:15] Pumukel: has joined #RubyOnRails
[17:40:38] DoctorMonocular: has joined #RubyOnRails
[17:41:37] arup_r: hey folks, once get time read my question plzz. :)
[17:42:04] jmignault: has joined #RubyOnRails
[17:42:12] umdstu: tubbo: it seems that the second param is setting "rack.session" in the @request instance variable, but "action_dispatch.request.path_parameters" and "action_dispatch.request.parameters" remain unchanged
[17:43:08] ppinkerton: has joined #RubyOnRails
[17:43:37] tubbo: umdstu: i think request.path_parameters is the params gleaned from the URL (e.g. /products/:id turning into params[:id]), and request.parameters are the query params like /products/1?foo=bar
[17:44:30] theunraveler: has joined #RubyOnRails
[17:44:47] benlieb: has joined #RubyOnRails
[17:44:59] umdstu: tubbo: i agree. so the post(:create, {}, {controller: "xy", action: "create"}) still posts to the controller/action of the testcontroller
[17:45:06] umdstu: instead of the xy controller
[17:45:21] tubbo: umdstu: yeah duh
[17:45:24] DEA7TH: how can I get where.not to *not* exclude nil? this is stupid default behavior anyway
[17:45:30] tubbo: umdstu: you can't tell post(:create) to just run another controller method
[17:45:43] tubbo: umdstu: what are you tryign to do here?
[17:45:44] umdstu: tubbo: well that's what i was asking you initially! haha
[17:45:47] DEA7TH: Booking.where.not(delivery_trip_item_id: 1).count - this exludes all bookings where delivery_trip_item_id = nil
[17:46:00] theunraveler: has joined #RubyOnRails
[17:46:14] Maletor: has joined #RubyOnRails
[17:46:31] umdstu: sessions_controller#create sets up the user and creates the JWT
[17:47:10] umdstu: so for most of any controllers tests to pass I need to login first, get the token, so i can include that in the tests request params
[17:47:15] theunraveler: has joined #RubyOnRails
[17:47:16] Oliphaunte: has joined #RubyOnRails
[17:47:27] pydave6377: has joined #RubyOnRails
[17:47:28] tubbo: umdstu: oh yeah you misunderstood what i was trying to tell you.
[17:47:57] tubbo: umdstu: post :create, { param: 'foobar' }, { user_id: user.id } will force the session[:user_id] to be the value of user.id
[17:48:20] umdstu: yea that makes more sense
[17:48:33] tubbo: umdstu: if your auth code is basically doing User.find(session[:user_id]) in order to figure out whether a user is currently logged in (which i hope it isn't haha), then you'll just be logged in
[17:48:37] tubbo: you don't need to make an extra "request"
[17:48:58] umdstu: it's a bit more complicated than that i'm afraid
[17:49:09] umdstu: for the sake of secure internet bits everywhere
[17:49:56] chipotle: has joined #RubyOnRails
[17:50:27] umdstu: it's a combination of PKI, session info, JWTs and some membached stuff
[17:51:30] rakm: has joined #RubyOnRails
[17:51:59] safety_cut: has joined #RubyOnRails
[17:52:18] lemur: has joined #RubyOnRails
[17:52:42] Oliphaunte: has joined #RubyOnRails
[17:52:50] Guest34101: has joined #RubyOnRails
[17:52:50] aloneintheworld: has joined #RubyOnRails
[17:53:02] tubbo: umdstu: then perhaps the problem here is really that SessionsController#create does _way_ too much. at some point, you're storing data into the session. at some point, your controller reads that session and uses it to determine whether a user is logged in, right?
[17:53:37] tubbo: umdstu: for really complex auth procedures, sometimes people will make that its own service object.
[17:56:07] safety_cut: has joined #RubyOnRails
[17:56:43] AlvilsK: has joined #RubyOnRails
[17:58:01] Oliphaunte: has joined #RubyOnRails
[17:58:55] hahuang65: has joined #RubyOnRails
[17:59:00] aegis3121: has joined #RubyOnRails
[18:01:37] polishdub_: has joined #RubyOnRails
[18:01:49] mikecmpbll: has joined #RubyOnRails
[18:04:05] sleungcy: has joined #RubyOnRails
[18:05:56] srinidhi: has joined #RubyOnRails
[18:06:32] hahuang65: has joined #RubyOnRails
[18:07:27] rubyonrails563: has joined #RubyOnRails
[18:08:33] arup_r: DEA7TH: why you want to include those `nil` when you said the id equal to 1 as a filter ?
[18:09:15] chouhoulis: has joined #RubyOnRails
[18:10:08] DEA7TH: arup_r: in practice I'm filtering by multiple ids. But I want to include the nils.
[18:10:38] DEA7TH: I can either do where(.._id: present_ids), or where.not(.._id: absent_ids)
[18:10:41] DEA7TH: but I solved it!
[18:10:49] arup_r: DEA7TH: then include nil in the filter Booking.where.not(delivery_trip_item_id: [ 1, nil ]).count
[18:10:55] DEA7TH: where(.._id: present_ids + [nil])
[18:11:08] DEA7TH: uhh that would exclude the nil
[18:11:25] arup_r: nah, it will include
[18:11:51] differentreality: has joined #RubyOnRails
[18:11:52] DEA7TH: I tried it and it excludes
[18:12:04] DEA7TH: so I still don't have a solution if the ids need to be excluded
[18:13:41] DEA7TH: yeah that might be the only solution if I have to do that
[18:16:38] Pazician: has joined #RubyOnRails
[18:17:51] kirillzh: has joined #RubyOnRails
[18:17:54] goodcodeguy: has joined #RubyOnRails
[18:18:28] ElFerna: has joined #RubyOnRails
[18:21:05] yellow5: has joined #RubyOnRails
[18:21:08] PedramT: has joined #RubyOnRails
[18:24:35] yardenbar: has joined #RubyOnRails
[18:25:21] mhoungbo: has joined #RubyOnRails
[18:26:24] B1n4r10: has joined #RubyOnRails
[18:28:32] yellow5: has joined #RubyOnRails
[18:33:19] cabargas: has joined #RubyOnRails
[18:34:13] goodcodeguy: has joined #RubyOnRails
[18:34:45] IFrank00: has joined #RubyOnRails
[18:34:50] smathy: has joined #RubyOnRails
[18:35:04] chipotle: has joined #RubyOnRails
[18:37:48] nfk|laptop: has joined #RubyOnRails
[18:39:02] barce: has joined #RubyOnRails
[18:39:03] jschoolcraft: has joined #RubyOnRails
[18:39:22] banister: has joined #RubyOnRails
[18:39:28] ur5us: has joined #RubyOnRails
[18:39:33] barce: what's a good job board for freelance rails jobs?
[18:39:44] umdstu: tubbo: something to think about, thanks.
[18:40:02] umdstu: barce: i'm partial to walnut, it has a nice grain
[18:40:11] umdstu: oh job board
[18:40:15] barce: umdstu: haha, pine myself
[18:40:45] _djbkd: has joined #RubyOnRails
[18:40:49] barce: mmm walnut speakers
[18:40:56] Maletor: Is this a Rails bug? `self.serialized_column.delete(:key_attribute); self.save` where after safe `:key_attribute` is still present.
[18:41:03] jasmo2: has joined #RubyOnRails
[18:41:27] aweis: has joined #RubyOnRails
[18:43:23] umdstu: walnut everything!
[18:43:47] PedramT: has joined #RubyOnRails
[18:43:49] workmad3: maletor: `delete` and other in-place modifications of serialised data types don't trigger dirty tracking in ActiveRecord
[18:44:03] Maletor: This must be new with Rails 4.2?
[18:44:13] rikkipitt: has joined #RubyOnRails
[18:44:22] workmad3: afaik, that's been the case for pretty much the entire existence of serialized columns
[18:44:43] umdstu: tubbo: so, mulled it over.... sorry for the confusion. i wasn't implying that my 'create' does all those things I listed, just that the app does those things; that its more robust than that lookup by id
[18:44:43] Maletor: workmad3, well it worked with Rails 4.1 so it's either a regression or a "bug" that's been "fixed".
[18:44:46] workmad3: it's also the case for things like json, hstore and array pg columns with AR 4+
[18:44:58] tubbo: umdstu: ok
[18:45:00] error_A496: has joined #RubyOnRails
[18:46:12] brycesenz: has joined #RubyOnRails
[18:46:29] workmad3: maletor: hmm, weird... I've never encountered that 'working' in any version of rails
[18:47:12] Maletor: hmm, what's the best ruby idiom to replace self.attribute.delete(:foo) so that it's self.attribute = ...
[18:48:03] smathy: barce, freelancers tend to find their own gigs.
[18:48:07] arup_r: maletor: slice! may be
[18:48:20] workmad3: maletor: you could put `attribute_will_change!` just before the `delete` to manually invoke AR's dirty tracking
[18:48:29] error_A496: whats with my rails console hanging on a User.new(), then hanging waiting for input, and any input such as "asdasd" or enter button press gets inputted into some function and causes rails console to segfault?
[18:48:31] workmad3: arup_r: any in-place change will ignore dirty tracking (which is the issue)
[18:48:39] Technodrome: has joined #RubyOnRails
[18:48:49] eljimmy: has joined #RubyOnRails
[18:49:02] barce: smathy: *nod*
[18:50:04] Maletor: workmad3: except in 4.1 ! :)
[18:50:29] workmad3: maletor: I never experienced it working in 4.1... and if it did, I suspect it was a bug to do with `save` ignoring dirty tracking :P
[18:51:00] Maletor: is it even worth it to produce a bug template with 4.1 showing the issue?
[18:51:21] ziyadb: has joined #RubyOnRails
[18:51:42] intrigueD: has joined #RubyOnRails
[18:52:04] error_A496: irb(main):001:0> m = Member.new() => #<Member id: nil, user_id: nil, created_at: nil, updated_at: nil> ENTER PRESSED NameError: undefined local variable or method `asdasd' for main:Object
[18:52:24] maxdoubt: has joined #RubyOnRails
[18:52:28] barce: has joined #RubyOnRails
[18:52:29] kmckelvi1: has joined #RubyOnRails
[18:52:37] umdstu: tubbo: There's actually a service for the token generator, and a service for handling authorization and authentication, the session#create just sets it up and calls it. all
[18:53:06] lemur: has joined #RubyOnRails
[18:53:14] umdstu: i guess i dont need to call that end point in the test, i'll just need to rewrite it all as a test helper
[18:53:22] umdstu: just seems wasteful!
[18:53:33] emachnic: has joined #RubyOnRails
[18:55:31] mdw: has joined #RubyOnRails
[18:57:10] brycesenz: Hi all - I have design question that's come up a lot recently. Say a User has_many Dogs, and I want a page that displays a users dogs (/users/1/dogs) and a page that displays all dogs (/dogs). The routing is easy, but do you keep conditional logic just in the DogsController to see whether or not it's scoped to a particular User? Or is there a cleaner pattern that I'm missing?
[18:57:14] workmad3: maletor: so just trying with rails 4.1, and yup... a serialized column there appears to ignore dirty tracking and saves every single time
[18:57:45] workmad3: maletor: meaning it would always generate and send the entire query even if nothing in the serialized column (potentially quite large) had changed
[18:57:50] sled: has joined #RubyOnRails
[18:57:53] arup_r: error_A496: in any of your code file, you have that asdasd by mistake
[18:58:07] arup_r: search your codebase .. with that word?
[18:58:17] workmad3: maletor: so yes, it 'worked' in rails 4.1, but because of a different issue that would be quite problematic in a lot of circumstances :)
[18:58:21] arup_r: you will get to know where you put it ?
[18:58:39] error_A496: arup_r no, that "asdasd" is a result of me typing something then pressing enter in the rails console. i could type anything and it would output whatever I did
[18:58:58] Maletor: so i should do self.my_serialized_col.delete(:whatever); self.my_serialized_col_will_change! ?
[18:59:12] Maletor: or self.my_serialized_col = my_seriailzed_col - :whatever
[19:00:12] workmad3: maletor: If you're inside the model, I'd probably do `my_serialized_col_will_change!; my_serialized_col.delete(:whatever)`
[19:00:42] polishdub_: has joined #RubyOnRails
[19:01:57] Maletor: that's awesome. thanks so much for your help. i guess i'm not 100% confident that i know why that works. is it because marking that column as dirty will send the value in mem to AR no matter what?
[19:02:03] barce: @brycesenz: i'd keep the conditional logic or scoping in the model, the dog model
[19:02:31] replay: has joined #RubyOnRails
[19:02:52] stannard: has joined #RubyOnRails
[19:03:23] celly: has joined #RubyOnRails
[19:03:37] arup_r: then why are you worried so much ?
[19:04:34] brycesenz: barce - can you elaborate? I don't see what would go in the model that would clean up this situation. I feel like fundamentally, don't I still need some conditional logic to say if the controller is responding to a scoped request?
[19:04:58] workmad3: maletor: yup, that's exactly it
[19:05:19] workmad3: maletor: AR only sends an update to the db if there are some dirty values, and it only sends dirty values
[19:05:21] celly: anybody here use(d) the ratyrate gem for implementing ratings to their app?
[19:05:32] Maletor: course. makes sense. danke
[19:05:38] workmad3: maletor: and by marking it as dirty before you change it, you also preserve the original value in the `changes` hash
[19:05:49] workmad3: in case you need it elsewhere afterwards :)
[19:05:50] celly: For some reason, the actual ratings aren't showing up on my end. Developer console doesn't show any errors (except for the missing user profile)
[19:06:24] celly: It shows the image of the big star (IMDB style) but not showing the actual ratings or a way to select a rating
[19:07:07] error_A496: arup_r is that to me?
[19:07:23] Sceko: has joined #RubyOnRails
[19:07:23] Sceko: has joined #RubyOnRails
[19:07:26] error_A496: arup_r because i can't create users in my console, as it just segfaults out
[19:07:56] polishdub: has joined #RubyOnRails
[19:09:36] barce: brycesenz: making a gist
[19:11:35] error_A496: arup_r =/ im not really sure whats causing the issue. Ive re installed rails from scratch, and made sure its not the model itself (tested with base model). it does not like the new method
[19:12:25] arup_r: what is the rails version ?
[19:12:52] error_A496: it was on 4.2.5, same issue, but i thought it have been some bug so I flipped back to 4.2.4
[19:13:23] arup_r: I am on 4.2.5. didn't see the issue ever
[19:13:27] arup_r: ruby version ?
[19:14:19] arup_r: hm.. so only ruby and rails without any other gem is throwing the error ?
[19:14:30] baweaver: has joined #RubyOnRails
[19:14:51] arup_r: I mean fresh ruby/rails just the vanilla thing,, throwing the error? or you have other gems too ?
[19:14:56] epochwolf: seg faults are usually a ruby problem.
[19:15:06] ianfleeton: has joined #RubyOnRails
[19:15:34] aegis3121: has joined #RubyOnRails
[19:15:40] workmad3: epochwolf: or an issue with native gem extensions...
[19:15:40] flashpoint9: has joined #RubyOnRails
[19:16:15] arup_r: workmad3: used wrong nick.. seems so.. :)
[19:16:33] workmad3: error_A496: run `gem pristine --all` to eliminate something like a native gem extension that's compiled against a library that's since been updated
[19:16:54] workmad3: arup_r: no, I was aiming that one at epochwolf because it wasn't of any real use to the OP :)
[19:17:00] arup_r: yeah got you
[19:17:25] error_A496: arup_r yep, happens with a clean rails application with a simple model (rails g model user)
[19:17:48] voobscout: has joined #RubyOnRails
[19:18:06] barce: brycesenz: does something like this work for you: @user.dogs ?
[19:18:20] tubbo: error_A496: have you reinstalled ruby yet though?
[19:18:29] tubbo: that's what you probably need to do
[19:18:41] bronson: has joined #RubyOnRails
[19:18:46] error_A496: tubbo trying that now
[19:18:47] tubbo: at least that's the first thing i'd try, then `gem pristine --all` to rebuild native extensions
[19:18:47] workmad3: `gem pristine --all` is a precursor to reinstalling ruby ;)
[19:19:07] error_A496: workmad3 no success on that, trying ruby rebuild
[19:19:11] workmad3: fair enough
[19:19:18] workmad3: I'm off for food now, hope you figure it out :)
[19:19:34] tubbo: workmad3: the way i see it is, gem pristine --all needs to happen anyway after you rebuild ruby ¯\_(ツ)_/¯
[19:19:35] aloneintheworld: has joined #RubyOnRails
[19:19:40] brycesenz: barce - yeah, but that only works if you're accessing things through the scoped user path, right? Which is my question - you have to have *some* logic that says whether you're returning all dogs, or just the user's dogs, and is there a cleaner place than just keeping that conditional in the controller?
[19:20:34] Seich: has joined #RubyOnRails
[19:20:53] rikkipitt: has joined #RubyOnRails
[19:22:19] barce: yeah, I'd use something like this, but it's not really necessary with the AR relations: https://gist.github.com/barce/6df9b1f4c14cde3c2623
[19:22:28] barce: brycesenz: ^1
[19:23:57] Technodrome: has joined #RubyOnRails
[19:25:02] brycesenz: barce - that doesn't really address the actual issue I'm discussing.
[19:25:56] brycesenz: barce - I don't have issues finding which dogs are owned by a User. To your point, the relations take care of that. It's more an issue of where, as a design pattern, do you separate out condition logic for scoped controllers and scoped views.
[19:26:45] siaW: has joined #RubyOnRails
[19:28:13] Oliphaunte: has joined #RubyOnRails
[19:28:28] siaW: hello how do I use Faraday to submit and access_token to get access to an API. i tried this: https://gist.github.com/siaw23/274b1b47d8a413c2138a
[19:29:25] barce: brycesenz: and the condition in this case is all dogs or dogs by user, right? hmmm... Would the code look DRY if you didn't separate out the condition logic?
[19:30:32] brycesenz: barce - I think we're speaking past each other. Don't worry about it; I think just in talking about this, I'm confident that the solution I have is pretty ideal.
[19:30:51] tubbo: siaw: depends on the API, they should have documentation about obtainining an access token.
[19:31:03] manfrin: has joined #RubyOnRails
[19:32:17] siaW: tubbo: i know how to get the access token. i got it already. but i’m not sure how to use it. the API usage example looks like this: https://developers.positionly.com/#usage-example but I don’t know if to use Faraday.post for that
[19:33:18] tubbo: siaw: since the `curl` example seems to indicate that there's no "-X POST" option needed, i believe that's a GET request. so Faraday.get is what you want
[19:33:19] voobscout: has joined #RubyOnRails
[19:33:38] tubbo: siaw: but you also need to pass the access token in an 'Authorization:' header, which i can't remember how to do with Faraday right now
[19:33:48] tubbo: but you definitely can do it
[19:34:05] siaW: tubbo: so the default method to curl is GET?
[19:35:11] tubbo: siaw: yes
[19:35:27] kdough: has joined #RubyOnRails
[19:36:29] humbledaisy: has joined #RubyOnRails
[19:36:52] siaW: tubbo: thanks let me try that
[19:39:13] mdw: has joined #RubyOnRails
[19:40:21] bobbobbins: has joined #RubyOnRails
[19:40:35] IrishGringo: has joined #RubyOnRails
[19:41:25] treehug88: has joined #RubyOnRails
[19:44:46] safety_cut: has joined #RubyOnRails
[19:45:55] trosborn: has joined #RubyOnRails
[19:46:13] fox_mulder_cp: has joined #RubyOnRails
[19:47:11] kirillzh: has joined #RubyOnRails
[19:48:37] Guest34101: has joined #RubyOnRails
[19:52:47] B1n4r10: has joined #RubyOnRails
[19:52:51] Oliphaunte: has joined #RubyOnRails
[19:52:54] ianfleeton: has joined #RubyOnRails
[19:53:54] alexhartley: has joined #RubyOnRails
[19:57:39] jgpawletko: has joined #RubyOnRails
[20:02:44] ppinkert_: has joined #RubyOnRails
[20:02:52] trosborn: has joined #RubyOnRails
[20:04:24] allcentury: has joined #RubyOnRails
[20:06:38] blackmesa: has joined #RubyOnRails
[20:06:49] nfk|laptop: has joined #RubyOnRails
[20:10:45] borodin: has joined #RubyOnRails
[20:11:36] _3dwardsharp: has joined #RubyOnRails
[20:11:42] ferr: has joined #RubyOnRails
[20:12:13] ferr: Hey, could anyone tell me why the 3 column is empty on this? https://gist.github.com/Fercell/54e2b1958cb82459d1b7 http://i.share.pho.to/81a5084d_o.png
[20:12:28] ferr: All tags are closed
[20:12:39] Oliphaunte: has joined #RubyOnRails
[20:13:29] mdw: has joined #RubyOnRails
[20:13:37] slash_nick: ferr: well, what are the values for `order.uniq_id` in <td><%= order.uniq_id %></td>
[20:14:13] ferr: It's 6 symbols id
[20:14:24] mdw: has joined #RubyOnRails
[20:14:26] ferr: You may see it at next column
[20:14:51] ferr: That 6 symbols ID should be displayed at 3rd column
[20:15:07] slash_nick: ah, i see... and your last column doesn't have a header
[20:15:19] nogic: has joined #RubyOnRails
[20:15:30] slash_nick: ferr: yuno close your tag?
[20:15:35] sankaber: has joined #RubyOnRails
[20:15:41] helpa: ლ(ಠ_ಠლ)
[20:15:45] slash_nick: https://gist.github.com/Fercell/54e2b1958cb82459d1b7#file-admin_show-html-erb-L23
[20:15:51] SteenJobs: has joined #RubyOnRails
[20:16:08] ferr: Ur best, thanks
[20:16:18] slash_nick: ferr: no problem... :)
[20:17:52] jscheel: has joined #RubyOnRails
[20:22:55] aegis3121: has joined #RubyOnRails
[20:24:02] sankaber: has joined #RubyOnRails
[20:24:16] Pazician: has joined #RubyOnRails
[20:24:28] openstruct: has joined #RubyOnRails
[20:24:52] Radar: GOOD MORNING.
[20:25:22] jasmo2: has joined #RubyOnRails
[20:26:29] brycesenz: has joined #RubyOnRails
[20:27:18] adac: has joined #RubyOnRails
[20:27:21] error_A496: tubbo workmad3 arup_r updates: reinstalled ruby environment through rvm rather than rbenv, and the stupid seg faults are gone!
[20:27:50] tubbo: error_A496: interesting. usually the opposite is true ;)
[20:27:51] error_A496: however, now I need to figure out why my before hook isn't called =]
[20:28:28] ElFerna: has joined #RubyOnRails
[20:28:36] Coldblackice: has joined #RubyOnRails
[20:28:51] arup_r: Good night. My night shift is over.
[20:29:49] bronson: has joined #RubyOnRails
[20:29:54] jottr: has joined #RubyOnRails
[20:30:26] benlieb: has joined #RubyOnRails
[20:30:33] diegoviola: has joined #RubyOnRails
[20:30:59] error_A496: so say i have a validation on an variable for uniqueness, and I have a before_create to generate the value of that variable, I'm guessing before_create is the wrong hook?
[20:31:03] yardenbar: has joined #RubyOnRails
[20:33:49] smathy: error_A496, before_validation
[20:34:36] smathy: error_A496, http://guides.rubyonrails.org/active_record_callbacks.html#creating-an-object documents the callback sequence.
[20:34:42] helpa: good morning IRCers, I hope that this day finds you hale and hearty
[20:34:42] error_A496: smathy thought so, must be an error in the tutorial
[20:35:37] Monkey_: has joined #RubyOnRails
[20:37:06] ferr: I store my pdfs at assets/pdfs/*.pdf, how do I make a link to download it?
[20:37:29] arup_r: wrong place, i think
[20:37:44] arup_r: they must exist in public/ dir
[20:38:20] slash_nick: error_A496: what tutorial?
[20:38:41] ppinkerton: has joined #RubyOnRails
[20:39:10] sandstrom: has joined #RubyOnRails
[20:39:14] NeoHamled: has joined #RubyOnRails
[20:39:31] error_A496: slash_nick http://apionrails.icalialabs.com/
[20:41:34] srinidhi: has joined #RubyOnRails
[20:42:18] baweaver: has joined #RubyOnRails
[20:42:43] slash_nick: ah, thanks error_A496 ... just checking to be sure it's not a mistake in some official guide
[20:43:32] error_A496: slash_nick no problem. i think since its older its a little out of date with somethings
[20:43:45] marr: has joined #RubyOnRails
[20:45:07] brycesenz: has joined #RubyOnRails
[20:45:12] emachnic: has joined #RubyOnRails
[20:47:49] ferr: arup_r: thanks, that works fine, but I cannot show these files in public, user must be authenticated to download that
[20:48:05] SteenJobs: has joined #RubyOnRails
[20:49:49] Jasaka: has joined #RubyOnRails
[20:50:36] celly: has joined #RubyOnRails
[20:50:58] baweaver: has joined #RubyOnRails
[20:53:41] bphogan: Silly question…. when you do render: json @project, what is the method that gets invoked? Is it .as_json? I need to override it so it returns additional data. I saw there are gems I can add, but this should be possible within Rails itself, right? (can’t use jbuilder for this as the other library I’m using also delegates to the model for the serialization.
[20:53:49] lemur: has joined #RubyOnRails
[20:53:54] pawnbox: has joined #RubyOnRails
[20:54:02] Radar: bphogan: I think it's .to_json
[20:54:42] stannard: has joined #RubyOnRails
[20:55:34] smathy: ferr, put something like this in your `config/initializers/assets.rb`: ActionView::Helpers::AssetUrlHelper::ASSET_PUBLIC_DIRECTORIES[:pdf] = "/pdfs"
[20:56:08] Radar: I would strongly encourage you to not put them in /assets.
[20:56:25] Radar: put them in /pdfs at the root, and then you can serve them with a controller using send_file
[20:56:33] ferr: That's what I'll do
[20:56:36] ferr: but thanks smathy
[20:56:59] intrigueD: has joined #RubyOnRails
[20:56:59] intrigueD: has joined #RubyOnRails
[20:57:42] Radar: controller can also determine if the user can/can't access it
[20:57:51] tubbo: ACTION is not a big fan of using the sprockets asset pipeline for anything that doesn't require compilation and/or minification.
[20:58:25] bphogan: I’m not convinced more than 10% of the Rails developers in the world understand how the pipeline even works.
[20:58:47] bphogan: There is so much conflicting and contradictory stuff out there on how to solve problems with it :D
[20:59:01] tubbo: first of all, it makes deploys a lot faster...and second of all, it's just what sprockets is meant for.
[20:59:09] Radar: bphogan: 3 people have known entirely how it works. One is dead, one doesn't speak about it and one has completely forgotten everything.
[20:59:10] tubbo: you don't really need sprockets for static content like images, pdfs, etc.
[20:59:32] arup_r: Radar: :)
[20:59:37] tubbo: bphogan: i've made sprockets plugins and am working on an ES6 module loader that will automatically turn your JS into ES6 modules
[20:59:37] bphogan: tubbo: I was thinking about that - if you put those folders back in public/ does Rails still route tings there?
[20:59:41] tubbo: so there's 4 people.
[20:59:59] tubbo: bphogan: yep. that's in fact how pre-sprockets rails worked, you'd just put your JS/CSS in public/javascripts and public/stylesheets
[21:00:10] bphogan: tubbo: oh I’ve been using Rails for 10 years. :)
[21:00:18] bphogan: tubbo: I just took a break to do some Elixir for a while
[21:00:28] arup_r: Why the one doesn't speak, evenif knows the concept behind it ?
[21:01:01] bphogan: tubbo: my first rails app was pre Migrations, and still has a dispatch.cgi file in the public folder :/
[21:01:10] aloneintheworld: has joined #RubyOnRails
[21:01:11] Radar: arup_r: !g post traumatic stress disorder
[21:01:35] arup_r: oh. I didn't think that direction.
[21:01:41] Radar: tubbo: yeah, bphogan is an Ancient
[21:01:46] sdwrage: has joined #RubyOnRails
[21:01:55] bphogan: Radar: how ya doin, buddy?
[21:02:00] Radar: bphogan: good thanks :D
[21:02:06] Sheperson: has joined #RubyOnRails
[21:02:25] tubbo: it's funny how all the old rails heads hate JS
[21:02:34] bphogan: tubbo: Wat?
[21:03:47] bphogan: tubbo: I’m not sure that’s true - I think Rails itself goes out of its way to keep you from doing JS. I’m tripping over turbolinks right now trying to get some react stuff to work. Fighting the framework a lot :(
[21:05:11] slash_nick: that's one rails feature i've never had any luck with
[21:05:37] Radar: die turbolinks die
[21:06:16] jenrzzz: has joined #RubyOnRails
[21:06:23] Cohedrin: has joined #RubyOnRails
[21:06:40] emachnic: has joined #RubyOnRails
[21:07:42] blackmes1: has joined #RubyOnRails
[21:09:13] Axilla: has joined #RubyOnRails
[21:09:37] Axilla: afternoon, i have an issue where i have a modal and call it from two different controller views with a link_to remote: true
[21:09:58] Axilla: on one view(files controller) works just fine(path is files/:id/share
[21:10:07] Axilla: but on the controller view using the same partial same link
[21:10:18] Axilla: it submits the remote: true link_to as a html format
[21:10:26] Axilla: any ideas why it would do that?
[21:10:50] Axilla: collections view* not controller view.
[21:10:51] cajone: has joined #RubyOnRails
[21:11:57] Axilla: Filter chain halted as :ensure_xhr rendered or redirected
[21:12:05] Radar: axilla: !rule0
[21:12:05] helpa: axilla: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[21:12:07] Radar: axilla: !enternotspace
[21:12:07] helpa: axilla: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[21:12:27] Radar: small reproducible example please
[21:13:49] Oliphaunte: has joined #RubyOnRails
[21:18:13] yardenbar: has joined #RubyOnRails
[21:20:18] kirillzh: has joined #RubyOnRails
[21:21:23] kirillzh: has joined #RubyOnRails
[21:24:05] pawnbox: has joined #RubyOnRails
[21:27:05] adac: has joined #RubyOnRails
[21:27:25] doublemalt_: has joined #RubyOnRails
[21:35:49] IFrank00: has joined #RubyOnRails
[21:36:34] cabargas: has joined #RubyOnRails
[21:37:09] rickmasta: has joined #RubyOnRails
[21:37:44] htmldrum: has joined #RubyOnRails
[21:37:58] rickmasta: has joined #RubyOnRails
[21:40:03] arBmind: has joined #RubyOnRails
[21:40:24] _djbkd: has joined #RubyOnRails
[21:41:39] bronson: has joined #RubyOnRails
[21:42:35] kirillzh: has joined #RubyOnRails
[21:43:01] safety_cut: has joined #RubyOnRails
[21:43:02] diegoviola: has joined #RubyOnRails
[21:44:16] pawnbox: has joined #RubyOnRails
[21:44:21] logorrhea: has joined #RubyOnRails
[21:46:37] pvertenten: has joined #RubyOnRails
[21:49:31] Guest34101: has joined #RubyOnRails
[21:49:56] logorrhea: question about providing authentication -- it seems like Devise offers a LOT of stuff, but I don't really want/need most of it...should I still use Devise for authentication or should I create my own?
[21:51:51] tubbo: logorrhea: there are other gems for providing auth if you don't need everything devise provides.
[21:52:11] tubbo: logorrhea: but it's just as easy to use devise and ignore all of the view-level features just to get its nice mailer features
[21:52:30] tubbo: confirmations, forgot password, etc. are all useful...but you might not need it
[21:53:00] tubbo: ActiveModel::SecurePassword lets you use just the encrypted password functionality with bcrypt since it's built-in to rails
[21:53:57] logorrhea: yeah I was looking at the has_secure_password
[21:55:17] logorrhea: ok, well I'll take a look at what other options there are and see if there's some features I just can't live without :) thank you!
[21:56:34] sudoubuntu: has joined #RubyOnRails
[21:56:40] jasmo2: has joined #RubyOnRails
[21:56:41] stannard: has joined #RubyOnRails
[21:58:10] ramortegui_: has joined #RubyOnRails
[22:00:25] Radar: logorrhea: I would recommend Devise and then just taking out the parts you don't need.
[22:00:27] Oliphaunte: has joined #RubyOnRails
[22:00:33] Radar: Like you can remove the confirmable module easy enough
[22:00:37] jeanlinux: has joined #RubyOnRails
[22:00:44] hugoangelo: has joined #RubyOnRails
[22:01:03] hahuang65: has joined #RubyOnRails
[22:01:33] stannard: has joined #RubyOnRails
[22:04:12] mdw: has joined #RubyOnRails
[22:04:17] mhoungbo: has joined #RubyOnRails
[22:04:36] logorrhea: Radar, ok yeah I'll play around with that. after more reading it does seem like there are a lot of nice-to-haves that I probably would not have though of/bothered with
[22:05:05] syngularity: has joined #RubyOnRails
[22:05:14] logorrhea: like tracking
[22:05:46] Palsson: has joined #RubyOnRails
[22:05:50] RahulT: has joined #RubyOnRails
[22:06:07] stannard: has joined #RubyOnRails
[22:06:26] Guest64616: has left #RubyOnRails: ()
[22:06:45] syngularity: I have a migration for postgres, that later on I delete. But it errs with "no foreign key on column". I can see the column in postgres. What am I doing wrong?
[22:07:24] baweaver: has joined #RubyOnRails
[22:09:36] Radar: logorrhea: like safe password resettings
[22:09:39] baweaver: has joined #RubyOnRails
[22:09:40] Radar: resetting*
[22:10:02] Radar: syngularity: show us the full error please
[22:10:58] Cohedrin: has joined #RubyOnRails
[22:11:08] syngularity: @Radar: http://pastebin.com/5vnrenwH
[22:11:17] Radar: thanks helpa :)
[22:11:24] syngularity: ah, next time I will use Pastie, sorry
[22:11:28] Radar: syngularity: I can't access pastebin.com on my machine. Please use either Gist or pastie.
[22:11:32] trosborn: has joined #RubyOnRails
[22:11:38] Radar: syngularity: I can't access it because I've on-purpose blocked it in my /etc/hosts.
[22:12:02] syngularity: @Radar: http://pastie.org/10734882
[22:12:56] Radar: syngularity: thanks. If you're removing that column with remove_references you don't need to remove the foreign key. You can remove that second line.
[22:13:16] ekinmur: has joined #RubyOnRails
[22:14:00] ekinmur: has joined #RubyOnRails
[22:14:10] syngularity: @Radar: thank you, that did it. I knew it was something simple :)
[22:14:56] ppinkert_: has joined #RubyOnRails
[22:15:56] josephkokenge: has joined #RubyOnRails
[22:15:57] jtong: has joined #RubyOnRails
[22:16:00] Seich: has joined #RubyOnRails
[22:16:08] TwinkleHood: has joined #RubyOnRails
[22:16:40] defsdoor: There's a convention that i18n translation keys are looked for with html suffixes for translations that contain html - unfortunately the built in rails submit tag skips this and goes directly to i18n.translate (as opposed to using the Helper method that does the suffix search) - Should this be raised as a bug do you think ?
[22:18:37] trinaldi: has joined #RubyOnRails
[22:19:30] greghoggard: has joined #RubyOnRails
[22:20:20] Oliphaunte: has joined #RubyOnRails
[22:20:31] barce: hmmm... time to switch to an es6 chat room. running into issues there. ttyl.
[22:20:36] barce: has left #RubyOnRails: ()
[22:21:18] pwnd_nsfw: Because having multiple channels open is so overrated
[22:21:49] adaedra: ¯\_(ツ)_/¯
[22:21:59] quazimodo: has joined #RubyOnRails
[22:22:19] Technodrome: has joined #RubyOnRails
[22:24:21] sudoubuntu: has joined #RubyOnRails
[22:24:47] Pazician: has joined #RubyOnRails
[22:25:23] rikkipitt: has joined #RubyOnRails
[22:25:25] jgpawletko: has joined #RubyOnRails
[22:25:39] netzfisch: has joined #RubyOnRails
[22:26:05] jottr: has joined #RubyOnRails
[22:29:22] uris: has joined #RubyOnRails
[22:30:38] Scripore: has joined #RubyOnRails
[22:31:20] greghoggard: I'm having with my shoulda-matchers. I am not able to test associations with a has_many :through joiner. If anyone could help me that would be great. Heres the code https://gist.github.com/greghoggard/3f8cb4e30a7ecbca087f. I am using rails 3.2.13 and ruby 2.0.0-p247
[22:31:52] yfeldblum: has joined #RubyOnRails
[22:33:22] bmalum: has joined #RubyOnRails
[22:33:27] dmcc: Does anyone know why an embedded google map on a rails view wouldn't display at all on iOS devices?
[22:33:38] dmcc: It displays fine on desktops.
[22:33:50] pawnbox: has joined #RubyOnRails
[22:33:52] lacrymology: has joined #RubyOnRails
[22:34:40] ewnd9: has joined #RubyOnRails
[22:34:45] cnk: greghoggard: My glance at the docs makes me think you don't use the 'through' in the test
[22:34:46] cnk: http://www.rubydoc.info/github/thoughtbot/shoulda-matchers/Shoulda/Matchers/ActiveRecord#have_many-instance_method
[22:35:17] cnk: it {should have_many (:parents)} and it {should have_many (:dog_parents)} should both be true
[22:36:01] greghoggard: thank you so much cnk
[22:36:46] greghoggard: im revising my code to see if that works
[22:36:55] cnk: hope so. I love shoulda
[22:37:18] pwnd_nsfw: cnk, if you scroll down a bit (or find "through"), you do
[22:38:47] mdw: has joined #RubyOnRails
[22:41:59] ss_much: has joined #RubyOnRails
[22:43:30] camilasan: has joined #RubyOnRails
[22:49:08] Maletor: is there a way to politely nudge an issue? it seems like it'd be fairly easy to backport this commit to 4-2-stable https://github.com/rails/rails/commit/19b168e611fb8fb547981c4535130c29856efd3a
[22:52:38] Pumukel: has joined #RubyOnRails
[22:54:38] baweaver: has joined #RubyOnRails
[22:54:51] evenix: has joined #RubyOnRails
[22:55:13] crst: has joined #RubyOnRails
[22:55:20] evenix: someone can explain me why rendering locals is always so freaking annoying sometimes? Sometimes it works sometimes it doesn't
[22:55:31] stannard: has joined #RubyOnRails
[22:55:38] Arcaire: DAMN IT TOMAW
[22:55:39] evenix: <%= render :partial => 'info', :locals => {f: f} %>
[22:55:43] kirillzh: has joined #RubyOnRails
[22:55:52] evenix: even the documentation says that
[22:56:01] evenix: but I've always experieced issue with it
[22:56:10] evenix: can someone explain
[22:56:34] matthewd: evenix: Not until you describe the issue you're having
[22:56:56] crst: Hello, is there an easy way to install all previous gems to the new version of ruby?
[22:57:05] evenix: matthewd: `undefined local variable f` when i load the page
[22:57:07] workmad3: has joined #RubyOnRails
[22:57:32] matthewd: On what line? A line inside the partial, or that render call itself?