#RubyOnRails - 12 January 2018
« Back 1 day Forward 1 day »
[00:00:44] fryguy: you should make the images smaller on your site so they are appropriately sized, displaying a 3000x3000 image that is 10MB in a 100x100 slot on the site is going to be problematic
[00:02:33] Smedley_: I have the full size images, which I use in show and then set the css to size them down
[00:08:30] Radar: Smedley_: I have a blog post covering it here: http://ryanbigg.com/2017/08/rails-dropzone-js-amazon-s3-and-imgix
[00:39:01] conceivably: Hi. Is it possible to configure the webpack-dev-server so that it also live-reloads regular rails assets?
[02:24:17] amperry: so I have a controller action that looks for a placement, and and if block: "if @placement.nil? ; redirect_back fallback_location: '/transfers' ; end". @placement.nil? is true, but I'm not redirect-ing back. Anything wrong with my syntax or semantics here?
[08:33:52] Torrone: Hello, I'm trying to test a mail delivery within a fork process triggered by a post request in rspec, I have the post request within a before block. What's the proper way to do it?
[08:41:46] za1b1tsu: Hello, I made scopes that should be used for other scopes so I dont have long lines
[08:54:05] fugee: i'm looking at different blog engines, i notice only one of many instructs you to put the engine in your models, how do the others provide similar functionality without adding the gem to the models
[09:03:14] Andr3as: i am stuck, a bit.. i have a before_action for clearance in the app controller and skip it for some static pages.. thats working fine
[09:04:24] Andr3as: now i've added the koudoku gem to make stripe payments and this has some strnage changes to be made as this is mounted as (another app?)
[09:06:09] Andr3as: i thought i'd overreide the subscription controller with https://gist.github.com/awunder/4fe016f93bc58a8ed03c92b525d8890b but that doesnt do the trick.. what am i doing wrong?
[12:06:28] za1b1tsu: Hello, for a model I have an attribute expire that is an DateTime object, when I try to do Model.new(expire: DateTime.current) in the console, it shows expire nil, but if do Model.new(name:'foo') the name attribute has 'foo' value. Anybody knows why?
[12:17:34] za1b1tsu: change_column :sessions, :expire, :timestamptz, default: now() + interval "1week"
[12:38:59] apeiros: as in, is it `class Model; attribute :expire …` or is it an actual column in your database?
[12:47:06] apeiros: also you almost never want update_attribute. it bypasses validations, callbacks and maybe some things I forgot to list right now.
[12:47:29] fschuindt: when you update, you're saving, unless you're updating the same attribute, in this case is just a COMMIT
[12:48:40] apeiros: update_attributes and update_attributes! also persist, but perform validations, callbacks etc.
[12:55:56] apeiros: so to be fully correct: update_attributes is an alias of update, update_attributes! is an alias of update!. and all 4 perform save or save! respectively.
[13:15:57] za1b1tsu: Hi, so from what I've read online, when I test a model_c that belongs to model_a and model_b, there is no way I can stub model_a and model_b, I need to actually create them?
[14:18:45] za1b1tsu: Can someone explain this https://gist.github.com/bbtdev/825c437d94948577653bdc8cc75cd55b ?
[14:32:53] drale2k_: Is it ok to have a resource or rather a namespace in this case, not be plural with an "s" ? I need "loot"
[14:54:43] Jnco: Hey Guys, how ya doin? Big time noobie over here that needs a bit of advice. I am attempting to use carrierwave-aws gem and wondering what brackets or what I need to do in order to configure a couple variables for use with AWS KMS encryption keys. I am close I swear but still getting an error "ArgumentError (unexpected value at params[:"x-amz-server-side-encryption-aws-kms-key-id"]):". I know I just have to pass that argument
[15:00:02] Rinkana: Are there any articles on how to connect two rails services trough GraphQL with eachother, acting like models for any references?
[16:57:50] amperry: Anyone know why redirect_back would fail? I have a conditional, if @placement.nil?, which fails to redirect_back even when @placement is, in fact, nil. Gist: https://gist.github.com/amp108/7bebf15053cc3a91c907d1e4e44e442b <-- although it doesn't say much more than what I just have.
[18:11:42] havenwood: desperek: If I had to guess, I'd say you have a model and want #all, but unsure?
[18:12:46] desperek: havenwood, ah, fianlly, so for now, I want to make new Model X from x_params, the problem is, that x_params contain a "Y" which is string (but it is meant to be int and is id of something owning the X), now, I am tryinng to fetch a simple model but it doesnt work really
[18:29:23] amperry: Andr3as: sorry, I was away for a bit. It is literally nil. I checked after throwing 'byebug' in there.
[19:04:15] ule: Hey guys, I'm trying to understand how Rails Assets works. I have some webservers loading different fingerprints between them.
[19:17:35] ule: after this, my Rails app is requesting different hashes depending of which server the request goes
[19:18:24] ule: fryguy: so, do you where in rails core or sprockets it actually opens that filename to decide which file it should load?
[19:25:58] desperek: fryguy, could you perhaps tell me, what do i do when i want to get all posts that have parameter set to nil from the association?
[19:28:48] ule: I know.. but it generates a file inside that assets folder called ".sprockets-manifest-md5hash.json"
[19:29:45] ule: "The task also generates a .sprockets-manifest-md5hash.json (where md5hash is an MD5 hash) that contains a list with all your assets and their respective fingerprints. This is used by the Rails helper methods to avoid handing the mapping requests back to Sprockets. A typical manifest file looks like:"
[19:33:34] fryguy: https://github.com/rails/sprockets/blob/09f44cb0334ba94afbf0c3c385933e38f62bcd82/lib/sprockets/manifest_utils.rb#L9
[20:17:08] beingjohnm: is there a way to undo a csv import if an error occurs with one of the rows? Or do I need to test the whole csv file before saving records?
[20:31:57] desperek: what do i do when i want to get all posts that have parameter set to nil from the association?