« Back to channel list

#RubyOnRails - 24 April 2018

« Back 1 day Forward 1 day »
[00:01:57] chouhoulis: has joined #RubyOnRails
[00:08:52] alfiemax: has joined #RubyOnRails
[00:10:03] workmad3: has joined #RubyOnRails
[00:27:36] Technodrome: has joined #RubyOnRails
[00:28:37] orbyt_: has joined #RubyOnRails
[00:45:20] eckhardt: has joined #RubyOnRails
[00:47:20] cagomez_: has joined #RubyOnRails
[00:55:48] Intii: has joined #RubyOnRails
[00:56:59] Intii: Hey all.. Can anyone help me with a timezone issue? Like an idiot I saved all the times in my database with PST. Problem is they are supposed to be in UTC so I thought I could just add + 8.hours to all the times in the DB to convert them to UTC. Now, since we're in DST the times are showing up off by an hour.
[00:57:03] Intii: How can I fix this?
[00:57:24] Intii: Essentially, I want all the times in my DB to be in the UTC timezone so that my application handles the time zone conversion
[01:04:59] havenwood: Intii: So you want to call #utc on each and save it?
[01:05:55] Intii: havenwood: I'm not sure if I can do that. Here is my screw up: If I select 10:00 AM on my form, the DB saves it as 10:00:00 instead of 18:00:00
[01:06:44] havenwood: Intii: Rails uses timezones, so you can just call #utc on it before saving. You could undo the offsets you applied and then just map each to utc, right?
[01:08:17] Intii: I guess my question would be, how would I undo the offsets? I wrote a rake task to go through and add +8 to all the times in the DB. When I view it back in my app with timezone enabled through config.time_zone = "Pacific Time (US & Canada)" it shows the time off by an hour. So it shows 11:00 AM instead of 10:00 AM
[01:08:20] havenwood: Intii: Compare `DateTime.current` and `DateTime.current.utc`.
[01:08:25] Intii: When originally the user wanted it to be at 10:00 AM
[01:08:54] havenwood: Intii: Add -8 to undo what you did, then convert them all to utc.
[01:09:10] Intii: Okay one sec, let me restore the DB. It's easier :)
[01:09:41] havenwood: Intii: You could always set your app's tz to utc.
[01:10:00] Intii: Well I need the tz to be set by the user. Some users are in the east coast, some are in the west
[01:10:19] Intii: How would I convert to UTC? appointment.start_date = appointment.start_date.utc?
[01:10:28] havenwood: Intii: config.active_record.default_timezone = :utc
[01:11:53] havenwood: Intii: yeah, probably something like: Appointment.find_each { |appt| appt.start_date = appt.start_date.utc; appt.save! }
[01:12:21] havenwood: Intii: If you wanted to, you could probably do it in a query instead of #find_each batches.
[01:12:38] havenwood: Intii: Take my advice with a grain of salt, long day!
[01:12:44] havenwood: Intii: Maybe someone else will weigh in.
[01:13:13] Intii: It's converting right now. Let's see how this works
[01:13:46] havenwood: Intii: To keep it using UTC, modify your config/application.rb file.
[01:14:01] havenwood: Intii: config.time_zone = 'UTC'
[01:14:21] havenwood: Intii: config.active_record.default_timezone = :utc
[01:14:48] Intii: I did the second one since the time_zone will be set by the user logged in
[01:14:49] havenwood: I dunno if you really need to do the former, when you're using :utc instead of :local though.
[01:15:51] Intii: So after the task, nothing converted since Rails thinks 10:00:00 is in UTC (it's not wrong)
[01:15:59] Intii: It should be 18:00:00
[01:16:26] havenwood: Intii: err, it wasn't -8h before?
[01:16:41] Intii: Maybe I'm not explaining it correctly lol
[01:16:49] SteenJobs: has joined #RubyOnRails
[01:17:15] Intii: So before today, a user would select an appointment start date, for ex 10:00 AM. The DB should save it as 18:00:00 but since I had config.time_zone = "PST" it saved it as 10:00:00
[01:17:24] havenwood: You're probably explaining fine but my brain is failing to function! :-)
[01:17:43] Intii: I removed that and the users were using the app fine for a year
[01:17:57] Intii: Adding appointments and what not. Since it wasn't doing any tz conversion, 10:00:00 is 10:00 AM in PST
[01:18:03] Intii: Now they are adding users from different locations
[01:18:16] Intii: So 18:00:00 would be 7:00 AM in EST
[01:19:05] Intii: I did +8 and everything converted successfully to UTC. (18:00:00 for 10:00 AM). Beacuse of stupid DST, its showing 11:00 AM instead of 10:00 AM
[01:26:22] Intii: I hope that makes sense lol
[01:27:27] krawchyk: has joined #RubyOnRails
[01:54:31] Radar: GOOD ALMOST AFTERNOON
[01:58:09] Intii: Good afternoon friend!
[01:58:54] kapil___: has joined #RubyOnRails
[01:59:52] Radar: [11:18:16] <Intii> So 18:00:00 would be 7:00 AM in EST
[01:59:57] Radar: Seems like you are wanting to store times in EST.
[02:00:01] Radar: This is not a good choice.
[02:00:03] Radar: Store times in UTC only.
[02:00:11] alfiemax: has joined #RubyOnRails
[02:00:30] Intii: I'm trying to store in UTC
[02:00:45] Intii: The problem is, like an idiot, I didn't do it from the begining so 10:00:00 stores as 10:00:00 instead of 18:00:00
[02:02:10] Intii: So I tried doing + 8.hours to convert them all to UTC, but 10:00 shows as 11:00 now because of DST
[02:02:14] Intii: Not sure how to fix that
[02:05:56] Saukk: has joined #RubyOnRails
[02:08:58] Technodrome: has joined #RubyOnRails
[02:15:03] ur5us: has joined #RubyOnRails
[02:21:55] orbyt_: has joined #RubyOnRails
[02:55:05] darkhanb: has joined #RubyOnRails
[03:06:03] easzero: has joined #RubyOnRails
[03:10:17] ur5us: has joined #RubyOnRails
[03:10:21] easzero_: has joined #RubyOnRails
[03:12:21] easzero_: has joined #RubyOnRails
[03:30:25] alfiemax: has joined #RubyOnRails
[03:42:50] mroutis: has joined #RubyOnRails
[03:58:12] rrichardsr3: has joined #RubyOnRails
[04:07:53] workmad3: has joined #RubyOnRails
[04:15:34] jerematic: has joined #RubyOnRails
[04:16:14] jerematic: has joined #RubyOnRails
[04:16:57] jerematic: has joined #RubyOnRails
[04:17:44] jerematic: has joined #RubyOnRails
[04:18:47] jerematic: has joined #RubyOnRails
[04:19:40] alfiemax: has joined #RubyOnRails
[04:51:27] chouhoulis: has joined #RubyOnRails
[04:53:09] srinidhi: has joined #RubyOnRails
[05:03:50] jnollette: has joined #RubyOnRails
[05:07:41] jerematic: has joined #RubyOnRails
[05:23:43] rafaeldelucena: has joined #RubyOnRails
[05:29:49] apeiros: has joined #RubyOnRails
[05:30:16] reber: has joined #RubyOnRails
[05:41:19] mroutis_: has joined #RubyOnRails
[05:47:16] jerematic: has joined #RubyOnRails
[06:03:29] apeiros: has joined #RubyOnRails
[06:05:10] apeiros: has joined #RubyOnRails
[06:05:19] roshanavand: has joined #RubyOnRails
[06:06:40] conta: has joined #RubyOnRails
[06:15:55] srinidhi: has joined #RubyOnRails
[06:22:49] workmad3: has joined #RubyOnRails
[06:25:33] jerematic: has joined #RubyOnRails
[06:47:49] noodle: has joined #RubyOnRails
[06:50:59] dionysus69: has joined #RubyOnRails
[06:59:43] alfiemax: has joined #RubyOnRails
[07:02:40] alfiemax_: has joined #RubyOnRails
[07:03:14] jerematic: has joined #RubyOnRails
[07:10:18] schneider: has joined #RubyOnRails
[07:22:00] ur5us: has joined #RubyOnRails
[07:37:47] srinidhi: has joined #RubyOnRails
[07:38:29] jerematic: has joined #RubyOnRails
[07:39:48] blitz: has joined #RubyOnRails
[07:45:05] dionysus69: I don't have memcached installed in production, dalli is said to be included in rails as documentation says
[07:45:38] dionysus69: but I guess dalli won't work without memcached, so which cache store production default to?
[07:45:47] dionysus69: memory_store?
[07:45:58] defsdoor: has joined #RubyOnRails
[07:55:27] marr: has joined #RubyOnRails
[07:57:34] jerematic: has joined #RubyOnRails
[08:34:38] jerematic: has joined #RubyOnRails
[08:39:28] jottr: has joined #RubyOnRails
[08:49:34] DrYockel: has joined #RubyOnRails
[08:53:36] srinidhi: has joined #RubyOnRails
[09:11:13] jerematic: has joined #RubyOnRails
[09:16:45] srinidhi: has joined #RubyOnRails
[09:27:50] defsdoor: has joined #RubyOnRails
[09:44:01] jottr: has joined #RubyOnRails
[09:55:31] jerematic: has joined #RubyOnRails
[10:05:20] hfp_work: has joined #RubyOnRails
[10:13:29] ur5us: has joined #RubyOnRails
[10:14:19] apeiros: has joined #RubyOnRails
[10:21:36] conta: has joined #RubyOnRails
[10:24:00] srinidhi: has joined #RubyOnRails
[10:28:43] srinidhi: has joined #RubyOnRails
[10:30:38] _aeris_: has joined #RubyOnRails
[10:32:26] ferr: has joined #RubyOnRails
[10:32:50] srinidhi: has joined #RubyOnRails
[10:37:04] jerematic: has joined #RubyOnRails
[10:53:20] apparition: has joined #RubyOnRails
[10:58:48] gheegh: has joined #RubyOnRails
[11:16:15] mostlybadfly: has joined #RubyOnRails
[11:22:22] jerematic: has joined #RubyOnRails
[11:27:06] dminuoso: Your Yarn packages are out of date! Please run `yarn install` to update.
[11:27:08] dminuoso: Thank you rails.
[11:29:54] dminuoso: Woah what is this.
[11:30:49] tbuehlmann: have you tried running yarn install?
[11:38:39] Cavallari: has joined #RubyOnRails
[11:39:15] dminuoso: apeiros: Wow.
[11:39:21] dminuoso: This fucking optional dependency that failed to build.
[11:39:36] dminuoso: Not so optional after all.
[11:39:53] dminuoso: Im so rage filled at the moment.
[11:41:18] sevenseacat: has joined #RubyOnRails
[11:43:23] sonOfRa: has joined #RubyOnRails
[11:43:33] srinidhi: has joined #RubyOnRails
[12:03:51] daxroc: has joined #RubyOnRails
[12:08:08] jottr: has joined #RubyOnRails
[12:19:22] tfitts: has joined #RubyOnRails
[12:22:53] jerematic: has joined #RubyOnRails
[12:28:15] jerematic: has joined #RubyOnRails
[12:30:37] mondongo: has joined #RubyOnRails
[12:39:11] gheegh: has joined #RubyOnRails
[12:39:12] roshanavand: has joined #RubyOnRails
[12:47:31] jottr: has joined #RubyOnRails
[12:56:54] alfiemax: has joined #RubyOnRails
[13:02:24] jottr: has joined #RubyOnRails
[13:08:10] Technodrome: has joined #RubyOnRails
[13:13:25] rfoust: has joined #RubyOnRails
[13:13:33] apeiros: dminuoso: so… did yarn install help?
[13:18:57] dionysus69: scope :scp, -> { Rails.cache.fetch(find_by(code: "1").cache_key) } returns activerecord relationship
[13:19:08] dionysus69: while it should obviously return single record
[13:19:26] sevenseacat: scopes should never return a single record
[13:20:02] dionysus69: ok :D :) just a method then?
[13:20:22] dionysus69: I figured instead of writing Model.find_by() everytime I could use a Model.something
[13:20:50] dionysus69: I am talking about model that is very few in quantity, less than 5 rows in table
[13:23:06] krawchyk: has joined #RubyOnRails
[13:23:55] sevenseacat: not the point. scopes are for narrowing relations, and they should always return chainable relations
[13:24:25] sevenseacat: http://blog.plataformatec.com.br/2013/02/active-record-scopes-vs-class-methods/ old but still true
[13:25:25] tbuehlmann: do you see a real advantage caching the records instead of just finding them?
[13:26:37] dionysus69: ok what about this ? https://gist.github.com/webzorg/6d41081c9e844337a4ec3dd547b6190e
[13:26:53] dionysus69: this correctly returns single record, but my point is different, cache is working, am I writing this properly?
[13:27:36] dionysus69: rails cache fetch, without block returns nil in that case
[13:27:54] tbuehlmann: go back one step and consider not caching this at all
[13:28:07] dionysus69: I am calling this lots of times in some pages
[13:28:21] sevenseacat: thats... not going to do what you want to do
[13:28:29] sevenseacat: given you have to load the record to get the cache key
[13:28:36] sevenseacat: to then load it from cache
[13:28:59] dionysus69: but it will happen only once every 12 hours, or not even that?
[13:29:21] tbuehlmann: naw, sevenseacat is right, by calculating the cache key you're hitting the database
[13:29:30] tbuehlmann: besides that, you're now calling the cache often, don't you rather want to memoize per request?
[13:29:51] tbuehlmann: also, finding records which are indexed is pretty fast and you almost always don't need a cache
[13:30:10] dionysus69: n+1 problem over here :D
[13:30:20] dionysus69: will google up memoization I guess
[13:30:24] sevenseacat: thats not what an n+1 problem is
[13:30:46] dionysus69: well i have a db request in a loop, where it's not really necessary
[13:30:58] dionysus69: this record I am querying for, is not really ever changing
[13:31:55] dionysus69: but it still is a good idea to keep it in a db :) :D
[13:31:55] tbuehlmann: _also_: it can be pretty bad caching whole activerecord model objects. if caching is really needed, I prefer caching the record's id/ids and fetching the record/s fresh with that id/ids, since that's still fast
[13:32:32] tbuehlmann: when updating rails, changing a models internals or something related happens, your cached records might raise exceptions or behave in a way you don't want
[13:32:33] TheMoonMaster: has joined #RubyOnRails
[13:32:37] dionysus69: I really dived into caching today, wanted to level up too quick lol
[13:32:37] sevenseacat: unless its a very expensive call, I wouldn't recommend caching it at all
[13:33:58] dionysus69: Roger that :)
[13:34:24] dionysus69: btw quick question, until I dive too far into memcached/dalli, should I switch to redis? which is more recommended?
[13:35:02] dionysus69: the reason I chose dalli is that I read that memcached would expire records automatically based on updated_at attr
[13:35:27] dionysus69: need cache ninja advice lol
[13:35:36] tbuehlmann: both are really good, choose your favorite
[13:35:47] tbuehlmann: I personally prefer redis
[13:36:09] dionysus69: and is there a particular advantage, even a little one ?
[13:37:02] dionysus69: like performance, need to write less code, stuff like that :D
[13:37:44] dionysus69: scalability/<i>sharding</i> simplicity
[13:37:58] spohnz: has joined #RubyOnRails
[13:38:08] tbuehlmann: they are similar performance-wise, just search online for benchmarks
[13:38:19] spohnz_: has joined #RubyOnRails
[13:39:04] tbuehlmann: I had a hard time figuring out how to get existing cache keys in memcached, at that time that was simpler in redis. no idea how that's today
[13:40:08] dionysus69: from what I notice online, redis has more presence
[13:52:03] acovrig: has joined #RubyOnRails
[13:53:59] dminuoso: apeiros: Essentially the problem is this:
[13:55:30] dblessing: has joined #RubyOnRails
[13:57:21] dminuoso: If your yarn.lock pins an optional dependency, and you rebuild without that optional dependency, then you have a mismatch.
[13:57:50] dminuoso: Annoyingly `yarn install` will report everything up-to-date (with just a warning it couldn't install a - not so - optional dependency)
[13:58:16] dminuoso: The whole concept of optional dependencies is so retarded.
[13:58:25] dminuoso: I lack the words to sufficiently insult the people who came up with it.
[13:58:37] apeiros: it sounds like all those JS dependency tools are reiterating all the problems all other dependency managers already stumbled over 😂
[13:59:39] dminuoso: apeiros: Know another thing I love about Haskell? Resolvers.
[13:59:56] dminuoso: apeiros: It's a quite elegant solution to a lot of dependency problems.
[14:00:16] dionysus69: should I use https://github.com/redis-store/redis-rails or this is outdated?
[14:13:47] gheegh: has joined #RubyOnRails
[14:22:13] tbuehlmann: dionysus69: that's fine. if you're using a very recent version of rails, a redis cache store is already included iirc
[14:22:42] dionysus69: nice hehe, I ll check it out
[14:24:58] tbuehlmann: should be rails 5.2
[14:26:17] SteenJobs: has joined #RubyOnRails
[14:29:49] nickjj: that's cool, i missed that feature in the changelog
[14:30:07] nickjj: i used redis-rails for years previously
[14:40:45] maciuszek: has joined #RubyOnRails
[14:50:46] Technodrome: has joined #RubyOnRails
[14:56:18] Nuck: has joined #RubyOnRails
[14:58:31] greengriminal: has joined #RubyOnRails
[15:03:32] dionysus69: has joined #RubyOnRails
[15:05:00] mr-robert: has joined #RubyOnRails
[15:22:28] DrYockel: has joined #RubyOnRails
[15:24:45] mrtroy32: has joined #RubyOnRails
[15:41:40] cagomez_: has joined #RubyOnRails
[15:42:48] jcarl43: has joined #RubyOnRails
[15:43:52] Technodrome: has joined #RubyOnRails
[15:47:03] apeiros: has joined #RubyOnRails
[15:50:19] darkhanb: has joined #RubyOnRails
[15:51:21] FrostCandy: has joined #RubyOnRails
[15:51:36] mjolnird: has joined #RubyOnRails
[15:54:18] FrostCandy: You know when you def params that you allow at the bottom of a page? Well if i send a string type then it works, but I have a checkbox sending an array ["one","two"] and my variable ends up being nil even when data is being sent to that parameter.
[15:57:42] Andr3as: hello everyone.. finally i'm trying to learn some rspec and given i've the chance for a rewrite, i thought i am implementing it right from the getgo..
[15:58:24] Andr3as: however, somehow i am not getting it here.. i thought i got the correct validation but rspec still throws me an error
[15:59:14] Andr3as: here's a gist with model, spec and output https://gist.github.com/awunder/7926052d437365949e4e33e1760ceec3
[15:59:20] Andr3as: anyone with a hint?
[16:01:28] srinidhi: has joined #RubyOnRails
[16:07:19] FrostCandy: Ah params.permit(:id => [])
[16:10:03] acovrig: has joined #RubyOnRails
[16:14:46] FrostCandy: dang ruby has so many gotcha's. ^^ that needs to be at the end of the permitted parmms lol
[16:14:54] FrostCandy: well rails, not ruby i guess
[16:16:24] one_zero: has joined #RubyOnRails
[16:20:35] orbyt_: has joined #RubyOnRails
[16:20:55] darkhanb: has joined #RubyOnRails
[16:24:05] tycoon177: I have an application that worked perfectly in dev, but in production, it refuses to remotely submit forms. When I submit this one, it returns the javascript in my browser as a document. I have checked and jquery_ujs is loaded in the application.js after jquery
[16:26:30] tycoon177: The chrome web console says that the content-type is text/javascript, but there is a warning that says "Resource interpreted as Document but transferred with MIME type text/javascript" I don't think an xhr request is ever spawned for this form, but other forms work just fine
[16:36:10] SteenJobs: has joined #RubyOnRails
[16:36:48] dtzuzu: has joined #RubyOnRails
[16:38:24] Saukk: has joined #RubyOnRails
[16:45:01] FrostCandy: Is this an accurate hardware analogy for fixing someone else's code? https://tinyurl.com/ydcujhzm
[16:51:50] cagomez_: has joined #RubyOnRails
[17:05:51] srinidhi: has joined #RubyOnRails
[17:08:48] armyriad: has joined #RubyOnRails
[17:11:06] dionysus69: has joined #RubyOnRails
[17:16:15] gheegh: has joined #RubyOnRails
[17:16:28] alfiemax: has joined #RubyOnRails
[17:20:15] mondongo: has joined #RubyOnRails
[17:20:42] Cavallari: has joined #RubyOnRails
[17:21:46] AnotherOne: has joined #RubyOnRails
[17:25:03] dionysus69: has joined #RubyOnRails
[17:26:14] dionysus69: has joined #RubyOnRails
[17:26:58] alfiemax: has joined #RubyOnRails
[17:27:49] tycoon177: in case anyone was wondering about my issue, i ended up finding out that multipart forms cannot be remote submissions because javascript doesn't have access to your filesystem to grab the file contents
[17:29:23] Intii: Morning all!
[17:32:23] AnotherOne: what do you think of rubymine guys?
[17:33:07] mondongo: anotherone: does it play well with Docker?
[17:35:11] Intii: Wondering if anyone can help me with my stupid mistake of saving time in PST instead of UTC
[17:35:23] AnotherOne: whats the issue?
[17:36:13] Intii: I made the mistake of saving 10:00:00 AM PST as 10:00:00 in my DB when it should really be 18:00:00. I can add +8 to all the times in the DB but since we're in DST now it shows 11:00 AM isntead of 10:00 AM
[17:36:32] FrostCandy: When I print <%= @db.myvar %> I get [&quot;myvar&quot;] instead of ["myvar"] which is messing up my javascript. Is there a way to print my variable with quotes instead of with the &quot; safe ?
[17:36:38] eckhardt: has joined #RubyOnRails
[17:37:20] mondongo: FrostCandy tried .html_safe ?
[17:38:25] FrostCandy: hmmm that worked.
[17:39:26] AnotherOne: Intii so whats the issue?
[17:39:37] Intii: I made the mistake of saving 10:00:00 AM PST as 10:00:00 in my DB when it should really be 18:00:00. I can add +8 to all the times in the DB but since we're in DST now it shows 11:00 AM isntead of 10:00 AM
[17:39:52] Intii: It needs to show 10:00 AM
[17:40:08] AnotherOne: so just update it
[17:40:12] Intii: I even tried checking if the time is in DST by #dst? and adding +7 to that but still the same
[17:40:41] AnotherOne: db_object.time.in_time_zone("Your Timezone")
[17:40:50] AnotherOne: is this how you print it?
[17:41:16] Intii: Nope. I have config.time_zone = "Pacific Standard Time (US & Canada)" in my application.rb
[17:41:35] Intii: I just assumed it would automatically convert
[17:41:47] AnotherOne: what is in the db
[17:42:04] Intii: Before adding +8, 10:00:00 after adding 18:00:00
[17:42:36] Intii: So the user would select 10:00 AM from the time dropdown and it saved as 10:00 instead of converting it to UTC. That was my original problem
[17:42:41] Intii: But now I need everything in the DB to be converted to UTC
[17:42:49] Intii: and show the proper time that the user selected
[17:51:40] cagomez_: has joined #RubyOnRails
[17:52:21] alfiemax: has joined #RubyOnRails
[17:53:27] sameerynho: has joined #RubyOnRails
[17:57:09] gheegh: has joined #RubyOnRails
[17:58:10] Intii: has joined #RubyOnRails
[18:06:20] SteenJobs: has joined #RubyOnRails
[18:17:25] tdy: has joined #RubyOnRails
[18:24:00] cagomez_: has joined #RubyOnRails
[18:28:29] conta: has joined #RubyOnRails
[18:31:53] apeiros: has joined #RubyOnRails
[18:33:30] eckhardt_: has joined #RubyOnRails
[18:34:52] brent__: has joined #RubyOnRails
[18:37:21] SteenJobs: has joined #RubyOnRails
[18:38:41] alfiemax: has joined #RubyOnRails
[18:41:01] srinidhi: has joined #RubyOnRails
[18:42:45] apeiros: has joined #RubyOnRails
[18:43:28] blackcross: Is there a LTS version of rails that will have security updates maintained?
[18:44:33] blackcross: seems like the X.2.Y verions are the longest maintained, is this correct?
[18:53:24] SteenJobs: has joined #RubyOnRails
[18:55:07] cschneid_: has joined #RubyOnRails
[18:56:26] fryguy: just coincidence
[19:01:45] Linuus: has joined #RubyOnRails
[19:04:12] ule: I'm following the official Rails guide to upgrade here from Rails 4.2 to 5
[19:05:16] ule: I'm kind of confused with the steps. When should I change my Gemfile? When should I run rails app:update?
[19:05:54] ule: Anyone did this upgrade before and could share some thoughts?
[19:09:01] Intii: ule: Can you link me the guide? I've done it once before. Maybe I can help
[19:09:52] ule: You have requested: rails >= 5.0.7, ~> 5.0 -- The bundle currently has rails locked at 4.2.10. Try running `bundle update rails`
[19:10:08] ule: Sure Intii http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html
[19:11:04] Intii: Those are the edge guides, let me get you the current version ones
[19:11:33] ule: Just going to the step that explains 4.2 to 5 you mean?
[19:12:02] ule: Those 21 sub-steps are fine. I'm just stuck on this part where I update my gemfile and run: rails app:update
[19:12:13] Intii: Woops, sorry didn't notice that. You're right
[19:12:34] ule: it is failing here saying I have to run bundle rails update. I run that it also complains I need to install a different version fo activesomething
[19:13:07] Intii: So what I did was first update the Rails version in the Gemfile. Then I ran that command. Can you share your Gemfile?
[19:13:18] Intii: There may be a gem that is dependent on an older version of activewhatever
[19:13:28] ellcs: has joined #RubyOnRails
[19:13:47] ule: exactly, so that means I need to update this activewhatever manually?
[19:14:09] Intii: It depends. If it's a dependent of a gem and that gem isn't updated you need a workaround
[19:14:28] Intii: If you can share your Gemfile.lock and Gemfile and I can look for you
[19:15:03] ule: I have some private gems I would need to clean up a bit
[19:15:23] ule: but anyways. Lets say I'm gonna start this upgrade from scratch
[19:15:49] ule: 1) Update my Gemfile and replace: rails 4.2.10 to rails 5.0.7
[19:15:56] ule: 2) rails app:update
[19:15:58] ule: thats it?
[19:16:01] Intii: Completely understand
[19:16:11] Intii: That's it. You also need to make some changes to your model files
[19:16:39] ule: yeah yeah. All those changes are done. ApplicationRecord, Job, configs and so on
[19:16:45] ule: ok Let me try here again
[19:16:57] Intii: One thing to remember though, Rails 5 defaults :belongs_to associations to required
[19:17:53] ule: Last time I did the upgrade from 4.0 to 4.2 was a pain in the a**
[19:18:22] Intii: Lol I guess I'm lucky I've never experienced that :)
[19:19:48] ule: activerecord-session_store (~> 1.1.1) was resolved to 1.1.1, which depends on actionpack (>= 4.0)
[19:20:08] KucukMubasir: has joined #RubyOnRails
[19:20:35] ule: Would be nice to have a flag like "bundle rails update --UPDATE_ALL_MY_DEPENDENCIES_DOEST_MATTER_WHAT_HAPPENS"
[19:20:36] Intii: Hmm... That looks like an official part of Rails.. Wonder why it's failing... Let me see
[19:20:45] KucukMubasir: hi there, I need urgent help :( why can’t I push to heroku without aws keys? I don’t have fog or aws or carrierwave gems in gemfile, what might be the reason?
[19:21:01] Cavallari1: has joined #RubyOnRails
[19:22:02] ule: KucukMubasir: git grep -n 'aws' .
[19:22:16] KucukMubasir: this is the gemfile https://www.paste.org/92868
[19:22:36] KucukMubasir: do i require aws credentials to push an app to heroku without image?
[19:22:47] Intii: ule: Does it give any more output than that?
[19:24:37] Intii: Can you look in your Gemfile.lock and find the version of actionpack that is installed?
[19:24:40] KucukMubasir: and this is the gemfile lock : https://www.paste.org/92869
[19:31:40] cagomez_: has joined #RubyOnRails
[19:35:07] ule: Intii: I removed my Gemfile.lock and now I'm trying to solve one by one
[19:35:31] Intii: It has to be some dependency issue with one of your gems
[19:35:57] ule: yeah :/ not just one but maybe 10 issues from what I can see here
[19:36:46] orbyt_: has joined #RubyOnRails
[19:37:55] ule: crazy how many crappy Gems I usually find on these upgrades :P
[19:38:08] ule: I bet 20% of them is not even being used anymore
[19:39:42] maryo: has joined #RubyOnRails
[19:42:00] zacts: has joined #RubyOnRails
[19:43:18] Intii: Maybe even more lol
[19:43:55] ule: Dammit, still not working
[19:44:26] ule: now it complains the dependencies depends on Rails 5.0.7 but I can't install Rails 5.0.7 because it depends on dependencies
[19:44:46] ule: awwesome
[19:45:07] ule: let me try gem install rails -v 5.0.7
[19:45:15] Intii: Can you install an earlier version of Rails 5?
[19:45:23] Intii: Then bundle update to update everything?
[19:45:28] ule: I'm at 4.2.10 (Latest)
[19:45:33] eckhardt: has joined #RubyOnRails
[19:45:39] ule: you mean 5.0.0 ?
[19:45:45] ule: Let me try
[19:45:45] roshanavand: has joined #RubyOnRails
[19:48:07] Ergo: has joined #RubyOnRails
[20:00:19] ule: nothing
[20:00:45] ule: I don't understand why even after updating my Gemfile to the suggested version it still doesn't execute bundle update/install
[20:00:53] ule: even using --force or removing Gemfile.lock
[20:07:38] Intii: Hmm... I don't know what else to say... When it get's this weird when upgrading I just make a new project and bring things over manually
[20:07:51] Intii: Nothing else in your Gemfile.lock points to an older version?
[20:09:08] orbyt_: has joined #RubyOnRails
[20:14:05] srinidhi: has joined #RubyOnRails
[20:18:38] alfiemax: has joined #RubyOnRails
[20:18:49] guacamole: has joined #RubyOnRails
[20:20:41] kapil___: has joined #RubyOnRails
[20:28:39] noodle: has joined #RubyOnRails
[20:35:32] ur5us: has joined #RubyOnRails
[20:40:03] eckhardt: has joined #RubyOnRails
[20:41:32] agent_white: has joined #RubyOnRails
[20:55:49] acovrig: has joined #RubyOnRails
[21:02:06] chouhoulis: has joined #RubyOnRails
[21:12:15] cagomez_: has joined #RubyOnRails
[21:13:02] acovrig: I’m having issues with devise_token_auth, https://gist.github.com/acovrig/e339fa7ce2b6ab03f318e16e01cec3ae is some of my files, test.txt is a list of what I try to show the issue - I can sign_in but it won’t accept any of my tokens
[21:15:08] rgr: has joined #RubyOnRails
[21:21:48] sunya7a_: hi, I have a many to many relationship (between model A and B with joining model AB) and would like to create a nested form for A that will accept values for B. When B already exists I would like to create the record in the join table without creating an additional B record. When B does not exist it should be created and the corresponding AB record as well. This is similar to this question on SO https://stackoverflow.com/questions/43106241/obj
[21:22:48] sunya7a_: it feels like this is a common use case but I don't know what to call it and that is the closest I've found. If there is a name for this could you tell me so I can research it on my own further
[21:31:42] cagomez_: has joined #RubyOnRails
[21:46:04] dviola: has joined #RubyOnRails
[21:52:11] easzero: has joined #RubyOnRails
[21:53:10] easzero_: has joined #RubyOnRails
[22:02:57] cagomez_: is it okay to pass a hash to a Sidekiq worker? ie will it serialize/deserialize correctly?
[22:07:37] easzero: has joined #RubyOnRails
[22:08:16] Intii: ule: Were you able to resolve?
[22:12:13] jerematic: has joined #RubyOnRails
[22:25:28] alfiemax: has joined #RubyOnRails
[22:27:18] gambl0re: has joined #RubyOnRails
[22:32:02] MrPunkin: has joined #RubyOnRails
[22:32:49] MrPunkin: Can anyone tell me a character that will for sure cause UTF-8 encoding issues? Trying to decode some DB / Rails encoding issues and trying to reproduce it.
[22:46:23] jackhum: has joined #RubyOnRails
[22:50:18] rfoust: has joined #RubyOnRails
[22:54:11] Intii: Just regular UTF-8 not utf8b whatever?
[23:16:58] orbyt_: has joined #RubyOnRails
[23:17:47] Intii: Can you try that?
[23:23:14] MrPunkin: Intii: Thanks, that indeed does break things.
[23:23:31] Intii: No problem!
[23:24:25] Intii: Can anyone help me understand the proper way to handle this? Right now, in California we're in Day light saving time. When I save a datetime to my database for say, December 2, 2018, which is NOT in DST, it saves incorrectly, off by one hour
[23:24:30] Intii: Is there a workaround to that?
[23:28:18] timdotrb: has joined #RubyOnRails
[23:28:21] timdotrb: Afternoon, all
[23:28:30] phon: has joined #RubyOnRails
[23:28:43] MrPunkin: Intii: Your database timestamps should all be UTC, and allow Rails to handle all time-zone issues.
[23:29:17] MrPunkin: Intii: Or do you mean when you try and save a date outside of DST it saves as if it’s the DST offset because current time is DST?
[23:29:19] Intii: They are all in UTC. Problem is if I create an appointment today for December 2, 2018 at 1:00 PM it saves it as 20:00 instead of 21:00
[23:29:27] Intii: The second one :)
[23:30:14] jackhum: has joined #RubyOnRails
[23:30:14] MrPunkin: How are you passing the date through?
[23:30:39] Intii: Two inputs on my form, one as a date field one as a time field
[23:30:46] Intii: I let Rails handle the magic
[23:30:47] MrPunkin: For example, in console if you do Date.new(2018,12,2).to_time you should see a -0800 offset instead of the current -0700… which makes me wonder if the form is passing in additional info
[23:31:20] MrPunkin: Intii: can you share the params being posted from the form?
[23:31:28] Intii: Yep I do see -0800
[23:31:52] Intii: MrPunkin: Want it in a gist?
[23:32:00] MrPunkin: Sure, whatever is easiest.
[23:32:34] Intii: MrPunkin: Here you go. https://gist.github.com/dsarhadian/2e28f1e3fd19f62ba5cc5bbf1c9054e5
[23:32:42] Intii: I also found this: http://tech.taskrabbit.com/blog/2014/11/07/time-zones-and-daylight-saving-time/ which might help
[23:32:53] LateralO1: has joined #RubyOnRails
[23:33:57] Intii: Hmm... found another bug. It doesn't set the date correctly with those params
[23:34:13] Intii: That may be the issue
[23:34:16] MrPunkin: Intii: are you using datetime_select?
[23:34:52] Intii: I updated that Gist with the form code
[23:35:05] Intii: But I think the problem is that both fields are :start_date
[23:35:05] cagomez_: has joined #RubyOnRails
[23:35:13] Intii: And the second one overwrites the date chosen in the first one
[23:35:58] MrPunkin: Intii: Yeah, sort out those issues first.
[23:36:06] Intii: MrPunkin: Yep working on those now
[23:37:48] timdotrb: I'm getting a strange validation error. I have two attributes on my model, main_title and main_subtitle. I want to require main subtitle if main title is present. I also wanted a custom error message. When attempting to implement this, I'm getting an error related to pluralization, which doesn't make sense because there should be no pluralization. https://gist.github.com/willc0de4food/fc241bde5251dfa1dc390352d11ea290
[23:39:25] Intii: MrPunkin: I need the date and time fields separated. What do you suggest?
[23:39:44] MrPunkin: Intii: It looks like you are using Simple Form?
[23:40:04] MrPunkin: Intii: I’m not familiar with it. I’ve always used the default rails form builder for date / time info.
[23:40:17] Intii: If I do use date_select and time_select, can the field be teh same?
[23:40:28] Intii: Or do I need attributes
[23:40:36] MrPunkin: so they write to the same attribute you mean?
[23:40:49] MrPunkin: You could always merge them in the controller before saving to the start_date model attribute.
[23:41:03] Intii: Yeah they write to the same attribute, start_date in my DB
[23:41:47] Intii: https://stackoverflow.com/questions/3677531/separate-date-and-time-form-fields-in-rails/6730104 i was following the answer that has 38 upvotes
[23:42:09] MrPunkin: Intii: Check this out: https://stackoverflow.com/a/6730104/1255858
[23:42:41] Intii: I know you can use the standard Rails form fields with SimpleForm so let me do that. One sec
[23:44:32] Intii: MrPunkin: That fixed all my issues
[23:44:53] Intii: It saves properly in the DB now too. Correct date and time saves at 18:00:00 which with our offset, -8 is 10:00
[23:44:58] Intii: Let me try a DST date
[23:45:40] Intii: Yep works with the DST date perfectly as well. Thanks MrPunkin!
[23:45:53] MrPunkin: Excellent! Yep, no problem
[23:59:54] uks: has joined #RubyOnRails