« Back to channel list

#RubyOnRails - 04 April 2018

Forward 1 day »
[06:49:41] helpa: has joined #RubyOnRails
[06:49:59] Radar: !botsnack
[06:49:59] helpa: Nom nom. Thanks, Radar!
[06:50:01] Radar: Lazy ass bot.
[06:50:09] Radar: (Don't ever leave me.)
[06:50:17] dminuoso: Y u no work.
[06:50:22] Radar: dminuoso: https://github.com/dry-rb/dry-monads/blob/master/lib/dry/monads/either.rb#L7-L9
[06:50:24] Radar: #triggere
[06:50:26] Radar: #triggered
[06:50:30] reber: has joined #RubyOnRails
[06:50:48] Radar: https://github.com/dry-rb/dry-monads/blob/master/lib/dry/monads/either.rb#L3
[06:51:06] Radar: I wonder what the reason was.
[06:51:32] Radar: https://github.com/dry-rb/dry-monads/commit/09066220e135b8efa1bc7e0ba9cef3fa30d64c2d No PR. No explanation. Probably lost in the sands of time ... oops I mean Gitter.im
[06:51:44] dminuoso: Radar: It's just a shame monad patterns tend to perform horribly with Ruby's execution model and complete lack of optimizations.
[06:52:00] Radar: Yeah almost like Ruby wasn't designed with monads in mind or something
[06:52:15] Radar: TBH tho it is a better alternative to pervasive if/else typically found in service objects
[06:52:34] dminuoso: Radar: I'd argue throwing an exception is better.
[06:52:34] Radar: ANYWAY. I said I was leaving the office 5 mins ago but I am _still here_. Time to change that :wave:
[06:52:40] dminuoso: (Which is isomorphic to Either monad)
[06:52:46] Radar: dminuoso: "Do not use exceptions for flow control" - St. Avdi.
[06:53:08] dminuoso: Radar: Id ask you to ponder about this for a moment. What exactly does Either/Result model?
[06:53:11] dminuoso: Short circuiting computation.
[06:53:31] dminuoso: As in "once you emit a Left/Failure, skip all further computation until someone handles your left case"
[06:53:33] dminuoso: That _is_ an exception.
[06:53:49] MasterAsia: Radar, I ended up solving it with a table-lock that still allows reads (lock table with exclusive)
[06:54:59] MasterAsia: Although triggers seems like a good way to go as well
[06:55:24] dminuoso: Radar: And even `Maybe` models exceptions, they are just completely anonymous.
[06:55:33] crankharder: has joined #RubyOnRails
[06:55:36] MasterAsia: wait a second - that trigger uses a table lock anyways
[06:55:43] MasterAsia: might as well just simplify it and use a table-lock myself
[06:59:11] dminuoso: Radar: So what strength do you get from using `Either` over `raise`? What exactly is so dangerous or problematic for using exceptions to shortcircuit computation?
[07:00:49] dminuoso: It's mostly lack of enforced contract really, in that the consumer has to know that an exception can be produced. Java does it right by forcing you to acknowledge that fact.
[07:01:53] dminuoso: But in Ruby all bets are off anyway, because we have no type system to rule out cases where someone forgets to handle the left case, and we have no syntactic sugar or combinators to properly use monadic code
[07:03:31] dminuoso: We already happily live with the fact that you have to read the source code and documentation to know how to use a method. So some note that "this throws XYZ in case of failure" seems to fit into standard ruby practices.
[07:03:45] dminuoso: (Not that this makes it any better)
[07:07:03] srinidhi: has joined #RubyOnRails
[07:08:40] dminuoso: The more I stare at this result monad from dry-monads, the less Im convinced about it. It has too many options to promote escaping the either monad, which means programmers will be quick to simply pry the thing open because its too cumbersome to use the monadic interface.
[07:10:35] Radar: dminuoso: You're right. An exception would be just as suitable in this case. I like it solely because it isn't enforcing that rescuing from exceptions is a "good pattern"
[07:10:45] Radar: But essentially, the implementation is the same. "In this _exceptional_ case, go do this thing"
[07:11:59] dminuoso: Radar: Oh absolutely yeah. With the right set of combinators `Either` becomes more powerful because suddenly control flow lives in data types.
[07:12:19] dminuoso: It's a cool thing though
[07:12:58] dminuoso: Radar: I recently tried rolling a parser combinator library in Ruby. It was an absolute nightmare to write. :(
[07:14:15] schneider: has joined #RubyOnRails
[07:15:29] Radar: Why would you do that to yourself?
[07:16:06] dminuoso: Radar: Once the groundwork is laid, it's the most elegant way to write parsers.
[07:16:19] dminuoso: With some tricks you can make it look nice in Ruby too.
[07:16:44] dminuoso: It's just difficult to write an efficient combinator library that can backtrack and has location reporting..
[07:31:08] DrYockel: has joined #RubyOnRails
[07:31:21] uksio: has joined #RubyOnRails
[07:49:31] alfiemax: has joined #RubyOnRails
[07:53:17] workmad3: has joined #RubyOnRails
[07:56:27] dionysus69: has joined #RubyOnRails
[08:06:41] defsdoor: has joined #RubyOnRails
[08:10:45] timdotrb: has joined #RubyOnRails
[08:15:41] mikecmpbll: has joined #RubyOnRails
[08:31:16] _aeris_: has joined #RubyOnRails
[08:42:27] _aeris_: has joined #RubyOnRails
[08:56:01] jnollette: has joined #RubyOnRails
[09:08:50] marr: has joined #RubyOnRails
[09:08:53] Ergo: has joined #RubyOnRails
[09:19:25] workmad3: has joined #RubyOnRails
[09:32:33] rikkipitt: has joined #RubyOnRails
[09:41:02] elcms: has joined #RubyOnRails
[10:06:17] hfp_work: has joined #RubyOnRails
[10:06:48] schneider-: has joined #RubyOnRails
[10:08:19] reber: has joined #RubyOnRails
[10:08:36] sunrunner202: has joined #RubyOnRails
[10:09:13] dionysus69: as you already know to_json stringifies array
[10:09:23] dionysus69: so I am forced to do this to get pretty output
[10:09:43] dionysus69: ActiveSupport::JSON.decode(Model.to_json(only: %i[code name]))
[10:09:54] Radar: "pretty output"? For what purpose?
[10:09:59] Radar: `brew install httpie`
[10:10:09] Radar: `http localhost:3000/api/posts`
[10:10:11] Radar: pretty output
[10:10:22] dionysus69: json array otherwise contains escaped quotes
[10:10:30] dionysus69: because array itself is inside string
[10:10:43] dionysus69: so key value quotes are being escaped
[10:10:56] dionysus69: it's not nice for api consumer to have that kind of object
[10:11:27] dionysus69: json array > json string containing array
[10:11:27] funnel_: has joined #RubyOnRails
[10:11:45] Radar: Seems suspicious.
[10:11:49] Radar: Do you have an example I can look at?
[10:14:38] segy_: has joined #RubyOnRails
[10:14:58] tomaw_: has joined #RubyOnRails
[10:15:07] dionysus69: Radar https://pastebin.com/d7jAF2s1
[10:15:14] Gizmokid2010: has joined #RubyOnRails
[10:15:16] LenPayne_: has joined #RubyOnRails
[10:15:21] dionysus69: by Model I meant AR collection
[10:15:37] Radar: Hm that is not so great.
[10:15:45] Radar: Have you considered using jbuilder instead?
[10:16:01] dionysus69: hmm ye but I didnt want to create view for just a simple line
[10:16:15] Radar: It is seemingly not so simple anymore.
[10:16:22] dionysus69: I am just rendering json: in action
[10:16:37] dionysus69: xD ok I ll transition to view I guess :) thanks
[10:17:07] ferr: has joined #RubyOnRails
[10:17:26] atrius: has joined #RubyOnRails
[10:18:57] cgfbee: has joined #RubyOnRails
[10:21:24] ferr: has left #RubyOnRails: ()
[10:22:11] Ergo: has joined #RubyOnRails
[10:22:18] Cyrus1: has joined #RubyOnRails
[10:23:29] kies: has joined #RubyOnRails
[10:27:09] jnollette: has joined #RubyOnRails
[10:28:57] kapil___: has joined #RubyOnRails
[10:34:34] cschneid_: has joined #RubyOnRails
[10:35:47] jnollette: has joined #RubyOnRails
[10:35:57] kapil___: has joined #RubyOnRails
[10:41:03] mostlybadfly: has joined #RubyOnRails
[10:41:19] mostlybadfly: has joined #RubyOnRails
[10:41:37] srinidhi: has joined #RubyOnRails
[11:00:46] schneider-: has joined #RubyOnRails
[11:06:52] schneider-: has joined #RubyOnRails
[11:09:03] sandstrom: has joined #RubyOnRails
[11:09:56] apparition: has joined #RubyOnRails
[11:13:21] srinidhi: has joined #RubyOnRails
[11:20:57] mjolnird: has joined #RubyOnRails
[11:21:27] mjolnird: has joined #RubyOnRails
[11:24:34] schneider-: has joined #RubyOnRails
[11:42:17] Cavallari: has joined #RubyOnRails
[11:51:45] schneider-: has joined #RubyOnRails
[11:56:04] errakeshpd: has joined #RubyOnRails
[12:01:21] duderonomy: has joined #RubyOnRails
[12:04:03] jnollette_: has joined #RubyOnRails
[12:04:14] qyliss: has joined #RubyOnRails
[12:04:17] damonf: has joined #RubyOnRails
[12:05:58] lupine: has joined #RubyOnRails
[12:06:41] schneider-: has joined #RubyOnRails
[12:08:55] rikkipitt: has joined #RubyOnRails
[12:11:49] rfoust: has joined #RubyOnRails
[12:39:45] m_s__saints: has joined #RubyOnRails
[12:40:44] m_s__saints: has left #RubyOnRails: ()
[12:45:29] DrYockel: has joined #RubyOnRails
[12:52:19] jnollette: has joined #RubyOnRails
[12:56:26] schneider-: has joined #RubyOnRails
[13:01:50] dminuoso: Given the nesting [Foo::Bar], should a reference to `Foo::Quux` autoload and find some `::Foo::Quux`?
[13:02:13] dminuoso: Im confused right now, because it tried to look up Foo::Bar::Quux.
[13:05:37] tcopeland: has joined #RubyOnRails
[13:18:44] _aeris_: has joined #RubyOnRails
[13:38:24] Alchemical: has joined #RubyOnRails
[13:39:36] ule: has joined #RubyOnRails
[13:42:00] cschneid_: has joined #RubyOnRails
[13:47:39] Tempesta: has joined #RubyOnRails
[13:58:11] duderonomy: has joined #RubyOnRails
[14:00:12] WalterPeck: has joined #RubyOnRails
[14:00:31] arooni: has joined #RubyOnRails
[14:01:30] mikecmpb_: has joined #RubyOnRails
[14:14:30] yebyen: can I ask a question of anyone that is using fixtures in rails (with rspec? not sure if that part is important)
[14:15:26] yebyen: the question is, when you invoke "fixtures :whatevers" at the top of your file's first describe block
[14:16:03] yebyen: is that the end of the story or are you later going down and asking for particular fixtures within a given test like whatever(:certain_one)
[14:16:42] yebyen: i am not doing that, and my fixture data is still available during the test
[14:16:53] yebyen: and I'm trying to understand why... if it's because of something I've done, or what version I'm on
[14:23:57] yebyen: http://www.betterspecs.org/#factories <- "Use Factories and not fixtures"
[14:24:03] yebyen: seems to be talking about a different kind of fixture
[14:36:36] croberts: has joined #RubyOnRails
[14:43:42] mikecmpbll: has joined #RubyOnRails
[14:52:14] erlingur: has joined #RubyOnRails
[14:52:39] LateralO1: has joined #RubyOnRails
[14:54:22] tcopeland: has joined #RubyOnRails
[14:55:54] lunarkitty7: has joined #RubyOnRails
[14:59:09] erlingur: has joined #RubyOnRails
[15:00:12] sandstrom: has joined #RubyOnRails
[15:04:44] yebyen: I adjusted my RSpec config to use database cleaner and truncate before each suite
[15:05:07] yebyen: I don't like it but it works, I can run rspec twice and it doesn't have surprise failures the second time
[15:06:42] SteenJobs: has joined #RubyOnRails
[15:08:12] drale2k_: has joined #RubyOnRails
[15:08:29] drale2k_: this confuses the sh** out of me. With webpack there is not app/assets/javascript and app/javascript .. what's the difference ?
[15:13:37] timdotrb: has joined #RubyOnRails
[15:14:00] WalterPeck: drale2k_: I dont think anything in the app/assets/javascript gets used in webpack
[15:18:45] cagomez: has joined #RubyOnRails
[15:19:03] drale2k_: WalterPeck: i would like to use this ui framework. It has a npm package, can i use that with webpacker? https://www.npmjs.com/package/tabler-ui
[15:19:38] drale2k_: if i can, how would i go about adding it ?
[15:20:06] rfoust: has joined #RubyOnRails
[15:22:22] WalterPeck: drale2k_: I am not really a front end guy, but it webpacker allows you to use npm ui packages
[15:24:11] WalterPeck: drale2k_: you could add the package to the package.json dependencies
[15:25:08] cagomez: has joined #RubyOnRails
[15:25:14] WalterPeck: drale2k_: and then just make sure your rails app is set up to read assets from the ui package
[15:26:47] WalterPeck: drale2k_: but that looks like a jekyll template ui system, are you trying to utilize it for rails?
[15:27:08] drale2k_: it's a ui framework built on top of bootstrap
[15:27:19] drale2k_: i think jekyll is only used for the demo
[15:27:24] drale2k_: ye i want to use it in raisl
[15:28:18] drale2k_: i figured i can do "yard ann tabler-ui"
[15:28:24] GeorgesLeYeti: has joined #RubyOnRails
[15:28:47] GeorgesLeYeti: I want to do something like that: https://gist.github.com/GeorgesLeYeti/4bb8e6b245444e4361ba0747f556ef0e
[15:28:49] WalterPeck: drale2k_: yeah thats how i install them locally
[15:29:28] WalterPeck: drale2k_: but I have run into issues where rails wasnt using the package assets
[15:29:49] GeorgesLeYeti: But when is_joe = false then it returns any user with last_name = Doe and any first name
[15:29:58] GeorgesLeYeti: Don't know if it's clear
[15:30:01] drale2k_: WalterPeck: ye i am trying to figure out now how to use them in rails
[15:30:55] cagomez: has joined #RubyOnRails
[15:32:12] GeorgesLeYeti: I know i can do something like I did in the comment but i wanna know if it s possible to do it like the 1st code
[15:33:23] cagomez: has joined #RubyOnRails
[15:37:18] cagomez: has joined #RubyOnRails
[15:39:06] woohoou: has joined #RubyOnRails
[15:44:41] schneider-: has joined #RubyOnRails
[15:50:12] Sylario: has joined #RubyOnRails
[15:53:29] erlingur: has joined #RubyOnRails
[15:59:29] apeiros: has joined #RubyOnRails
[16:01:29] erlingur: has joined #RubyOnRails
[16:04:53] lupine: has joined #RubyOnRails
[16:05:16] schneider-: has joined #RubyOnRails
[16:11:32] sandstrom: has joined #RubyOnRails
[16:12:23] conta: has joined #RubyOnRails
[16:13:48] one_zero: has joined #RubyOnRails
[16:13:55] schneider-: has joined #RubyOnRails
[16:16:18] lupine: has joined #RubyOnRails
[16:18:17] Saukk: has joined #RubyOnRails
[16:22:02] [Butch]: has joined #RubyOnRails
[16:22:28] dionysus69: has joined #RubyOnRails
[16:23:01] harrycs: has joined #RubyOnRails
[16:25:46] jcarl43: has joined #RubyOnRails
[16:27:20] chouhoulis: has joined #RubyOnRails
[16:28:30] conta: has joined #RubyOnRails
[16:36:21] darkhanb: has joined #RubyOnRails
[16:47:52] LateralO1: has joined #RubyOnRails
[16:48:24] erlingur: has joined #RubyOnRails
[16:54:20] orbyt_: has joined #RubyOnRails
[16:55:17] lunarkitty7: has joined #RubyOnRails
[16:58:28] cagomez: has joined #RubyOnRails
[17:06:28] cagomez: has joined #RubyOnRails
[17:13:10] erlingur: has joined #RubyOnRails
[17:21:00] Cavallari: has joined #RubyOnRails
[17:22:35] orbyt_: has joined #RubyOnRails
[17:27:03] gemini315: has joined #RubyOnRails
[17:29:00] lupine: has joined #RubyOnRails
[17:33:45] WalterPeck: has joined #RubyOnRails
[17:34:32] duderonomy: has joined #RubyOnRails
[17:37:57] gemini315: has joined #RubyOnRails
[17:58:01] fcser_: With a multi-step form - after visitors complete it, to prevent them from going back and editing the form. Is the standard best practice to just keep the record ID in the session and delete it at the end once the form is complete? Or is there a better way? There is no login involved for this record creation.
[17:58:58] cagomez: has joined #RubyOnRails
[18:11:44] tdy: has joined #RubyOnRails
[18:16:11] dminuoso: fcser_: What frontend mechanism? Traditional or SPA?
[18:16:37] dminuoso: fcser_: That is how do you realize the multi-step wizard
[18:18:59] dminuoso: fcser_: If possible I'd try to not enforce it server side unless I had a good reason to do so. If you can simply use `history.replaceState` to navigate, that avoids the issue.
[18:20:09] dminuoso: But it really depends on how you roll the multi-step wizard.
[18:20:43] fcser_: dminuoso: thanks - I’m using Wicked gem for multi step form
[18:21:05] fcser_: and have a few steps then a payment and want to disallow any editing after payment / thank-you
[18:21:24] fcser_: so it’s wicked gem and stripe payment on final step
[18:21:56] fcser_: and I’m not sure what you mean by front end mechanism
[18:22:09] za1b1tsu: has joined #RubyOnRails
[18:22:57] dminuoso: fcser_: How does Wicked handle multi steps?
[18:23:12] dminuoso: Are data collected, or does it somehow persist partial updated on each step?
[18:23:44] fcser_: Generally you define steps in a controller, first step it creates a model, next steps add more data to the model. Validation is setup to be conditional based on the current step, and then payment occurrs as a validation on last step.
[18:24:33] fcser_: so it calls the update_attributes action on each step
[18:24:45] fcser_: and if validation fails returns to previous step
[18:24:47] dminuoso: fcser_: But no intermediate save?
[18:25:09] fcser_: Maybe I’m not explaining it well. It does save, there is also a ‘status’ attribute on the model
[18:25:12] dminuoso: fcser_: Well anyway. Id probably use `history.replaceState` to navigate between the steps.
[18:25:18] fcser_: once the final step is compelted the model status is set to 'active'
[18:25:28] dminuoso: fcser_: That way the user doesn't even get access to those steps.
[18:25:32] fcser_: ok thanks for the suggestion I was not aware of that option and will check it out.
[18:25:45] dminuoso: fcser_: It's a JS approach. Are you using turbolinks?
[18:26:12] fcser_: in this case I have turbolinks turned off
[18:26:21] dminuoso: That makes things easier ;)
[18:26:29] fcser_: Yes that’s what I’ve found ;)
[18:27:11] yebyen: does anyone know about pre_loaded_fixtures ?
[18:27:23] yebyen: i'm trying to find documentation on it
[18:27:46] dminuoso: fcser_: An alternative option would be to generate some token on the initial request, store it in the model and add a unique constraint. That guarantees it server side.
[18:28:07] fcser_: ok I had started down that path too but was wondering if there was a better option
[18:28:09] devpolish: has joined #RubyOnRails
[18:28:22] fcser_: and that would allow access via a ‘secret url’ in the future to view the completed form
[18:28:24] dminuoso: fcser_: but it should be nullable, so that it's still usable for API clients
[18:28:56] dminuoso: fcser_: But yeah, history.replaceState is probably saner.
[18:29:41] dminuoso: fcser_: the point isnt as much the "secrecy", its the inability to replay that last request because of the unique constraint.
[18:29:59] dminuoso: but as far as I can gather its not a security issue, but merely a UX issue.
[18:30:17] fcser_: aye thanks for the insight dminuoso
[18:30:21] dminuoso: if a user shoudn't be able to go back (or only at defined points), dont use the browser history
[18:31:26] dminuoso: fcser_: What you could do, which might not be so bad actually - is grab the `id` by fetching from the database sequence manually before.
[18:31:50] dminuoso: which is better than the token solution.
[18:32:02] dminuoso: (or rather its a variant thereof)
[18:32:55] cagomez: has joined #RubyOnRails
[18:33:14] fcser_: interesting - ok I’ll have to think about that some - wonder if there is some example code for that scenario?
[18:36:04] yebyen: aha, this is not a popular option because it's not an option in rspec at all!
[18:36:49] beingjohnm: has joined #RubyOnRails
[18:36:59] fcser_: yebyen: I did a quick search but could not find any info on ‘pre_loaded_fixtures’
[18:37:41] yebyen: fcser_: http://api.rubyonrails.org/v5.1/classes/ActiveRecord/FixtureSet.html
[18:37:43] cagomez: has joined #RubyOnRails
[18:38:33] yebyen: and in the 4.2.9 version I'm using too
[18:38:39] yebyen: but it's not an option in RSpec Core config
[18:38:48] devpolish: Hi guys, I'm doing an API using Faker gem. I'm serving random data without using a DB, for each request. It's a good pattern doing this?
[18:40:27] weaksauce: has joined #RubyOnRails
[18:44:10] cagomez: has joined #RubyOnRails
[18:45:22] jnollette: has joined #RubyOnRails
[18:45:25] alfiemax: has joined #RubyOnRails
[18:53:45] sameerynho: has joined #RubyOnRails
[18:57:33] elcms: has joined #RubyOnRails
[19:04:07] dminuoso: fcser_: I recommend you try this without example code.
[19:04:35] dminuoso: devpolish: whats the purpose?
[19:05:00] srinidhi: has joined #RubyOnRails
[19:07:35] cagomez: has joined #RubyOnRails
[19:07:41] WalterPeck: has joined #RubyOnRails
[19:10:56] devpolish: Only serve data
[19:11:10] devpolish: https://bitbucket.org/bitconcept/rails-api/src/a35729084bd8f7de6c4e2764f2ef1b33399d5bd7/app/models/user_generator.rb?at=master&fileviewer=file-view-default
[19:11:23] devpolish: https://bitbucket.org/bitconcept/rails-api/src/a35729084bd8f7de6c4e2764f2ef1b33399d5bd7/app/controllers/users_controller.rb?at=master&fileviewer=file-view-default
[19:11:28] devpolish: Model and controller
[19:12:39] devpolish: https://bitbucket.org/bitconcept/rails-api/src/a35729084bd8f7de6c4e2764f2ef1b33399d5bd7/README.md?at=master&fileviewer=file-view-default
[19:13:47] dminuoso: I dont use bitbucket.
[19:15:33] FLeiXiuS: has joined #RubyOnRails
[19:15:52] FLeiXiuS: I have a method in my model, fullname. It has self.f_name.capitalize under it.
[19:16:13] FLeiXiuS: Im getting a no method error, capitalize for User.
[19:16:25] devpolish: It's public now
[19:16:49] FLeiXiuS: self.f_name.capitalize works in the irb debug window.
[19:17:13] devpolish: Hey FleiXius, show us a snippet of that code
[19:17:51] cagomez: has joined #RubyOnRails
[19:18:30] FLeiXiuS: devpolish, https://pastebin.com/1nzka3L8
[19:18:38] FLeiXiuS: Fairly simple lol...not sure what the deal is.
[19:18:52] FLeiXiuS: f_name and l_name are both strings.
[19:19:25] yebyen: FLeiXiuS: put the 'pry' gem in there and drop a 'binding.pry' statement on the line before it blows up
[19:19:45] yebyen: then you can `cd f_name` and `ls` and see what kind of methods you have
[19:19:58] yebyen: and run `class` if you want and see what kind of object it really is at that point
[19:20:06] FLeiXiuS: yebyen, Webrick has the built in web console
[19:20:21] dminuoso: FLeiXiuS: pry is simply better.
[19:20:25] yebyen: pry is better imho, you can run "modules" and get a list of modules in the web console
[19:20:26] FLeiXiuS: self.l_name.class => String
[19:20:32] yebyen: but "ls" is a thing of beauty
[19:20:43] helpa: https://github.com/pry/pry and https://github.com/pry for its ecosystem
[19:20:53] yebyen: the pry ecosystem!
[19:21:07] yebyen: i am such a poseur, I don't know anything
[19:21:13] FLeiXiuS: Sec - I'll get it
[19:21:13] devpolish: User.methods.exists? :method_name
[19:24:14] harryk_: has joined #RubyOnRails
[19:24:17] FLeiXiuS: Hrm - restarting webrick did the trick.
[19:24:28] FLeiXiuS: I thought for sure I did that already, no idea.
[19:30:53] harrycs: has joined #RubyOnRails
[19:32:44] harryk_: has joined #RubyOnRails
[19:36:39] orbyt_: has joined #RubyOnRails
[19:41:18] Cavallari: has joined #RubyOnRails
[19:58:19] duderonomy: has joined #RubyOnRails
[19:58:43] cagomez: has joined #RubyOnRails
[19:59:36] workmad3: has joined #RubyOnRails
[20:04:09] cagomez: has joined #RubyOnRails
[20:07:41] WalterPeck: has joined #RubyOnRails
[20:14:57] Ergo: has joined #RubyOnRails
[20:18:15] beingjohnm: has joined #RubyOnRails
[20:22:06] WalterPeck: has joined #RubyOnRails
[20:27:46] harrycs: has joined #RubyOnRails
[20:28:26] Puffball: has joined #RubyOnRails
[20:29:47] dionysus69: has joined #RubyOnRails
[20:32:19] croberts: has joined #RubyOnRails
[20:36:13] gambl0re: has joined #RubyOnRails
[20:48:42] rfoust: has joined #RubyOnRails
[20:51:52] marr: has joined #RubyOnRails
[20:52:35] schneider-: has joined #RubyOnRails
[21:14:39] FrostCandy: has joined #RubyOnRails
[21:15:27] FrostCandy: Easy Question, I need to see if this date is older than a year old. This timestame looks like this 2018-04-04 18:45:31.079599
[21:15:59] FrostCandy: I think i want something like this but it doesnt work Date.today - 365 <= Date.parse(created_at, "%d-%m-%Y")
[21:16:03] FrostCandy: probalby cause i got the wrong format
[21:22:06] ellcs: has joined #RubyOnRails
[21:25:23] dionysus69: just this works Date.parse("2018-04-04 18:45:31.079599")
[21:27:52] harrycs: has joined #RubyOnRails
[21:30:31] FrostCandy: oh ok thanks couldnt find that easily
[21:30:32] harrycs: has joined #RubyOnRails
[21:31:25] tetraktys: has joined #RubyOnRails
[21:31:48] FrostCandy: undefined method `downcase' for Thu, 26 Oct 2017 21:08:05 UTC +00:00:Time
[21:31:50] FrostCandy: i got this :(
[21:32:15] FrostCandy: if Date.today - 365 <= Date.parse(vemail.created_at)
[21:32:20] FrostCandy: ^^ Thats my line that breaks
[21:40:55] orbyt_: has joined #RubyOnRails
[21:41:29] beingjohnm: has joined #RubyOnRails
[21:46:30] defsdoor: has joined #RubyOnRails
[21:50:11] GodFather: has joined #RubyOnRails
[21:55:15] conorao: has joined #RubyOnRails
[21:59:12] workmad3: has joined #RubyOnRails
[22:01:04] conorao: hey all, does anyone have experience using recognize_path in the context of a routing constraint?
[22:03:41] FrostCandy: dionysus69: by the way turns out reading the date in from postgres through activerecords automaticalyl puts it into a date class so i was trying to to_date a date heh
[22:05:05] conorao: did you end up figuring it out, FrostCandy?
[22:05:12] dionysus69: oh :D ye otherwise the pgsql date record would be super ugly for humans to read :)
[22:05:34] WalterPeck: has joined #RubyOnRails
[22:05:55] workmad3: has joined #RubyOnRails
[22:26:46] mikecmpbll: has joined #RubyOnRails
[22:31:00] FrostCandy: conorao: yup it turned out i didn't have to mess with the returend date from the db. It was already a date type.
[22:33:58] tcopeland: has joined #RubyOnRails
[22:39:03] workmad3: has joined #RubyOnRails
[22:39:46] Radar: GOOD MORNING
[22:42:03] conorao: FrostCandy: Awesome!
[22:42:08] andywww: has joined #RubyOnRails
[23:27:26] sameerynho: has joined #RubyOnRails
[23:55:06] chouhoulis: has joined #RubyOnRails