« Back to channel list

#RubyOnRails - 25 May 2016

« Back 1 day Forward 1 day »
[00:03:37] djbkd: has joined #RubyOnRails
[00:05:30] sypheren: has joined #RubyOnRails
[00:06:13] moeabdol: has joined #RubyOnRails
[00:07:44] nk121: has joined #RubyOnRails
[00:09:14] stannard: has joined #RubyOnRails
[00:09:56] jancel: has joined #RubyOnRails
[00:16:39] User458764: has joined #RubyOnRails
[00:17:22] arBmind: has joined #RubyOnRails
[00:24:09] Radar: Synthead: ^
[00:25:06] ksmutthu: has joined #RubyOnRails
[00:26:31] yfeldblum: has joined #RubyOnRails
[00:29:39] SteenJobs: sql chat is dead - can i ask a quick sql question? (i’m helping a friend out with something and learning as i go, because you know, ActiveRecord)
[00:29:49] triptec: has joined #RubyOnRails
[00:30:31] Radar: Sure why not.
[00:31:46] SteenJobs: if i have table A, B, and C (c belongs to b and b belongs to a) and i need to select columns from table A based on the values of a column in C, i know how to do it with multiple inner joins, but what if i need to do it with a subquery?
[00:32:02] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[00:32:46] SteenJobs: Radar: ugh. lemme check the data he’s given
[00:33:02] SteenJobs: ok so there’s a Customer table, an Invoice table, and an Invoice_Item table
[00:33:12] SteenJobs: invoice_item has a column “item”
[00:33:15] lalalaaa: has joined #RubyOnRails
[00:33:34] SteenJobs: i need to select Customer’s first_name and last_name for customers that have an order containing an invoice_item with item == “dress shirt"
[00:35:29] SteenJobs: Radar: basically i know how to do it with inner joins, but one of the questions explicity requires subqueries
[00:35:51] Radar: Where do orders come from?
[00:36:17] qsun__: has joined #RubyOnRails
[00:36:51] Radar: customer -> orders -> invoices -> invoice_items -> items (where -> is a has_many?)
[00:37:18] SteenJobs: it’s prepopulated data, this isn’t a rails app, but customer -> invoice -> invoice_item (has column “item”)
[00:37:30] SteenJobs: so in AR terms, customer has_many invoices, and invoices has_many invoice_items
[00:37:34] Radar: You said "order" and it got me confused.
[00:37:47] SteenJobs: not that kind of order
[00:38:43] Radar: SELECT first_name, last_name FROM customers INNER JOIN invoices ON invoices.customer_id = customers.id INNER JOIN invoice_items ON invoice_items.invoice_id = invoices.id WHERE invoice_items.item = 'dress shirt'
[00:39:15] SteenJobs: Radar: so that was my answer for the one requiring inner joins, but one question requires subqueries explicitly
[00:39:25] SteenJobs: so instead of inner joins, i need to use subqueries of (select…etc.)
[00:39:26] lalalaaa: has joined #RubyOnRails
[00:39:36] SteenJobs: so FROM (SELECT …)
[00:39:56] Radar: SteenJobs: May I suggest asking in #mysql or #postgresql?
[00:39:57] matthewd: has joined #RubyOnRails
[00:39:57] ChanServ: +o matthewd
[00:40:03] SteenJobs: ah good idea
[00:40:12] Radar: I'd need to tinker around with it a bit. They'd know quicker than I would.
[00:40:44] SteenJobs: awesome. yea i’ve been spoiled by AR for so long that doing SQL down and dirty is pretty new
[00:44:36] lalalaaa: has joined #RubyOnRails
[00:44:43] roamingdog: has joined #RubyOnRails
[00:46:07] DoctorMonocular: has joined #RubyOnRails
[00:48:45] ChanServ: -o matthewd
[00:49:35] thejamespinto: has joined #RubyOnRails
[00:49:46] lalalaaa: has joined #RubyOnRails
[00:52:52] hfp_work: has joined #RubyOnRails
[00:53:22] hfp: has joined #RubyOnRails
[00:54:45] lalalaaa: has joined #RubyOnRails
[00:55:26] SteenJobs: Radar: well that went over well - they’re saying to tell the professor that his question is just wrong
[00:57:16] paradisaeidae_: has joined #RubyOnRails
[00:58:01] dangeranger: has joined #RubyOnRails
[00:59:13] matthewd: SteenJobs: select (select first_name from customers where id = invoices.customer_id), (select last_name from customers where id = invoices.customer_id) from invoices where exists (select * from invoice_items where invoice_id = invoices.id and item = 'dress shirt')
[00:59:41] SteenJobs: Radar: bec you should really be using inner joins
[00:59:47] SteenJobs: matthewd: thanks!! will try it now
[00:59:56] lalalaaa: has joined #RubyOnRails
[01:00:12] mikecmpbll: or you could double nest subqueries :x
[01:01:13] mikecmpbll: select firstname, surname from customers where id in (select customer_id from invoices where id in (select invoice_id from invoice_items where item = "dress shirt")) :Dddddd
[01:01:21] mikecmpbll: or i could go to bed. nn \o
[01:01:40] SteenJobs: waaait mikecmpbll that’s what i think they’re looking for
[01:01:43] SteenJobs: double nesting subqueries
[01:01:45] chouhoulis: has joined #RubyOnRails
[01:02:19] mikecmpbll: ACTION shrugs
[01:02:54] matthewd: Ah, yeah: "customers that have an order" --> one row per so-qualified customer, sounds more likely
[01:03:14] SteenJobs: thanks so much to both of you, mikecmpbll and matthewd. should be able to get it working from this, if not i’ll be back. thanks!
[01:03:24] SteenJobs: this chat is so many leagues ahead of every other chat ha
[01:05:43] Radar: it's because we're nice
[01:06:08] lalalaaa: has joined #RubyOnRails
[01:07:17] SteenJobs: and don’t respond with “tell the professor his question is stupid"
[01:07:24] SteenJobs: which is terribly unhelpful
[01:09:34] Alazoral: has joined #RubyOnRails
[01:11:06] lalalaaa: has joined #RubyOnRails
[01:12:59] jstransky: has joined #RubyOnRails
[01:14:30] Radar: Sometimes we do.
[01:14:37] Radar: But mostly we're nice.
[01:15:12] sneakersec: has joined #RubyOnRails
[01:16:07] lalalaaa: has joined #RubyOnRails
[01:21:08] lalalaaa: has joined #RubyOnRails
[01:22:19] chopin: has joined #RubyOnRails
[01:22:54] JoshGlzBrk: has joined #RubyOnRails
[01:25:24] SteenJobs: Radar: you were patient with me when i first started programming, and that’s saying quite a bit ;)
[01:25:39] crystal77: has joined #RubyOnRails
[01:26:01] Ropeney: has joined #RubyOnRails
[01:26:08] lalalaaa: has joined #RubyOnRails
[01:28:17] dangeranger: has joined #RubyOnRails
[01:28:27] paradisaeidae: has joined #RubyOnRails
[01:28:48] qsun_: has joined #RubyOnRails
[01:29:11] maxdoubt: has joined #RubyOnRails
[01:31:07] lalalaaa: has joined #RubyOnRails
[01:32:56] norc-2: has joined #RubyOnRails
[01:35:08] gfvcastro: has joined #RubyOnRails
[01:36:08] lalalaaa: has joined #RubyOnRails
[01:36:37] maxdoubt: has joined #RubyOnRails
[01:37:54] sevenseacat: has joined #RubyOnRails
[01:39:25] kies: has joined #RubyOnRails
[01:40:15] DoctorMonocular: has joined #RubyOnRails
[01:41:08] lalalaaa: has joined #RubyOnRails
[01:42:41] B1n4r10: has joined #RubyOnRails
[01:43:01] paradisaeidae_: has joined #RubyOnRails
[01:43:38] smathy: has joined #RubyOnRails
[01:44:35] maxdoubt: has joined #RubyOnRails
[01:45:34] der-landgraf: nothing I am doing seems to be influencing the outcome that redis wants to connect to 127.0.0.1:6379
[01:45:35] Dios: has joined #RubyOnRails
[01:47:07] maxdoubt: has joined #RubyOnRails
[01:47:13] Ropeney: have you tried --port ?
[01:47:38] Ropeney: or the port in the redis.conf ?
[01:48:40] qsun: has joined #RubyOnRails
[01:48:43] Radar: der-landgraf: From where?
[01:49:12] Ropeney: well yeah, I guess you could mean IP too
[01:49:25] xibalba: has joined #RubyOnRails
[01:49:43] der-landgraf: hmm in the rails project
[01:49:58] der-landgraf: I am grepping for 6379 and nothing shows
[01:50:06] Radar: der-landgraf: "in the rails project" isn't useful for us.
[01:50:08] havenwood: der-landgraf: OS/distro?
[01:50:13] Radar: Can you please be more specific? What errors are you seeing?
[01:50:40] der-landgraf: well I am trying to deploy to heroku
[01:51:10] Ropeney: ACTION walks away
[01:51:32] havenwood: der-landgraf: So you're talking a Heroku addon here? You've tried it? What's the problem?
[01:52:02] hnanon: has joined #RubyOnRails
[01:52:15] hnanon: I have User.where(vendor_id: nil)
[01:52:31] hnanon: How can I check if vendor_id is blank, not just nil?
[01:52:36] der-landgraf: remote: Redis::CannotConnectError: Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)
[01:52:38] der-landgraf: remote: /tmp/build_3a69e784b314cddaae24d8ff389370cc/vendor/bundle/ruby/2.2.0/gems/redis-3.3.0/lib/redis/client.rb:345:in `rescue in establish_connection'
[01:52:39] xibalba: Can ActiveRecord make use of MS SQL Stored Procs?
[01:52:51] Radar: der-landgraf: !gist a longer stacktrace than that please
[01:52:51] helpa: der-landgraf: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[01:52:53] hnanon: I have User.where(vendor_id.blank?)
[01:52:58] sevenseacat: hnanon: (where: vendor_id: [nil, ""])
[01:53:02] hnanon: I tried User.where(vendor_id: nil)
[01:53:21] xibalba: sevenseacat , thank you this morning for helping me compile the list of learning resources for the wife. much appreciated.
[01:53:30] hnanon: sevenseacat: I see. So I have to check for both cases explicitly.
[01:54:00] sevenseacat: xibalba: no problem :)
[01:54:20] moeabdol: has joined #RubyOnRails
[01:54:49] der-landgraf: https://gist.github.com/sylvanmist/95d3aad7f33f580df24e35b35142a55c
[01:54:51] hnanon: sevenseacat: I don't need this, but out of curiosity, what if I also wanted " " (with a space)?
[01:55:01] sevenseacat: then you add it to the where clause
[01:55:04] hnanon: .empty? returns true for " "
[01:55:05] bronson: has joined #RubyOnRails
[01:55:22] hnanon: I mean .blank?
[01:56:19] Radar: Why can `vendor_id` be in a blank state anyway?
[01:56:45] Radar: if it's `*_id` I'd expect it to be a number
[01:56:48] Radar: Is it not a number?
[01:57:06] hnanon: Radar: It's a number. But only some users will belong to a vendor.
[01:57:07] indianowl: has joined #RubyOnRails
[01:57:20] datanois1: has joined #RubyOnRails
[01:57:51] sevenseacat: numbers cant be blank
[01:58:00] Radar: hnanon: What type is this field in your schema? Is it an :integer or is it a :string?
[01:58:02] sevenseacat: "" is not a number
[01:58:34] hnanon: Ah, so a blank string won't get saved.
[01:58:58] hnanon: So, I guess there's no reason to check for anything other than nil.
[02:00:35] hnanon: Thanks you two.
[02:00:39] arBmind: has joined #RubyOnRails
[02:00:57] DoctorMonocular: has joined #RubyOnRails
[02:01:17] qsun_: has joined #RubyOnRails
[02:01:47] havenwood: der-landgraf: The Heroku stack default doesn't include Redis. Are you using a Heroku addon for Redis?
[02:02:12] joskei: has joined #RubyOnRails
[02:09:50] one_zero: has joined #RubyOnRails
[02:09:53] barhum2013: has joined #RubyOnRails
[02:12:22] Coldblackice: has joined #RubyOnRails
[02:12:34] chipotle: has joined #RubyOnRails
[02:12:37] Technodrome: has joined #RubyOnRails
[02:13:12] jancel: has joined #RubyOnRails
[02:13:21] tubbo: der-landgraf: the redis url is configured with the environment variable $REDIS_URL.
[02:13:39] tubbo: that's usually how i do it
[02:14:11] smathy: Did you read https://devcenter.heroku.com/articles/heroku-redis der-landgraf ?
[02:16:57] arBmind: has joined #RubyOnRails
[02:19:31] Dios: has joined #RubyOnRails
[02:23:46] robbyoconnor: has joined #RubyOnRails
[02:23:53] robbyoconnor: has joined #RubyOnRails
[02:26:07] yfeldblum: has joined #RubyOnRails
[02:27:07] yfeldblum: has joined #RubyOnRails
[02:28:03] indianowl: hi rails friend
[02:28:12] indianowl: I am facing issue
[02:28:26] indianowl: with my Problem controller
[02:28:35] indianowl: which has show action
[02:28:37] indianowl: https://gist.github.com/abuzarhamza/17dc93503402871dc14ea42b3dfcd9bc
[02:29:15] indianowl: each time I am displaying the show function
[02:29:40] indianowl: it running the "update sql"
[02:29:59] indianowl: with problem_id as null
[02:30:41] indianowl: def show @problem = Problem.find(params[:id]); @problem.build_question
[02:31:04] indianowl: is this right way to fetch the value for nested forms
[02:31:15] indianowl: nested data*
[02:34:17] Ropeney: can you gist the error?
[02:35:24] indianowl: I am getting no error ....
[02:35:51] sevenseacat: then whats the problem? the show action does not run any 'update sql'
[02:38:15] indianowl: Started GET "/problems/1/edit" for 173.174.125.29 at 2016-05-25 02:13:17 +0000
[02:38:15] indianowl: Cannot render console from 173.174.125.29! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
[02:38:16] indianowl: Processing by ProblemsController#edit as HTML
[02:38:16] indianowl: Parameters: {"id"=>"1"}
[02:38:16] indianowl: Problem Load (0.3ms) SELECT "problems".* FROM "problems" WHERE "problems"."id" = ? LIMIT 1 [["id", 1]]
[02:38:19] indianowl: question Load (0.3ms) SELECT "question".* FROM "question" WHERE "question"."problem_id" = ? LIMIT 1 [["problem_id", 1]]
[02:38:22] indianowl: (0.1ms) begin transaction
[02:38:24] indianowl: SQL (0.5ms) UPDATE "question" SET "problem_id" = ?, "updated_at" = ? WHERE "question"."id" = ? [["problem_id", nil], ["updated_at", "2016-05-25 02:13:17.267309"], ["id", 7]]
[02:38:25] Ropeney: so gist that
[02:38:30] sevenseacat: please don't spam the channel
[02:38:34] sevenseacat: thats also the edit action, not show
[02:38:53] indianowl: sorry pasting it here
[02:38:59] indianowl: let me create a gist
[02:39:30] ensyde: has joined #RubyOnRails
[02:39:47] indianowl: Started GET "/problems/1/edit" for 173.174.125.29 at 2016-05-25 02:13:17 +0000
[02:39:47] indianowl: Cannot render console from 173.174.125.29! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
[02:39:47] indianowl: Processing by ProblemsController#edit as HTML
[02:39:47] indianowl: Parameters: {"id"=>"1"}
[02:39:47] indianowl: Problem Load (0.3ms) SELECT "problems".* FROM "problems" WHERE "problems"."id" = ? LIMIT 1 [["id", 1]]
[02:39:50] indianowl: question Load (0.3ms) SELECT "question".* FROM "question" WHERE "question"."problem_id" = ? LIMIT 1 [["problem_id", 1]]
[02:39:53] indianowl: (0.1ms) begin transaction
[02:39:55] indianowl: SQL (0.5ms) UPDATE "question" SET "problem_id" = ?, "updated_at" = ? WHERE "question"."id" = ? [["problem_id", nil], ["updated_at", "2016-05-25 02:13:17.267309"], ["id", 7]]
[02:39:58] indianowl: sorry it ws clipboard issue
[02:40:02] sevenseacat: stop spamming the channel!
[02:40:18] indianowl: https://gist.github.com/abuzarhamza/1aba4cbc930135c0464e28b6b8b23dfe
[02:40:53] rubyonrailed: has joined #RubyOnRails
[02:41:35] indianowl: need advice
[02:41:45] sevenseacat: ok, either there's more to that controller that you haven't shown, or thats not the correct controller code
[02:42:08] sevenseacat: I lean towards the latter
[02:42:23] indianowl: let me copy the original code
[02:42:38] sevenseacat: please don't paste it in the channel.
[02:42:57] YourManCJ: has joined #RubyOnRails
[02:43:31] YourManCJ: anyone have experience getting a 501(c)3 organization hosted on dreamhost?
[02:43:45] YourManCJ: I am just looking for tips to stream line the process
[02:44:13] sevenseacat: whats a 501(c)3 organization and what does this 'process' involve?
[02:45:33] YourManCJ: a 501(c)3 is a non-profit and the process is getting free hosting from dreamhost. Also getting a RoR app on dreamhost
[02:45:35] YourManCJ: I have experience using heroku and mainting using git, just wondering if dreamhost is the same if anyone knows
[02:46:00] sevenseacat: no idea about the free hosting but glhf running rails apps on dreamhost
[02:46:14] sevenseacat: dreamhost is totally different - its not a PaaS like heroku
[02:46:28] YourManCJ: oh, what about it is difficult?
[02:47:02] sevenseacat: well, forget about the shared hosting. the vps, you'll need to set up yourself
[02:48:21] qsun_: has joined #RubyOnRails
[02:48:21] triptec: has joined #RubyOnRails
[02:48:35] YourManCJ: so do they just give you a vps and you have to setup rails or is it something else?
[02:52:35] indianowl: this the complete code
[02:52:39] indianowl: https://gist.github.com/abuzarhamza/05fa98851ae16b00a76a32c051ada396
[02:54:40] emachnic: has joined #RubyOnRails
[02:55:34] gfvcastro: has joined #RubyOnRails
[02:58:49] indianowl: update the gist with log file too
[02:59:26] indianowl: my action is edit update the form and then redirect to show ...
[03:00:02] roamingdog: has joined #RubyOnRails
[03:00:17] indianowl: but when I edit again the same entry .. the form does not have values od the sql_dml and sql_ddl
[03:04:18] Devalo: has joined #RubyOnRails
[03:08:45] blackmesa: has joined #RubyOnRails
[03:12:09] bb: has joined #RubyOnRails
[03:13:41] benlieb: has joined #RubyOnRails
[03:14:33] braincrash: has joined #RubyOnRails
[03:15:52] owenjones: has joined #RubyOnRails
[03:20:55] k3rn31: has joined #RubyOnRails
[03:26:08] indianowl: need help friend
[03:29:19] kgrz: has joined #RubyOnRails
[03:29:20] der-landgraf: havenwood, tubbo: thanks
[03:30:39] njero: has joined #RubyOnRails
[03:31:39] moeabdol: has joined #RubyOnRails
[03:32:34] der-landgraf: havenwood: yes, I am using the Heroku::Redis addon
[03:33:14] der-landgraf: tubbo: I don't know how to deliver the REDIS_URL to the app
[03:34:20] DragonPunch: has joined #RubyOnRails
[03:35:22] lukec: has joined #RubyOnRails
[03:36:14] indianowl: https://gist.github.com/abuzarhamza/05fa98851ae16b00a76a32c051ada396
[03:36:58] triptec: has joined #RubyOnRails
[03:37:26] indianowl: after edit action the form
[03:38:06] indianowl: generated does not have value
[03:38:51] indianowl: and sql_ddl
[03:39:41] lxsameer: has joined #RubyOnRails
[03:41:08] hashtd: has joined #RubyOnRails
[03:47:06] ziggy: has joined #RubyOnRails
[03:51:29] gingray: has joined #RubyOnRails
[03:52:25] qsun: has joined #RubyOnRails
[03:52:36] sevenseacat: has joined #RubyOnRails
[03:54:36] qsun__: has joined #RubyOnRails
[03:55:29] paradisaeidae_: has joined #RubyOnRails
[03:56:53] Inside: has joined #RubyOnRails
[03:57:17] arup_r: has joined #RubyOnRails
[04:00:43] arup_r: Hi, I am designing a model AffiliateCode(number:string discount:integer owner_id:integer), and this is fine. Now I want to store 2 columns, shared_to_users and used_by_users. Now question is should I keep the these 2 as Array columns in the same model, or set up a HABTM. What would be the best choic?
[04:03:44] benlieb: has joined #RubyOnRails
[04:05:03] arup_r: has joined #RubyOnRails
[04:05:05] pawnbox: has joined #RubyOnRails
[04:07:14] arup_r: ignore me.
[04:09:29] jancel: has joined #RubyOnRails
[04:10:07] blackmesa: has joined #RubyOnRails
[04:14:04] datanois1: has joined #RubyOnRails
[04:17:34] arBmind: has joined #RubyOnRails
[04:22:04] sevenseacat: has joined #RubyOnRails
[04:22:49] indianowl: @sevenseacat : just now pasted my codegist https://gist.github.com/abuzarhamza/05fa98851ae16b00a76a32c051ada396
[04:23:04] indianowl: need ur valuable advice
[04:26:50] maxz: has joined #RubyOnRails
[04:31:01] rvanlieshout: has joined #RubyOnRails
[04:31:42] barhum2013: has joined #RubyOnRails
[04:33:13] qsun: has joined #RubyOnRails
[04:37:50] ksmutthu: has joined #RubyOnRails
[04:39:00] paradisaeidae_: has joined #RubyOnRails
[04:39:10] pawnbox: has joined #RubyOnRails
[04:39:52] andrew9184: has joined #RubyOnRails
[04:40:39] Radar: indianowl: It is not clear fro that Gist what is going wrong. A simple app which reproduces the issue would be good to see.
[04:40:53] Radar: There's like 200 lines of code in that Gist and it's hard to know what exactly it is you need help with.
[04:41:44] tildes_: has joined #RubyOnRails
[04:44:38] indianowl: the issue is that when I see the edit form in my browser
[04:44:56] indianowl: I do not see the old entry I have made
[04:46:01] indianowl: This is nor happing for "problem" but only for "sql_data" in the edit view is displaying empty values
[04:47:39] indianowl: basically it view issue .. I donot know when the view is being callled .. 2 of the form fields are appearning empty...
[04:47:54] chopin: has joined #RubyOnRails
[04:48:13] indianowl: it seems the controller of problem
[04:48:42] indianowl: edit function I am unable to fetch the old values existing in the DB
[04:49:03] Devalo: has joined #RubyOnRails
[04:56:25] norc-2: indianowl, whatever your problem is - make a test case.
[04:56:44] norc-2: In 9 out of 10 cases that allows you yourself to find the problem, and in the remaining 10th case someone else to help you.
[04:57:07] qsun_: has joined #RubyOnRails
[04:58:30] norc-2: indianowl, should be fairly easy too. Create a new git branch (you use git right?) and rip code until the bare minimum that still exibits your problem. Tada.
[05:00:45] sevenseacat: indianowl: your edit action is building a new sqldata object, to replace whatever was there before
[05:00:57] sevenseacat: indianowl: https://gist.github.com/abuzarhamza/05fa98851ae16b00a76a32c051ada396#file-problem_controller-rb-L49
[05:01:23] duncannz: has joined #RubyOnRails
[05:01:44] kristofferR: has joined #RubyOnRails
[05:02:24] duncannz: has joined #RubyOnRails
[05:03:36] duncannz: has joined #RubyOnRails
[05:03:57] pawnbox: has joined #RubyOnRails
[05:04:54] duncannz: has joined #RubyOnRails
[05:09:04] fujinuma: has joined #RubyOnRails
[05:09:16] indianowl: thanks sevenseacat :)
[05:09:25] chouhoulis: has joined #RubyOnRails
[05:09:48] fujinuma: when I try to select an element from index page in assests/javascripts/name.coffee I get a undefined result
[05:10:07] jancel: has joined #RubyOnRails
[05:10:10] fujinuma: rails -v 5.0.0.rc1
[05:10:16] sevenseacat: fumduq-: code?
[05:10:22] sevenseacat: fujinuma: code?
[05:11:04] fujinuma: sevenseacat: console.log(document.querySelecetor('.minutes'))
[05:11:15] sevenseacat: fujinuma: you misspelt querySelector
[05:12:03] fujinuma: sevenseacat: in here, yes.
[05:12:13] sevenseacat: fujinuma: so what does your actual code look like?
[05:12:23] sevenseacat: please gist it, with the error you get
[05:12:59] AmiMoench: has joined #RubyOnRails
[05:13:32] fujinuma: sevenseacat: http://vpaste.net/Y2xF1
[05:13:39] blackmesa: has joined #RubyOnRails
[05:13:56] qsun: has joined #RubyOnRails
[05:14:05] dionysus69: has joined #RubyOnRails
[05:14:45] sevenseacat: do you actually have an id=minutes on the page?
[05:15:20] fujinuma: sevenseacat: nevermind, it was chromium cache's fault :|
[05:15:31] sevenseacat: either way, i dont see how this relates to ra.... okay :)
[05:16:27] fujinuma: sevenseacat: I thought that I put the code in the wrong place, that was it ;D
[05:18:09] codeshah: has joined #RubyOnRails
[05:18:36] codeshah: hey guys, wondering what you guys use for PDF generation -> quick & dirty!!
[05:19:23] Ropeney: codeshah: http://wkhtmltopdf.org/
[05:19:38] qsun_: has joined #RubyOnRails
[05:19:39] sevenseacat: yeah girls dont use quick and dirty stuff :P
[05:20:10] Ropeney: debatable...
[05:25:47] chopin: has joined #RubyOnRails
[05:26:02] qsun: has joined #RubyOnRails
[05:29:26] triptec: has joined #RubyOnRails
[05:36:16] Radar: Hello again.
[05:36:35] emachnic: has joined #RubyOnRails
[05:37:18] der-landgraf: can someone kindly give me a hint on how to set the redis url (in an initializer?) running rails s always results in 127.0.0.1:6379 (Errno::ECONNREFUSED) (Redis::CannotConnectError)
[05:37:22] der-landgraf: I cannot use 6379
[05:38:08] der-landgraf: I tried something like config/initializers/config.rb
[05:38:24] Dimik: has joined #RubyOnRails
[05:39:00] barhum2013: has joined #RubyOnRails
[05:40:08] der-landgraf: if I set $redis = Redis.new(:host => 'localhost', :port => 2222) then I still get 127.0.0.1:6379 (Errno::ECONNREFUSED) (Redis::CannotConnectError) immediately
[05:40:13] jbermudes_: has joined #RubyOnRails
[05:41:18] qsun_: has joined #RubyOnRails
[05:41:25] der-landgraf: my redis-server is running on port 2222
[05:47:08] Coldblackice: has joined #RubyOnRails
[05:47:48] sniff: has joined #RubyOnRails
[05:48:07] Radar: der-landgraf: As I asked for this morning, a stacktrace for this error would be really useful.
[05:48:20] indianowl: has joined #RubyOnRails
[05:48:29] Radar: http://logs.ryanbigg.com/RubyOnRails?date=2016-05-25#5730067
[05:48:46] pwnd_nsfw: has joined #RubyOnRails
[05:48:50] raunicolae: has joined #RubyOnRails
[05:48:57] Radar: It could be that something else other than your application's code is trying to connect to Redis
[05:49:06] Radar: Maybe Sidekiq? Who knows. There isn't enough information to go on here.
[05:51:56] stardiviner: has joined #RubyOnRails
[05:52:15] moeabdol: has joined #RubyOnRails
[05:53:44] raunicolae: has left #RubyOnRails: ()
[06:00:33] Radar: der-landgraf: If it's going to be hours between asking questions and getting answers then you're going to have a hard time getting help here.
[06:00:53] sevenseacat: you ever got answers?
[06:01:51] Radar: der-landgraf: IRC works best when the communication is as quick as possible.
[06:01:54] moeabdol: has joined #RubyOnRails
[06:05:07] Palsson: has joined #RubyOnRails
[06:06:15] qsun__: has joined #RubyOnRails
[06:07:50] sukeerthi_adiga_: has joined #RubyOnRails
[06:11:09] SteenJobs: has joined #RubyOnRails
[06:13:50] KnownSyntax: has joined #RubyOnRails
[06:14:10] SukeerthiAdiga: has joined #RubyOnRails
[06:15:24] blackmesa: has joined #RubyOnRails
[06:15:32] SukeerthiAdiga: m I on the right place? Rails framework written on ruby
[06:15:34] tvw: has joined #RubyOnRails
[06:16:23] Radar: Yup, that's here :)
[06:17:10] Macaveli: has joined #RubyOnRails
[06:17:50] Macaveli: has joined #RubyOnRails
[06:18:03] arBmind: has joined #RubyOnRails
[06:18:50] rubyonrails238: has joined #RubyOnRails
[06:22:13] sukeerthi_adiga: has joined #RubyOnRails
[06:23:58] sukeerthi_adiga: has left #RubyOnRails: ()
[06:24:38] tetraktys: has joined #RubyOnRails
[06:25:34] SukeerthiAdiga__: has joined #RubyOnRails
[06:26:16] solars: has joined #RubyOnRails
[06:27:05] Devalo: has joined #RubyOnRails
[06:27:26] benlieb: has joined #RubyOnRails
[06:29:02] der-landgraf: oh Radar, sorry
[06:30:34] User458764: has joined #RubyOnRails
[06:30:56] Radar: der-landgraf: stacktrace please.
[06:31:03] emachnic: has joined #RubyOnRails
[06:31:38] der-landgraf: Radar-- thanks, this stacktrace is running locally without the heroku rails buildpack or anything
[06:31:53] Radar: der-landgraf: !gist your stacktrace please.
[06:31:53] helpa: der-landgraf: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[06:32:02] Radar: This is the last time I am going to ask for it. It is now 3 times.
[06:32:54] der-landgraf: <script src="https://gist.github.com/sylvanmist/3d7ebcd53d89068503fa5138dce82a0f.js"></script>
[06:32:55] jbermudes: has joined #RubyOnRails
[06:33:07] sevenseacat: I don't think they know what a stacktrace is
[06:33:13] tetraktys: has joined #RubyOnRails
[06:33:17] Radar: Looks like thye do.
[06:34:41] Radar: der-landgraf: https://gist.github.com/sylvanmist/3d7ebcd53d89068503fa5138dce82a0f#file-rails-L25
[06:34:46] roamingdog: has joined #RubyOnRails
[06:34:47] Pazician: has joined #RubyOnRails
[06:34:48] Radar: This shows that it's calling dashing-rails code.
[06:34:58] Radar: dashing-rails has these docs on how to tell it where to find Redis: https://github.com/gottfrois/dashing-rails#redis
[06:35:08] Radar: You will need to change the configuration you have in `config/initiailizers/dashing.rb`
[06:35:25] jenrzzz: has joined #RubyOnRails
[06:35:52] der-landgraf: Radar, thanks for patiently helping
[06:36:10] Ropeney: did github just recently default to embeded?
[06:36:56] Radar: Nope. Copy + paste fail.
[06:37:00] audy: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[06:37:20] Radar: Or do you mean the link at the top of Gist? I've never noticed it.
[06:37:50] sevenseacat: me either, I just grab the URL out of the browser box
[06:41:30] conta: has joined #RubyOnRails
[06:42:43] alfie_max15: need some advice
[06:42:54] alfie_max15: i'm asked to build a blog app in rails
[06:43:03] sevenseacat: I hope the guys here will be able to provide some
[06:43:17] alfie_max15: but it should have some plugins for SEO
[06:43:26] alfie_max15: something like what wordpress has
[06:43:28] universal: alfie_max15: no wai!
[06:44:14] alfie_max15: universal, ??
[06:44:25] universal: sorry, thought you were joking.
[06:45:03] alfie_max15: nop, i'm damn serious, and i have no clue if there is anything like that for rails
[06:45:07] universal: why rebuild wordpress if it is already there?
[06:45:54] solars: there are also quite a lot of blog tools/projects implemented in ruby or rails if you need that
[06:46:11] Ropeney: lets ignore the weekly/daily vulns found for a start though
[06:46:11] alfie_max15: solars, can you direct me to that
[06:46:24] universal: alfie_max15: ruby-toolbox | google :p
[06:46:36] universal: s/blog/cms/
[06:46:57] alfie_max15: universal, checking :)
[06:47:05] solars: yeah just look for ruby/rails blog engines or cms
[06:47:52] universal: but this question remains: why rebuild wordpress if it is already there?
[06:48:12] alfie_max15: well, we already have a rails app, now the blog feature is a new addition,
[06:48:23] jm3: has joined #RubyOnRails
[06:48:40] alfie_max15: the staff would write up a blog and the admin would have access to edit/publish
[06:48:48] universal: so you are not asked to build a blog app, but integrate some blog functionality into an existing application.
[06:48:52] solars: alfie_max15, you could just hook it in seamlessly
[06:49:09] solars: would probably be easier as usually people demand a lot of features afterwards
[06:50:14] Radar: alfie_max15: !gettingstarted
[06:50:14] helpa: alfie_max15: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy and Ryan Bigg
[06:50:22] Radar: That'll *ahem* get you started.
[06:50:40] Ropeney: solars, hopefully when its a feature wordpress doesn't have, someone knows php
[06:51:01] sevenseacat: I'd have to be given a really good reason to reimplement wordpress
[06:51:21] solars: Ropeney, that's right :) but chances are high that effort is lower
[06:51:22] alfie_max15: Radar, seriously??? i'm not asking help for the blog feature, that's the first thing i did an year ago
[06:51:35] sevenseacat: alfie_max15: what are you asking for help with then?
[06:51:42] alfie_max15: the SEO plugins
[06:52:02] Radar: ACTION lols when people think there is a magic SEO plugin that will make their content #1 ranked across the world
[06:52:21] sevenseacat: so... you want to build a plugin system, or you want to add some meta tags to your app, or what?
[06:52:26] alfie_max15: if i create the blog feature, how can i have something similar to what wordpress have in rails.. that was my question, sorry if i wasn't clear
[06:52:29] solars: there were such plugins, 15 years ago :)
[06:53:24] Janno: has joined #RubyOnRails
[06:53:29] sevenseacat: 'I want a SEO plugin' is not an answerable request
[06:53:56] solars: alfie_max15, as you have been told, either use one of the existing ones writte in rails, or just integrate something like wordpress which is a lot easier
[06:54:57] alfie_max15: solars, i'm looking at that
[06:56:20] artto: has joined #RubyOnRails
[06:56:22] sevenseacat: this is what I get for trying to find out information even when not asked
[06:56:41] sevenseacat: ACTION goes back to refactoring All Of The Things
[06:57:25] Cork: is there an update_all like command that runs active record callbacks?
[06:59:30] comrad: has joined #RubyOnRails
[06:59:31] DoctorMonocular: has joined #RubyOnRails
[07:02:23] owenjones: has joined #RubyOnRails
[07:02:57] lxsameer: has joined #RubyOnRails
[07:05:00] kareeoleez: has joined #RubyOnRails
[07:06:01] kareeoleez: I have a question about Rails validators. I want to either allow nil/blank or enter the right format. So If I add allow_nil or allow_blank: true, the validator ignores format and saves as nil.
[07:06:22] kareeoleez: presence: false also does not work, meaning that it doesn't allow nil or blank
[07:06:51] kareeoleez: or all of my thinking is nonsense ? Should I implement this in some other way ?
[07:08:34] sevenseacat: kareeoleez: code?
[07:08:42] Macaveli: has joined #RubyOnRails
[07:09:00] kareeoleez: validates :ip_addr, format: { with: Regexp.union(Resolv::IPv4::Regex)}
[07:09:13] kareeoleez: either allow_blank: true or allow_nil: true
[07:10:40] ur5us: has joined #RubyOnRails
[07:11:17] sevenseacat: either those things where?
[07:11:37] kareeoleez: validates :ip_addr, format: { with: Regexp.union(Resolv::IPv4::Regex)}, allow_nil: true
[07:11:44] kareeoleez: validates :ip_addr, format: { with: Regexp.union(Resolv::IPv4::Regex)}, allow_blank: true
[07:11:46] kareeoleez: makes sense ?
[07:11:54] fujinuma: where should I write global coffeescript?
[07:12:07] mark_66: has joined #RubyOnRails
[07:12:45] sevenseacat: kareeoleez: and what problem are you having with that code? that won't just allow arbitrary values
[07:12:48] Ergo: has joined #RubyOnRails
[07:13:19] kareeoleez: sevenseacat: I want to allow either nil or the proper format
[07:13:20] fujinuma: I tried assests/javascripts/controller_name.coffee but I've not access to the variables/function etc.
[07:13:30] kareeoleez: sevenseacat: it seems that allow_* overrides the format
[07:14:32] kareeoleez: I try with random values, then it just persists "nil" to the database
[07:14:47] kareeoleez: If I remove allow_* it works fine but won't allow blank/nill
[07:14:48] sevenseacat: kareeoleez: !debug
[07:14:48] helpa: kareeoleez: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[07:14:55] sevenseacat: show us what you're doing
[07:15:21] ner0x: has joined #RubyOnRails
[07:15:41] dudepare: has joined #RubyOnRails
[07:15:49] ferr: has joined #RubyOnRails
[07:15:55] kareeoleez: sevenseacat: Model.update(ip_addr: "1431413$$$#")
[07:16:08] Cohedrin: has joined #RubyOnRails
[07:16:11] sevenseacat: thats not even valid
[07:16:17] sevenseacat: let's not use fake code please
[07:16:35] kareeoleez: NetworkIP.update(ip_addr: "1431413$$$#")
[07:16:47] kareeoleez: that's the purpose, to not be valid
[07:16:54] sevenseacat: please follow the directions in the gist
[07:17:00] jstransky: has joined #RubyOnRails
[07:17:23] kareeoleez: I believe I am following them
[07:17:54] kareeoleez: it's more of a theoretical rails question than rails oriented
[07:17:54] sevenseacat: great. where's the code causing the problem, any error messages, logs, etc.
[07:17:57] Palsson: has joined #RubyOnRails
[07:18:07] sevenseacat: I don't see any of those things
[07:18:10] kareeoleez: let's leave the code aside for a minute
[07:18:24] kareeoleez: so not theory questions allowed ?
[07:18:25] blackmesa: has joined #RubyOnRails
[07:18:37] sevenseacat: you're asking a question about your specific piece of code that isnt doing what you expect
[07:18:42] sevenseacat: that is not a theory question
[07:19:12] kareeoleez: If you read my initial question you'll see that it's just If Rails allows you to do this
[07:19:33] kareeoleez: that's enough for me
[07:19:43] kareeoleez: to see If I am doing something wrong or not
[07:19:56] kareeoleez: obviously I am
[07:21:14] jm3: has joined #RubyOnRails
[07:23:32] gambl0re: has joined #RubyOnRails
[07:27:21] gustache: has joined #RubyOnRails
[07:29:05] Macaveli: has joined #RubyOnRails
[07:29:48] datanois1: has joined #RubyOnRails
[07:37:25] qsun: has joined #RubyOnRails
[07:38:08] zpe: has joined #RubyOnRails
[07:38:36] stardiviner: has joined #RubyOnRails
[07:42:37] mikecmpbll: has joined #RubyOnRails
[07:44:50] mikecmpbll: has joined #RubyOnRails
[07:45:30] AzaToth: has joined #RubyOnRails
[07:47:04] artto: has joined #RubyOnRails
[07:48:40] norc: has joined #RubyOnRails
[07:49:36] norc: Hi, so we want to expose some APIs to Web Servers inside our DMZ. Someone brought up the idea to hide all APIs behind some API Gateway appliance to create "security". Is this a common thing?
[07:50:09] pawnbox: has joined #RubyOnRails
[07:50:11] qsun_: has joined #RubyOnRails
[07:51:17] norc: These API Gateways, while being advertised with lots of fancy words like compliance, security and the likes seem to be extremely horrible proxy servers, sometimes shipping their own "secret" ssl implementations, allowing people without programming knowledge to program things. Nothing I have seen has convinced me in the slightest..
[07:51:37] universal: norc: why not use a firewall + ip check in the app?
[07:52:41] qsun__: has joined #RubyOnRails
[07:53:07] norc: universal: There is not much trust in layer 4 firewalls here.
[07:53:47] universal: norc: you most likely have a "proxy"-server before your rails app, this can also deny access to anything nto coming from your dmz
[07:55:58] darutoko: has joined #RubyOnRails
[07:58:39] norc: universal: What about things like protocol validation? There is some paranoia about 0-day attacks, and some people here think that an API Gateway magically finds out and prevents attacks.
[07:59:19] norc: (Say sending malformed HTTP). Or would a robust proxy, say a squid maybe, help mitigate attack vectors here?
[07:59:33] kareeoleez: Can someone help with this issue http://stackoverflow.com/questions/37431081/rails-model-attribute-allow-nil-but-validate-when-not ?
[08:00:01] universal: norc: if malformed http breaks your app / allows access... it does so already because of the public facing part. the api part is not different.
[08:00:04] norc: kareeoleez: supply your own validation method
[08:00:31] norc: universal: The idea is that the people responsible for writing the API need not be tasked with writing particularly safe code..
[08:00:40] norc: (I expect a harsh comment on that)
[08:01:27] norc: kareeoleez: http://guides.rubyonrails.org/active_record_validations.html#performing-custom-validations
[08:01:36] universal: norc: why not have a "base api", which includes authentication, etc... and then the people implemnting the api only need toc concern themselfes with the actual data.
[08:01:51] helpa: http://i.imgur.com/m9m3wr9.gif
[08:02:11] kareeoleez: norc: I did an unless: 'ip_addr.nil?' but it doesn't work finally
[08:02:21] kareeoleez: norc: do you think custom is the only way to go ?
[08:02:34] universal: norc: and bypassing nginx ip validation for example, though most likely not impossible, seems highly unlikely to me.
[08:02:49] jsrn: has joined #RubyOnRails
[08:02:55] norc: kareeoleez: pass a proc object to unless, not an expression.
[08:03:10] norc: kareeoleez: otherwise the expression will be evaluated when the class is loaded. once.
[08:03:25] universal: validations should not throw exceptions!
[08:03:34] adre: has joined #RubyOnRails
[08:03:55] mikecmpbll: has joined #RubyOnRails
[08:04:13] universal: record.valid? should return false. calling record.valid? should never result in an exception!
[08:04:29] universal: just irritated by the wording in the so question.
[08:04:55] norc: kareeoleez: http://guides.rubyonrails.org/active_record_validations.html#conditional-validation
[08:05:01] CornishPasty: ACTION takes one of the seacats
[08:05:09] norc: kareeoleez: Both links I have given you provide you with the tools to provide your validation.
[08:05:13] sevenseacat: I'm more annoyed by the "I dont want your actual help!" *5 minutes later* "oh hey can someone help me with this SO question?"
[08:05:25] CornishPasty: sevenseacat: I'd always accept your help :P
[08:05:33] ql6wlld: has joined #RubyOnRails
[08:06:50] AzaToth: has joined #RubyOnRails
[08:06:53] norc: universal: Well, lets assume the web server gets taken over. That would provide an attacker with direct access to the API then, so that is where the paranoia starts. People here do not want the API to fail, as it essentially provides an interface to our customer database.
[08:07:29] norc: (Though I think it is interesting to note that such a critical API is designed with the attitude "We do not want them to bother with security")
[08:07:46] jsrn_: has joined #RubyOnRails
[08:07:59] universal: norc: if your web server is taken over, what prevents people to listen to network traffic and figure out the unprotected api then... since the webserver is in the dmz...
[08:08:12] kareeoleez: sevenseacat: you want the whole application in order to help ?
[08:08:34] sevenseacat: kareeoleez: no, just what I asked for originally - an example of the code not working, with possibly some logs showing what gets run
[08:08:45] norc: universal: Nothing, but we do not expect the API to be used a lot - so such a leak is small compared to being able to somehow dump the entire database.
[08:08:53] kareeoleez: I don't beg for help, there are other people here too except you (obviously)
[08:09:04] sevenseacat: kareeoleez: thats fine.
[08:09:05] alfie_max15: has joined #RubyOnRails
[08:09:12] sevenseacat: kareeoleez: I wish you all the best.
[08:09:15] kareeoleez: so they might be (also obviously) more polite and accept appreciation
[08:09:35] kareeoleez: that's what you're always doing, that's why I don't need your help
[08:09:50] kareeoleez: you can downvote me in SO also, idgas
[08:09:58] sevenseacat: I already did.
[08:10:29] sevenseacat: you didnt follow the SO rules either
[08:10:32] kareeoleez: seems I got an upvote so finally again idgas
[08:10:39] norc: universal: Albeit there will be authorization done (the API will require valid JWT tokens which contain some information about the user, so that he can only access data about himself).
[08:10:48] norc: Which in turn come out of an OAuth 2.0 flow.
[08:10:48] kareeoleez: you're not the president of the US
[08:10:52] triptec: has joined #RubyOnRails
[08:10:53] kareeoleez: so let the people do their work
[08:10:53] sevenseacat: who said I was?
[08:11:05] mikecmpbll: sevenseacat for POTUS!
[08:11:12] kareeoleez: i don't really care :)
[08:11:16] edwinvdgraaf: has joined #RubyOnRails
[08:11:21] norc: kareeoleez: Arguing with the people who spend their free and some even paid time to assist is a great way to thank them.
[08:11:31] norc: It really is.
[08:11:41] mikecmpbll: kareeoleez : restate your issue in one message, cba to search logs :D
[08:12:14] kareeoleez: norc: can you prove that "those" people helped or just enjoy the drama ?
[08:12:28] norc: kareeoleez: I have been around long enough to know that sevenseacat knows his or her shit.
[08:12:40] kareeoleez: again, I don't care
[08:12:48] kareeoleez: there are 551 people in this room
[08:13:02] norc: Stop argiung then.
[08:13:07] kareeoleez: I am asking for help from the rest 549
[08:13:25] kareeoleez: norc: can you help ?
[08:13:38] sevenseacat: norc: her, for the record
[08:13:45] sevenseacat: norc: and thanks :)
[08:13:45] universal: we could, if you would provide what sevenseacat asked for.
[08:14:13] universal: anyways, gtg... off to a presentation.
[08:14:22] norc: universal: thank you for your thoughts and feedback.
[08:14:24] mikecmpbll: [09:11:40] <mikecmpbll> kareeoleez : restate your issue in one message, cba to search logs :D
[08:14:29] mikecmpbll: and yet he's too busy arguing ...
[08:15:02] universal: norc: yw. though i'm by all means no expert, just some thoughts i had on the issue :-)
[08:15:49] kareeoleez: mikecmpbll: I guess you read the SO issue ?
[08:16:08] gambl0re: has joined #RubyOnRails
[08:16:08] gambl0re: has joined #RubyOnRails
[08:16:09] mikecmpbll: nope. include that in your one-message description.
[08:16:52] Talltree: morning, i think i dont know the name for it, its probable some ajx or something, i want to be able to check a box to trigger a param in the url, but without the need to reload the page
[08:17:08] Talltree: do you guys have any idea what this could be called? i'm sure there is a name for it
[08:17:53] mikecmpbll: Talltree : "trigger a param in the url"? do you mean send a request to your app with a parameter it
[08:17:58] kareeoleez: mikecmpbll: I want to allow nil but validate format if !attribute.nil?
[08:18:04] kareeoleez: mikecmpbll: makes sense ?
[08:18:19] mikecmpbll: kareeoleez : all the validators accept an allow_nil option
[08:18:35] Talltree: mikecmpbll, i got the url set up to filter the model with ?param=value
[08:18:53] edwinvdgraaf: has joined #RubyOnRails
[08:18:55] Talltree: or just filter it without that url stuff, i pretty much dont care, but filter it :D
[08:19:14] emachnic: has joined #RubyOnRails
[08:19:14] kareeoleez: mikecmpbll: If nil? then save successfully, no errors. If not nil? then validate its format
[08:19:19] Talltree: usualy for a param to "hit" the controller i need to GET i think
[08:19:40] mikecmpbll: Talltree : to make a request without a page reload, yes, you want ajax. rails has built in ajax support with it's 'unobtrusive javascript' bits. check out the `remote` option for link_to.
[08:19:41] kareeoleez: mikecmpbll: validates :ip_addr, format: { with: Regexp.union(Resolv::IPv4::Regex)} will work in all cases but won't allow a nil/empty value as it throws an exception. But: validates :ip_addr, format: { with: Regexp.union(Resolv::IPv4::Regex)}, allow_nil: true won't
[08:19:48] mikecmpbll: Talltree : or `form_for`
[08:20:11] kareeoleez: mikecmpbll: How could I include both cases ?
[08:20:14] blackmesa: has joined #RubyOnRails
[08:20:33] mikecmpbll: the 2nd one.
[08:20:46] Talltree: thank you mike
[08:20:55] mikecmpbll: kareeoleez : the 2nd one is correct.
[08:21:07] tetraktys: has joined #RubyOnRails
[08:22:26] kareeoleez: mikecmpbll: Will allow nil/empty values but If the input is invalid e.g. "33@@@#$" then it returns "true"
[08:22:50] mikecmpbll: kareeoleez : no it doesn't. please gist some console logs or something to demonstrate your point.
[08:23:03] mikecmpbll: (also, what returns true?)
[08:23:04] artto: has joined #RubyOnRails
[08:23:24] kareeoleez: mikecmpbll: rails console -> Model.update(ip_addr: "$#%#$%")
[08:24:04] GorillaApe: has joined #RubyOnRails
[08:24:11] kareeoleez: universal: If you enter update! instead of update doesn't it throw an exception ?
[08:24:52] stardiviner: has joined #RubyOnRails
[08:25:35] mikecmpbll: kareeoleez : that code is invalid?
[08:25:51] kareeoleez: mikecmpbll: what code ?
[08:25:56] kareeoleez: mikecmpbll: can you be more specific ?
[08:25:57] mikecmpbll: [09:23:23] <kareeoleez> mikecmpbll: rails console -> Model.update(ip_addr: "$#%#$%")
[08:26:06] mikecmpbll: the only code you've posted, genius.
[08:26:26] kareeoleez: universal: The bang versions (e.g. save!) raise an exception if the record is invalid. The non-bang versions don't, save and update return false, create just returns the object.
[08:26:27] sevenseacat: mikecmpbll: that was a little uncalled for
[08:26:32] kareeoleez: universal: says the official manual
[08:26:45] mikecmpbll: sevenseacat : :|
[08:28:39] Devalo: has joined #RubyOnRails
[08:28:45] kareeoleez: mikecmpbll: I've posted other code too but it seems you only got short term memory
[08:28:56] sevenseacat: kareeoleez: that is also uncalled for.
[08:29:04] mikecmpbll: kareeoleez : i've been quite explicit in that i haven't followed this from the beginning.
[08:30:09] mikecmpbll: kareeoleez : since we engaged in discussion, that is the only code you've posted, and it doesn't even run let alone return true.
[08:30:50] kareeoleez: (0.3ms) COMMIT => true
[08:30:57] kareeoleez: I see something like this
[08:31:20] mikecmpbll: copy your console output into a gist, including the exact code you're running.
[08:31:45] kareeoleez: I'll post the entire contents of my hard drive only for you
[08:32:33] kareeoleez: you don't spend even 30 seconds to read my SO question so there's no point to continue this conversation with you
[08:32:53] mikecmpbll: has joined #RubyOnRails
[08:32:53] sevenseacat: your SO question doesnt have what he asked for
[08:33:00] sevenseacat: and what I asked for, and what universal asked for
[08:33:09] mikecmpbll: [09:15:49] <kareeoleez> mikecmpbll: I guess you read the SO issue ?[09:16:08] <mikecmpbll> nope. include that in your one-message description.
[08:33:15] mikecmpbll: did you include the link since i've been joined? no.
[08:33:24] norc: kareeoleez: Everybody here is critizing you for the way you ask questions and handle this conversation. Maybe it is not all of us who are at fault.
[08:33:32] norc: Have you considered this? At all?
[08:33:33] mikecmpbll: so, even if it did include the correct information, i don't have it.
[08:33:41] sevenseacat: mikecmpbll: it didn't, don't worry.
[08:33:45] norc: *criticizing even
[08:34:02] kareeoleez: norc: Everybody = sevenseacat?
[08:34:12] kareeoleez: universal was irritated for the wrong reasons
[08:34:32] kareeoleez: mikecmpbll wants to read the question in irc instead of visiting a webpage
[08:34:40] norc: kareeoleez: You are irritating everybody.
[08:34:48] mikecmpbll: i'm beginning to think troll ..
[08:34:50] norc: kareeoleez: I recommend you buy a book.
[08:34:57] sevenseacat: kareeoleez: this conversation has been continuing for over an hour and you have not answered anyones questions
[08:35:11] sevenseacat: kareeoleez: this is your last chance to start being civil, if you want any help.
[08:35:19] sevenseacat: go get some sleep then.
[08:35:32] kareeoleez: but you will be again here
[08:35:38] sevenseacat: most likely so.
[08:35:41] kareeoleez: doesn't change anything
[08:35:48] mikecmpbll: .. has that last chance gone yet?
[08:35:56] sevenseacat: it will in about five minutes, from now.
[08:36:26] kareeoleez: the funny thing is that none of you helped even a little
[08:36:42] kareeoleez: I mean of 3-4 people out of 545
[08:36:51] startupality: has joined #RubyOnRails
[08:36:57] kareeoleez: and If you have the authority to just throw people out of this room
[08:37:15] mikecmpbll: same, but i can't remember how so you're safe.
[08:37:17] qsun_: has joined #RubyOnRails
[08:37:20] fox_mulder_cp: tubbo: hm. i move calling my create container job from after_save callback to classic model method calling and seems, that it creates only one job, but i want start this job from my shell scripts too, and code must be dublicate
[08:37:31] dionysus69: I just migrated a migration in development. Schema changed, so did it change for production too? does it mean when I run migration in production the schema will have been already changed?
[08:37:48] norc: Migrating migrations! :)
[08:37:53] sevenseacat: dionysus69: you'll need to run it when you deploy it to production also.
[08:37:58] kareeoleez: there might be the right time to open an alternative room to Rails
[08:38:11] sevenseacat: kareeoleez: have at it.
[08:38:13] norc: kareeoleez: Go aheac.
[08:38:13] mikecmpbll: dionysus69 : the db/schema.rb's only use is for db:schema:load afaik
[08:38:23] dionysus69: ok ok thanks sevenseacat, last time I remember some kind of conflict and I was checking if that could have been the problem :)
[08:38:27] mikecmpbll: kareeoleez : can i be op?
[08:38:37] norc: mikecmpbll: Please do not feed the troll any further.
[08:38:41] kareeoleez: mikecmpbll: you must paste your entire log first
[08:38:52] mikecmpbll: norc : it's not troll food.
[08:38:59] Talltree: mikecmpbll, i'm running into an error, isnt form_for for enteties and not for indexes?
[08:39:00] FooMunki: has joined #RubyOnRails
[08:39:00] neanderslob: has joined #RubyOnRails
[08:39:06] kareeoleez: has left #RubyOnRails: ()
[08:39:16] mikecmpbll: Talltree : not sure what you mean there with respect to entities/indexes
[08:39:18] Talltree: i can't call form for on my @characters
[08:39:19] DragonPunch: has joined #RubyOnRails
[08:39:25] mikecmpbll: what is @characters?
[08:39:30] Talltree: my model :D
[08:39:47] rakm: has joined #RubyOnRails
[08:40:01] Talltree: @characters = Character.where(:realm => "europe").order(exp_latest: :desc)
[08:40:38] mikecmpbll: Talltree : is this a search form you're trying to make?
[08:40:53] sevenseacat: right, thats an ActiveRecord::Relation
[08:41:00] sevenseacat: you cannot have a form_for multiple objects, no
[08:41:17] mikecmpbll: Talltree : you'll probably want a form_tag for this one, then.
[08:41:20] Talltree: filter form, if i check a box it should only show characters with a certain field value/boolean
[08:41:33] mikecmpbll: yeah, filter/search, same diff.
[08:42:15] qsun: has joined #RubyOnRails
[08:43:37] flopsec: has joined #RubyOnRails
[08:45:59] alfie_max15: has joined #RubyOnRails
[08:46:39] jancel: has joined #RubyOnRails
[08:54:10] artto: has joined #RubyOnRails
[08:57:46] eGGshke: has joined #RubyOnRails
[08:59:15] Nailinton: has joined #RubyOnRails
[08:59:41] triptec: has joined #RubyOnRails
[09:03:25] artto: has joined #RubyOnRails
[09:04:30] startupality: has joined #RubyOnRails
[09:05:05] maxx88: has joined #RubyOnRails
[09:05:56] lalalaaa: has joined #RubyOnRails
[09:06:23] ql6wlld: has joined #RubyOnRails
[09:06:41] snowy: has joined #RubyOnRails
[09:08:19] DaniG2k: has joined #RubyOnRails
[09:08:39] arBmind: has joined #RubyOnRails
[09:08:41] Macaveli: has joined #RubyOnRails
[09:09:19] DaniG2k: hello all. Does anyone here use Sidekiq with a systemd script and know how I can set it up? I tried yesterday using https://github.com/mperham/sidekiq/blob/master/examples/systemd/sidekiq.service but apparently my config was off as it was erring
[09:09:25] chouhoulis: has joined #RubyOnRails
[09:09:28] blackmesa: has joined #RubyOnRails
[09:09:40] rvanlieshout: DaniG2k: what errors did you get?
[09:11:35] DaniG2k: hmm I'm looking for it in dmesg but can't find it anymore, logs seem to have rotated
[09:12:02] DaniG2k: I might want to add that I'm on Ubuntu 15.10
[09:12:06] elementaru: has joined #RubyOnRails
[09:13:17] Talltree: i still don't think form_tag is the right thing, or i dont get it ^^
[09:13:44] Circuit8: has joined #RubyOnRails
[09:13:53] c355E3B: has joined #RubyOnRails
[09:14:22] alaing: has joined #RubyOnRails
[09:14:33] alaing: has joined #RubyOnRails
[09:15:02] DaniG2k: rvanlieshout: so I put the script in /lib/systemd/system/sidekiq.service. I put the path to my app in the WorkingDirectory= setting
[09:15:08] DaniG2k: then I run systemctl enable sidekiq
[09:15:24] DaniG2k: this creates a symlink from /etc/systemd/system/multi-user.target.wants/sidekiq.service to /lib/systemd/system/sidekiq.service
[09:15:34] alaing: Am I missing something. I'm trying to conditionally set AWS S3 permissions on specific files if a condition is set https://gist.github.com/aliuk2012/f1df42f1d0b097655f90f6ef33bdd733
[09:15:38] DaniG2k: them systemctl start sidekiq
[09:15:54] workmad3: has joined #RubyOnRails
[09:17:51] DaniG2k: rvanlieshout: ps aux | grep sidekiq shows no sidekiq processes thereafter
[09:19:11] rvanlieshout: DaniG2k: systemctl status sidekiq
[09:20:41] DaniG2k: Failed to start sidekiq.
[09:20:41] weckl: has joined #RubyOnRails
[09:21:01] adre: has joined #RubyOnRails
[09:21:02] DaniG2k: sidekiq.service: Failed with result 'exit-code'.
[09:21:38] DaniG2k: rvanlieshout: May 25 10:17:37 basho systemd[10695]: sidekiq.service: Failed at step EXEC spawning /usr/local/bin/bundle: No such file or directory
[09:21:50] DaniG2k: seems it can't find bundle?
[09:22:08] DaniG2k: i think it needs it cause it runs with the command: ExecStart=/usr/local/bin/bundle exec sidekiq -e production
[09:22:27] DaniG2k: but I had tried to change this value with the result of `which bundle`
[09:22:37] DaniG2k: which gives me: /home/dani/.rvm/gems/ruby-2.3.0/bin/bundle
[09:22:53] DaniG2k: seems annoying cause I'd have to change this on every gem update
[09:23:07] rvanlieshout: rvm use 2.3.0 do bundle exec
[09:23:11] rvanlieshout: don't use direct paths
[09:23:30] DaniG2k: sorry I'm not sure I got that, what path do I need to use?
[09:23:34] Snowy_: has joined #RubyOnRails
[09:23:39] rvanlieshout: direct path to that bundle
[09:23:43] startupality: has joined #RubyOnRails
[09:23:50] GarethAdams: has joined #RubyOnRails
[09:23:53] GarethAdams: has joined #RubyOnRails
[09:23:57] rvanlieshout: use rvm use 2.3.0 do bundle exec ...
[09:25:36] DaniG2k: Failed to start sidekiq.service: Unit sidekiq.service failed to load: Invalid argument. See system logs and 'systemctl status sidekiq.service' for details.
[09:26:21] DaniG2k: rvanlieshout: May 25 10:25:16 basho systemd[1]: [/lib/systemd/system/sidekiq.service:28] Executable path is not absolute, ignoring: rvm use 2.3.0 bundle exec sidekiq -e production
[09:26:36] rvanlieshout: use absolute path to rvm binary
[09:27:00] pawnbox: has joined #RubyOnRails
[09:27:47] DaniG2k: Unrecognized command line argument: 'bundle' ( see: 'rvm usage' )
[09:28:03] rvanlieshout: have to run! Back later
[09:29:33] quazimodo: has joined #RubyOnRails
[09:31:09] pawnbox: has joined #RubyOnRails
[09:31:31] datanois1: has joined #RubyOnRails
[09:33:32] artto: has joined #RubyOnRails
[09:33:32] yopp: has left #RubyOnRails: ("woop-woop-woop")
[09:36:50] artto: has joined #RubyOnRails
[09:38:26] alfie_max15: has joined #RubyOnRails
[09:42:28] antgel: has joined #RubyOnRails
[09:44:58] jenrzzz: has joined #RubyOnRails
[09:47:31] Disavowed: has joined #RubyOnRails
[09:49:56] dANOKELOFF: has joined #RubyOnRails
[09:50:57] Disavowed: has joined #RubyOnRails
[09:51:02] allcentury: has joined #RubyOnRails
[09:51:40] Macaveli: has joined #RubyOnRails
[09:52:14] alaing: Am I missing something. I'm trying to conditionally set AWS S3 permissions on specific files if a condition is set https://gist.github.com/aliuk2012/f1df42f1d0b097655f90f6ef33bdd733
[09:54:06] diegoaguilar: has joined #RubyOnRails
[09:58:14] universal: alaing: what is not working?!
[09:59:05] universal: alaing: and you're in the if should_publish? condition, your set_security will then also be in that condition. so it will never return private(!)
[09:59:20] universal: alaing: and why are you doing 'private'.to_sym instead of :private ?
[09:59:30] dionysus69: whats up with invalid url error? I was using two browsers to test view and my api domain died and it was dead until I deleted cache in chrome. anyone ever experienced something like that?
[10:00:35] jeffmess: has joined #RubyOnRails
[10:00:36] alaing: universal: when I go into the s3 management console and find the file I've upload it still says everyone can view/download it and it not private
[10:00:42] mdw: has joined #RubyOnRails
[10:01:34] universal: alaing: so what makes you think that you set it to private this way? (disclaimer: i've no clue about s3!)
[10:01:39] alaing: universal: i'll change it back to :private i just thought maybe it wasn't reading the symbol
[10:01:54] jeffmess: hey there, is anyone familiar with deploying a rails app which uses docker? Are folk capistrano deploying and running docker build commands that way... is there maybe another better way?
[10:03:51] alaing: universal: i see this in my terminal as well [AWS S3 200 0.482478 0 retries] put_object(:acl=>:public_read,:bucket_name=>"mysecret",:content_length=>145501,:content_type=>"application/pdf",:data=>Paperclip::UploadedFileAdapter: ADP Screen Sharing.pdf,:key=>"unpublished/test1-protest-English.pdf")
[10:04:31] srinidhi: has joined #RubyOnRails
[10:04:51] alaing: I've only seen examples where it explicitly sets the permissions for the the uploaded files
[10:05:17] alaing: and they use :s3_permissions to do it
[10:05:27] alaing: although I wonder if it should be :acl
[10:06:16] zpe: has joined #RubyOnRails
[10:06:38] startupality: has joined #RubyOnRails
[10:07:42] emachnic: has joined #RubyOnRails
[10:09:59] universal: alaing: try s3_permissions: -> {|i| i.set_security}
[10:10:01] stannard: has joined #RubyOnRails
[10:10:13] universal: or s3_permissions: -> { set_security }
[10:10:19] universal: no clue which one works.
[10:10:36] triptec: has joined #RubyOnRails
[10:11:23] universal: ohh probably more like: -> {|a| a.instance.set_security }
[10:11:42] dANOKELOFF: Hi, how it's possible with regex to add point at the end of my text. My text looks like : "<p>Example test</p>" and I want to change it : "<p>Example test.</p>"
[10:11:47] universal: ->(a) {a.instance.set_security } ;-)
[10:12:16] universal: dANOKELOFF: blub.gsub("</p>", ".</p>")
[10:12:58] jeanlinux: has joined #RubyOnRails
[10:13:46] alaing: universal: like has_attached_file :attachment, s3_permissions: -> {|a| a.instance.set_security }?
[10:13:58] alaing: I'm getting syntac error on that line
[10:14:01] universal: alaing: yes.
[10:14:07] universal: alaing: ->(a) {a.instance.set_security } ;-)
[10:14:44] universal: alaing: guess coding in irc, and not so active in ruby currently, so i'm sometimes off
[10:16:00] alaing: I'll try your initial suggestions
[10:16:16] alaing: universal: has_attached_file :attachment, s3_permissions: ->(a) {a.instance.set_security } returns this error wrong number of arguments (given 2, expected 1)
[10:16:45] universal: alaing: ok, so add a second argument and some debug statement to see what the first and second argument are!
[10:17:00] universal: alaing: i'm not using s3, so i can only guess ;)
[10:17:30] alaing: universal: thats fine I appreciate your help :-)
[10:17:36] artto: has joined #RubyOnRails
[10:18:54] adre: has joined #RubyOnRails
[10:20:13] jeanlinux: has joined #RubyOnRails
[10:20:59] alaing: I didn't think it was s3 specific syntax just a case of setting the :s3_permissions symbol
[10:21:23] universal: alaing: you want the s3_permissions to be dynamic.
[10:21:51] universal: so you can not set them to something static. so you need a lambda, which gets called for every instance.
[10:22:31] bronson: has joined #RubyOnRails
[10:22:43] universal: alaing: because has_att_file ... s3_permissions: some_method (this gets evaluated ONCE!)
[10:23:17] startupality: has joined #RubyOnRails
[10:23:34] artto: has joined #RubyOnRails
[10:23:35] universal: s3_permissions: -> { some_method } , this usually results in the supplied lambda / block to be evaluated for every instance.
[10:24:25] kareeoleez: has joined #RubyOnRails
[10:24:29] kareeoleez: has left #RubyOnRails: ()
[10:24:50] alaing: has_attachment_file is a paperclip method
[10:24:52] alaing: http://www.rubydoc.info/gems/paperclip/2.3.8/Paperclip/ClassMethods:has_attached_file
[10:25:16] universal: alaing: when does the has_attachment_file method get called?
[10:25:53] universal: alaing: when the "file is initially read", for every instance?, ...
[10:26:18] alaing: Ah i've found :S3_permissions http://www.rubydoc.info/gems/paperclip/2.3.8/Paperclip/Storage/S3
[10:26:27] srinidhi: has joined #RubyOnRails
[10:27:03] DoubleMalt: has joined #RubyOnRails
[10:29:58] alaing: universal: i'm not sure how to phrase this but i thiink the has_attached_file tells the model that its part of paperclip and therefore includes the Paperclips methods/ attributes on the the record
[10:30:25] alaing: so I assume it would be for every instance
[10:31:55] alaing: https://github.com/thoughtbot/paperclip/wiki/Restricting-Access-to-Objects-Stored-on-Amazon-S3#1-set-s3_permissions-to-private-in-your-paperclip-model
[10:32:09] alaing: universal: https://github.com/thoughtbot/paperclip/wiki/Restricting-Access-to-Objects-Stored-on-Amazon-S3#1-set-s3_permissions-to-private-in-your-paperclip-model
[10:33:09] Detch: has joined #RubyOnRails
[10:38:14] jeanlinux: has joined #RubyOnRails
[10:39:28] raz: has joined #RubyOnRails
[10:39:41] raz: what's the best ruby on rails books?
[10:40:10] GarethAdams: raz: what makes one book better than another, for you?
[10:40:37] raz: GarethAdams: being able to recommend it to someone who asked me for a book and hearing a happy thank you from him next week ;)
[10:40:50] raz: ACTION never reads tech books, so wouldn't know
[10:41:05] GodFather_: has joined #RubyOnRails
[10:41:18] adre: has joined #RubyOnRails
[10:41:22] GarethAdams: Difficult to recommend the best one without knowing what kind of book they're after
[10:41:49] fox_mulder_cp: raz: official guides, ruby on rails in actions, agile development with rails 4
[10:42:06] fox_mulder_cp: i read this three books
[10:43:31] dionysus69: 2:43:22 PM - dionysus69: I have only default actions defined and created by scaffolding which are these: only: [:show, :update, :destroy] but then I can go to the route and I can view indexed items as well as create a record. The record creates with attributes set to null though.
[10:43:50] artto: has joined #RubyOnRails
[10:45:13] raz: fox_mulder_cp: thanks
[10:45:34] fox_mulder_cp: dionysus69: gist your model and controller code + routes please
[10:45:40] jenrzzz: has joined #RubyOnRails
[10:45:40] jenrzzz: has joined #RubyOnRails
[10:46:28] triptec: has joined #RubyOnRails
[10:46:41] diegoaguilar: has joined #RubyOnRails
[10:47:45] startupality: has joined #RubyOnRails
[10:50:28] dionysus69: fox_mulder_cp: https://gist.github.com/anonymous/a8611692b72235dfa170d127ac3cdaf8
[10:51:45] defsdoor: has joined #RubyOnRails
[10:55:28] srinidhi: has joined #RubyOnRails
[10:56:11] tetraktys: has joined #RubyOnRails
[10:57:28] GorillaApe: mou ton foraei i css
[10:57:59] conta: has joined #RubyOnRails
[10:58:19] jmignault: has joined #RubyOnRails
[10:58:31] tvw: has joined #RubyOnRails
[11:01:31] triptec: has joined #RubyOnRails
[11:02:30] emachnic: has joined #RubyOnRails
[11:04:01] Craigimus: has joined #RubyOnRails
[11:05:50] beilabs: has joined #RubyOnRails
[11:06:39] beilabs: has joined #RubyOnRails
[11:08:27] Macaveli: has joined #RubyOnRails
[11:08:39] Craigimus: has joined #RubyOnRails
[11:08:39] beilabs: has joined #RubyOnRails
[11:09:30] beilabs: has joined #RubyOnRails
[11:09:51] fox_mulder_cp: dionysus69: what your app posted to server. u can see it in console where app server is started.
[11:11:34] rodfersou: has joined #RubyOnRails
[11:13:04] dionysus69: hmm what do you mean
[11:13:22] dionysus69: I am using httprequester to send requests
[11:13:41] artto: has joined #RubyOnRails
[11:14:10] Craigimus: has joined #RubyOnRails
[11:14:41] startupality: has joined #RubyOnRails
[11:15:40] AlexJakeGreen: has joined #RubyOnRails
[11:17:19] syndikate: has joined #RubyOnRails
[11:18:28] fox_mulder_cp: dionysus69: see output from rails app daemon in console, not in logs, in it u see what your server deserialize from your http request from params. may be u have some failures
[11:18:48] snowy: has joined #RubyOnRails
[11:19:06] kies: has joined #RubyOnRails
[11:19:19] GodFather__: has joined #RubyOnRails
[11:20:31] workmad3: dionysus69: can you add the request you sent as well please?
[11:22:44] dionysus69: this is how I send post request, is this correct? https://gist.github.com/anonymous/8c68aa865654e548b2ca95befd191240
[11:23:17] dionysus69: I input it in httprequest (firefox addon) and send to my address
[11:24:43] dionysus69: I get this error. << Unpermitted parameter: id >>
[11:24:45] defsdoor_: has joined #RubyOnRails
[11:25:05] Fernando-Basso: has joined #RubyOnRails
[11:25:18] dionysus69: fox_mulder_cp, workmad3: so I need id and type permitted as well as aboutsectionheading and sectionbody?
[11:27:58] fox_mulder_cp: dionysus69: hm. id - not needed - it assigned by active record engine and sql database when record is created
[11:28:13] blackmesa: has joined #RubyOnRails
[11:28:21] AimlessRAven: has joined #RubyOnRails
[11:28:22] fox_mulder_cp: unless u edit ALREADY created record
[11:28:25] AimlessRAven: = f.select :order_id_eq, @orders.collect{|o| [o.id, "#{o.product.name}"]}, {include_blank: true}, data: {init_plugin: :select2}, class: "full-width select-company"
[11:28:40] AimlessRAven: how to set here more than 1 collect values
[11:29:02] AimlessRAven: for example if push = f.select :order_id_eq, @orders.collect{|o| [o.id, o.product.name]}
[11:29:06] AimlessRAven: in my select i see only my o.id
[11:29:31] ldnunes: has joined #RubyOnRails
[11:29:51] universal: AimlessRaven: did you inspect the html?
[11:31:21] dionysus69: fox_mulder_cp: ok now I get what I was doing wrong. but I still don't understand why I am able to create new record, I have this defined, shouldn't this constrain post/create method? before_action :set_about_section, only: [:show, :update, :destroy]
[11:31:35] walidvb_: has joined #RubyOnRails
[11:32:01] fox_mulder_cp: AimlessRaven: why? i may use easy way, seems that <%= f.collection_select :reseller_id, @resellers.all, :id, :name, {:selected => @app_server.reseller} %>
[11:32:46] AimlessRAven: fox_mulder_cp: mm no, :id, :name ..
[11:32:50] AimlessRAven: i wanna show realtion info
[11:33:05] AimlessRAven: and cantdo :product.name or :product_name
[11:33:06] fox_mulder_cp: dionysus69: read about rails controller/model callback/hooks, and rails params permit
[11:33:06] datanois1: has joined #RubyOnRails
[11:33:29] dionysus69: ok thanks :)
[11:33:43] fox_mulder_cp: AimlessRaven: so fix your code, such as my example $)
[11:34:53] fox_mulder_cp: dionysus69: logic in views - bad practice, use scope and methods in controllers, not in views
[11:35:12] fox_mulder_cp: oh, sorry, AimlessRaven
[11:35:24] stardiviner: has joined #RubyOnRails
[11:35:40] AimlessRAven: but i wanna add additional labels for search
[11:35:53] k3rn31: has joined #RubyOnRails
[11:35:58] ql6wlld: has joined #RubyOnRails
[11:36:37] fox_mulder_cp: AimlessRaven: your code work, but logic must be in model, and controllers, not in views.
[11:36:50] fox_mulder_cp: what you mean by 'additional labels'?
[11:36:59] AlexJakeGreen: has joined #RubyOnRails
[11:37:13] fox_mulder_cp: some like autocomplete in 'search' field?
[11:39:08] beilabs: has joined #RubyOnRails
[11:39:21] universal: AimlessRaven: you probably want an array of hashes as a data-attribute for select2, which then replaces your base seleect.
[11:39:40] jmignault: has joined #RubyOnRails
[11:40:35] dreinull: has joined #RubyOnRails
[11:41:00] wpp: has joined #RubyOnRails
[11:41:06] adre: has joined #RubyOnRails
[11:41:31] AimlessRAven: universal: yeah
[11:41:32] dreinull: how would you communicate with an http server about large amounts of ids. Right now I'm just using get requests with a list of all ids.
[11:41:54] dreinull: oh, off for luch for a few minutes.
[11:41:58] AimlessRAven: universal: i wanna to do this function but in my select 2 i see only my order.id .. i wanna see also order.product.name
[11:42:49] Ropeney: has joined #RubyOnRails
[11:42:57] sevenseacat: has joined #RubyOnRails
[11:43:48] artto: has joined #RubyOnRails
[11:44:14] fox_mulder_cp: dreinull: serialize it as loong json list of id?
[11:45:07] fox_mulder_cp: AimlessRaven: do u try my variant of code?
[11:45:22] Craigimus: has joined #RubyOnRails
[11:45:32] artto_: has joined #RubyOnRails
[11:45:38] solars: has joined #RubyOnRails
[11:46:45] maatt83: has joined #RubyOnRails
[11:47:33] maatt83: Hi guys, would you know why do I get this :table key when converting OpenStruct to json? https://gist.github.com/anonymous/711f3f37fb45eec799d17267302a0eaf
[11:47:35] owenjones: has joined #RubyOnRails
[11:47:39] k3rn31: has joined #RubyOnRails
[11:47:45] jenrzzz: has joined #RubyOnRails
[11:48:13] sevenseacat: maatt83: you may have include_root_in_json set to true
[11:48:28] sevenseacat: and it has no idea what the root should be
[11:49:23] hcnewsom: has joined #RubyOnRails
[11:50:29] maatt83: sevenseacat: it's not even an AR. just an OpenStruct object
[11:51:12] sevenseacat: maatt83: but to_json is provided by activesupport
[11:51:30] chouhoulis: has joined #RubyOnRails
[11:51:32] auwooo-0x71: has joined #RubyOnRails
[11:51:34] eGGshke: has joined #RubyOnRails
[11:51:35] sevenseacat: https://gist.github.com/sevenseacat/93b271c22cc6eb12e9989a1f26da1da9
[11:52:40] solars: has joined #RubyOnRails
[11:52:43] maatt83: sevenseacat: to_json(root: false) should do then, right? but it doesn't
[11:56:53] apeiros: it's not the root node. it's because it's @table ivar
[11:57:23] apeiros: i.e. rails' basic to_json will do a {ivar => value, …} mapping
[11:57:35] apeiros: hence root: false won't have any effect.
[11:58:56] GodFather__: has joined #RubyOnRails
[11:59:21] maatt83: apeiros: right. That said, there's no way then to omit this key when using .to_json on OpenStruct?
[11:59:37] apeiros: you're using ruby. there's always a way.
[12:00:11] sevenseacat: you can transform it to a hash first
[12:00:17] sevenseacat: ie. @foo.to_h.to_json
[12:00:27] apeiros: ^ would be the sane way
[12:01:40] lalalaaa: sevenseacat: cool new reads on your blog :-)
[12:02:05] maatt83: sevenseacat: apeiros: got it!!! Thanks guys
[12:02:24] dreinull: fox_mulder_cp but it would also be sent as a get request, right?
[12:02:48] startupality: has joined #RubyOnRails
[12:04:23] AlexJakeGreen: has joined #RubyOnRails
[12:04:24] fox_mulder_cp: dreinull: hm. u reaaly want get a data by post request? %)
[12:04:29] maucar: has joined #RubyOnRails
[12:05:37] dreinull: no, not really. I just want to comminicate with the server about selections. What about session vars?
[12:07:26] fox_mulder_cp: dreinull: /model/index.json -> and accept it in json, and add it to your search field for autocomplete, as example
[12:07:30] startupality: has joined #RubyOnRails
[12:07:33] Macaveli: has joined #RubyOnRails
[12:08:01] fox_mulder_cp: or make a /model/search (post) where u post some first letters for filtering
[12:08:14] solars: has joined #RubyOnRails
[12:09:32] dreinull: fox_mulder_cp the list of ids is already available. It is used for further actions. Think of files you select and want to do stuff with. That data has to be sent somehow. I'm trying to avoid too much javascript interaction going on.
[12:14:28] GarethAdams: has joined #RubyOnRails
[12:15:45] startupality: has joined #RubyOnRails
[12:16:20] Palsson: has joined #RubyOnRails
[12:17:18] AntiSpamMeta: has joined #RubyOnRails
[12:18:00] gfvcastro: has joined #RubyOnRails
[12:20:19] mdw: has joined #RubyOnRails
[12:20:35] andywww: has joined #RubyOnRails
[12:22:20] fmcgeough: has joined #RubyOnRails
[12:22:47] jancel: has joined #RubyOnRails
[12:24:31] crystal77: has joined #RubyOnRails
[12:25:46] kristoff_: has joined #RubyOnRails
[12:25:49] gfvcastro: has joined #RubyOnRails
[12:26:56] startupality: has joined #RubyOnRails
[12:27:43] AimlessRAven: has joined #RubyOnRails
[12:27:48] AimlessRAven: i wanna put this https://gist.github.com/anonymous/40d39682368c51968f64b94dd6f6b401
[12:27:58] AimlessRAven: in method in my order model, how would be looks like this method
[12:29:02] jhass: AimlessRaven: you want to move it into a view helper rather, it's presentation logic
[12:29:25] AimlessRAven: jhass: i wanna crate method in my model to do this
[12:29:31] AimlessRAven: to look simple in view
[12:29:32] jhass: it's wrong to do so
[12:29:41] AimlessRAven: jhass: my boss want this way
[12:30:03] jhass: tell your boss the internet says no :P
[12:30:14] Circuit8: Hey guys. Just a quick question about params require: Say I have three params coming in, and at the moment my code looks like this -> params.permit(:shopify_id, :name, :image) . What if I wanted to ensure that all three params come in and throw an error if they don't? I thought I could use params.require but it only accepts one argument...
[12:30:22] AimlessRAven: jhass: ok how to puit it in method
[12:30:25] AimlessRAven: and render this method there
[12:30:31] jhass: give me a second
[12:31:45] AimlessRAven: jhass: if i can put only this ["Order: #{o.id} " + o.product.name + " - " + humanized_money_with_symbol(o.product.price), o.id
[12:33:30] universal: AimlessRaven: prepare_orders_for_select2(orders) --> define that method.
[12:33:53] AimlessRAven: universal: yeah.. in my order model
[12:34:21] universal: wherever you want, i give you a list of orders, you give me back the array for select2.
[12:34:51] AimlessRAven: universal: oks, but how be looks like my method
[12:34:56] fox_mulder_cp: Circuit8: model validation layer
[12:35:02] jhass: AimlessRaven: https://p.jhass.eu/1x.rb
[12:35:16] universal: AimlessRaven: not doing your work, that is a very simple method, you can do it.
[12:35:34] universal: jhass: why? :p
[12:35:38] AimlessRAven: universal: i wanna model method
[12:35:42] jhass: universal: bored :P
[12:35:44] startupality: has joined #RubyOnRails
[12:36:11] universal: AimlessRaven: this little transformation you can do.
[12:36:44] Circuit8: fox_mulder_cp: Thanks, the issue I'm having is that I'm trying to create an API that will create a product when JSON is given to productscontroller#create . The issue is that I'm trying to create the product in a background activeJob process, so I want to check somehow that the JSON coming in is valid so I can return the correct HTTP response code to whoever is using my API
[12:36:52] jhass: don't. make. it. a. model. method.
[12:36:58] jhass: it's wrong. period.
[12:37:28] AimlessRAven: undefined method `order_choices' for #<#<Class:0x007f68872927e0>:0x007f6882acbba0>
[12:37:33] Circuit8: fox_mulder_cp: Perhaps I'm doing things wrong though, do you know a good solution?
[12:37:39] norc: Circuit8: Strong params is just whitelisting what params you will _allow_ in order to reduce attack vectors or bugs. You should not use it in any way to specify what _must_ have.
[12:37:41] apeiros: jhass: right. make it a relation method! :D
[12:37:52] maucar: has joined #RubyOnRails
[12:38:36] Craigimus: has joined #RubyOnRails
[12:38:39] apeiros: I have it as a relation method actually, despite agreeing that it's in the wrong domain there.
[12:38:41] Circuit8: norc: OK thanks, do you know how I can deal with my situation on my last comment?
[12:39:06] stardiviner: has joined #RubyOnRails
[12:39:15] norc: Circuit8: Create a model for it.
[12:39:17] jhass: wait, where in the guides are view helpers explained anyway?
[12:40:05] Circuit8: norc: I already have a model for it but I want it to get created in a background job so I need to know before the model gets saved to the database if its valid or not
[12:40:05] norc: Circuit8: Or lets name it a "service" class maybe.
[12:40:17] norc: Circuit8: A class that implements validation for the parameters.
[12:40:29] jhass: AimlessRaven: idk where your actual template is located, the view helper has to match its resource
[12:40:39] maxdoubt: has joined #RubyOnRails
[12:40:48] norc: Circuit8: The idea is to wrap the request parameters into an object which can validate them.
[12:41:24] Circuit8: norc: Ah I see, is this a common pattern?
[12:41:53] Circuit8: norc: Could I just check for validation on the normal class without saving to DB?
[12:42:02] norc: Circuit8: Personally I have quite a few non-activerecord models representing "requests for services" which do a lot of validations (even using the ActiveRecord validations).
[12:42:30] norc: And none of them have any kind of representation in a database.
[12:42:56] Circuit8: norc: OK I see thanks a lot
[12:43:20] norc: Circuit8: Just don't derive your class from ActiveRecord::Base. :)
[12:43:24] norc: It's just Ruby.
[12:43:44] Circuit8: norc: What should I derive it from?
[12:43:47] norc: Nothing.
[12:44:02] norc: Create a plain class. Or if you are lazy you could use OpenStruct.
[12:44:07] norc: Or maybe a struct.
[12:44:09] Circuit8: norc: How could I mix in the activeRecord validations?
[12:44:30] norc: Circuit8: include ActiveModel::Validations
[12:44:39] norc: Mix that module into your class.
[12:44:59] Circuit8: norc: Great, thanks alot
[12:45:28] acovrig: has joined #RubyOnRails
[12:46:09] Circuit8: norc: one more thing, do you think there would be a big performance boost in having my own class that just mixes in ActiveModel::Validations and using that to validate, rather than using the actual ActiveRecord object?
[12:46:33] Ergo^: has joined #RubyOnRails
[12:47:08] stardiviner: has joined #RubyOnRails
[12:47:10] norc: Circuit8: It is not about performance but a) about design (why use ActiveRecord when it is *not* representing a table) and b) about all the magic that AR does assuming there is an underlying table matching the name convention.
[12:48:11] norc: Circuit8: Haven't even considered trying it to know how many problems you get if you tried it.
[12:48:41] Circuit8: norc: OK Im with you thanks. So I should call it something like ProductValidator and stick it in lib/services ?
[12:48:43] AlexJakeGreen: has joined #RubyOnRails
[12:49:18] jenrzzz: has joined #RubyOnRails
[12:49:38] norc: Circuit8: If you want, sure. Not sure the name is ideal though. Maybe something like ProductRequestValidator
[12:49:40] hcnewsom: has joined #RubyOnRails
[12:50:05] gfvcastro: has joined #RubyOnRails
[12:50:23] norc: (As it does not validate the product itself)
[12:50:29] Circuit8: norc: OK sounds good :)
[12:51:20] jsrn: has joined #RubyOnRails
[12:54:49] ramortegui: has joined #RubyOnRails
[12:55:50] suchness: has joined #RubyOnRails
[12:55:58] artto: has joined #RubyOnRails
[12:57:17] suchness: I have a yard that has many trees. I also have an after destroy hook on trees. when I do @yard.update(tree_ids: []), they are all deleted correctly, but my after destroy hook is never being called on tree. How can I fix this? (activerecord)
[12:58:23] alaing: has joined #RubyOnRails
[12:58:38] alaing: has joined #RubyOnRails
[12:58:44] alaing: When I try access my app at root level (localhost:3000) it throws this error Routing Error - uninitialized constant SessionsController https://gist.github.com/aliuk2012/7a3a92ff4283665e863b02e2fbd436d8
[12:58:49] alaing: What I want to do is lock down the whole app and the landing page is the signin page if the user is not logged in else it should take them to the user home page
[12:59:56] deur-: suchness: you're not destroying, you're updating. you'll need to call @yard.trees.destroy_all for the after_destroy to fire
[13:01:42] deur-: suchness: oh, if the after_destroy is on tree, you might need to change it to an after_update callback
[13:03:03] suchness: deur-: But in the case I have @yard.trees => [1, 3] and I do @yard.update(tree_ids: [1, 4]) it should (and does) keep the tree id 1, and deletes 3, and adds 4. There is no way with this approach for Tree 3 to have its hook called?
[13:03:24] alfie_max15: has joined #RubyOnRails
[13:03:32] AimlessRAven: https://gist.github.com/anonymous/40d39682368c51968f64b94dd6f6b401
[13:03:41] AimlessRAven: how to put this in a model method and rend here
[13:03:54] AimlessRAven: to look more simple in view
[13:03:55] universal: AimlessRaven: wtf.
[13:04:20] universal: AimlessRaven: jhass already gave you the solution. if you can't adopt that to be a model solution, you need to learn some ruby basics!
[13:04:30] rubyonrails189: has joined #RubyOnRails
[13:05:01] norc: suchness: Use @yard.trees.destroy_all
[13:05:26] suchness: norc: But I want to keep tree 1 and add tree 4?
[13:05:30] norc: suchness: Ah. In that case give it some special method that does this manually.
[13:05:45] norc: suchness: A method that knows which one needs to be removed, iterating over them calling #destroy
[13:05:50] suchness: norc: Like overwrite the tree_ids method
[13:06:16] norc: suchness: No, more like give it a method "set_trees"
[13:06:21] norc: Something along those lines.
[13:06:27] emachnic: has joined #RubyOnRails
[13:06:41] suchness: norc well active record already supplies the relationship_ids= method and handles the deleting what needs to be deleted and adding what is not there already, but it seems to skip over the destroy callbacks on the ids that are no longer in the array
[13:06:59] norc: suchness: It does not use the destroy callback because you are calling an update.
[13:07:03] rubyonrails189: Im going to ask a question as well if its possible
[13:07:17] suchness: norc: Hrm, alright, I will have to dive into it a little bit more.
[13:07:32] emachnic: has joined #RubyOnRails
[13:07:40] norc: suchness: I reckon you might be able to an assignment however.
[13:08:00] norc: suchness: i.e. @yard.trees = exp; Just a wild guess but something I would look into.
[13:08:18] suchness: norc Alright
[13:09:24] rubyonrails189: At this moment im working on a paypal system for adaptive payments. But for paypal the security method on openssl needs to be TLS1v or TLSv1.2 . But the default method is SSLv23. How can i change it to TLSv1 ?
[13:10:41] norc: rubyonrails189: ctx = OpenSSL::SSL::SSLContext.new; ctx.ssl_version = :TLSv1_2
[13:10:50] norc: (Assuming you are using OpenSSL)
[13:11:12] norc: Throw that into an initialize if you like.
[13:11:14] rubyonrails189: Yea i tried that one
[13:11:25] rubyonrails189: in the initialize?
[13:11:35] rubyonrails189: I did it in the controller..
[13:11:52] aegis3121: has joined #RubyOnRails
[13:11:57] nettoweb: has joined #RubyOnRails
[13:11:58] norc: rubyonrails189: Rails initializer.
[13:12:09] rubyonrails189: Ok gonna try it now tnx for now
[13:12:14] norc: rubyonrails189: http://guides.rubyonrails.org/configuring.html#using-initializer-files
[13:12:24] doodlehaus: has joined #RubyOnRails
[13:13:28] triptec: has joined #RubyOnRails
[13:14:11] nettoweb: hey guys, Im running my app through Vagrant, but my emails arent being sent. Im using mailgun with SMTP. Need I to install something else in Vagrant related with email in order to this to work? In ruby log, it appears as being sent but it isnt really.
[13:14:33] sevenseacat: nettoweb: have you turned on notification of delivery failures?
[13:14:53] sevenseacat: config.action_mailer.raise_delivery_errors = false
[13:17:20] tetraktys: has joined #RubyOnRails
[13:18:25] nettoweb: I'm turning this setting and checking
[13:19:51] nettoweb: It had an config enabled: "config.action_mailer.perform_deliveries = false", turn this to true it worked. ;/
[13:20:12] pawnbox: has joined #RubyOnRails
[13:21:23] nettoweb: heheh, just to make sure, in the meanwhile I installed postfix in Vagrant ubuntu thinking this was the problem. Is it really mandatory to send email using Vagrant (using mailgun smtp)?
[13:21:45] elaptics: nettoweb: nothing's mandatory
[13:22:10] rubyonrails189: norc: i've got this error: ArgumentError: unknown SSL method `TLSv1_2
[13:22:44] rubyonrails189: So it seems paypal wants to get TLSv1_2 but i dont have this version
[13:22:47] elaptics: nettoweb: in development, I use a local mail program called mocksmtp and I use vagrant for my dev boxes. I just reverse tunnel from the vagrant box back to my local machine to have it send the mail to mocksmtp
[13:23:15] rubyonrails189: at least ruby doesnt have TLSv1_2
[13:23:34] rubyonrails189: sorry Ruby 1.9.1 doesnt have this encryption method
[13:23:45] nettoweb: In my case I havnt setup anything, just mailgun setting in development.rb, this shoudl work as well, right?
[13:23:53] elaptics: nettoweb: this is what I do vagrant: ssh -- -R 1025:localhost:1025
[13:24:06] elaptics: nettoweb: it will if you have enabled delivery, etc
[13:24:09] sevenseacat: I just use mailcatcher or letter opener in development
[13:24:14] gareth_: has joined #RubyOnRails
[13:24:38] nettoweb: yeah, I used letter opener in the past, and was looking mailcatcher.
[13:24:40] elaptics: isn't there some preview built into rails for it now?
[13:24:58] sevenseacat: yeah, it requires stuffing around though
[13:24:58] elaptics: ACTION has been stuck working on a rails 2 project for quite some time...
[13:25:12] bronson: has joined #RubyOnRails
[13:26:23] nickenchuggets: has joined #RubyOnRails
[13:27:07] norc: rubyonrails189: I recommend you do some checking. Ruby 1.9.1 is grossly outdated.
[13:28:17] elaptics: some of us still have to develop with it
[13:28:59] godzillaenlacasa: has joined #RubyOnRails
[13:29:07] gareth_: has joined #RubyOnRails
[13:29:28] godzillaenlacasa: is there a way to put Sidekiq in verbose mode? I'm trying to run a job, and the console isn't kicking back any errors...
[13:30:07] GarethAdams: has joined #RubyOnRails
[13:31:23] gfvcastro: has joined #RubyOnRails
[13:31:53] rashkov: has joined #RubyOnRails
[13:32:50] raz: can anyone think of a SaaS service targeting developers with really good on-boarding on the homepage (curl examples and everything)?
[13:33:08] raz: i know i have seen a few, but now that i want to take some cues, i can't remember a single one :D
[13:33:14] GorillaApe: I have a reviews controller
[13:33:24] GorillaApe: However I use the reviews form within
[13:33:32] GorillaApe: another view
[13:34:06] GorillaApe: is there a way to return to other view somehow ?
[13:34:08] macsteps: has joined #RubyOnRails
[13:34:44] gfvcastro: has joined #RubyOnRails
[13:35:05] datanois1: has joined #RubyOnRails
[13:35:42] solars: has joined #RubyOnRails
[13:37:57] lxsameer: has joined #RubyOnRails
[13:38:35] elaptics: GorillaApe: what are you actually asking? you are posting (or whatever) to a given controller from a few different places but you want to return from wherever you came from?
[13:39:31] GorillaApe: actually I post from another place and not /new
[13:39:46] GorillaApe: I am not posting from /reviews/new
[13:39:56] elaptics: GorillaApe: simplest option is to save the url in the place where you start in the session or something and then use that as the return location
[13:39:57] GorillaApe: but from /product_name/
[13:40:15] GorillaApe: but in case of errors I cant redirect
[13:40:26] GorillaApe: so I guess I should return products view?
[13:40:31] elaptics: if there's an error you're just going to re-render the form aren't you?
[13:40:48] GorillaApe: yes but product page also
[13:40:58] GorillaApe: i mean product page renders reviews form
[13:41:02] rvanlieshout: has joined #RubyOnRails
[13:41:09] GorillaApe: but my problem is how to handle
[13:42:09] stardiviner: has joined #RubyOnRails
[13:42:22] DragonPunch: has joined #RubyOnRails
[13:43:03] qsun_: has joined #RubyOnRails
[13:46:09] k3rn31: has joined #RubyOnRails
[13:46:34] marr: has joined #RubyOnRails
[13:49:14] diegoviola: has joined #RubyOnRails
[13:49:26] jenrzzz: has joined #RubyOnRails
[13:49:45] gmond071: has joined #RubyOnRails
[13:49:53] gmond071: has left #RubyOnRails: ()
[13:50:02] chouhoulis: has joined #RubyOnRails
[13:52:20] ramortegui: has joined #RubyOnRails
[13:53:41] stannard: has joined #RubyOnRails
[13:53:42] kdough: has joined #RubyOnRails
[13:54:23] triptec: has joined #RubyOnRails
[13:55:11] AzaToth: has joined #RubyOnRails
[13:55:13] startupality: has joined #RubyOnRails
[13:57:41] jeffleeismyhero: has joined #RubyOnRails
[13:58:22] startupality: has joined #RubyOnRails
[13:59:50] k3rn31_: has joined #RubyOnRails
[14:01:13] elaptics: GorillaApe: like I said, in your controller where you're rendering that reviews form, i.e. products I'm guessing, you set a session, e.g. session[:review_return_to] = product_path(@product) then when that review is posted to your reviews controller you can use it to redirect back. Similarly set it elsewhere you're showing the reviews form
[14:01:38] triptec: has joined #RubyOnRails
[14:01:45] elaptics: GorillaApe: alternatively you could do a remote form so you don't leave the page and just re-render it on the page
[14:02:07] GorillaApe: remote form is ajax?
[14:03:30] maxdoubt: has joined #RubyOnRails
[14:05:56] yellow5: has joined #RubyOnRails
[14:07:17] dblessing: has joined #RubyOnRails
[14:08:06] blackmesa: has joined #RubyOnRails
[14:09:02] dopamean_: has joined #RubyOnRails
[14:11:11] axl_: has joined #RubyOnRails
[14:13:26] Pazician: has joined #RubyOnRails
[14:15:12] stannard: has joined #RubyOnRails
[14:17:17] triptec: has joined #RubyOnRails
[14:18:40] axl__: has joined #RubyOnRails
[14:20:40] artto: has joined #RubyOnRails
[14:20:46] Detch: has joined #RubyOnRails
[14:20:54] solars: has joined #RubyOnRails
[14:22:47] macsteps: has joined #RubyOnRails
[14:22:49] axl_: has joined #RubyOnRails
[14:23:07] gfvcastro: has joined #RubyOnRails
[14:24:00] roamingdog: has joined #RubyOnRails
[14:25:06] akshat_: has joined #RubyOnRails
[14:26:17] allcentury: has joined #RubyOnRails
[14:27:44] artto: has joined #RubyOnRails
[14:29:18] ql6wlld_: has joined #RubyOnRails
[14:31:22] barhum2013: has joined #RubyOnRails
[14:35:09] Jasaka: has joined #RubyOnRails
[14:35:50] alfie_max15: has joined #RubyOnRails
[14:37:57] njero: has joined #RubyOnRails
[14:38:34] alfie_max15: I'm getthig this error when starting my rails server after adding the `binding_of_caller` gem uninitialized constant RubyVM::DebugInstagram
[14:41:03] jhass: ruby -v ?
[14:41:51] jhass: "Only works in MRI Ruby 1.9.2, 1.9.3, 2.0, 2.1 and RBX (Rubinius)"
[14:42:22] clandry94: Is application.rb loaded whenever a rake task is run?
[14:43:25] sevenseacat: thats an... odd question
[14:43:30] sevenseacat: strictly, not always
[14:43:32] jhass: no, only for tasks depending on the :environment task
[14:44:26] alfie_max15: jhass, ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
[14:44:36] jhass: alfie_max15: there you go then
[14:44:40] sevenseacat: answers that question
[14:44:54] datanois1: has joined #RubyOnRails
[14:45:05] alfie_max15: nop, i've got the same app setup in 3 systems, same ruby version
[14:45:14] alfie_max15: and only one has this error
[14:46:05] mdw: has joined #RubyOnRails
[14:46:16] clandry94: I'm asking because whenever I encountered some behavior I haven't come across before. I put a 'puts' in my application.rb within the Application class and created a basic rake task. Whenever I call rake something:easytask, whatever I have in the application class in application.rb is outputted
[14:46:25] gopz: has joined #RubyOnRails
[14:46:42] sevenseacat: clandry94: !debug
[14:46:42] helpa: clandry94: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[14:46:54] sevenseacat: show us your rake task and your code
[14:47:28] clandry94: Okay, one moment
[14:48:20] alfie_max15: nvm, fixed it.. :)
[14:48:25] alfie_max15: issue was with the debug_inspector gem
[14:48:41] alfie_max15: removed and reinstalled it
[14:48:45] alaing: When I try access my app at root level (localhost:3000) it throws this error Routing Error - uninitialized constant SessionsController https://gist.github.com/aliuk2012/7a3a92ff4283665e863b02e2fbd436d8
[14:48:47] nettoweb: has joined #RubyOnRails
[14:48:51] alaing: What I want to do is lock down the whole app and the landing page is the signin page if the user is not logged in else it should take them to the user home page
[14:49:01] jeanlinux: has joined #RubyOnRails
[14:49:17] gopz: What is a good way to store static data that will not be changed by users, something like tags, but again, users cannot create/change them. Storing them in database makes it a nightmare to test because they all need to be seeded in order to feature test things them. I also need to store some hierarchal information about them, i.e, some tags have subtags.
[14:49:18] alfie_max15: but, can assure you it works with the latest ruby version
[14:49:33] sevenseacat: alaing: you've routed the homepage to the sessions controller but not defined the sessions controller...?
[14:50:34] jenrzzz: has joined #RubyOnRails
[14:50:53] alaing: sevenseacat: i'm using devise. do i need to change my application controller?
[14:51:12] sevenseacat: then fix your routes because you're pointing to the sessions controller
[14:51:14] sevenseacat: which doesnt exist
[14:51:48] Devalo: has joined #RubyOnRails
[14:53:22] idefine: has joined #RubyOnRails
[14:53:28] eGGshke_: has joined #RubyOnRails
[14:54:02] idefine: has joined #RubyOnRails
[14:54:21] clandry94: @sevenseacat https://gist.github.com/anonymous/387fc0b01c3120cb882041a92e7f802b
[14:55:03] clandry94: Let me know if you need anymore information
[14:55:11] tubbo: alaing: why not just `before_action :authenticate_user!` in your ApplicationController?
[14:55:14] seaworthy: has joined #RubyOnRails
[14:55:20] tubbo: that will apply the filter for every action, including the homepage
[14:55:43] tubbo: as devise's docs say, the root path should be where you want logged-in users to go (IIRC)
[14:56:19] alaing: what about the sign in page? no need to restrict access
[14:57:11] alaing: so place the before action in application controller and then have only one root to doc_attachments/index?
[14:57:42] jhass: clandry94: https://github.com/rails/rails/blob/master/railties/lib/rails/generators/rails/app/templates/Rakefile looks like that's normal actually :/
[14:58:05] stannard: has joined #RubyOnRails
[14:58:08] Coldblackice: has joined #RubyOnRails
[14:58:31] habitullence: has joined #RubyOnRails
[14:58:36] clandry94: Interesting..
[14:59:31] clandry94: Is there a reason why it's required?
[15:02:26] jeanlinux: has joined #RubyOnRails
[15:04:15] disgrntld: has joined #RubyOnRails
[15:04:27] tubbo: alaing: hmm...not sure if devise already has a solution for that built-in
[15:04:33] tubbo: but you can always `skip_before_action`
[15:04:43] artto: has joined #RubyOnRails
[15:07:10] theunraveler: has joined #RubyOnRails
[15:08:07] alaing: tubbo: ok, I've kind of got it working. However when i type in my root path and i'm not signed it I ge redirected to the sign in page and it shows a message saying "You need to sign in or sign up before continuing." is there a way to suppress this message?
[15:08:29] xardion_: has joined #RubyOnRails
[15:08:37] futilegames: has joined #RubyOnRails
[15:08:43] lukec: has joined #RubyOnRails
[15:09:15] beilabs: has joined #RubyOnRails
[15:10:35] frem_: has joined #RubyOnRails
[15:10:49] Quintasan: Can I somehow create a Devise user using only encrypted_password field?
[15:10:55] chopin: has joined #RubyOnRails
[15:10:59] indianowl: has joined #RubyOnRails
[15:11:15] tubbo: Quintasan: no, you need some kind of login key (email or name)
[15:11:27] Quintasan: Uh I phrased that wrongly
[15:11:31] lxsameer: has joined #RubyOnRails
[15:11:31] lxsameer: has joined #RubyOnRails
[15:11:58] Quintasan: I have a MongoDB database dump which already has all the data and the bcrypted password and I want to use that password.
[15:12:17] Quintasan: Oh wait, it depends on the salt
[15:12:20] tubbo: well "bcrypted password" could mean a lot of things.
[15:12:31] tubbo: so if the salt is the same, then yeah totally that will work. otherwise it will not work at all.
[15:12:35] Quintasan: Damned Parse.
[15:12:42] indianowl: hi all .. need a small advice .. which gem should i use nested_form or cocoon for nested form ?
[15:12:54] tubbo: isn't parse open-source now?
[15:13:00] aegis3121: has joined #RubyOnRails
[15:13:11] tubbo: indianowl: i use nested_form, never used cocooon. it works.
[15:13:12] kgrz: has joined #RubyOnRails
[15:13:20] tubbo: i don't know which gem you should use
[15:13:26] Quintasan: tubbo: I am not sure if you can access the salt used there.
[15:13:27] sevenseacat: i like cocoon, but havent used nested_form.
[15:13:34] tubbo: Quintasan: probably not.
[15:13:43] gheegh: has joined #RubyOnRails
[15:14:09] idefine: has joined #RubyOnRails
[15:15:20] indianowl: thank you tubbo
[15:15:56] blackmesa: has joined #RubyOnRails
[15:16:08] roamingdog: tiring of coercing devise to my will...can someone recommend something simpler/up-to-date or should i roll my own?
[15:16:48] yardenbar: has joined #RubyOnRails
[15:17:02] tubbo: roamingdog: what issues are you having with devise?
[15:18:06] sevenseacat: i like devise. saves so much time.
[15:18:15] roamingdog: tubbo: allowing an admin to create a user (in administrate) without a password. sending the invitation email to new user, having them create password and confirm. that's generally it, details getting hairy
[15:18:37] tubbo: roamingdog: devise_invitable
[15:18:38] tvw: has joined #RubyOnRails
[15:19:41] tubbo: it's really something you'd build on top of devise. you wouldn't create a User object without a password. you'd create an Invite object when you want to send an invitation to someone, with a generated code. that would be the :id in the URL, and users would get an email telling them to go to /invitations/:id that would then let them sign up to be a user.
[15:20:07] njero: Hey, I have a rails app running with passenger standalone. I was trying to estimate max requests/sec . I'm performed 100 req all at-once and got 200 OK for all. however when I'm trying 110reqs at a time served reqts drops to 3. Why am i loosing all at once instead of dropping the ones that cannot be served?
[15:20:21] roamingdog: tubbo: yes, as i've surmised, kinda. thanks, will look at this gem
[15:22:19] njero: is passenger supposed to act like that or is that due to any configuration errors?
[15:24:11] njero: i increased no:of instances to check whether is that an issue with load balancer, but then max concurrent request also doubled
[15:24:43] njero: but got same issue after 200+ reqsts
[15:26:45] chintanparikh: has joined #RubyOnRails
[15:30:55] chintanparikh: Hey all, I'm having a little trouble with a join and could use some help. Here's how my schema is structured: I have a deal_collaborators table, a deal table, and a users table. A deal has_many :deal_collaborators and a deal has_many :users, through: :deal_collaborators. I want get an array of all deals, but want them to also have a collaborators field which is an array of all of it's users
[15:31:10] acovrig: I installed devise_token_auth and when doing POST /auth/sign_in '{"email": “test@example.com”, "password: "asdf”}’; I get Unpermitted parameter: {"email": “test@example.com”, "password: "asdf"} followed by a 401, why?
[15:31:55] scottschecter: has joined #RubyOnRails
[15:32:10] stardiviner: has joined #RubyOnRails
[15:33:18] njero: acovrig: code for controller plz
[15:33:47] njero: may be you're missing strong params
[15:34:29] acovrig: n_e_o: the user controller is empty; the application controller is https://gist.github.com/acovrig/1baa83a9065a5e62b33d0d5021ab264e
[15:35:05] njero: lol your link giving 404 :P
[15:35:43] artemaminov: has joined #RubyOnRails
[15:35:44] acovrig: ummm wat… that’s awkward…
[15:36:13] Cohedrin: has joined #RubyOnRails
[15:38:20] JesseH: has joined #RubyOnRails
[15:38:54] acovrig: n_e_o: interesting; the link works for me now, I guess they just had a slowdown for a moment
[15:40:05] smathy: has joined #RubyOnRails
[15:42:43] quazimodo: has joined #RubyOnRails
[15:44:04] acovrig: n_e_o: I just added the development.log to the gist
[15:46:47] bb: has joined #RubyOnRails
[15:47:25] nettoweb: has joined #RubyOnRails
[15:48:00] watersoul: has joined #RubyOnRails
[15:48:35] nartes: has joined #RubyOnRails
[15:49:01] zeknox: has joined #RubyOnRails
[15:49:02] jancel: has joined #RubyOnRails
[15:49:19] njero: acovrig: how are submitting your request?
[15:49:28] njero: did you check https://github.com/lynndylanhurley/devise_token_auth/issues/142
[15:49:35] zeknox: looking for something that functions like group_by but just returns the collection of ActiveRecord objects, not a hash, any insight?
[15:49:42] njero: it says some issues with params submission
[15:50:36] acovrig: n_e_o: lol, was reading that same page; I just used ARC (Chrome app thing) and it works; so it must be an issue with resty (https://github.com/micha/resty); thanks for the help
[15:51:11] njero: chintanparikh: take a look at eagerload includes()
[15:51:13] njero: acovrig: np
[15:51:14] jenrzzz: has joined #RubyOnRails
[15:51:14] jenrzzz: has joined #RubyOnRails
[15:52:01] hobodave: has joined #RubyOnRails
[15:52:11] chintanparikh: n_e_o: Yup I ended up doing current_user.deals.includes(:users).map{|deal| deal.attributes.merge({collaborators: deal.users})}
[15:52:20] chintanparikh: Not sure if there's a better way but that seems to work
[15:53:07] idefine_: has joined #RubyOnRails
[15:53:58] njero: has left #RubyOnRails: ("Oops! connection lost.")
[15:54:05] davidw: has joined #RubyOnRails
[15:54:19] njero: has joined #RubyOnRails
[15:54:41] njero: chintanparikh: that's definitely seems bad
[15:55:06] chintanparikh: n_e_o: Yeah ...
[15:55:46] hobodave: hi guys, I'm having trouble figuring out how to clean up after using ActiveSupport::Subscriber.attach_to in a spec. The attachment (understandably) persists across tests and causes test pollution. - https://gist.github.com/hobodave/349f7fcf2bd62f369eb5c4b2a5fd6d26
[15:56:15] hobodave: how do I "undo" the RailsCacheStenoSubscriber.attach_to :active_support
[15:57:14] dionysus69: has joined #RubyOnRails
[15:57:52] njero: chintanparikh: can you gist those models, it would be easy to take a look. just relations only
[15:58:04] chintanparikh: n_e_o: Sure, one sec
[15:58:20] norc-2: hobodave, ah I actually know that one. Give me a moment.
[15:58:45] kgrz: has joined #RubyOnRails
[15:59:01] mrgreenfur: has joined #RubyOnRails
[15:59:12] chintanparikh: n_e_o: https://gist.github.com/chintanparikh/ec4062793bbda1c7ff220c979750eecb
[15:59:18] hobodave_: has joined #RubyOnRails
[15:59:48] idefine: has joined #RubyOnRails
[16:00:04] hobodave_: sorry got disconnected
[16:00:06] hobodave_: did anyone answer my above question?
[16:00:22] datanois1: has joined #RubyOnRails
[16:00:30] norc-2: hobodave_, I did. Give me a second.
[16:00:45] norc-2: hobodave_, ActiveSupport::Notifications#unsubscribe is the interface
[16:00:48] kgrz: has joined #RubyOnRails
[16:00:55] norc-2: Correction
[16:01:00] rakm: has joined #RubyOnRails
[16:01:00] norc-2: hobodave_, ActiveSupport::Notifications.unsubscribe
[16:01:02] hobodave_: norc__ Yes, I found that in the docs, but since I didn't use #subscribe, I'm unclear how to use it
[16:01:23] norc-2: hobodave_, if I didnt have to run I could guide you through it
[16:01:25] norc-2: hobodave_, https://github.com/rails/rails/blob/master/activesupport/lib/active_support/subscriber.rb
[16:01:28] hobodave_: I don't know the argument to pass
[16:01:34] norc-2: This is how the subscription is done.
[16:01:46] norc-2: You basically have to undo everything attach_to provokes.
[16:01:47] kgrz: has joined #RubyOnRails
[16:02:17] norc-2: hobodave_, if you or nobody else can figure it out Ill be back in about 2 hours.
[16:02:18] acovrig: I can login with a POST and I see an Access-Token and Uid headers get set, but when I try a GET with those headers, I see current_user returns nil in the console
[16:02:21] mrgreenfur: anyone know how to override created_at? I’ve tried setting it in my data before passing it to Model.create, but it doesn’t seem to work
[16:02:28] hobodave_: this seems needlessly complicated :)
[16:03:00] haaj: has joined #RubyOnRails
[16:03:32] norc-2: hobodave, in essence you need to get the pattern of each event (its just method.namespace), and unsubscribe them from whichever notifier you use (ActiveSupport::Notifications by default)
[16:04:16] norc-2: hobodave, or actually it seems you can even just pass the subscriber! That is nice.
[16:04:30] hobodave: gonna try this: ActiveSupport::Notifications.unsubscribe(RailsCacheStenoSubscriber)
[16:04:33] hobodave: I think that's what you're saying
[16:04:56] hobodave: doesn't work :(
[16:05:13] kgrz: has joined #RubyOnRails
[16:05:15] norc-2: hobodave, thats because RailsCacheStenoSubscriber is NOT the subscriber.
[16:05:17] norc-2: hobodave, that is your namespace.
[16:05:25] [Butch]: has joined #RubyOnRails
[16:05:30] hobodave: heh, so what *is* the subscriber?
[16:05:34] hobodave: the method?
[16:05:36] norc-2: hobodave, the subscriber is the second argument ot attach_to.
[16:05:45] kgrz: has joined #RubyOnRails
[16:05:53] norc-2: Which defaults to a new Subscriber object.
[16:06:03] hobodave: that's weird, subscriber=new
[16:06:28] hobodave: but it's a protected attr_reader on the Subscriber class? so confused
[16:06:56] norc-2: hobodave, no on the Singleton class of Subscriber.
[16:07:03] norc-2: Note the class << self at the top?
[16:07:21] dopamean_: has joined #RubyOnRails
[16:07:27] mrgreenfur: oops fixed ;)
[16:07:28] hobodave: yes, that's what I meant
[16:07:34] hobodave: sorry if my terminology is not proper
[16:07:36] rogue_koder: has joined #RubyOnRails
[16:07:47] norc-2: hobodave, in simple terms
[16:08:00] njero: chintanparikh: sry. I think i misjudged. you just need to merge those collection included into array, rt? I don't see any other options with AR. Anyone else can take on
[16:08:20] norc-2: hobodave, so this looks like you are using it wrong already.
[16:08:27] benlieb: has joined #RubyOnRails
[16:08:38] norc-2: hobodave, you are passing your subscriber in the namespace argument
[16:08:43] norc-2: So your subscriber is not the subscriber.
[16:08:58] hobodave: could you reference a line please?
[16:09:12] norc-2: hobodave, https://gist.github.com/hobodave/349f7fcf2bd62f369eb5c4b2a5fd6d26#file-rails_cache_steno_subscriber_spec-rb-L3
[16:09:25] norc-2: Im incapable of reading.
[16:09:28] hobodave: that's how the documentation says to do it
[16:09:39] norc-2: It is all good. Im kind of in a hurry.
[16:10:04] ql6wlld: has joined #RubyOnRails
[16:10:11] hobodave: I think I see
[16:10:27] haaj: has joined #RubyOnRails
[16:10:28] hobodave: https://github.com/rails/rails/blob/52ce6ece8c8f74064bb64e0a0b1ddd83092718e1/activesupport/test/log_subscriber_test.rb#L32
[16:10:30] hobodave: this is the only Rails test that uses attach_to
[16:10:50] hobodave: so if I instantiate an instance of my subscriber, and keep a refernece to it, then I can use that to unsubscribe?
[16:12:01] norc-2: hobodave, the yes.
[16:12:04] norc-2: hobodave, then yes.
[16:12:13] i: has joined #RubyOnRails
[16:12:14] norc-2: hobodave, though attach_to might return that object already.
[16:12:17] norc-2: I would look at that first.
[16:12:28] hobodave: gah, still not working :(
[16:13:37] hobodave: Am I wrong thinking this is unnecessarily complicated?
[16:13:43] blackmesa: has joined #RubyOnRails
[16:15:00] dopie: has joined #RubyOnRails
[16:17:32] haaj_: has joined #RubyOnRails
[16:17:43] hobodave: still can't get the damn thing to clean up
[16:20:29] srinidhi: has joined #RubyOnRails
[16:21:41] idefine: has joined #RubyOnRails
[16:24:44] idefine: has joined #RubyOnRails
[16:25:27] peterretief: has joined #RubyOnRails
[16:25:55] kgrz: has joined #RubyOnRails
[16:28:44] triptec: has joined #RubyOnRails
[16:28:45] tildes_: has joined #RubyOnRails
[16:29:43] Craigimus: has joined #RubyOnRails
[16:30:59] godzillaenlacasa: has joined #RubyOnRails
[16:31:15] [Butch]: has joined #RubyOnRails
[16:31:55] mrgreenfur: hobodave: don’t give up! whats your question? i logged in after you posted it
[16:32:56] hobodave: mrgreenfur it's not worth the time :) But here: https://gist.github.com/hobodave/349f7fcf2bd62f369eb5c4b2a5fd6d26#file-rails_cache_steno_subscriber_spec-rb-L3 - I can't "undo" the result of .attach_to -- I've tried many combinations of .unsubscribe and other things, to no avail
[16:33:12] hobodave: the symptom is test pollution, but the fix for now is to just combine those two tests
[16:34:36] andrew9184: has joined #RubyOnRails
[16:34:54] mrgreenfur: a bit over my head
[16:35:06] macsteps: has joined #RubyOnRails
[16:36:02] moeabdol: has joined #RubyOnRails
[16:38:01] nettoweb: has joined #RubyOnRails
[16:38:06] idefine: has joined #RubyOnRails
[16:39:20] Megamos: has joined #RubyOnRails
[16:39:44] kgrz: has joined #RubyOnRails
[16:40:28] Craigimus: has joined #RubyOnRails
[16:41:16] rafaelfranca: has joined #RubyOnRails
[16:42:50] moeabdol: has joined #RubyOnRails
[16:44:14] rafaelfr_: has joined #RubyOnRails
[16:46:23] manfrin: has joined #RubyOnRails
[16:46:44] Craigimus: has joined #RubyOnRails
[16:47:06] triptec: has joined #RubyOnRails
[16:47:12] cabinB: has joined #RubyOnRails
[16:47:26] idefine: has joined #RubyOnRails
[16:48:38] Craigimus: has joined #RubyOnRails
[16:48:56] bensarz: has joined #RubyOnRails
[16:50:04] sillypog: has joined #RubyOnRails
[16:50:38] ferr: has joined #RubyOnRails
[16:52:12] jenrzzz: has joined #RubyOnRails
[16:53:59] idefine: has joined #RubyOnRails
[16:54:06] Technodrome: has joined #RubyOnRails
[16:54:41] Megamosaren: has joined #RubyOnRails
[16:56:04] Craigimus: has joined #RubyOnRails
[16:56:48] aegis3121: has joined #RubyOnRails
[16:57:19] hahuang65: has joined #RubyOnRails
[16:57:44] stannard: has joined #RubyOnRails
[16:57:55] jancel: has joined #RubyOnRails
[16:58:07] arBmind: has joined #RubyOnRails
[16:58:12] sillypog: has joined #RubyOnRails
[17:00:16] macsteps: has joined #RubyOnRails
[17:00:43] blackmesa: has joined #RubyOnRails
[17:01:29] chipotle: has joined #RubyOnRails
[17:03:39] mikecmpbll: has joined #RubyOnRails
[17:04:33] srinidhi: has joined #RubyOnRails
[17:08:36] |2701: has joined #RubyOnRails
[17:10:47] godzillaenlacasa: has joined #RubyOnRails
[17:11:43] jm3: has joined #RubyOnRails
[17:11:50] Ergo: has joined #RubyOnRails
[17:12:15] jeanlinux: has joined #RubyOnRails
[17:14:02] axl_: has joined #RubyOnRails
[17:14:11] t4nkD: has joined #RubyOnRails
[17:15:41] solars: has joined #RubyOnRails
[17:17:40] dblessing: has joined #RubyOnRails
[17:17:44] yellow5: has joined #RubyOnRails
[17:18:26] t4nkD: Hey RoR, I have kind of a weird problem, I've got two projects trying to access the same database (one is a Lambda running POR, in fact). Both of the projects use ActiveRecord, and have identical connection settings. My Rails project reports `Sample.where(is_critical: true).count` as 4545, the lambda project (using ActiveRecord without Rails) runs what the logs say is the exact same query, and gets a result of 2971
[17:18:30] m_antis: has joined #RubyOnRails
[17:18:49] jhack: has joined #RubyOnRails
[17:18:56] t4nkD: An explain on the where() clause is showing even more confusing results... Why is something as seemingly trivial as counting rows giving me so many results?
[17:19:10] Scriptonaut: has joined #RubyOnRails
[17:19:15] neha-: hey what method is hit when i make a write to a model? this is for testing, i want to make sure a call does not hit the database/write
[17:19:40] neha-: would it be :save
[17:19:46] mikecmpbll: has joined #RubyOnRails
[17:20:49] djbkd: has joined #RubyOnRails
[17:21:04] conta: has joined #RubyOnRails
[17:21:53] rakm: has joined #RubyOnRails
[17:22:16] neha-: i actually want to make sure the model object isn't being written to
[17:22:28] neha-: regardless of if it's saved (assuming it will be saved at some point)
[17:23:01] jm3: has joined #RubyOnRails
[17:23:02] t4nkD: neha-: Why would you use a method that modifies the instance object AND saves to the database if you want to do neither of those things?
[17:23:07] solars: has joined #RubyOnRails
[17:23:30] edwinvdgraaf: has joined #RubyOnRails
[17:23:40] neha-: it doesn't have to do both, i just want to know this method is not being called
[17:23:49] siaw23: has joined #RubyOnRails
[17:24:19] neha-: i have a getter that does lazy loading i suppose. so in a unit test i want to check that it is not writing to the database under certain conditions
[17:24:30] audy: has joined #RubyOnRails
[17:24:59] siaw23: i’m working on a rails 3.2 app. doing bundle install and i get this https://gist.github.com/siaw23/57ea2d87c5854afb4212ef5b9fb52f96 i searched the some people solved it by install the syck gem. but not me. how do i fix this if anyone can help?
[17:29:12] sbarg: has joined #RubyOnRails
[17:30:37] bronson: has joined #RubyOnRails
[17:31:24] sbarg: has joined #RubyOnRails
[17:33:49] edwinvdgraaf: has joined #RubyOnRails
[17:34:35] andywww: has joined #RubyOnRails
[17:35:29] audy: has left #RubyOnRails: ("bye")
[17:35:45] mikecmpbll: has joined #RubyOnRails
[17:35:49] Craigimus: has joined #RubyOnRails
[17:35:50] andywww: i’ve been digging into callbacks a bit more recently and there seems to be a fair bit of slating of them out there
[17:36:04] andywww: what is generally considered the alternative approach?
[17:36:56] andywww: i’ve put quite a lot into service objects but they don’t have the convenience of being triggered automatically
[17:37:34] Megamosaren: has joined #RubyOnRails
[17:37:48] t4nkD: Either that or a state machine maybe?
[17:38:35] t4nkD: Most of the lawdy OOP people I know choose service objects because they don't like anything being automatic
[17:39:24] andywww: problem is, thats whats so handy about them
[17:39:50] t4nkD: The argument tends to be, it's handy because we know about them
[17:40:11] sbarg1: has joined #RubyOnRails
[17:40:50] Ergo: has joined #RubyOnRails
[17:42:05] solars: has joined #RubyOnRails
[17:42:40] artto: has joined #RubyOnRails
[17:42:48] arBmind: has joined #RubyOnRails
[17:43:59] hobodave: has joined #RubyOnRails
[17:44:26] shinnya: has joined #RubyOnRails
[17:44:42] tildes_: has joined #RubyOnRails
[17:46:14] haaj: has joined #RubyOnRails
[17:46:18] samuel02: has joined #RubyOnRails
[17:46:20] srinidhi: has joined #RubyOnRails
[17:47:47] haaj: has joined #RubyOnRails
[17:47:58] samuel02: hi, I'd like some input on how to solve an issue as cleanly as possible
[17:48:13] samuel02: I have a data model like this; http://pastie.org/private/wdtsm0wyim86vbjlka4w
[17:48:59] samuel02: I would like to run a validation when something is added to Cart, i.e. a CartItem is created and make sure the quantity of is within the limit of the license
[17:49:23] samuel02: one way would of course be to just have a validation method on the CartItem
[17:49:24] chipotle: has joined #RubyOnRails
[17:49:30] jancel: has joined #RubyOnRails
[17:49:50] solars: has joined #RubyOnRails
[17:50:05] samuel02: that would basically do cart.customer.licenses.where(item_id: item.id).first.valid_quantity?(quantity)
[17:50:19] samuel02: but it seems like that would violate the Law of Demeter quite harshly
[17:50:29] samuel02: what would be a good way of solving this?
[17:53:11] jenrzzz: has joined #RubyOnRails
[17:54:10] diegoaguilar: has joined #RubyOnRails
[17:54:47] qsun__: has joined #RubyOnRails
[17:55:07] diegoaguilar: has joined #RubyOnRails
[17:57:38] datanois1: has joined #RubyOnRails
[17:58:50] adre: has joined #RubyOnRails
[18:00:34] yfeldblum: has joined #RubyOnRails
[18:03:28] axl_: has joined #RubyOnRails
[18:03:48] B1n4r10: has joined #RubyOnRails
[18:03:53] syndikate: has joined #RubyOnRails
[18:06:11] roamingdog: tubbo: many thanks for devise_invitable tip, works a treat
[18:06:51] rashkov: has left #RubyOnRails: ()
[18:07:22] acovrig: Event belongs_to user, foreign_key: ‘created_by’; event.created_by doesn’t work, but event.created_by_id returns a User.id; can I have event.created_by return a <User>?
[18:08:43] FooMunki: has joined #RubyOnRails
[18:09:10] acovrig: I guess I could do this in the event model: def created_by { return User.find(created_by_id) } but eeh
[18:09:35] petor: has joined #RubyOnRails
[18:10:24] tubbo: roamingdog: no problem :) i generally decide whether to use devise based on whether i'll need all its extra features like email confirmations, locking/timeouts, the pre-built forms, and stuff like this.
[18:10:53] artto: has joined #RubyOnRails
[18:10:57] roamingdog: tubbo: and i generally want lots of that too, glad i didn't have to try something else just to get this working
[18:11:16] tubbo: for example, this one app i'm building is just an API for a mobile and desktop app...the reason i don't use devise is because i don't need 90% of what it does
[18:11:27] tubbo: instead, i just made my own User model with has_secure_password, and integrated it with Warden directly :)
[18:11:35] emachnic: has joined #RubyOnRails
[18:15:01] Benny_: has joined #RubyOnRails
[18:16:03] srinidhi: has joined #RubyOnRails
[18:16:16] micahbf: has joined #RubyOnRails
[18:16:49] kdough: has joined #RubyOnRails
[18:16:55] Cohedrin: has joined #RubyOnRails
[18:17:18] manfrin: has joined #RubyOnRails
[18:17:43] hazelux: has joined #RubyOnRails
[18:18:09] hazelux: Hey guys. Do you see any way of optimizing this? I feel like there must be a better way to go about it: https://gist.github.com/maxcodes/df731d29cc9f8b35f0ce3e024e34c4ff
[18:18:21] jancel: has joined #RubyOnRails
[18:18:23] micahbf: ACTION msg NickServ REGISTER f1d3lity micahbuckleyfarlee@gmail.com
[18:18:51] micahbf: using a new irc client :)
[18:19:05] micahbf: does anyone know if there is a way to extend an already defined association?
[18:19:11] groktar: has joined #RubyOnRails
[18:19:32] jenrzzz: has joined #RubyOnRails
[18:20:00] Terens: has joined #RubyOnRails
[18:20:15] micahbf: @hazelux you're going to want to do a self join
[18:20:19] Terens: I have a products page where I show a simple for for adding reviews
[18:20:55] Terens: the problem is that form posts at reviewscontroller/create thus getting away from productcontroler.
[18:21:16] Terens: is there a way to embed it within products controller ?
[18:21:26] hazelux: micahbf: thanks. looking into it.
[18:22:17] artto: has joined #RubyOnRails
[18:24:33] jstransky: has joined #RubyOnRails
[18:24:39] micahbf: /msg NickServ VERIFY REGISTER micahbf utjrmrhkqadn
[18:25:18] emachnic_: has joined #RubyOnRails
[18:27:16] meoblast001: has joined #RubyOnRails
[18:28:11] emachnic: has joined #RubyOnRails
[18:28:44] tildes_: has joined #RubyOnRails
[18:30:03] emachnic_: has joined #RubyOnRails
[18:31:16] hazelux: micahbf: I understand what self joins are, but I'm not sure how they apply in this case?
[18:31:55] kronshausen: I'm having a fun problem with nil values in arel that's fixed in master and arel 7, but hasn't been ported back to arel 6. think it's likely something like that could be backported?
[18:31:56] kronshausen: https://gist.github.com/anonymous/e04155550134cf8ed2f9ededc9d0fe2a
[18:32:39] emachnic_: has joined #RubyOnRails
[18:32:54] idefine: has joined #RubyOnRails
[18:33:49] micahbf: @hazelux i didn't initially see the parameterization and distance calculation, which adds some complexity, but the idea would be to self join on title, which will only return (exact) dups from the database
[18:35:32] jm3: has joined #RubyOnRails
[18:36:35] hazelux: micahbf: yeah, this is actually a slimmed down version of it. I'd also like to check if the author is the same for example, or add even more complexity to it later on.
[18:37:08] hazelux: Does extracting everything into json-like objects and working with that seem like a better idea?
[18:37:19] hazelux: To avoid sql constraints
[18:37:58] micahbf: @hazelux I think you probably want to do as much db-side as possible
[18:38:21] micahbf: If you're using postgres, it some some string similarity stuff
[18:39:26] SendgridQuestion: has joined #RubyOnRails
[18:39:45] hazelux: micahbf: yup, I'm on pg. I guess I'll have to go with raw sql then? ugh
[18:40:03] andywww: has joined #RubyOnRails
[18:40:07] arBmind: has joined #RubyOnRails
[18:40:22] micahbf: Check out the pg_similarity extension
[18:40:29] beilabs: has joined #RubyOnRails
[18:40:35] sbarg: has joined #RubyOnRails
[18:41:17] SendgridQuestion: I'm using sendgrid for emails, both in staging & production but I want the information that's monitored to be separate. Instead of making 2 separate sendgrid accounts, is there some kind of feature that supports this
[18:42:20] artto: has joined #RubyOnRails
[18:42:24] hazelux: oh, great. Thanks for the pointers micahbf!
[18:43:23] micahbf: @hazelux good luck! one thing is if you use some other algorithm for string similarity that doesn't do comparison, but just comes up with some simplified version, then you only need one iteration
[18:43:26] mikecmpbll: has joined #RubyOnRails
[18:43:30] jenrzzz: has joined #RubyOnRails
[18:43:38] micahbf: like converting all of the titles to soundex or something
[18:43:45] micahbf: then you can just hash them
[18:44:43] hazelux: > algorithm for string similarity that doesn't do comparison
[18:45:07] hazelux: is this a thing? how can you not compare it to something else?
[18:45:22] micahbf: totally depends on use case, but for example see soundex https://en.wikipedia.org/wiki/Soundex
[18:45:49] micahbf: the idea is that you would loop through once, indexing by soundex, then if you already have something indexed for the same soundex key, you have a dup
[18:45:53] artto: has joined #RubyOnRails
[18:46:17] micahbf: what sort of dups are you seeing that you need the jaro-winkler distance checking?
[18:46:34] sbarg: has left #RubyOnRails: ()
[18:47:46] maxdoubt: has joined #RubyOnRails
[18:48:28] maxdoubt: does anybody know the syntax for using factory_girl to create a factory for a subclass of a model (eg: MyClass::Subclass) ?
[18:49:29] jhass: you mean a namespaced class?
[18:50:24] jhass: factory :admin, class: User::Admin
[18:54:06] Technodrome: has joined #RubyOnRails
[18:54:47] alfie_max15: has joined #RubyOnRails
[18:55:49] Dimik: has joined #RubyOnRails
[18:56:56] idefine: has joined #RubyOnRails
[18:57:42] idefine: has joined #RubyOnRails
[18:58:03] sneakersec: has joined #RubyOnRails
[18:58:12] maxdoubt: jhass: thanks!
[18:58:23] hazelux: micahbf: the algorithm was chosen at random, really. it could be levenshtein just as well. We just have tons of duplicate books and need to get rid of them with the minimum amount of misses possible.
[18:58:43] triptec: has joined #RubyOnRails
[18:58:49] hazelux: micahbf: also, that idea of soundex sounds great. Implementing that would be A+
[18:59:58] blackmesa: has joined #RubyOnRails
[19:00:22] gvz108: has joined #RubyOnRails
[19:01:00] hazelux: It seems though, that Jaro-Winkler is better at comparing smaller strings like words and names, which is sort of what we need (source: https://stackoverflow.com/questions/25540581/difference-between-jaro-winkler-and-levenshtein-distance)
[19:02:07] jaequery: has joined #RubyOnRails
[19:02:37] gvz108: has joined #RubyOnRails
[19:06:13] blackmesa: has joined #RubyOnRails
[19:06:20] elementaru: has joined #RubyOnRails
[19:08:12] akshat_: has joined #RubyOnRails
[19:11:21] elementaru: hi, got a question about gits
[19:11:47] tubbo: elementaru: all the gits
[19:12:42] tubbo: elementaru: just ask it
[19:13:21] elementaru: I'm just wondering, I did commit and push, then I updated 2 files and did commit A, then updated 2 other files, and did commit B
[19:13:32] haaj: has joined #RubyOnRails
[19:13:40] elementaru: if I specifically push commit B, commit A's files won't be pushed?
[19:13:40] Technodrome: has joined #RubyOnRails
[19:13:42] norc-2: elementaru, if you update and commit you havent changed anything.
[19:13:50] norc-2: elementaru, you need to *add* changes to your index before commiting.
[19:14:10] triptec: has joined #RubyOnRails
[19:14:10] elementaru: yes, added as well
[19:14:15] tubbo: elementaru: git commits are always linear, and based on what time at which you made the commit. so if you "specifically push commit B", commit A's files *are* going to be pushed.
[19:14:36] norc-2: elementaru, git is all about history really.
[19:14:42] tubbo: the reason for that is because you can't "just push 1 commit", you have to push the current state of the repo branch
[19:14:44] smathy: You can't push a single commit, just a branch.
[19:14:52] norc-2: elementaru, a single commit in its hash contains the *entire* git history.
[19:14:58] norc-2: behind the commit
[19:14:59] tubbo: which is made up of a chain of commits, all with parents
[19:15:05] elementaru: ok got it thanks
[19:15:11] elementaru: makes sense yeah
[19:15:33] smathy: "contains the entire git history" is not correct for any definition of "contains" I can imagine.
[19:15:52] norc-2: elementaru, that particular bit is why changing history through rebasing should not be done if someone else has fetched from your repository
[19:16:01] norc-2: elementaru, because all the hashes will mismatch and give everybody a huge headache.
[19:16:01] tubbo: yeah you can't get to anything that isn't in that commit's "lineage"
[19:16:15] tubbo: but i suppose eventually you'd find your way back to the initial commit...
[19:16:16] smathy: ...or unless you're wearing a cowboy hat, then you can do whatever you want.
[19:16:43] tubbo: norc__: hyperbole alert :)
[19:16:49] tubbo: never say never
[19:16:58] elementaru: norc__, how do people avoid it on big projects tho? branches and stuff?
[19:17:06] norc-2: elementaru, rebase before your push.
[19:17:13] norc-2: If at all.
[19:17:21] tubbo: i <3 rebase
[19:17:32] norc-2: elementaru, but yeah. branches usually play a huge role in it.
[19:17:46] elementaru: does rebase mean that I can push commit B before commit A?
[19:17:47] njero: hey, what device would be recommended for rails dev? mac or linux?
[19:17:54] norc-2: n_e_o, either is fine
[19:17:58] tubbo: elementaru: no
[19:18:13] norc-2: elementaru, rebase is the git hammer for changing the git history.
[19:18:15] arBmind: has joined #RubyOnRails
[19:18:16] tubbo: rebase means a lot of things.
[19:18:18] owenjones: has joined #RubyOnRails
[19:18:32] norc-2: elementaru, basically anything where you want a previous thing to look different somehow can be done with rebase pretty much.
[19:18:33] smathy: "if at all" - wtf?
[19:18:35] tubbo: elementaru: i would advise looking up all these commands because both `git help` and git-scm.com will tell you a lot more than we can.
[19:18:56] norc-2: smathy, some people do not like rebasing because they consider every step to be part of the history.
[19:19:01] norc-2: Its a taste I suppose.
[19:19:11] tubbo: pedantics :P
[19:19:30] tubbo: my personal philosophy is that git should look as much like a changelog as possible
[19:19:33] norc-2: Me I do not want people to see the mess I make on a bad day.
[19:19:33] tubbo: your git history*
[19:20:04] smathy: ...you just made it sound like general advice norc__ - it's a process specific thing.
[19:20:17] tubbo: as i said before, plz watch the hyperbole
[19:20:24] norc-2: smathy, my point was just that rebasing is not a necessary action if you push.
[19:21:02] njero: norc__: was going through this, http://david.heinemeierhansson.com/arc/000433.html
[19:21:28] robbyoconnor: has joined #RubyOnRails
[19:21:49] Talltree: why is the railscast website so slow :-(
[19:22:04] tubbo: n_e_o: i can't remember how old that is but given its aspect ratio, it's definitely pre-evergreen browsers haha
[19:22:25] tubbo: but yeah anything is better than windows for rails development imho
[19:22:33] norc: has joined #RubyOnRails
[19:23:00] tubbo: Talltree: it's not slow for me, but i also would imagine that it's not exactly being supported right now..
[19:23:09] tubbo: the fact that it's still online is surprising to me frank;y
[19:23:23] Talltree: mhhh, dont you think its a good resource?
[19:23:46] tubbo: Talltree: you tell me. how often do you find one of its solutions to be out of date?
[19:24:18] norc: n_e_o, the only things that can be a pain in the ass is the updates in OSX when they make some changes to the underlying security features without telling you about it.
[19:25:04] tubbo: yeah OSX does suck for that
[19:25:18] tubbo: like every time they release a new minor version you have to fuck with *something*
[19:25:21] Talltree: tubbo since i didnt direcly copy any of it, none so far.... but there is a ton i'd imagine
[19:25:26] norc: tubbo, honestly it would be fine if Apple had given me a clear notice about how El Capitan introduced SIP.
[19:25:28] njero: norc: tubbo noted :)
[19:25:35] tubbo: this time they chmod'ed /usr/bin to be read-only...
[19:25:52] tubbo: norc: is that what happened? haha
[19:26:12] micahbf: @hazelux what do the non-exact dups tend to look like?
[19:26:26] norc: tubbo, yes. And the ugly thing is everything was still kind of working, but any DYLD overrides through DYLD_LIBRARY_PATH in any build tools (say gem) stopped working.
[19:26:33] norc: Except you got the most bizarre errors.
[19:26:38] norc: Because the wrong libraries were used.
[19:27:08] tubbo: i'm not sure how much better that is on linux? i've certainly dealt with a lot of those kinds of errors.
[19:27:23] tubbo: as long as you have a good package manager you can just reinstall the latest versions, recompile ruby, recompile gems, and you're golden.
[19:28:24] norc: I guess in a way that is the downside for using a third-party tool like ruby-install, using rubygems and expecting package maintainers to be on the spot on any architectural changes of *your* operating system.
[19:28:35] elementaru: so in the given example, I change 2 files, do a commit, I change another 2 files, do another commit. if I revert last commit with "git revert <commit>", will I be able to push commit A?
[19:28:39] norc: So you make a fair point tubbo.
[19:28:50] norc: elementaru, sure.
[19:29:04] elementaru: and then right after do a commit B on another branch for example, without changing the files again?
[19:29:29] tildes_: has joined #RubyOnRails
[19:29:37] norc: elementaru, all commit does is.. well create a commit. You can use git reset to set your HEAD pointer to whatever you like.
[19:30:12] norc: (It really is just a pointer containing the hash of the commit it points to)
[19:30:29] elementaru: so my files are safe if I revert a commit?
[19:30:39] elementaru: that was not yet pushed
[19:30:44] tubbo: define "my files are safe"
[19:31:00] roamingdog: has joined #RubyOnRails
[19:31:06] norc: elementaru, as soon as you commit something git knows about it and will not forget about it that easily.
[19:31:59] norc: elementaru, and if you really screw things up badly, you still have the reflog allowing you to salvage almost anything.
[19:32:25] norc: Go toy around, the reflog has your back if things go the wrong way.
[19:35:06] Talltree: https://github.com/jhund/filterrific is EXACTLY what i've been looking for
[19:35:20] Talltree: *please work*
[19:35:22] norc: ACTION expects Talltree to be the author
[19:36:04] Talltree: nah dude, i'm such a noob still
[19:36:14] Talltree: but learning every day
[19:36:16] centrx: has joined #RubyOnRails
[19:36:35] Talltree: i should really learn to use gender unspecific language more
[19:36:42] Talltree: sorry if you're not a dude :D
[19:37:09] roamingdog: has joined #RubyOnRails
[19:37:41] elementaru: hm.. I did git revert for the last commit
[19:37:53] elementaru: and now git status says that there's nothing to commit
[19:38:48] DoctorMonocular: has joined #RubyOnRails
[19:39:17] norc: elementaru, git revert does not leave you with a dirty working directory.
[19:40:01] norc: elementaru, though I think you do not mean to revert but to reset.
[19:40:21] elementaru: I did revert..
[19:40:40] roamingdog: has joined #RubyOnRails
[19:40:49] norc: elementaru, bring this to #git
[19:40:59] elementaru: alrighty then
[19:41:33] triptec: has joined #RubyOnRails
[19:41:55] elementaru: I cannot talk there
[19:42:12] norc: elementaru, try reading the topic.
[19:42:36] elementaru: I thought I was identified already
[19:43:39] kdough1: has joined #RubyOnRails
[19:44:37] am55: i'm going through some beginner resources, and i notice that i've set a local username and password for postgresql, and I was wondering if these credentials live on if I were to deploy remotely?
[19:45:30] diegoaguilar: has joined #RubyOnRails
[19:46:56] DoubleMalt: has joined #RubyOnRails
[19:49:58] jenrzzz: has joined #RubyOnRails
[19:49:58] jenrzzz: has joined #RubyOnRails
[19:50:08] godzillaenlacasa: has joined #RubyOnRails
[19:51:11] JoshGlzBrk: has joined #RubyOnRails
[19:51:40] djbkd: has joined #RubyOnRails
[19:51:42] am55: has joined #RubyOnRails
[19:52:06] clandry94: @am55 The local username/pass probably won't be the same on the deploy server as your local dev machine
[19:52:43] srinidhi: has joined #RubyOnRails
[19:53:17] am55: oh, i guess it's an import into a remote db, not straight up copying the db
[19:54:23] mrgreenfur: anyone know how to manualy expire fragments? I’m seeting their keys in my views like: <% cache("view_#{@publisher.id}_dash_top_#{@timescale||1}") do %> but i can’t figure out how to clear them
[19:54:46] mrgreenfur: I’m using Rails.cache.delete_matched(‘view_1_*’), but it never finds the view fragments
[19:56:26] tubbo: mrgreenfur: are there any keys in the cache that match that?
[19:56:47] mrgreenfur: hard to tell! I have that cache line and i load the page, there should be one from the page load at least right?
[19:58:17] mrgreenfur: can’t find anything via Rails.cache.fetch(…)
[19:58:22] mrgreenfur: is it posisble it’s not caching?
[19:59:09] mrgreenfur: view fragments ar ejust normal cache elements right? I can use Rails.cache.delete_matched and Rails.cache.fetch, right?
[19:59:19] tubbo: mrgreenfur: yeah i thought so
[19:59:37] tubbo: it's very possible that you're not caching there, yes.
[19:59:55] qsun__: has joined #RubyOnRails
[20:00:19] tubbo: so when you say "can't find anything", are you talking about literally anything or just none of the expected cache keys
[20:00:36] RegulationD: has joined #RubyOnRails
[20:01:29] mrgreenfur: i can’t find the cache elements using Rails.cache.fetch(key) that should be set from view fragments, like cache(key) do...
[20:01:44] mrgreenfur: it works great for data set with rails.cache.fetch(key) or Rails.cache.write
[20:02:11] yellow5: has joined #RubyOnRails
[20:02:32] triptec: has joined #RubyOnRails
[20:02:39] mrgreenfur: Sorry if I’m being confusing. I set a view frag like this: <% cache("view_#{@publisher.id}_dash_top_#{@timescale||1}", digest: false) do %> and then try to see if it’s existing by: Rails.cache.read("view_#{@publisher.id}_dash_top_#{@timescale||1}”)
[20:02:41] mrgreenfur: but it’s always nil
[20:02:50] tubbo: so maybe that view fragment isn't being set
[20:02:51] DoctorMonocular: has joined #RubyOnRails
[20:02:58] tubbo: mrgreenfur: are you, by any chance, trying to find this info out in development?
[20:03:03] tubbo: because you can't test caching in development.
[20:03:13] tubbo: it's not in use
[20:03:24] tubbo: that's why dev is so slow haha
[20:03:40] tubbo: mrgreenfur: you'd need to install and boot your app into production to test caching
[20:03:59] mrgreenfur: basic write / read works okay in dev for me from console
[20:04:19] lawell: has joined #RubyOnRails
[20:04:28] tubbo: why do you have digest: false set?
[20:04:42] mrgreenfur: i read somewhere it can add digests based ont he md5 of your view
[20:04:53] mrgreenfur: just trying to eliminate possiblities of the wrong key name
[20:04:54] pawnbox: has joined #RubyOnRails
[20:05:40] mrgreenfur: aha, i see iin the console: views/view_2_dash_bottom_1/83c46714b0557e64b188a43ecfc7a4ce
[20:05:46] mrgreenfur: views/view_2_dash_bottom_1/83c46714b0557e64b188a43ecfc7a4ce
[20:05:55] mrgreenfur: must be the views/ prefix ruining my keys!
[20:06:03] tildes_: has joined #RubyOnRails
[20:06:09] mrgreenfur: cache.read works now
[20:06:28] mrgreenfur: I guess all view fragment keys start with ‘views/‘ then your key then the digest
[20:06:37] allcentu1: has joined #RubyOnRails
[20:06:46] mrgreenfur: ok, no more typing into chat for me ^^
[20:08:51] kgrz: has joined #RubyOnRails
[20:09:17] RegulationD: has joined #RubyOnRails
[20:11:01] mdw: has joined #RubyOnRails
[20:13:42] DragonPunch: has joined #RubyOnRails
[20:14:21] kronshausen: has joined #RubyOnRails
[20:15:42] djbkd: has joined #RubyOnRails
[20:16:07] Scriptonaut: I have an association, Listings have_many ShortenedUrls
[20:16:17] Scriptonaut: How can I do a query that will return all the listings with no shortened urls?
[20:16:31] Scriptonaut: I tried: Listing.joins(:shortened_urls).where("shortened_urls IS NULL")
[20:16:45] Scriptonaut: but the join must exclude the ones that have no shortened_urls. Do I need an outer join for that?
[20:18:34] mrgreenfur: Scriptonaut: the tables are named “listings” and “shortened_urls"?
[20:18:45] neanderslob: has joined #RubyOnRails
[20:18:52] mrgreenfur: or is shortened_urls an attribute/field of listings?
[20:18:58] manfrin: has joined #RubyOnRails
[20:19:03] Scriptonaut: shortened_urls is a separate table
[20:19:12] Scriptonaut: with a foreign_key listing_id
[20:19:25] mrgreenfur: so maybe Listing.where(shortened_url_id: nil)
[20:19:32] mrgreenfur: listings where the remote key is missing
[20:19:45] Scriptonaut: it's the other way around
[20:19:48] Scriptonaut: shortened_urls have a listing_id
[20:19:52] Scriptonaut: listings have no shortened_url_id
[20:19:58] Scriptonaut: but I want to return listings
[20:20:06] Scriptonaut: I want all the listings that have no shortened_urls
[20:22:45] datanois1: has joined #RubyOnRails
[20:23:31] mrgreenfur: Listing.joins(:shortened_urls).where(“shortened_urls.listing_id IS NULL")
[20:25:10] FooMunki: has joined #RubyOnRails
[20:25:57] Scriptonaut: the issue with that is it does an inner join
[20:26:10] Scriptonaut: and effectively already excludes all of the shortened_urls with a listing_id of nil
[20:26:45] mrgreenfur: oh try outer then. tbh i usualy do joins myself instead of rails
[20:26:53] Scriptonaut: oh, I finally figured it out
[20:27:06] Scriptonaut: Listing.joins("left outer join shortened_urls as su on listings.id = su.owner_id").where("su.owner_id IS NULL").count
[20:27:08] aegis3121: has joined #RubyOnRails
[20:27:12] Scriptonaut: sorry it was owner_id not listing_id
[20:27:16] Scriptonaut: thanks for the help mrgreenfur
[20:27:31] mrgreenfur: sure, not sure I helped much :)
[20:27:41] Scriptonaut: You did, that last where clause really helped me
[20:29:01] Technodrome: has joined #RubyOnRails
[20:32:53] Devalo: has joined #RubyOnRails
[20:34:32] Intii: has joined #RubyOnRails
[20:35:06] B1n4r10: has joined #RubyOnRails
[20:38:12] dreinull: has left #RubyOnRails: ("undefined")
[20:39:17] jancel: has joined #RubyOnRails
[20:41:09] micahbf: Does anyone know how I could extend an already defined association?
[20:41:19] micahbf: Specifically trying to add some functionality to papertrail versions
[20:41:32] micahbf: Can I just open up x.versions.class?
[20:41:40] micahbf: in this case ActiveRecord::Associations::CollectionProxy::ActiveRecord_Associations_CollectionProxy_PaperTrail_Version
[20:41:43] DevastatingDave: has joined #RubyOnRails
[20:42:47] micahbf: I don't know how persistent those dynamically generated proxy classes are
[20:43:03] art-solopov: has joined #RubyOnRails
[20:43:42] jancel_: has joined #RubyOnRails
[20:44:43] gingray: has joined #RubyOnRails
[20:46:17] eGGshke: has joined #RubyOnRails
[20:47:19] micahbf: nor for that matter if I have access to proxy_association if I just open up the class
[20:47:56] micahbf: confirmed: I don't
[20:48:23] tfitts: has joined #RubyOnRails
[20:49:18] godzillaenlacasa: has joined #RubyOnRails
[20:49:34] Scriptonaut: has left #RubyOnRails: ()
[20:49:55] agent_white: has joined #RubyOnRails
[20:51:51] jancel: has joined #RubyOnRails
[20:52:11] jancel: has joined #RubyOnRails
[20:55:17] Voker57|2: has joined #RubyOnRails
[20:55:36] ur5us: has joined #RubyOnRails
[20:57:39] workmad3: has joined #RubyOnRails
[20:59:40] blackmesa: has joined #RubyOnRails
[21:01:53] DoctorMonocular: has joined #RubyOnRails
[21:01:57] jaequery: has joined #RubyOnRails
[21:02:00] Macaveli: has joined #RubyOnRails
[21:03:42] JoshGlzBrk: has joined #RubyOnRails
[21:09:31] hcnewsom: has joined #RubyOnRails
[21:11:26] idefine_: has joined #RubyOnRails
[21:12:29] DoctorMonocular: has joined #RubyOnRails
[21:13:22] JoshGlzBrk: has joined #RubyOnRails
[21:13:43] jero_: has joined #RubyOnRails
[21:16:23] macsteps: has joined #RubyOnRails
[21:21:22] manfrin: has joined #RubyOnRails
[21:23:17] Ebok: has joined #RubyOnRails
[21:23:19] Doddlin: has joined #RubyOnRails
[21:23:29] Doddlin: Evening all!
[21:23:43] davidw: has joined #RubyOnRails
[21:25:34] Doddlin: I have a question regarding a respond_to block. I want it to only respond once but sometimes it prints the reply 6 times, sometimes 2 and some only the one time I want. Response is in JS. Anyone with a comment on this?
[21:27:15] allcentu1: has joined #RubyOnRails
[21:31:13] Ebok: I think I'd need context to approach this question.
[21:32:49] Ebok: A method shouldnt get called more then once unless you call it more then once.
[21:34:13] nettoweb: has joined #RubyOnRails
[21:35:08] bronson: has joined #RubyOnRails
[21:35:38] DoctorMonocular: has joined #RubyOnRails
[21:35:46] jancel: has joined #RubyOnRails
[21:36:33] alfie_max15: Doddlin, code?
[21:37:24] Doddlin: alfie_max15, I guess the controller should be enough?
[21:39:29] Doddlin: https://gist.github.com/anonymous/a50f4ca97acf87b839fd8d96644c70bc
[21:39:38] Doddlin: alfie_max15
[21:40:03] Doddlin: it is the ”check_tank” that gets fired random amount of times
[21:40:03] hcnewsom: has joined #RubyOnRails
[21:41:15] Technodrome: has joined #RubyOnRails
[21:41:43] Doddlin: And it also is seen on the server, it is not only the JS that fires, it actually is requesting the same amount of times from the server
[21:42:03] Doddlin: so I can have 6 requests on the same query
[21:42:33] hazelux: has joined #RubyOnRails
[21:42:41] Doddlin: and this will, if all goes well, handle A LOT of requests, I can’t afford to have it doing this to each and every query ^^
[21:42:58] norc: Doddlin, A LOT is quite a lot.
[21:43:21] Doddlin: norc, hahaha, I know, just that it is my first ”non-hobby” project
[21:43:48] Doddlin: so at least more than I’m used to ;)
[21:43:50] norc: Doddlin, in that case let me give you a quick tour:
[21:43:55] qejk: has joined #RubyOnRails
[21:44:16] norc: Doddlin, take your problem, make a test case. 90% of the time you have found your problem yourself by now. For the rest 10% you get to ask here.
[21:44:34] gvz108: has joined #RubyOnRails
[21:44:37] norc: If you do "non-hobby" project you definitely need to learn this.
[21:44:48] Doddlin: norc, you mean a test test, the ones you write and run locally?
[21:44:50] shinnya: has joined #RubyOnRails
[21:44:55] noobRORDev_: has joined #RubyOnRails
[21:45:11] norc: Doddlin, test cases are about reducing all related code to the minimum that still exibits your problem.
[21:45:59] workmad3: has joined #RubyOnRails
[21:46:06] Ebok: I've never been a fan of trying to parse erb files. So much ugly surrounding the pretty. I dont actually see on what line check_tank is even invoked. A search through givess me the title of one document and the method but no calls.
[21:46:31] norc: Ebok, most serious developers in here do not use erb.
[21:46:40] Ebok: I never do.
[21:46:53] norc: Though I suppose its fine for yaml.erb :P
[21:47:19] gingray: has joined #RubyOnRails
[21:48:02] idefine: has joined #RubyOnRails
[21:48:16] Doddlin: Ebok, I’m sorry… Of course you can’t find it since I posted the wrong index-file...
[21:48:43] Doddlin: Ebok, https://gist.github.com/anonymous/4133bfe04087d4a10166f7feed00a329
[21:48:47] Doddlin: There it is.. Sorry...
[21:49:00] idefine_: has joined #RubyOnRails
[21:49:04] norc: Doddlin, you pasted a fair 150 lines of code, badly formatted with tabs. You are trying to force people to play human debugger.
[21:49:16] norc: Make a test case. Seriously.
[21:49:29] Doddlin: norc, this is actually Atom’s work on indents I think
[21:49:41] xall: has joined #RubyOnRails
[21:50:22] Doddlin: Anyhow, it is the last section
[21:50:30] Ebok: No... You can tell atom what your indents are
[21:50:37] Ebok: two spaces is good.
[21:50:47] norc: Doddlin, if you know only one portion is relevant, delete the rest.
[21:50:55] norc: I dont care about dozens of lines of HTML.
[21:51:01] yfeldblum: has joined #RubyOnRails
[21:51:06] norc: It just makes it hard for anyone to read.
[21:51:10] Doddlin: fair enough
[21:51:22] norc: (And that is what creating a test case is about)
[21:51:43] norc: If you do this in a local git branch you can do this withotu impacting your code base, and still verify locally that it still exhibits the problem after removing the code.
[21:51:43] Technodrome: has joined #RubyOnRails
[21:53:32] Ebok: Or you can just ask yourself who you could be calling it six times. Is there another piece of related data that has six parts? Maybe you're calling it while iterating?
[21:54:22] Ebok: The number of actions is defined by your code, so there will be something relational to the problem at hand.
[21:55:00] Doddlin: Ebok, yeah I’ve had that thought… Tried to relate it to the compcount but nothing
[21:55:20] norc: Doddlin, secondly, do you want some honest opinions on that code?
[21:55:28] Doddlin: norc, feel free
[21:55:38] norc: Doddlin, do not use js.erb. Ever.
[21:55:46] norc: Use unobstrusive javascript.
[21:56:02] norc: js.erb is an abomination that rails should by default prevent from happening.
[21:56:22] Radar: GOOD MORNING
[21:56:40] art-solopov: norc: You mean JS views?
[21:56:43] Doddlin: norc, that is due to my low knowledge, I like it since I can access variables easily… Would you mind giving me a link to any guide or anything and I will happily read it!
[21:56:58] AnoHito_: has joined #RubyOnRails
[21:57:04] norc: Doddlin, http://edgeguides.rubyonrails.org/working_with_javascript_in_rails.html
[21:57:11] Doddlin: norc, thanks! :D
[21:57:28] norc: Doddlin, make use of jquery and data fields if you want to share code with your JavaScript (or expose the data in a separate controller)
[21:57:34] B1n4r10: has joined #RubyOnRails
[21:57:50] Doddlin: norc, I’ll definitely look into this, thank you!
[21:57:56] acovrig: is it possible to have devise_token_auth return the token as the response body instead of header?
[21:58:10] norc: Doddlin, thirdly: turn off turbolinks. Chances are it will bite you in the back and create problems you do not understand.
[21:58:40] Doddlin: norc, Haha, I love this, probably the best information-gathering I’ve been too in here ;)
[21:58:48] norc: art-solopov, yes. JS should be served as assets through the asset pipeline.
[21:59:40] h0m1x: has joined #RubyOnRails
[21:59:42] norc: Doddlin, one thing I like is that I can see you have a commented out binding.pry in your controller. Thumbs up on that one.
[22:00:39] moeabdol: has joined #RubyOnRails
[22:01:21] art-solopov: norc: I agree that it's often not a right thing to do, but I kinda understand why it's here. The alternative would be pretty much forcing a JS framework onto a programmer IMHO.
[22:01:34] blackmesa: has joined #RubyOnRails
[22:01:35] norc: art-solopov, hardly.
[22:01:48] norc: art-solopov, pure sharing data is easily done without any framework.
[22:02:06] art-solopov: norc: True, but what about inserting HTML dynamically?
[22:03:01] norc: art-solopov, you can use XHR without jquery. I think support for Promises is there nowadays, so there really isn't much left.
[22:04:23] norc: art-solopov, with the current state of JavaScript there really is not much left in jquery that people need to rely on.
[22:04:42] idefine: has joined #RubyOnRails
[22:05:05] jenrzzz_: has joined #RubyOnRails
[22:09:02] PlasmaStar: has joined #RubyOnRails
[22:09:42] allcentu1: has joined #RubyOnRails
[22:11:36] JoshGlzBrk: has joined #RubyOnRails
[22:11:48] idefine: has joined #RubyOnRails
[22:15:15] lukec: has joined #RubyOnRails
[22:15:19] Radar: Surprised React didn't get a mention :P
[22:15:41] jancel: has joined #RubyOnRails
[22:16:33] beilabs: has joined #RubyOnRails
[22:17:09] JoshGlzBrk: has joined #RubyOnRails
[22:17:17] triptec: has joined #RubyOnRails
[22:18:21] idefine: has joined #RubyOnRails
[22:18:40] jenrzzz: has joined #RubyOnRails
[22:18:40] jenrzzz: has joined #RubyOnRails
[22:20:02] helpa: has joined #RubyOnRails
[22:20:03] art-solopov: norc: No, I mean, stuff like rendering partials inside the JS view and inserting them into the HTML.
[22:22:11] Radar: art-solopov: I would really recommend looking at React with react-rails.
[22:22:52] dopamean1: has joined #RubyOnRails
[22:22:53] art-solopov: Radar: I've looked at React, kinda mixed on it.
[22:23:08] art-solopov: I personally find Knockout more to my taste.
[22:23:13] rarruda: has joined #RubyOnRails
[22:25:19] owenjones: has joined #RubyOnRails
[22:26:33] aaronroyer: has joined #RubyOnRails
[22:26:54] JoshGlzBrk: has joined #RubyOnRails
[22:27:50] patrick_star_3: has joined #RubyOnRails
[22:28:19] pipework: art-solopov: I'm a fan of Vue with dustjs
[22:28:34] art-solopov: pipework: So many frameworks, so little time. ^_^
[22:28:35] pipework: Vue is pretty fast and light compared.
[22:28:57] pipework: art-solopov: Vue isn't a framework, it's a library.
[22:29:09] pipework: Smaller, simpler, less learning a lot of noise specific to facebook.
[22:29:19] pipework: Learn yourself some standards instead.
[22:29:33] quazimodo: has joined #RubyOnRails
[22:29:56] norc: art-solopov, and you would want this because... ?
[22:30:10] mrgreenfur: has joined #RubyOnRails
[22:30:58] djbkd: has joined #RubyOnRails
[22:30:59] pipework: I'm going to be working on webworkers handling events, coming up with the new HTML+json patch to send to the UI thread that applies the patch lickety split.
[22:33:32] rarruda: has joined #RubyOnRails
[22:34:30] Asudem: Alright I got a kinda-sorta RoR question: What I'm trying to install is looking for rbenv in the wrong place. Any idea where it might be looking?
[22:35:10] neha-: hey, so i have a job that i enqueue using ActiveJob. I want to test functionality if it works (which is time dependent, it looks at Time.now). However just using travel (ActiveSupport::Testing::TimeHelpers) doesn't trigger the job to run. Normally people suggest using perform_enqueue_jobs, however that means that the jobs run automatically once created - this won't work however as my
[22:35:10] neha-: job looks at the created_at time and the Time.now in order to run. So how do I test this properly?
[22:35:11] art-solopov: norc: Well, we have several views like that on my job. And it was a pattern in all Rails books for beginners I've seen.
[22:35:51] rakm_: has joined #RubyOnRails
[22:36:03] tercenya_: has joined #RubyOnRails
[22:36:44] jacobat: has joined #RubyOnRails
[22:37:34] lipoqil: has joined #RubyOnRails
[22:37:44] gavit: has joined #RubyOnRails
[22:37:51] GragHarker: has joined #RubyOnRails
[22:39:16] zeknox: has left #RubyOnRails: ()
[22:39:30] Radar: Asudem: What info do you have to go on?
[22:39:52] diegoaguilar: has joined #RubyOnRails
[22:39:56] kanzure: has joined #RubyOnRails
[22:39:57] aaronroyer: has joined #RubyOnRails
[22:42:42] Asudem: What it's excuting: Running /usr/bin/env [ -d ~/.rbenv/versions/2.3.1 ]
[22:42:47] arBmind: has joined #RubyOnRails
[22:43:22] Asudem: result of which rbenv: /usr/local/rbenv/bin/rbenv
[22:43:44] DoctorMonocular: has joined #RubyOnRails
[22:43:52] norc: art-solopov, well it is your code, I won't stop you from doing it the wrong way.
[22:44:31] helpa: has joined #RubyOnRails
[22:44:59] helpa: has joined #RubyOnRails
[22:46:06] jstransky: has joined #RubyOnRails
[22:46:55] eGGshke: has joined #RubyOnRails
[22:48:48] pawnbox: has joined #RubyOnRails
[22:49:22] AnoHito: has joined #RubyOnRails
[22:51:02] helpa: has joined #RubyOnRails
[22:51:33] helpa: has joined #RubyOnRails
[22:51:54] Radar: !botsnack
[22:51:54] helpa: Nom nom. Thanks, Radar!
[22:52:28] art-solopov: norc: Well, again, the alternative is to pack several JS libraries, which may or may not be against some policies.
[22:52:45] aaronroyer: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[22:52:54] art-solopov: I don't think js.erb is the optimal way, but I get why it was bundled into Rails instead of, say, React or Ember.
[22:53:41] Radar: It's Good Enough For Basecamp™
[22:54:16] mrgreenfur_: has joined #RubyOnRails
[22:54:57] jstransky: has joined #RubyOnRails
[22:56:41] art-solopov: Radar: Could we not go there please?
[22:58:04] Radar: It's fun to go there.
[22:58:21] Radar: js.erb is a legacy design decision that we're stuck with. I think they didn't remove it in Rails 5 because a lot of apps depend on it.
[22:59:00] Radar: Although it's not in Rails' nature to deprecate footguns.
[22:59:16] art-solopov: Hmmmm... I wonder if including Mustache in JS and ERB would've been better.
[23:03:49] maxdoubt: has joined #RubyOnRails
[23:06:06] triptec: has joined #RubyOnRails
[23:06:14] Doddlin: has joined #RubyOnRails
[23:08:16] djbkd: has joined #RubyOnRails
[23:09:15] Synthbread: has joined #RubyOnRails
[23:15:54] jhass: has joined #RubyOnRails
[23:17:04] micahbf: has joined #RubyOnRails
[23:18:25] jordanm: what is the recommended way to run a rails application inside of docker? are people actually using nginx+passenger in docker containers?
[23:18:59] exadeci: has joined #RubyOnRails
[23:20:42] jancel: has joined #RubyOnRails
[23:24:00] Coldblackice: has joined #RubyOnRails
[23:25:44] refinerysource: has joined #RubyOnRails
[23:27:23] emachnic: has joined #RubyOnRails
[23:29:00] maxdoubt: has joined #RubyOnRails
[23:29:29] datanois1: has joined #RubyOnRails
[23:30:55] RegulationD: has joined #RubyOnRails
[23:31:06] emachnic: has joined #RubyOnRails
[23:33:49] rakm: has joined #RubyOnRails
[23:37:28] Asudem: Okay, so I'm pretty sure capistrano-rbenv is the one responsible for throwing the error
[23:38:23] Ebok: has joined #RubyOnRails
[23:40:45] arBmind: has joined #RubyOnRails
[23:40:46] StaticVoid: has joined #RubyOnRails
[23:41:59] Asudem: Okay figuring that out led to a solution, nice!
[23:42:22] micahbf: has joined #RubyOnRails
[23:46:22] maxdoubt: has joined #RubyOnRails
[23:48:49] moeabdol: has joined #RubyOnRails
[23:54:18] idefine: has joined #RubyOnRails
[23:54:34] bronson: has joined #RubyOnRails
[23:55:08] hahuang65: has joined #RubyOnRails
[23:55:55] bronson_: has joined #RubyOnRails
[23:56:54] djbkd: has joined #RubyOnRails
[23:57:22] dalbuschat: has joined #RubyOnRails