« Back to channel list

#RubyOnRails - 03 September 2018

« Back 1 day Forward 1 day »
[00:04:32] JamJam_kid: has joined #RubyOnRails
[01:02:20] Technodrome: has joined #RubyOnRails
[01:04:45] sevenseacat: has joined #RubyOnRails
[01:05:07] ariedler: has joined #RubyOnRails
[01:25:12] tdy: has joined #RubyOnRails
[02:18:02] Saukk: has joined #RubyOnRails
[02:18:33] apeiros: has joined #RubyOnRails
[02:19:27] rootsudo: has joined #RubyOnRails
[02:21:06] fugee: has joined #RubyOnRails
[02:21:18] Technodrome: has joined #RubyOnRails
[02:22:01] fugee: the presence of attr_accessor in a model inside a gem is gonna be a problem in a 5 or above app?
[02:22:09] fugee: not attr_accessor
[02:22:23] fugee: the presence of attr_accessible in a model inside a gem is gonna be a problem in a 5 or above app?
[02:22:31] aesthetikx: attr_accessible was removed after 3 iirc
[02:23:06] fugee: i have this problem with mailboxer and when i look inside the gem i find these attr_accessible statements
[02:23:44] fugee: but this version of the gem was released in may 2017
[02:24:27] sevenseacat: there are compatibility libraries that re-add support for it
[02:24:47] fugee: specific to the gem?
[02:25:05] fugee: ok thanks
[02:25:13] sevenseacat: are you actually having an issue?
[02:25:28] fugee: message comes up nil in conversation show
[02:25:37] Radar: GOOD MORNING
[02:25:37] Radar: WELL IT IS AFTERNOON NOW ACTUALLY
[02:25:43] sevenseacat: morning Radar
[02:25:52] sevenseacat: got an error to show us?
[02:25:53] Radar: fugee: !rule0
[02:25:53] helpa: fugee: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[02:31:18] eckhardt: has joined #RubyOnRails
[02:40:47] fugee: https://gist.github.com/mices/e446b5b90e0d65ad0d5a559aa15f9e9b
[02:41:30] HisShadow: has left #RubyOnRails: ()
[02:43:49] jenenliu: has joined #RubyOnRails
[02:50:02] mices: has joined #RubyOnRails
[02:50:16] mices: hi sevenseacat
[02:50:34] mices: https://gist.github.com/mices/e446b5b90e0d65ad0d5a559aa15f9e9b
[02:50:44] mices: i got dc'd
[02:53:20] mices: i must have messed somethingn up?
[02:58:34] eckhardt: has joined #RubyOnRails
[03:03:07] jenenliu: has joined #RubyOnRails
[03:06:17] ariedler: has joined #RubyOnRails
[03:06:47] srinidhi: has joined #RubyOnRails
[03:10:03] braincrash: has joined #RubyOnRails
[03:18:29] quazimodo: has joined #RubyOnRails
[03:30:20] blobsson: is it possible to put a "hold" on a model to prevent other threads from doing anything until its over
[03:36:50] aesthetikx: take a look at ActiveRecord::Base.transaction, may be what you need
[04:11:49] knight33: has joined #RubyOnRails
[04:40:27] jjman: has left #RubyOnRails: ("WeeChat 1.6")
[04:46:41] quazimodo: has joined #RubyOnRails
[04:50:37] cgfbee: has joined #RubyOnRails
[05:03:58] LambdaSource: has joined #RubyOnRails
[05:07:14] ariedler: has joined #RubyOnRails
[05:08:58] LambdaSource: has joined #RubyOnRails
[05:17:27] LambdaSource: has joined #RubyOnRails
[05:21:31] LambdaSource: has joined #RubyOnRails
[05:44:06] nemesit: has joined #RubyOnRails
[05:50:30] quazimodo: has joined #RubyOnRails
[06:09:36] reber: has joined #RubyOnRails
[06:11:34] dionysus69: has joined #RubyOnRails
[06:11:52] snickers: has joined #RubyOnRails
[06:15:38] jenenliu_: has joined #RubyOnRails
[06:23:28] LambdaSource: has joined #RubyOnRails
[06:36:47] jammanbo: has joined #RubyOnRails
[06:46:13] sandstrom: has joined #RubyOnRails
[07:00:32] kotepillar_: has joined #RubyOnRails
[07:00:55] kapil___: has joined #RubyOnRails
[07:04:37] kotepillar_: why can’t send too long message in here
[07:05:24] sevenseacat: because people don't like reading paragraphs of text in one hit
[07:05:39] sevenseacat: think about what you want to write, and say it succinctly.
[07:05:48] kotepillar_: https://dpaste.de/rUE3 here is my question, I can’t send it to you
[07:05:57] kotepillar_: I am not think it’s too long
[07:06:29] sevenseacat: /user-posts/ vs /posts/?user_id which one is more restful isnt too long, no.
[07:06:56] sevenseacat: neither is restful, something like /users/12/posts would be restful.
[07:09:52] kotepillar_: Why you are so sure ? is there any book or blog decribe this question
[07:11:52] sevenseacat: its how rails resourceful routing works by default
[07:12:35] sevenseacat: https://guides.rubyonrails.org/routing.html#resource-routing-the-rails-default is a quick primer - I don't have any more detailed resources on hand right now
[07:13:17] kotepillar_: And my admin need to manage /posts/ and client app need to manage /user/12/posts/, so I need to write two resource ?
[07:14:37] sevenseacat: you might need to clarify what you mean. there are two schools of thought - one is to have a completely separate admin area for your admins to use, one is to have admin actions in your normal controllers
[07:19:31] kotepillar_: so there is no right and wrong, which method is easy to maintain, I choice the one, right ?
[07:19:42] sevenseacat: you choose what's best suited to your app.
[07:32:46] mikecmpbll: has joined #RubyOnRails
[07:53:07] Technodrome: has joined #RubyOnRails
[07:57:07] mikecmpbll: has joined #RubyOnRails
[07:59:38] sandstrom: has joined #RubyOnRails
[08:33:14] lxsameer: has joined #RubyOnRails
[08:43:57] r3za: has joined #RubyOnRails
[08:47:33] uks: has joined #RubyOnRails
[08:47:34] pwnd_nsfw: has joined #RubyOnRails
[08:51:25] desperek: has joined #RubyOnRails
[09:01:07] roshanavand: has joined #RubyOnRails
[09:05:11] kotepillar_: has joined #RubyOnRails
[09:11:56] roshanavand: has joined #RubyOnRails
[09:39:19] sonOfRa: Apologies if these messages show up twice, I switched connection and am not sure whether they were successfully sent:
[09:39:49] sonOfRa: I'm deploying an app with passenger, but I tend to run into the problem that the ruby on debian stable is too old to work with whatever the current rails version is. I could move to testing instead of stable, but it can probably happen there too. What do you folks do to work around this? Currently I compile newer rubies from source and build passenger against that, but that's annoying and a lot of work everytime there's an upgrade. The
[09:39:49] sonOfRa: application doesn't have a lot of users (there's ~250 accounts, and people only log in to change their password, or admins log in to create new users), so I was wondering if it's viable to just run the builtin web server, and slap a reverse proxy in front of it; that way I can just install ruby locally for a user, have that user run the server on localhost:3000 inaccessible to other IPs, and have apache proxy it to :443 on the real domain name
[09:58:25] roshanavand: has joined #RubyOnRails
[09:59:08] mices: has joined #RubyOnRails
[09:59:29] mices: i'm trying to understand the models of mailboxer gem
[10:01:13] mices: i found "belongs_to :sender :polymorphic => :true, :required => false" in notification.rb but i can't find "as: : sender" in any of the other models
[10:03:50] Ergo: has joined #RubyOnRails
[10:07:40] dionysus69: any idea why this is not working? <input type="number" min="1e-18" step="1e-18" >
[10:08:02] dionysus69: it works for <input type="number" min="1e-8" step="1e-8" >
[10:08:06] dionysus69: and smaller values
[10:16:01] DTZUZO: has joined #RubyOnRails
[10:17:10] jottr: has joined #RubyOnRails
[10:30:39] nottwo: has joined #RubyOnRails
[10:33:40] noob_on_rails: has joined #RubyOnRails
[10:33:42] Giorgio: has joined #RubyOnRails
[10:34:32] noob_on_rails: hey all if i have a = [1,2,3] and b = [0,1] how can i use b so i get what i would if i just a[0,1] #=> [1,2]
[10:35:28] Giorgio: what is best practice to save range in postgresql daterange column from form ?
[10:48:24] lankanmon: has joined #RubyOnRails
[10:49:07] TvL2386: noob_on_rails: what are you trying to accomplish?
[10:50:06] TvL2386: noob_on_rails: is "b" referencing index positions your interestend in in "a"?
[10:50:12] noob_on_rails: i have a hash which contains data like user1: [1,2,5] , which those corespond to the index number of the things i want to return for this user , from another array
[10:52:57] anikras: has joined #RubyOnRails
[10:53:07] TvL2386: noob_on_rails: trying to find a small (one-liner) solution
[10:53:36] TvL2386: noob_on_rails: but in the mean time: a.each_with_index { |index, value| puts value if b.include?(index) }
[10:53:39] TvL2386: something like that
[10:53:50] noob_on_rails: TvL2386: i was trying not to iterate
[10:53:57] noob_on_rails: at least "syntactically"
[10:54:32] TvL2386: better to just get out of a, which b refers to
[10:54:40] TvL2386: because a might be enormous
[10:54:50] TvL2386: and b always contains what you must get
[10:55:05] TvL2386: b.map { |index| a[index] }
[10:55:07] ariedler: has joined #RubyOnRails
[10:55:15] TvL2386: that will get you your array
[10:56:46] noob_on_rails: ya i think it's clean enough for what i want to do
[10:57:03] TvL2386: yw! If you do see a cleaner solution, I'd be interested :)
[11:01:34] sandstrom: has joined #RubyOnRails
[11:21:21] kotepillar_: has joined #RubyOnRails
[11:22:11] beholders_eye: has joined #RubyOnRails
[11:23:21] drale2k_: has joined #RubyOnRails
[11:24:44] quazimodo: has joined #RubyOnRails
[11:56:38] noob_on_rails: has joined #RubyOnRails
[12:11:15] mikecmpbll: has joined #RubyOnRails
[13:02:10] mikecmpbll: has joined #RubyOnRails
[13:09:41] mices: https://gist.github.com/mices/e446b5b90e0d65ad0d5a559aa15f9e9b
[13:11:47] dblessing: has joined #RubyOnRails
[13:15:50] lexileo: has joined #RubyOnRails
[13:15:51] sandstrom: has joined #RubyOnRails
[13:26:12] sandstrom: has joined #RubyOnRails
[13:41:54] mices: has joined #RubyOnRails
[13:42:05] mices: https://gist.github.com/mices/e446b5b90e0d65ad0d5a559aa15f9e9b
[14:36:07] drale2k_: has joined #RubyOnRails
[14:44:33] srinidhi: has joined #RubyOnRails
[14:52:56] LambdaSource: has joined #RubyOnRails
[15:03:24] conta2: has joined #RubyOnRails
[15:05:09] mices: has joined #RubyOnRails
[15:06:30] Technodrome: has joined #RubyOnRails
[15:14:31] kotepillar_: has joined #RubyOnRails
[15:20:13] Technodrome: has joined #RubyOnRails
[15:34:00] Applitect: So lets say I've loaded 2 models into 2 different arrays and I want to show the records from array 1 that don't exist in array 2. What's the easiest but most efficient way to do that?
[15:36:29] dblessing: has joined #RubyOnRails
[15:42:49] syndikate: Are you trying to do array1 - array2?
[15:45:22] Applitect: Yea.. actually its more like Array2 - Array1
[15:45:49] Applitect: But can you actually do that? Subtract an array from another array?
[15:49:21] Applitect: Ok... I guess so. Just read up on it. Wow... didn't expect it to be that simple.
[15:56:44] hays: has joined #RubyOnRails
[16:02:31] lomex: has joined #RubyOnRails
[16:05:42] hays_: has joined #RubyOnRails
[16:10:28] eddof13: has joined #RubyOnRails
[16:13:29] lxsameer: has joined #RubyOnRails
[16:14:18] Dbugger: has joined #RubyOnRails
[16:18:03] hays: has joined #RubyOnRails
[16:21:35] srinidhi: has joined #RubyOnRails
[16:23:11] lxsameer: has joined #RubyOnRails
[16:33:13] lxsameer: has joined #RubyOnRails
[16:43:11] lxsameer: has joined #RubyOnRails
[16:43:36] lomex: has joined #RubyOnRails
[16:44:53] dionysus69: has joined #RubyOnRails
[16:46:01] samort7: has joined #RubyOnRails
[16:48:05] Dimik: has joined #RubyOnRails
[16:53:16] lxsameer: has joined #RubyOnRails
[16:57:38] emmezeta: has joined #RubyOnRails
[16:57:56] emmezeta: Hi, Yesterday I started for the *first time* ruby and ruby on rails from the getting started guide.
[16:57:57] emmezeta: I've a question about deleting-associated-objects https://guides.rubyonrails.org/getting_started.html#deleting-associated-objects.
[16:58:06] emmezeta: when I delete an Article that has a 1:n relation with Comments "has_many :comments, dependent: :destroy", I can se from the server logs that each comment is deleted with 1 query. So, delete an article with 10 comments will fire 11 "delete" queries. (n+1 problem)
[16:58:12] emmezeta: Why Rails don't use a single delete query for every articles "DELETE comments WHERE article_id = ?" ? Is there some drawback I can't see?
[17:03:13] lxsameer: has joined #RubyOnRails
[17:13:19] lxsameer: has joined #RubyOnRails
[17:18:04] dblessing: has joined #RubyOnRails
[17:23:15] lxsameer: has joined #RubyOnRails
[17:33:33] lxsameer: has joined #RubyOnRails
[17:33:54] Aherin: has joined #RubyOnRails
[17:43:14] lxsameer: has joined #RubyOnRails
[17:46:38] _ritchie_: has joined #RubyOnRails
[17:47:35] _ritchie_: anyone here familar with ActiveAdmin filters on model index pages?
[17:48:05] _ritchie_: I’m trying to write one for a field on an associated model from a had_one relation and I’m looking at the Ransack docs and it’s just not working
[17:48:14] _ritchie_: has_one relation
[17:53:15] lxsameer: has joined #RubyOnRails
[18:03:31] lxsameer: has joined #RubyOnRails
[18:10:01] LambdaSource: has joined #RubyOnRails
[18:13:12] lxsameer: has joined #RubyOnRails
[18:17:30] defsdoor: has joined #RubyOnRails
[18:23:13] lxsameer: has joined #RubyOnRails
[18:23:44] Croata: has joined #RubyOnRails
[18:27:34] beholders_eye: has joined #RubyOnRails
[18:33:21] lxsameer: has joined #RubyOnRails
[18:43:22] lxsameer: has joined #RubyOnRails
[18:43:22] Linuus: has joined #RubyOnRails
[18:49:42] dionysus70: has joined #RubyOnRails
[18:53:15] lxsameer: has joined #RubyOnRails
[19:03:29] lxsameer: has joined #RubyOnRails
[19:10:55] arielserafini_: has joined #RubyOnRails
[19:11:00] arathald: has joined #RubyOnRails
[19:11:27] TheMoonMaster_: has joined #RubyOnRails
[19:15:26] noodle: has joined #RubyOnRails
[19:17:15] beholders_eye: has joined #RubyOnRails
[19:18:34] kapil___: has joined #RubyOnRails
[19:35:45] Technodrome: has joined #RubyOnRails
[19:36:26] jari: i'm learning RoR atm
[19:36:36] jari: at i'm finding it a treat
[19:36:43] jari: but i thought i'd pick it up a bit faster
[19:36:56] jari: (maybe i'm just slow)
[19:51:38] DTZUZO: has joined #RubyOnRails
[20:05:14] sameerynho: has joined #RubyOnRails
[20:12:23] sandstrom: has joined #RubyOnRails
[20:17:25] LambdaSource: has joined #RubyOnRails
[20:18:24] Technodrome: has joined #RubyOnRails
[20:45:52] danguita: has joined #RubyOnRails
[20:59:12] orbyt_: has joined #RubyOnRails
[21:15:15] Guest58115: has joined #RubyOnRails
[21:32:25] LambdaSource: has joined #RubyOnRails
[21:51:10] LambdaSource: has joined #RubyOnRails
[21:52:45] LambdaSource: has joined #RubyOnRails
[21:59:01] LambdaSource: has joined #RubyOnRails
[22:06:58] beholders_eye: has joined #RubyOnRails
[22:12:34] mikecmpbll: has joined #RubyOnRails
[23:03:52] billabel: has joined #RubyOnRails
[23:15:52] Guest58115: has joined #RubyOnRails
[23:21:32] apeiros: has joined #RubyOnRails
[23:22:42] LiftLeft3: has joined #RubyOnRails
[23:23:50] jackrandom: has joined #RubyOnRails
[23:26:33] orbyt_: has joined #RubyOnRails
[23:31:55] dviola: has joined #RubyOnRails
[23:34:31] quazimodo: has joined #RubyOnRails