« Back to channel list

#RubyOnRails - 11 November 2017

« Back 1 day Forward 1 day »
[00:06:37] conta2: has joined #RubyOnRails
[00:15:03] ur5us: has joined #RubyOnRails
[00:40:42] dviola: has joined #RubyOnRails
[00:49:55] Cache_Money: has joined #RubyOnRails
[01:37:11] helpa: has joined #RubyOnRails
[01:47:11] irishfromua: has joined #RubyOnRails
[02:08:33] tcopeland: has joined #RubyOnRails
[02:22:10] guacamole: has joined #RubyOnRails
[02:26:25] orbyt_: has joined #RubyOnRails
[02:30:15] Cache_Money: has joined #RubyOnRails
[02:41:20] kies: has joined #RubyOnRails
[02:42:57] irishfromua: has joined #RubyOnRails
[02:43:08] cam27: has joined #RubyOnRails
[02:44:54] cam27: If I drop a column in psql is that the same as doing it in a migration? Could I not do so many migrations then if I’m comfortable with psql?
[02:45:31] fryguy: cam27: you can, but then you lose auditing and the ability to do rollbacks, and to coordinate the changes at release time
[02:46:05] cam27: ok. Thank you
[02:46:39] irishfromua: has joined #RubyOnRails
[02:54:09] cam27: I had a network issue, an upgrade to Postgres 10.1 from 9.6 issue and now I am trying to switch an old rails project over to use webpack and yarn instead of Bower and the Asset Pipeline. Switching my Jquerry stuff to React. I’m two for three so far today, but Front end stuff is not my best qualtiy lol
[02:54:44] cam27: Really don’t like JS
[02:55:05] cam27: Or front end frameworks
[02:56:22] cam27: I wanted to use Angular 4, but I’m not seeing a whole lot of free tutorials to work with yet online with Rails and Angular 4 (or 2) It all seems to be 1.5
[02:57:45] cam27: So I am thinking React, since Ember is for really big projects (according to my research) React is for small scale stuff, and Angular 1.5 is deprecated
[02:58:37] cam27: Just thinkng out loud, but what does the rails community siggest? Is Coffee and JQuerry going by the wayside?
[03:27:56] epochwolf: has joined #RubyOnRails
[03:43:41] Technodrome: has joined #RubyOnRails
[03:48:41] apparition: has joined #RubyOnRails
[03:54:02] chrickso: has joined #RubyOnRails
[03:59:09] tcopeland: has joined #RubyOnRails
[04:16:37] francuz: has joined #RubyOnRails
[04:17:47] ur5us: has joined #RubyOnRails
[04:29:18] francuz: hi all, I'm using rails 5.1.3 and ruby 2.4.1 on ubuntu 17.04. I'm having a "SyntaxError: Unterminated multiline comment" as soon as i try to use "<%= video_path ... %>"/"<%= image_path ... %>"/<%= javascript_include_tag ... %>" or anything that gives some assets path in a view. I have no idea where it can come from, and no idea where to start with debuging this kind of error. The same project is running without any
[04:29:18] francuz: problem on my laptop with same OS.
[04:29:27] guacamole: has joined #RubyOnRails
[04:29:29] francuz: Any idea where this can come form ?
[04:36:23] francuz: I'd say I probably have a typo in one of my config files somewhere, but how can i run a trace and find it ? and how can it be working on my laptop and not on my desktop? (both running same OS, RVM, ruby and rails)
[04:49:06] francuz: found it, a "*/" was missing at the end of one of the 50 precompiled .js . Still don't know why it was working on my laptop tho, and still don't know how I can track this kind of problem without going though each and every file of my asset folder ...
[04:51:56] ^mtkd: has joined #RubyOnRails
[04:58:00] jottr: has joined #RubyOnRails
[05:29:36] cam27: has left #RubyOnRails: ()
[05:32:03] matthewd: francuz: Yeah unfortunately some (most?) of the lower level libraries that support the asset pipeline aren't great at error reporting
[06:11:53] jottr: has joined #RubyOnRails
[06:18:37] ur5us: has joined #RubyOnRails
[06:20:25] guacamole: has joined #RubyOnRails
[07:07:58] guacamole: has joined #RubyOnRails
[07:20:41] Illianthe: has joined #RubyOnRails
[07:25:28] ali_g: has joined #RubyOnRails
[07:29:12] ali_g: Hi there. Has anyone consumed an API, which is actually a json served as an octect-stream application type?
[07:30:18] Dimik: has joined #RubyOnRails
[07:56:48] marr: has joined #RubyOnRails
[07:58:29] srinidhi: has joined #RubyOnRails
[08:12:59] jottr: has joined #RubyOnRails
[08:15:12] ur5us: has joined #RubyOnRails
[08:29:18] Andr3as: good morning.. i have an issue with using paperclip for "nested" attachments on a model while using dropzone.js for the file handling
[08:29:20] Andr3as: https://gist.github.com/awunder/a3c433bef528e25f9d48da9263e1cbe6
[08:29:43] Andr3as: i get a NoMethodError - undefined method `[]' for #<ActionDispatch::Http::UploadedFile:0x00007f89b8fb34e0>:
[08:30:07] Andr3as: and am stuck.. googled back and forth but am unable to figure it out.. anyone an idea?
[08:54:59] xco: has joined #RubyOnRails
[09:05:11] dionysus69: has joined #RubyOnRails
[09:08:28] yottanami: has joined #RubyOnRails
[09:09:29] yottanami: I have `:dependent => :destroy` in one of my models. now it destroied the records because of this relation. is it anyway to undelete?
[09:10:12] elomatreb: If they deleted in the database you can't unless you have backups (which you should)
[09:10:47] elomatreb: However if they were just soft-deleted (with a deleted_at column) you can probably just unset that
[09:14:05] Coldblackice: has joined #RubyOnRails
[09:27:51] BloodyMer: has joined #RubyOnRails
[09:34:00] DTZUZO: has joined #RubyOnRails
[09:34:26] one_zero: has joined #RubyOnRails
[09:48:54] gambl0re: has joined #RubyOnRails
[09:55:23] Cache_Money: has joined #RubyOnRails
[10:14:04] jottr: has joined #RubyOnRails
[10:17:51] Puffball: has joined #RubyOnRails
[10:23:17] ShalokShalom: has joined #RubyOnRails
[10:43:05] jottr: has joined #RubyOnRails
[10:54:14] DTZUZO: has joined #RubyOnRails
[10:54:59] Ergo: has joined #RubyOnRails
[11:07:21] defsdoor: has joined #RubyOnRails
[11:07:30] dionysus69: has joined #RubyOnRails
[11:08:41] mikecmpbll: has joined #RubyOnRails
[11:16:02] AzaToth: has joined #RubyOnRails
[11:19:09] Papierkorb: has joined #RubyOnRails
[11:20:17] xco: has joined #RubyOnRails
[11:24:51] dionysus70: has joined #RubyOnRails
[11:35:57] meal: has joined #RubyOnRails
[11:36:44] dionysus69: has joined #RubyOnRails
[11:38:56] fl4sh_: has joined #RubyOnRails
[11:46:29] jottr: has joined #RubyOnRails
[12:02:22] francuz: has joined #RubyOnRails
[12:06:39] xco: has joined #RubyOnRails
[12:11:34] jottr: has joined #RubyOnRails
[12:22:03] gamut: has joined #RubyOnRails
[12:34:50] conta: has joined #RubyOnRails
[12:38:45] blackmesa: has joined #RubyOnRails
[12:39:43] Jameser: has joined #RubyOnRails
[12:50:09] jottr: has joined #RubyOnRails
[13:23:09] apparition: has joined #RubyOnRails
[13:24:19] iamarun: has joined #RubyOnRails
[13:31:55] Puffball: has joined #RubyOnRails
[13:50:03] Jameser: has joined #RubyOnRails
[13:52:18] xco: has joined #RubyOnRails
[14:05:35] xco_: has joined #RubyOnRails
[14:11:25] iamarun: has joined #RubyOnRails
[14:13:25] kapil___: has joined #RubyOnRails
[14:13:53] xco: has joined #RubyOnRails
[14:20:52] tamouse__: has joined #RubyOnRails
[14:22:30] peterhil: has joined #RubyOnRails
[14:30:54] alfiemax: has joined #RubyOnRails
[14:39:46] adelyne: has joined #RubyOnRails
[14:42:59] tcopeland: has joined #RubyOnRails
[14:51:20] adelyne: has left #RubyOnRails: ()
[14:53:00] dionysus69: has joined #RubyOnRails
[14:59:03] dionysus69: has joined #RubyOnRails
[15:03:00] mtkd: has joined #RubyOnRails
[15:09:18] xco: has joined #RubyOnRails
[15:15:48] jottr: has joined #RubyOnRails
[15:17:28] alfiemax: has joined #RubyOnRails
[15:25:16] xco: has joined #RubyOnRails
[15:26:40] xco: does doing `require ‘csv’` in application.rb make CSV available in ALL folderrs (even one i created myself) in Rails?
[15:27:07] xco: does it make it available in all folders and files?
[15:28:25] dminuoso: xco: Yes. Ruby has no module infrastructure in the same sense that many other languages do.
[15:28:45] dminuoso: require is effectively just "execute this file and only hide the local variables from it"
[15:28:58] dminuoso: (with the only rule that it will execute a given file only once)
[15:30:18] dminuoso: xco: The only reason you don't have to require your own files, is because Rails does it for you through autoloading.
[15:30:25] dminuoso: (Or eager loading)
[15:31:30] xco: ok reason i’m asking is i want i have a folder called “script” and in there are a bunch of files. like 50 files all requiring CSV, so i want to delete those require lines and have them in one place, application.rb
[15:31:49] xco: i’d like to know how this autoloading from application.rb to all files and folders work though
[15:31:58] xco: seems like a bit of magic to me
[15:32:23] dminuoso: xco: Eager loading is simple. It just recursively goes through some directories and requires each file once.
[15:32:29] dminuoso: xco: http://guides.rubyonrails.org/autoloading_and_reloading_constants.html for the second.
[15:36:13] xco: from the documenation you gave me
[15:36:23] xco: it says “Ruby looks for the file in the directories listed in $LOAD_PATH. “ when require is used
[15:36:32] xco: when i do $LOAD_PATH in my console
[15:36:50] dminuoso: A bunch of things.
[15:37:02] xco: in which the CSV is
[15:37:07] dminuoso: Hopefully. :)
[15:37:14] xco: so i’m assuming CSV is part of the standard library
[15:37:22] xco: got it!
[15:37:25] xco: makes sense now!
[15:37:30] xco: thank you
[15:37:52] dminuoso: xco: And essentially the difference between the stdlib and core is that stdlib has to be required
[15:38:18] dminuoso: But both come with ruby out of the box.
[15:38:26] xco: awesome!!
[15:38:48] xco: now the magic is no more, thank you dminuoso:
[15:38:56] Saukk: has joined #RubyOnRails
[15:38:58] xco: i’ll just call you “dm”
[15:39:05] xco: dminuoso: is too long and error prone
[15:39:26] marr: has joined #RubyOnRails
[15:41:08] tamouse__: xco: type "dm<TAB>"
[15:41:33] xco: thank you dminuoso
[15:41:54] xco: thanks tamouse__
[15:50:18] alfiemax: has joined #RubyOnRails
[15:52:10] dionysus69: has joined #RubyOnRails
[15:59:39] xco: has joined #RubyOnRails
[16:07:15] mtkd: has joined #RubyOnRails
[16:17:56] Technodrome: has joined #RubyOnRails
[16:26:36] ResidentBiscuit: has joined #RubyOnRails
[16:26:47] francuz: has joined #RubyOnRails
[16:30:42] dionysus69: is it good idea to handle every action with after_action :verify_authorized in pundit? even if it's index page without authorization. I would still prefer to have authorize in every action, if performance impact is negligible
[16:31:07] dionysus69: let's say index? pundit policy would return true for public actions
[16:31:47] bronson: has joined #RubyOnRails
[16:34:45] dviola: has joined #RubyOnRails
[16:37:09] borodin: has joined #RubyOnRails
[16:38:17] borodin: I'm having a durrrr moment. on mac sierra, trying to run 'bundle install' for the first time. I get "Could not reach host index.rubygems.org. Check your network connection and try again."
[16:38:39] borodin: I can wget http://index.rubygems.org and get a nice index file in the same terminal session
[16:38:52] borodin: I can wget https://index.rubygems.org as well
[16:39:03] borodin: so this doesn't make sense
[16:39:18] borodin: unless an http proxy is somehow embedded in bundle?
[16:39:50] borodin: (this laptop is a corporate laptop with an http proxy but I unset http_proxy, https_proxy)
[16:48:55] mtkd: has joined #RubyOnRails
[16:50:56] iheanyi: has joined #RubyOnRails
[17:01:57] Vesther: has joined #RubyOnRails
[17:03:10] Vesther: Hello everyone, i've come in dire need of help, since it feels like i'm going insane :P
[17:05:25] Vesther: I'm trying to do a .where on a associated model in a rich association with a join table, but i want to return records based on join record attributes, not the target attributes
[17:07:14] Vesther: As in, having a model Foo and model Bar, as well as a join table "foobars", which contains a attribute like active:boolean, along with Foo has_many :bars, through: :foobars declared, i want to get all the Bars of a Foo where the relation record has :active => true
[17:08:27] jhass: did you try .where(foobars: {active: true}) ?
[17:09:31] Vesther: as in Foo.first.bars.where(foobars: {active: true}) ?
[17:10:07] jhass: yeah why not
[17:12:01] Vesther: Oh wow, that is exactly what i've been looking for, thank you very, very much.
[17:12:23] Vesther: Seems i've got a few production apps to rewrite.. :')
[17:13:16] jhass: fwiw something like .where('foobars.active = t') should do too but is less nice
[17:14:20] helpa: has joined #RubyOnRails
[17:15:35] orbyt_: has joined #RubyOnRails
[17:16:38] jottr: has joined #RubyOnRails
[17:26:29] jonash: has joined #RubyOnRails
[17:28:04] jonash: with associations, how do I make a has_one with required: true not fail if the field is null? i.e. only validate the related table ID if it's not null
[17:28:58] andrewray: has joined #RubyOnRails
[17:29:30] andrewray: all of the cool kids seem to be using chruby over rvm, but is there *actually* a reason to hate rvm? I can't find anything online about why chruby is better
[17:29:41] andrewray: except a few misguided blog posts
[17:30:44] jhass: jonash: well that's what required is for, maybe you're looking for validate: true?
[17:32:16] jhass: andrewray: chruby is simply doing a lot less, thus it integrates better into whatever setup you want rather than giving you only one sanctioned way to do things. Also it being simpler makes it easier to debug and reason about. But if RVM works well for you there's nothing wrong in sticking to it
[17:32:48] jonash: jhass: that doesn't seem to work, if I use required: false and validate: true and enter an invalid related ID I get a database-level foreign key constraint error
[17:33:59] jhass: ah that's what you want. I'd simply rely on the database constraint there
[17:35:06] jhass: if you absolute need it AR level doing a custom validation should be easy
[17:35:18] jhass: if you absolutely need it AR level doing a custom validation should be easy
[17:37:44] jonash: jhass: I see, thanks, it's fine without the AR level check
[17:38:35] Takumo: has joined #RubyOnRails
[17:38:56] ResidentBiscuit: has joined #RubyOnRails
[17:41:06] PresidentBiscuit: has joined #RubyOnRails
[17:41:43] safetypin: has joined #RubyOnRails
[17:46:49] dionysus69: has joined #RubyOnRails
[17:53:32] BloodyMer: has joined #RubyOnRails
[18:05:00] jfelchner: has joined #RubyOnRails
[18:07:48] dviola: has joined #RubyOnRails
[18:09:50] dionysus69: has joined #RubyOnRails
[18:12:13] andrewray: hmmm, rvm lets you do project specific gemsets, while chruby makes all gems global to that ruby version. seems like you'd obviously want project specific gemsets by default?
[18:13:20] jhass: I don't, bundler does an good enough job at that
[18:13:42] jhass: there's chgems or something iirc if you'd want it with chruby
[18:15:09] andrewray: it's sad that the first result in google for "rvm vs chruby" is this http://kgrz.io/Programmers-guide-to-choosing-ruby-version-manager.html which is not helpful at all
[18:15:52] andrewray: and so many garbage links like https://blog.metova.com/choosing-a-ruby-version-management-tool still saying "rvm overwrites the cd command"
[18:16:11] andrewray: I haven't found any objective, good posts on this topic in the ruby community yet
[18:16:21] orbyt_: has joined #RubyOnRails
[18:18:44] xco: has joined #RubyOnRails
[18:21:38] Dimik: has joined #RubyOnRails
[18:27:09] andrewray: ah, looks like bundler installs everything to the global ruby folder as well by default
[18:27:40] jhass: yes but it makes sure only what's in the Gemfile.lock can be required
[18:27:53] andrewray: huh that's kinda neat
[18:27:56] jhass: and it has --path if you want to keep the gems site local
[18:28:12] andrewray: I thought JS had it bad, I didn't realize all ruby tools default to global installs
[18:29:18] andrewray: even rvm :(
[18:34:54] andrewray: lol even the chruby repo says it "doesn't hook cd" https://github.com/postmodern/chruby#anti-features
[18:35:10] andrewray: are all ruby version managers built on a web of lies?!
[18:38:11] jhass: yes, it's a conspiracy! step 1: lie to andrewray. step 2: ?. step 3: profit!
[18:41:59] uks: has joined #RubyOnRails
[18:44:18] andrewray: hmmm rvm does claim to "hook in" to cd but it's not clear how that happens
[18:44:58] jhass: iirc they simply redefine it, used to at least
[18:45:16] andrewray: `which cd` still shows `/usr/bin/cd` for me
[18:46:06] jhass: try command -v cd
[18:46:16] jhass: which only search $PATH
[18:48:01] andrewray: oh that got me closer. `type cd`. yup it's from rvm
[19:10:31] Aherin: has joined #RubyOnRails
[19:10:34] francuz_: has joined #RubyOnRails
[19:11:38] francuz_: Hi all, I'd like to create a discord bot using rails and discordrb. I'd like to be able to have a chatbox on my website, and that it forward messages from discord to the chatbox basically. Making the bot(using the discordrb gem) and the chat(thinking about using action record) isn't that much of a problem (I think) but I'm wondering how I should connect them.
[19:11:56] francuz_: From what I know, I should define the "bot" and its functions in a file(don't know where), than "bot.run async" during server initialisation(don't know how), and have bot be a global variable. That way I would be able to use bot.send_message(Message) in the controller that is working with the chat.
[19:12:01] francuz_: Also, in the definition of the bot I should make an "event" that catches any message I send inside a channel, and that even should call a specific method to add the new message(don't know how to do that)
[19:12:09] francuz_: Not asking you to do it for me of course, just asking if the global idea is okey, or if I doing something totally wrong? and if you have any advice/answers/keywords I should search for before making it, it would be great.
[19:12:24] jottr: has joined #RubyOnRails
[19:30:42] apofis: has joined #RubyOnRails
[19:34:30] guacamole: has joined #RubyOnRails
[19:40:49] Cache_Money: has joined #RubyOnRails
[19:43:15] apofis: has joined #RubyOnRails
[19:46:22] simmerz: has joined #RubyOnRails
[19:49:47] troys: has joined #RubyOnRails
[19:54:27] alfiemax: has joined #RubyOnRails
[19:58:39] dionysus69: has joined #RubyOnRails
[20:05:57] xco: has joined #RubyOnRails
[20:15:57] jottr: has joined #RubyOnRails
[20:20:01] andrewray: has joined #RubyOnRails
[20:24:24] dviola: has joined #RubyOnRails
[20:25:45] francuz: has joined #RubyOnRails
[20:36:24] ResidentBiscuit: has joined #RubyOnRails
[20:36:42] dviola: has joined #RubyOnRails
[20:40:47] ali_g: has joined #RubyOnRails
[20:50:06] BloodyMer: has joined #RubyOnRails
[20:51:33] cagomez: has joined #RubyOnRails
[20:53:52] ResidentBiscuit: has joined #RubyOnRails
[20:56:27] jottr: has joined #RubyOnRails
[21:15:42] gamut: has joined #RubyOnRails
[21:20:28] gamut: has joined #RubyOnRails
[21:24:26] mtkd: has joined #RubyOnRails
[21:25:07] francuz: has joined #RubyOnRails
[21:26:33] conta: has joined #RubyOnRails
[21:27:08] zinovyev: has joined #RubyOnRails
[21:38:03] andrewray: has joined #RubyOnRails
[21:39:18] andrewray: has joined #RubyOnRails
[21:43:12] boostbrigade: has joined #RubyOnRails
[21:44:37] jottr: has joined #RubyOnRails
[21:50:56] Technodrome: has joined #RubyOnRails
[22:08:15] ur5us: has joined #RubyOnRails
[22:13:01] guacamole: has joined #RubyOnRails
[22:25:11] francuz: has joined #RubyOnRails
[22:25:35] weaksauce: has joined #RubyOnRails
[22:36:27] francuz_: Hi all, I'd like to create a discord bot using rails and discordrb. I'd like to be able to have a chatbox on my website, and that it forward messages from discord to the chatbox basically. Making the bot(using the discordrb gem) and the chat(thinking about using action record) isn't that much of a problem (I think) but I'm wondering how I should connect them.
[22:36:36] francuz_: From what I know, I should define the "bot" and its functions in a file(don't know where), than "bot.run async" during server initialisation(don't know how), and have bot be a global variable. That way I would be able to use bot.send_message(Message) in the controller that is working with the chat.
[22:36:42] francuz_: Also, in the definition of the bot I should make an "event" that catches any message I send inside a channel, and that even should call a specific method to add the new message(don't know how to do that)
[22:36:49] francuz_: Not asking you to do it for me of course, just asking if the global idea is okey, or if I doing something totally wrong? and if you have any advice/answers/keywords I should search for before making it, it would be great.
[22:42:50] conta: has joined #RubyOnRails
[22:45:39] simmerz: has joined #RubyOnRails
[23:21:12] Technodrome: has joined #RubyOnRails
[23:25:03] francuz: has joined #RubyOnRails
[23:30:30] keegnotrub: has joined #RubyOnRails
[23:31:44] keegnotrub_: has joined #RubyOnRails
[23:36:19] dviola: has joined #RubyOnRails
[23:38:39] orbyt_: has joined #RubyOnRails
[23:47:28] tamouse__2: has joined #RubyOnRails