« Back to channel list

#RubyOnRails - 13 November 2018

« Back 1 day Forward 1 day »
[00:01:17] CGibsonmm: So would it be safe to get rid of the rest of the through: associations? and then go back and re-read there use?
[00:01:51] orbyt_: has joined #RubyOnRails
[00:02:55] orbyt_: `An error occurred while installing mysql2 (0.4.10), and Bundler cannot continue.
[00:02:55] orbyt_: Make sure that `gem install mysql2 -v '0.4.10' --source 'https://rubygems.org/'` succeeds before
[00:02:55] orbyt_: bundling.`
[00:03:03] orbyt_: Has anyone seen anything like this?
[00:03:27] akosednar: has joined #RubyOnRails
[00:03:39] orbyt_: Trying to help someone get a rails project setup and bundle won't complete because of some native extensions issue with mysql2
[00:04:34] CGibsonmm: Radar: Thank you, it is working as expected now!
[00:04:43] Radar: Great :) Sorry it took so long for us to fix.
[00:08:04] CGibsonmm: Radar: That's fine it works now! Thank you Again
[00:20:40] akosednar: has joined #RubyOnRails
[00:34:01] Exuma: has joined #RubyOnRails
[00:41:56] EXCHGR: has joined #RubyOnRails
[00:53:59] jane_booty_doe: has joined #RubyOnRails
[01:16:38] weaksauce: has joined #RubyOnRails
[01:27:30] hnanon: Hey Radar.
[01:29:23] hnanon: I remember, years ago, you said something about shopping carts and orders being basically the same, just in different states...or something like that.
[01:29:23] hnanon: Am I remembering that correctly?
[01:42:38] Radar: hnanon: I probably last gave that advice in 2014 :P
[01:42:56] hnanon: Yeah, really.
[01:43:24] Radar: hnanon: But yes, that was the gist of it. Carts and orders are the same thing. I am less convinced of that modelling now and I would have them be separate entities.
[01:43:34] hnanon: Your opinion is different now?
[01:43:49] Radar: hnanon: Carts are _potential_ orders, and go through their own state transitions. Orders never go back into the "address" or "delivery" or "payment" states.
[01:44:00] Radar: Similarly, carts never reach a "refunded" state.
[01:44:34] Radar: To keep the model separate and simpler, I would now have a Cart model and an Order model.
[01:44:59] hnanon: I see. Cool. I'm working on an ecommerce app at the moment.
[01:57:59] uksio: has joined #RubyOnRails
[02:11:00] elcontrastador: "validates :department, presence: false, length: { maximum: 20 }" doesn't pass unit tests when given nil but works thru form because params assign empty string. Am I missing a way to use a rails validates() validation to make a field non-reqd but not to exceed 20chars if provided? I can easily roll this into a custom validator...so easily that I question that it isn't already baked in.
[02:20:16] Dimik: has joined #RubyOnRails
[02:30:46] elcontrastador: disregard prior: validates :department, allow_nil: true, allow_blank: true, length: { in: 1..20 }
[02:30:46] Saukk: has joined #RubyOnRails
[02:32:21] tdy: has joined #RubyOnRails
[03:01:45] darkhanb: has joined #RubyOnRails
[03:34:12] Xiti: has joined #RubyOnRails
[03:36:12] fragamus: has joined #RubyOnRails
[03:37:56] za1b1tsu: has joined #RubyOnRails
[04:06:01] gambl0r3: has joined #RubyOnRails
[04:08:52] fragamus: has joined #RubyOnRails
[04:09:44] braincrash: has joined #RubyOnRails
[04:14:27] roshanavand1: has joined #RubyOnRails
[04:26:26] MoritaShinobu: has joined #RubyOnRails
[04:29:31] Radar: elcontrastador: you probably want "allow_blank"
[04:29:35] Radar: !validations
[04:29:35] helpa: The Active Record Validations Guide - http://guides.rubyonrails.org/active_record_validations.html - Written by Jaime Iniesta
[04:29:56] Radar: Section 3.2.
[04:31:09] elcontrastador: ahh... allow_blank is superset of both nil and empty. Def cleaner. Thank u
[04:32:41] elcontrastador: cool...changed...tests pass. thx again
[04:53:31] kapil____: has joined #RubyOnRails
[04:57:05] Exuma: has joined #RubyOnRails
[04:59:33] Guest53511: has joined #RubyOnRails
[05:00:15] hnanon: has joined #RubyOnRails
[05:06:32] sevenseacat: has joined #RubyOnRails
[05:09:42] Exuma: has joined #RubyOnRails
[05:13:38] za1b1tsu: has joined #RubyOnRails
[05:20:50] eckhardt_: has joined #RubyOnRails
[05:46:18] fragamus: has joined #RubyOnRails
[05:59:12] fragamus: has joined #RubyOnRails
[06:15:16] srinidhi: has joined #RubyOnRails
[06:20:55] conta: has joined #RubyOnRails
[06:25:23] reber: has joined #RubyOnRails
[06:33:52] roshanavand: has joined #RubyOnRails
[06:47:35] armyriad: has joined #RubyOnRails
[06:49:10] armyriad: has joined #RubyOnRails
[07:07:55] gambl0re: has joined #RubyOnRails
[07:09:37] za1b1tsu: has joined #RubyOnRails
[07:09:58] mangold: has joined #RubyOnRails
[07:23:33] dionysus69: has joined #RubyOnRails
[07:55:24] mangold: has joined #RubyOnRails
[07:56:35] mangold: has joined #RubyOnRails
[08:26:39] whysthatso: has joined #RubyOnRails
[08:27:25] akosednar: has joined #RubyOnRails
[08:29:04] dionysus69: when I do bundle package --all it installs gems into vendor/cache dir
[08:29:11] dionysus69: but when I add that dir to the repo I get this error
[08:29:16] dionysus69: You've added another git repository inside your current repository.
[08:30:03] dionysus69: adding embedded git repository: vendor/cache/ruby/2.5.0/bundler/gems/ckeditor-dc2cef2c2c33
[08:30:23] dionysus69: obviously, ckeditor gem is fetched from github
[08:30:27] dionysus69: what's the workaround?
[08:40:50] akosednar: has joined #RubyOnRails
[08:43:55] srinidhi: has joined #RubyOnRails
[08:59:44] akosednar: has joined #RubyOnRails
[09:24:51] roshanavand: has joined #RubyOnRails
[09:25:08] Guest53511: has joined #RubyOnRails
[09:32:37] davidh38: has joined #RubyOnRails
[09:32:56] gavit: has joined #RubyOnRails
[10:10:59] davidh38: has joined #RubyOnRails
[10:17:21] voolik: has joined #RubyOnRails
[10:33:06] apparition: has joined #RubyOnRails
[10:36:49] lxsameer: has joined #RubyOnRails
[10:53:05] ppl: what's the syntax (or place with docs) for scaffold_controller field:references argument?
[10:58:37] conta: has joined #RubyOnRails
[11:54:06] andywww: has joined #RubyOnRails
[12:04:39] andywww: wondered if i could get a bit of advice, I’m building a map application which has markers and routes drawn between the markers to follow the road. My models are Waypoint and Route. I want to update the route model when the marker (waypoint) is dragged to another location. I’m not sure how the relationships should be set up though because whilst both have a has_one relationship, neither really warrant a belongs to. This is what I have, how could this b
[12:04:39] andywww: better put do you think?
[12:04:40] andywww: https://gist.github.com/andywww12/6f94ae82b6bfcd8b8f20f2bee54b8b82
[12:06:20] andywww: I’m exposing the content of the models via jsonapi resources too so I’m not even convinced it matters as I don’t think jsonapi even has that level of detail on relationships
[12:11:28] lankanmon: has joined #RubyOnRails
[12:14:07] gavit: has joined #RubyOnRails
[12:21:23] Dbugger: has joined #RubyOnRails
[12:37:29] davidh38: has joined #RubyOnRails
[12:39:27] voolik: has joined #RubyOnRails
[12:45:00] gavit: has joined #RubyOnRails
[12:48:07] ss942: has joined #RubyOnRails
[12:55:41] roshanavand: has joined #RubyOnRails
[13:07:16] ss942: I'm making something with Redmine Plugin (ERPMine) and I have JQuery accordion in an place. I want it to open specified section on document ready, and I'm doing it.
[13:07:16] ss942: But in this place →https://github.com/lapinskik/redmine_wktime/blob/master/app/views/wkcustomfields/_relations.html.erb pagination would just pass last params[:current_section]
[13:07:17] ss942: I want it to replace it with index value (it's 100% sure it would be also accordion value)
[13:07:17] ss942: Any tips? Redmine paginations don't look like it would allow me to change params... ( https://www.rubydoc.info/github/redmine/redmine/Redmine/Pagination/Paginator )
[13:08:26] nertzy: has joined #RubyOnRails
[13:19:25] voolik: has joined #RubyOnRails
[13:20:35] blackcross: andywww, route should to have an array of markers [id's], in source to destination manner, would be my suggestion
[13:21:22] blackcross: using has_many doesn't accomplish this goal because 2 markers are not guranteed to be a minimum distance from each other
[13:44:01] davidh38: has joined #RubyOnRails
[13:46:14] davidh38: has joined #RubyOnRails
[14:07:30] dtzuzu: has joined #RubyOnRails
[14:14:01] JamieD: has joined #RubyOnRails
[14:19:33] hnanon: has joined #RubyOnRails
[14:31:38] dtzuzu: has joined #RubyOnRails
[14:53:59] jsc: has joined #RubyOnRails
[15:00:37] Jervis_: has joined #RubyOnRails
[15:07:13] Xiti: has joined #RubyOnRails
[15:10:41] gavit: has joined #RubyOnRails
[15:11:30] status402: has joined #RubyOnRails
[15:13:19] hnanon: has joined #RubyOnRails
[15:19:00] andywww: has joined #RubyOnRails
[15:19:25] andywww: has left #RubyOnRails: ()
[15:24:27] conta: has joined #RubyOnRails
[15:28:58] Xiti`: has joined #RubyOnRails
[15:39:12] status402: has joined #RubyOnRails
[15:41:33] voolik: has joined #RubyOnRails
[15:42:33] MoritaShinobu: has joined #RubyOnRails
[15:43:55] Xiti: has joined #RubyOnRails
[15:45:18] jetchisel: has joined #RubyOnRails
[16:13:49] roshanavand: has joined #RubyOnRails
[16:18:28] lxsameer: has joined #RubyOnRails
[16:28:35] MoritaShinobu: has joined #RubyOnRails
[16:29:33] MoritaShinobu: has joined #RubyOnRails
[16:30:58] MoritaShinobu: has joined #RubyOnRails
[16:31:59] MoritaShinobu: has joined #RubyOnRails
[16:33:16] MoritaShinobu: has joined #RubyOnRails
[16:50:26] Puffball: has joined #RubyOnRails
[16:50:45] JamieD: has joined #RubyOnRails
[16:51:16] conta: has joined #RubyOnRails
[16:53:16] roshanavand: has joined #RubyOnRails
[16:55:58] MoritaShinobu: has joined #RubyOnRails
[16:56:22] maryo: has joined #RubyOnRails
[17:01:19] gavit: has joined #RubyOnRails
[17:04:39] Exuma: has joined #RubyOnRails
[17:10:50] pLaTo0n: has joined #RubyOnRails
[17:11:31] ss942: has left #RubyOnRails: ()
[17:21:29] darkhanb: has joined #RubyOnRails
[17:23:38] orbyt_: has joined #RubyOnRails
[17:32:13] fragamus: has joined #RubyOnRails
[17:34:18] jesfre: has joined #RubyOnRails
[17:37:38] lxsameer: has joined #RubyOnRails
[17:46:01] lxsameer: has joined #RubyOnRails
[18:01:58] ur5us: has joined #RubyOnRails
[18:06:03] JamieD: has joined #RubyOnRails
[18:07:39] lxsameer: has joined #RubyOnRails
[18:20:31] jesfre: has joined #RubyOnRails
[18:20:59] roshanavand: has joined #RubyOnRails
[18:27:24] roshanavand: has joined #RubyOnRails
[18:33:15] ivanskie: has joined #RubyOnRails
[18:43:26] jesfre: has joined #RubyOnRails
[19:05:06] roshanavand: has joined #RubyOnRails
[19:08:15] lxsameer: has joined #RubyOnRails
[19:09:23] orbyt_: I'm looking at an ApplicationController that has the following: `return nil unless request.method != "OPTIONS" && !@current_user` meaning that it'll authenticate the request if theres a current user or the request method is "OPTIONS".
[19:09:54] orbyt_: Is there a way to essentially exploit this by "faking" an OPTIONS request in such a way that the router will still route the request to a controller?
[19:16:57] OrangeManBad: has joined #RubyOnRails
[19:18:33] roshanavand: has joined #RubyOnRails
[19:31:33] eckhardt_: has joined #RubyOnRails
[19:37:06] SteenJobs: has joined #RubyOnRails
[19:54:22] Xiti: has joined #RubyOnRails
[19:56:37] ellcs: has joined #RubyOnRails
[20:01:36] Inside: has joined #RubyOnRails
[20:18:33] roshanavand: has joined #RubyOnRails
[20:20:18] cp_dev: has joined #RubyOnRails
[20:22:02] cp_dev: has left #RubyOnRails: ("WeeChat 1.0.1")
[20:27:05] Dbugger: has joined #RubyOnRails
[20:27:39] kapil____: has joined #RubyOnRails
[20:30:43] GodFather_: has joined #RubyOnRails
[20:31:05] defsdoor: has joined #RubyOnRails
[20:37:14] orbyt_: has joined #RubyOnRails
[21:07:53] whysthatso: has joined #RubyOnRails
[21:16:10] snickers: has joined #RubyOnRails
[21:16:14] ivanskie: has joined #RubyOnRails
[21:23:55] wickedbloodfart: has joined #RubyOnRails
[21:37:42] eckhardt_: has joined #RubyOnRails
[21:39:38] Radar: GOOD MORNING
[21:40:13] Radar: orbyt_: hi. Only a few hours late, but do you have the rest of the code around that? I'd be interested about what it's doing.
[21:50:04] orbyt_: Radar https://pastebin.com/caactvS5 It's a simple method that's invoked via `before_action` by most controllers.
[21:50:12] helpa: Pastebin sucks! Use Gist (http://gist.github.com) instead, please!
[21:50:25] orbyt_: Ha, I agree.
[21:50:27] Radar: orbyt_: you could probably use httpie
[21:50:31] Radar: http options <route>
[21:50:51] Radar: depends on if your controller actions are verifying an authenticity_token to prevent CSRF attacks though
[21:51:04] Radar: if they are, then httpie won't work unless you're passing an authenticity token through
[22:21:14] TvL2386: has joined #RubyOnRails
[22:23:50] armyriad: has joined #RubyOnRails
[22:35:34] blackmesa: has joined #RubyOnRails
[22:37:45] armyriad: has joined #RubyOnRails
[22:43:30] orbyt_: Radar It uses Rails's default `protect_from_forgery` but seems to disable it for API responses: `protect_from_forgery with: :null_session, only: proc { |c| c.request.format.json? }`.
[22:44:13] Radar: orbyt_: seems good then. null_session makes Rails not define a session cookie, so each request is completely isolated from every other request for that client.
[22:45:07] orbyt_: Why would this affect uses of httpie?
[23:19:36] Radar: orbyt_: it wouldn't affect those
[23:19:44] Radar: they would still be able to make the request
[23:19:53] Radar: I only mentioned httpie because it's a good way to make http options request.
[23:19:55] Radar: requests*
[23:19:57] mlt-: has joined #RubyOnRails
[23:23:39] hnanon: has joined #RubyOnRails
[23:29:14] blindMoe: has joined #RubyOnRails
[23:29:32] blindMoe: Is it possible to .eager_load() a relation and specify a scope in AR? ( Rails 5.2)
[23:29:47] blindMoe: I can't seem to find anything on it but I need to unscope the relation
[23:41:25] hive-mind: has joined #RubyOnRails
[23:42:36] blackmesa1: has joined #RubyOnRails
[23:51:03] jetchisel: has joined #RubyOnRails