« Back to channel list

#RubyOnRails - 16 May 2017

« Back 1 day Forward 1 day »
[00:04:36] mrgreenfur: amperry: does the sql work directly to the db to save values = 8?
[00:04:49] mrgreenfur: is there a foreign key or constraight that’s causing it to fail?
[00:07:11] amperry: mrgreenfur: direct sql works
[00:07:39] mrgreenfur: non_revenue_status_id sounds like a foreign object reference
[00:07:46] mrgreenfur: is there a model called non_revenue_status?
[00:07:54] mrgreenfur: err NonRevenueStatus
[00:07:57] amperry: it is, there is, and it has 8 values
[00:08:06] mrgreenfur: and is there one with id = 8?
[00:08:17] ascarter: has joined #RubyOnRails
[00:08:26] mrgreenfur: and the relationship is setup with belongs_to or somesuch
[00:08:51] amperry: apt belongs_to non_revenue_status, yes
[00:09:24] lurkrake: has joined #RubyOnRails
[00:10:38] amperry: non_revenue_status id 8 has a status_code of 'VAC' and a status_desc of 'Vacant'; I don't know if that has anything to do with anything, but I tried duplicating it (so there's a non_revenue_status with id 9), and setting it to 9 doesn't work, either
[00:11:02] amperry: anything else, from nil to 7, works
[00:11:05] lurkrake: has joined #RubyOnRails
[00:13:12] mrgreenfur: still sounds like there is an error from the rdbms
[00:13:16] mrgreenfur: causing it to rollback
[00:13:25] mrgreenfur: might want to try executing the insert sql manually
[00:14:28] itarato: has joined #RubyOnRails
[00:14:34] amperry: insert at what point?
[00:15:31] mrgreenfur: or update, whatever sql rails is trying to run before it rollsback
[00:15:42] mrgreenfur: likely a constraint is failing
[00:15:48] mrgreenfur: should be in the console
[00:16:17] itarato: has joined #RubyOnRails
[00:17:26] pharma_joe: has joined #RubyOnRails
[00:18:36] amperry: some of the quoting might be tricky with postgresql, but the console tries this first:
[00:18:41] amperry: NonRevenueStatus Load (0.3ms) SELECT "non_revenue_statuses".* FROM "non_revenue_statuses" WHERE (non_revenue_statuses.is_active is true) AND "non_revenue_statuses"."status_code" = $1 LIMIT 1 [["status_code", "VAC"]]
[00:18:53] amperry: then immediately rolls back
[00:19:16] amperry: running that in a db console gets the right record
[00:28:18] amperry: the values 'VAC' and 'Vacant' have something to do with it; I changed those, and it saves.
[00:29:49] amperry: aaaand, narrowed it down to 'VAC'
[00:31:43] amperry: ActiveRecord won't save an apt if the non_revenue_status has a status_code of 'VAC', but the record will save in a db console.
[00:32:23] amperry: I don't know if the string 'VAC' has magic meaning to postgresql (looking up 'vacuuming' right now), but it trips up AR.
[00:33:53] Technodrome: has joined #RubyOnRails
[00:40:06] DLSteve: has joined #RubyOnRails
[00:40:33] nahtnam: has joined #RubyOnRails
[00:46:56] quazimodo: has joined #RubyOnRails
[00:48:40] amperry: asking on #Postgresql right now, apparently 'VAC' doesn't have any particular eaning.
[00:51:51] chouhoulis: has joined #RubyOnRails
[00:52:55] apparition: has joined #RubyOnRails
[00:53:24] irishfromua: has joined #RubyOnRails
[00:54:51] advorak: Can I use 'next' in a: loop { }
[00:55:39] advorak: Oops - answered my own question ..
[00:56:42] amperry: advorak: you can, just to clarify
[00:57:09] amperry: ACTION wonders if the string 'VAC' causes AR's placeholder substitution to trip up somehow
[00:57:14] gusrub: has joined #RubyOnRails
[00:57:27] advorak: Thanks. I asked that question when I thought I was near solving a problem I was having ... :-/
[00:58:44] amperry: advorak: check it out in a rails console: [1,2,3].each do |x|; next if x == 2; puts x; end
[00:59:15] amperry: gives 1<newline>3
[01:01:23] advorak: *nods* I play with ruby intermittently and occasionally forget these things. It also doesn't help that I'm trying to play with pdf files and the text within them ... too much can go so wrong so easily with PDF and the text inside when trying to read it .. :-)
[01:02:58] amperry: okay, maybe it isn't just the string 'VAC', because I tested my update on a different object with a status_code of 'VAC', and it worked.
[01:03:05] amperry: ACTION grumbles
[01:05:38] sevenseacat: has joined #RubyOnRails
[01:10:10] ur5us: has joined #RubyOnRails
[01:14:16] ascarter: has joined #RubyOnRails
[01:37:58] spheric: has joined #RubyOnRails
[01:55:11] gamblor3: has joined #RubyOnRails
[02:03:04] hahuang65: has joined #RubyOnRails
[02:04:19] quirkycoders: has joined #RubyOnRails
[02:21:49] Jameser: has joined #RubyOnRails
[02:30:15] tomasm-: has joined #RubyOnRails
[02:30:42] tomasm-: hey anyone know if there's a way for assets to overwrite previous versions rather than have some hash at the end of the filename?
[02:32:09] sevenseacat: you could turn offthe digesting, but it's there for a reason (cachebusting)
[02:33:17] sevenseacat: http://guides.rubyonrails.org/asset_pipeline.html#turning-digests-off
[02:33:21] tomasm-: yeah i've never had an issue with caching with other apps. just hard refresh
[02:34:05] sevenseacat: is that feasible to tell all your users to do, if theyre not using IE?
[02:34:12] sevenseacat: (in IE, that won't help)
[02:36:21] bruno-: has joined #RubyOnRails
[02:36:29] tomasm-: well i'm more concerned for development, production can digest. my master branch will change less often than my develop branch
[02:36:44] sevenseacat: what problems are you having with digesting in development?
[02:37:22] tomasm-: i dunno, just seems annoying to have a ton of files in the same folder
[02:38:28] sevenseacat: worrying about the size of your tmp folder seems a bit over the top
[02:40:02] quirkycoders: has joined #RubyOnRails
[02:41:16] sevenseacat: its also a good idea to keep the same behaviour in dev and production - that way if you do things like hardcoding links in dev that won't work in production, you'll know
[02:41:34] sevenseacat: (I just came across that one in my app this week so :) )
[02:45:01] hahuang65: has joined #RubyOnRails
[02:48:02] xall: has joined #RubyOnRails
[02:49:50] tomasm-: cool, i'm still just prototyping my app, so i'm sure i'll come across those issues later.... just trying to come up with some static mockups for my app as quickly as possible. i was noticing that if I got good that a static page wouldnt take any more time than working in sketch
[02:50:21] duderonomy: has joined #RubyOnRails
[03:04:33] agent_white: has joined #RubyOnRails
[03:12:13] FCser: has joined #RubyOnRails
[03:18:15] hndk: has joined #RubyOnRails
[03:18:39] itarato: has joined #RubyOnRails
[03:32:57] Tempesta: has joined #RubyOnRails
[03:40:09] brent__: has joined #RubyOnRails
[03:43:51] apparition: has joined #RubyOnRails
[03:44:28] nickjj_: has joined #RubyOnRails
[03:48:03] irishfromua: has joined #RubyOnRails
[03:48:46] ahrs: has joined #RubyOnRails
[03:59:46] pLaTo0n: has joined #RubyOnRails
[04:06:07] raul782: has joined #RubyOnRails
[04:13:05] dblessing: has joined #RubyOnRails
[04:19:02] hahuang65: has joined #RubyOnRails
[04:19:13] raul782: Hey guys, when you call force_ssl in ApplicationController, do you have access to the request?
[04:19:25] raul782: or Env variables?
[04:38:58] uksio: has joined #RubyOnRails
[04:51:42] apparition: has joined #RubyOnRails
[05:06:01] sloggerkhan: has joined #RubyOnRails
[05:08:02] apparition: has joined #RubyOnRails
[05:14:00] bigtawm: has joined #RubyOnRails
[05:17:27] bigtawm: Hey all, I've been learning ruby on rails for a little while Im in school so I can do some side projects in it. I am finally finishing community college and transferring to Berkeley and want to do a bunch of rails this summer. I just finished the Ruby on Rails Tutorial, and I am being that guy and asking you all for some advice lol what are some good next steps?
[05:18:47] sevenseacat: start building something
[05:18:57] hahuang65: has joined #RubyOnRails
[05:22:41] bigtawm: The thing I have the most questions on are should I try to learn to develop using agile and how would I use data structures and algorithms in my apps. My best friend and are are going to try to build some stuff together and are stuck on how to go about that.
[05:23:14] bigtawm: I was going to work through this edx course in my free time too https://www.edx.org/course/agile-development-using-ruby-rails-uc-berkeleyx-cs169-1x-0
[05:33:17] sevenseacat: sounds like wanting to use buzzwords for the sake of buzzwords. you cant build an app without 'data structures and algorithms'
[05:35:13] sevenseacat: if you want to get more familiar with ruby classes and the like, that's out of scope of building a basic rails app, really
[05:40:34] bigtawm: True I just took a data structures and algorithms class so Im talking more advanced data structures and algos unless you dont really run into those in typical rails development. Would building some type of CRUD app be good or is that kinda simple?
[05:41:22] sevenseacat: depends on what your aim is
[05:42:32] sevenseacat: everything you've mentioned is good. is it all good for you to do right now, probably not
[05:42:56] sevenseacat: if your objective is to get more experienced with rails, then by all means try building an app using what you've learnt so far
[05:43:24] sevenseacat: if your objective is to get better at Ruby, building a basic rails app won't help with that :D
[05:44:02] Technodrome: has joined #RubyOnRails
[05:45:18] bigtawm: I want to pick up some web development since I feel like school hasnt shown me a lot of that. I built a chess game in ruby recently and might build an ai for it.
[05:45:48] sevenseacat: nice. you could build a web interface so people can play games online :)
[05:46:34] bigtawm: Oh yeah thats a good idea. The ruby code would be the backend and the front end would be some javascript or something?
[05:46:58] sevenseacat: or it could be a rails app
[05:48:32] srinidhi: has joined #RubyOnRails
[05:48:46] bigtawm: Sounds interesting that could be a good exercise
[05:49:13] bigtawm: I could use a lot of the existing logic for the game right?
[05:49:59] sevenseacat: you may be able to just include the game as-is
[05:51:55] bigtawm: Its a command line game so there isnt much of a UI
[05:52:29] sevenseacat: thats what the web app would be for :)
[05:53:34] dionysus69: has joined #RubyOnRails
[05:54:30] bigtawm: Say the board is represented as a 2 dimensional array. Would I look for a piece object and then add a CSS class to make a chess piece appear on the board or something?
[05:56:33] bigtawm: Sorry thats kinda confusing lol Im trying to think about how two people would play a game against each other and have the board update after every move.
[05:56:39] sevenseacat: the web app would be responsible for building an interface for a board and clicking on pieces and the like, yes
[06:00:06] bigtawm: Lol not trying to keep blowing the irc up, but do you think Im at the point to where I could think of an idea and plan it out and build it? I feel like Im a decent programmer but larger projects are scary lol also I want to learn some JS too. Should I just learn some basic JS and jquery? Or is learning more than that important for web dev right now?
[06:03:33] srinidhi: has joined #RubyOnRails
[06:03:51] sevenseacat: I have no idea what point you're at
[06:04:21] sevenseacat: do you feel you understood enough of the material out of the Rails Tutorial to apply those ideas to building your own app?
[06:04:27] sevenseacat: if so, then go for it
[06:10:01] bigtawm: Yeah I do for the most part and if I get stuck I can google my way out of it. I mostly want to build it for my portfolio for when I apply for internships. Maybe a website for tutors and students to connect or something.
[06:10:47] bigtawm: I just want to make something that other people could use. Even if only a couple people do I think it would be pretty cool.
[06:34:28] morfin: has joined #RubyOnRails
[06:35:52] conta: has joined #RubyOnRails
[06:45:02] conta: has joined #RubyOnRails
[06:48:43] somerandomteen: has joined #RubyOnRails
[06:50:26] quirkycoders: has joined #RubyOnRails
[06:52:12] somerandomteen: Hi all, what's the best way to define a default for a session variable? I need it to be set no matter which controller is being hit.
[06:53:20] sevenseacat: I'd write a method in ApplicationController to access the variable and provide the default if necessary
[06:54:12] somerandomteen: Why not a before_action in ApplicationController?
[06:55:13] sevenseacat: because the fact it's something stored in the session isn't something that needs to propagate around your entire app
[06:55:26] somerandomteen: hmm, fair point. thanks!
[06:57:17] blackmesa: has joined #RubyOnRails
[07:26:30] quirkycoders: has joined #RubyOnRails
[07:27:51] srinidhi: has joined #RubyOnRails
[07:28:50] Cork: is there an option for unsigned values in rails 5+, or is it still "t.column <name>, 'integer unsigned'" the way to go?
[07:28:54] xall: has joined #RubyOnRails
[07:30:12] oki: has left #RubyOnRails: ()
[07:31:37] ur5us: has joined #RubyOnRails
[07:42:19] blackmesa: has joined #RubyOnRails
[08:02:13] quirkycoders: has joined #RubyOnRails
[08:03:38] mikecmpbll: has joined #RubyOnRails
[08:06:01] User458764: has joined #RubyOnRails
[08:06:10] otherj: has joined #RubyOnRails
[08:08:54] arBmind: has joined #RubyOnRails
[08:10:36] DaniG2k: has joined #RubyOnRails
[08:11:15] DaniG2k: Hello all :) I am trying to set up Cancancan abilities for users with a specific role. I want them to have access to the methods of a namespaced controller.
[08:11:21] DaniG2k: I've outlined my question further here: http://stackoverflow.com/questions/43995803/cancancan-allow-managing-on-namespaced-controller
[08:11:32] DaniG2k: any help would me much appreciated! Kind of stumped right now
[08:13:27] sevenseacat: authorization isnt about controller actions - its about performing actions on objects
[08:13:43] sevenseacat: I really don't think you want them to be able to blanket access every action in a ListingsController
[08:13:57] DaniG2k: sevenseacat: probably not in the long run
[08:14:14] sevenseacat: so what objects do they have access to?
[08:14:31] DaniG2k: sevenseacat: but right now I'm trying to figure out why i can't even access the /owners/dashboard page with a User with role listing_owner
[08:14:39] DaniG2k: You might be right actually...good point
[08:14:43] DaniG2k: this might be a Devise issue
[08:14:44] sevenseacat: what do your logs say?
[08:15:32] cryingfreeman: has joined #RubyOnRails
[08:17:26] Technodrome: has joined #RubyOnRails
[08:17:58] ur5us: has joined #RubyOnRails
[08:21:04] lipoqil: has joined #RubyOnRails
[08:21:10] cryingfreeman: Hi, I have a RoR-project which uses weekday names like strftime("%A, %d-%m-%Y"). I want to translate the constant Date::DAYNAMES to produce a localized version. I have done this before, but I have no idea where to put the definition and how it should look, since I'm no real RoR programmer. Can anyone help me? :)
[08:22:14] marr: has joined #RubyOnRails
[08:22:43] sevenseacat: cryingfreeman: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L11 you probably want to find the en.yml in your app and add a translation under that key
[08:23:48] sevenseacat: or use the rails-i18n gem that comes with a lot of different language translations baked in
[08:25:29] sevenseacat: https://github.com/svenfuchs/rails-i18n
[08:29:20] DrYockel: has joined #RubyOnRails
[08:34:46] cryingfreeman: sevenseacat: Thanks, I'll try the first one first :)
[08:36:25] Technodrome: has joined #RubyOnRails
[08:38:39] quirkycoders: has joined #RubyOnRails
[08:43:19] xall: has joined #RubyOnRails
[08:43:33] User458764: has joined #RubyOnRails
[08:46:38] Technodrome: has joined #RubyOnRails
[08:53:56] morfin: if you need some test message with different "body" attribute for tests where do you put that?
[08:54:32] xall: has joined #RubyOnRails
[08:54:34] morfin: different factories? like message_with_valid_body, message_with_invalid_body etc
[08:55:43] sevenseacat: pass the body into the factory? make it a trait of your factory? without seeing what you're working with, there are many approaches
[08:56:34] morfin: i am using FactoryGirl and testing using MiniSpec
[08:56:52] sevenseacat: so what do your test and factory look like?
[08:57:31] Technodrome: has joined #RubyOnRails
[09:02:12] morfin: like this https://gist.github.com/morfin60/001a8eef1c96cdbce4f3141e94076817
[09:03:23] morfin: i just wanted to avoid having body in same place
[09:03:41] sevenseacat: which body? what you have looks okay
[09:06:08] ErhardtMundt: has joined #RubyOnRails
[09:08:46] Technodrome: has joined #RubyOnRails
[09:14:28] quirkycoders: has joined #RubyOnRails
[09:16:26] lxsameer: has joined #RubyOnRails
[09:19:42] Technodrome: has joined #RubyOnRails
[09:19:54] ferr: has joined #RubyOnRails
[09:22:17] workmad3: has joined #RubyOnRails
[09:30:18] Technodrome: has joined #RubyOnRails
[09:30:20] xall: has joined #RubyOnRails
[09:42:14] rikkipitt: has joined #RubyOnRails
[09:43:15] rikkipitt: Afternoon folks, does anyone use Storext in the context of simple_form? https://github.com/G5/storext
[09:44:20] sevenseacat: havent used it, but it would sure make my app a lot nicer
[09:47:49] awille: has joined #RubyOnRails
[09:48:16] dionysus69: has anyone setup sparkpost email sender with rails? I chose an API option instead of an smtp relay
[09:49:30] ferr: has joined #RubyOnRails
[09:50:08] awille: has joined #RubyOnRails
[09:51:06] User458764: has joined #RubyOnRails
[09:53:52] rikkipitt: sevenseacat: thinking the same here, just figuring out the form builder aspect of it, much easier than I expected
[09:54:32] rikkipitt: doesn't require simple_fields_for, just straight up attribute
[09:55:13] machuga: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[10:04:39] User458764: has joined #RubyOnRails
[10:16:50] skroon: has joined #RubyOnRails
[10:17:26] skroon: seems that Rails 5 now default shows the name of an Enum , is it possible to render the Enum value instead? Because my API depends on this at the moment
[10:18:06] skroon: puts Person.first
[10:18:21] skroon: when there is an enum on Person like: enum gender: { male: 0, female: 1, not_sure: 2, prefer_not_to_disclose: 3 }
[10:18:47] skroon: in Rails 4 you would get for example gender: 0 , but in Rails 5 I see: gender: male
[10:20:54] sevenseacat: api.rubyonrails.org/classes/ActiveRecord/Enum.html see accessing the mapping directly
[10:24:49] skroon: thanks, but that requires me to already know what the result of gender is, when I do a AR query a list of People will be returned, each with different genders, and I want to give to to my API as enum values rather then names
[10:25:31] sevenseacat: what? yes, for each one, you can access the mapping
[10:32:58] xall: has joined #RubyOnRails
[10:38:45] Moeh: has joined #RubyOnRails
[10:39:03] Moeh: Is there a way to have a readonly model that can be destroyed in rails 5?
[10:39:54] sevenseacat: I can think of many ways to get around anything being readonly or not-destroyable
[10:40:30] itarato: has joined #RubyOnRails
[10:41:01] Moeh: At the moment we have "def readonly? new_record? ? false : true end" in the model, so what would be the best way to make it destroyable?
[10:41:30] sevenseacat: depends why its not destroyable now
[10:41:47] sevenseacat: also, unnecessary ternary
[10:41:56] Moeh: If I call destroy on it, I get the error: ActiveRecord::ReadOnlyRecord: UserActivity is marked as readonly
[10:42:24] Moeh: Ahja, can be written as "def readonly? !new_record end" right?
[10:42:30] sevenseacat: could just be `def readonly?; !new_record; end` or `def readonly?; persisted?; end`
[10:42:50] Moeh: makes sense, yes
[10:44:23] sevenseacat: however, I see what Rails is trying to do - readonly records mean no editing in any form
[10:45:13] matthewd: def readonly?; persisted? && !@allow_modifications; end
[10:46:29] sevenseacat: @readonly and @allow_modifications are not inverses of each other?
[10:46:35] matthewd: (with the disclaimer that I don't intend to imply overriding #readonly? is supported.. I don't know, but somewhat doubt it)
[10:46:55] Moeh: matthewd: With this code I still get the exception
[10:47:02] matthewd: I'm just inventing an ivar that can then be manually set before calling destroy
[10:47:43] matthewd: (or maybe in before_destroy ? Not sure how early we check readonly?)
[10:47:48] sevenseacat: i see what you're doing there
[10:49:10] matthewd: Alternatively: def my_destroy; self.class.where(id: self).delete_all; end -- with a different set of disclaimers that delete != destroy
[10:50:03] Moeh: Well, delete is not really the problem, as it ignores "readonly?" > http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-delete
[10:50:04] matthewd: Oh, there's even self.class.delete(self)
[10:50:50] matthewd: Ah, I didn't even know there as a Base#delete
[10:51:46] itarato: has joined #RubyOnRails
[10:52:01] marahin: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[10:52:14] matthewd: Looks like the before_destroy option would work
[10:52:49] Moeh: http://stackoverflow.com/questions/35348935/activerecord-readonly-true-is-preventing-destroy haven't tried it but according to this just returning true doesn't work
[10:53:18] matthewd: There are also slightly more insane options: def readonly?; persisted? && caller[0] !~ /destroy/; end
[10:54:13] matthewd: Yeah, I have no idea why that person would think that would help
[10:54:41] Moeh: Thanks for all the suggestions, we will just remove the readonly logic, is it not critical :)
[10:55:29] matthewd: Well that's confusing
[10:55:31] matthewd: But.. okay.
[11:15:03] DoubleMalt: has joined #RubyOnRails
[11:17:01] aajjbb: has joined #RubyOnRails
[11:38:26] Jameser: has joined #RubyOnRails
[11:39:33] blackmesa: has joined #RubyOnRails
[11:45:52] srinidhi: has joined #RubyOnRails
[11:47:44] shotbug: has joined #RubyOnRails
[12:01:37] blackmesa: has joined #RubyOnRails
[12:04:11] fmcgeough: has joined #RubyOnRails
[12:06:25] apparition: has joined #RubyOnRails
[12:08:15] fmcgeough_: has joined #RubyOnRails
[12:22:24] quirkycoders: has joined #RubyOnRails
[12:26:05] pupsicle: has joined #RubyOnRails
[12:28:51] kristoff_: has joined #RubyOnRails
[12:48:19] durango: has joined #RubyOnRails
[12:49:16] durango: If I run rake assets:precompile and everything works fine, a new JS/CSS is generated in public/.. I see the files just fine, changes are just fine, etc. however, the layout within the views thats using javascript_include_tag 'application' doesn't update to the latest version.. how can I resolve that issue? On production environment
[12:51:53] tbuehlmann: durango: what exactly do you expect to happen?
[12:58:12] itarato: has joined #RubyOnRails
[13:00:13] mrgreenfur: has joined #RubyOnRails
[13:09:52] User458764: has joined #RubyOnRails
[13:11:15] itarato: has joined #RubyOnRails
[13:12:24] Andr3as: durango: what does the js include tag say exactly?
[13:14:13] shilon: has joined #RubyOnRails
[13:23:20] xall: has joined #RubyOnRails
[13:34:06] bruno-: has joined #RubyOnRails
[13:34:23] DLSteve: has joined #RubyOnRails
[13:36:30] workmad3: has joined #RubyOnRails
[13:37:20] itarato: has joined #RubyOnRails
[13:40:07] fryguy: durango: did you restart the application server?
[13:49:38] NeoMalachi: has joined #RubyOnRails
[13:49:57] dionysus69: has joined #RubyOnRails
[13:55:57] pupsicle: durango: browser cache?
[13:57:12] andrew9184: has joined #RubyOnRails
[14:00:31] ahrs: has joined #RubyOnRails
[14:02:45] chouhoulis: has joined #RubyOnRails
[14:13:10] Technodrome: has joined #RubyOnRails
[14:13:15] theunraveler: has joined #RubyOnRails
[14:15:25] peterhil: has joined #RubyOnRails
[14:22:24] renegadeandy: has joined #RubyOnRails
[14:25:37] shilon: has joined #RubyOnRails
[14:26:30] DoubleMalt: has joined #RubyOnRails
[14:29:50] durango: pupsicle fryguy Andr3as tbuehlmann restarting the app worked ty thought i had previously done that but i guess not
[14:30:15] Andr3as: aight, great :)
[14:34:16] GodFather: has joined #RubyOnRails
[14:36:16] shilon: has joined #RubyOnRails
[14:37:08] shilon: has joined #RubyOnRails
[14:37:46] mikecmpb_: has joined #RubyOnRails
[14:37:49] shilon: has joined #RubyOnRails
[14:38:38] shilon: has joined #RubyOnRails
[14:39:26] shilon: has joined #RubyOnRails
[14:40:11] User458764: has joined #RubyOnRails
[14:40:20] shilon: has joined #RubyOnRails
[14:41:09] shilon: has joined #RubyOnRails
[14:48:02] blackmesa: has joined #RubyOnRails
[14:50:44] chouhoulis: has joined #RubyOnRails
[14:52:43] itarato: has joined #RubyOnRails
[15:00:30] ahrs: has joined #RubyOnRails
[15:02:26] waseem_: has joined #RubyOnRails
[15:04:45] shilon: has joined #RubyOnRails
[15:06:53] itarato: has joined #RubyOnRails
[15:18:40] shilon: hello everyone, does anyone know why is my DeviseInvitable sending me the email twice on seeding users and 3 times when inviting users… I haven’t changed a thing and this suddenly started to happen…
[15:23:41] quirkycoders: has joined #RubyOnRails
[15:23:53] bmgoog: has joined #RubyOnRails
[15:28:47] irishfromua: has joined #RubyOnRails
[15:29:04] mikecmpbll: has joined #RubyOnRails
[15:29:47] itarato: has joined #RubyOnRails
[15:30:08] hobodave: has joined #RubyOnRails
[15:30:47] cam27: has joined #RubyOnRails
[15:32:29] duderonomy: has joined #RubyOnRails
[15:33:53] mrbubbles: Hello folks - so usually I use link_to "Text", some_path - and if I want to do a more custom link it's link_to some_path do ... end
[15:34:17] mrbubbles: So I've just been using link_to "text", { order_by: column, order: direction } to have a link that loads the same page with URL params attached
[15:34:38] mrbubbles: but link_to { order_by: column, order: direction } do ... end doesn't seem to work - am I doing something silly?
[15:35:10] tbuehlmann: mrbubbles: I personally would use the path helper, like projects_path(order_by: column, order: direction)
[15:35:32] mrbubbles: good tip, thanks tbuehlmann
[15:36:29] mrbubbles: Ah, though it's in a helper so I dont' actually know what the path will be
[15:36:39] matthewd: mrbubbles: The direct fix is to add parens
[15:36:58] shilon: has joined #RubyOnRails
[15:37:01] brent__: has joined #RubyOnRails
[15:37:46] shilon: has joined #RubyOnRails
[15:38:08] mrbubbles: matthewd - ah I see, yep that worked. Thanks :)
[15:38:36] shilon: has joined #RubyOnRails
[15:39:28] shilon: has joined #RubyOnRails
[15:39:43] brent__: has joined #RubyOnRails
[15:40:18] shilon: has joined #RubyOnRails
[15:41:21] ascarter: has joined #RubyOnRails
[15:41:26] mdw: has joined #RubyOnRails
[15:43:25] brent__: has joined #RubyOnRails
[15:43:45] ascarter: has joined #RubyOnRails
[15:48:28] bruno-: has joined #RubyOnRails
[15:48:38] User458764: has joined #RubyOnRails
[15:49:26] ascarter: has joined #RubyOnRails
[15:56:05] juggler: has joined #RubyOnRails
[15:56:57] xall: has joined #RubyOnRails
[15:59:35] tercenya: has joined #RubyOnRails
[16:02:11] [Butch]: has joined #RubyOnRails
[16:02:17] patarr: has joined #RubyOnRails
[16:02:57] Pumukel: has joined #RubyOnRails
[16:06:15] gusrub: has joined #RubyOnRails
[16:07:52] andrew9184: has joined #RubyOnRails
[16:29:36] rakm: has joined #RubyOnRails
[16:34:51] itarato: has joined #RubyOnRails
[16:41:04] Technodrome: has joined #RubyOnRails
[16:55:51] hahuang65: has joined #RubyOnRails
[16:58:20] duderono_: has joined #RubyOnRails
[17:12:19] mikecmpbll: has joined #RubyOnRails
[17:13:27] patarr: Hi all. Has anyone here experienced issues with devise & versionist together? After adding versionist, I'm getting 403's all over the place. Google hasn't been too helpful so far.
[17:13:35] patarr: Was curious if anyone recollects running into this
[17:22:59] Andr3as: patarr: does that help? https://github.com/bploetz/versionist/issues/57
[17:23:25] aajjbb: has joined #RubyOnRails
[17:28:07] tercenya: has joined #RubyOnRails
[17:31:11] hahuang65: has joined #RubyOnRails
[17:31:34] hahuang65: has joined #RubyOnRails
[17:32:04] hahuang65: has joined #RubyOnRails
[17:45:02] swgillespie: has joined #RubyOnRails
[17:50:57] duderonomy: has joined #RubyOnRails
[17:54:57] jdqx: has joined #RubyOnRails
[17:56:08] zacts: has joined #RubyOnRails
[17:59:18] Criten: So.. there was something added in rails 5.1
[17:59:24] Criten: to permit a whole hash
[17:59:29] Criten: I can't find it anywhere now
[17:59:40] Criten: thought it was like params.permit(key: {})
[17:59:42] Criten: or soemthing
[18:01:11] tbuehlmann: should be an empty hash
[18:01:26] mrgreenfur: Whats the best way to test a flow between multiple controllers? A feature spec?
[18:03:18] tbuehlmann: mrgreenfur: a feature spec will do, yeah
[18:03:35] quazimodo: has joined #RubyOnRails
[18:04:19] tbuehlmann: Criten: see http://guides.rubyonrails.org/action_controller_overview.html#permitted-scalar-values and https://github.com/rails/rails/commit/e86524c0c5a26ceec92895c830d1355ae47a7034
[18:04:23] mrgreenfur: tbuehlmann: I tried a quick one but found it was missing stuff I’m used to in controller specs: @request, devise sign_in methods, etc. Any tips ot bring that stuff back?
[18:04:46] gusrub: has joined #RubyOnRails
[18:09:00] tbuehlmann: mrgreenfur: yeah, controller/request helpers aren't supposed to be used in a feature spec. I'd write a helper method that logs the user in via browser interactions
[18:11:06] tbuehlmann: see https://robots.thoughtbot.com/rspec-integration-tests-with-capybara
[18:15:05] Technodrome: has joined #RubyOnRails
[18:21:14] ForeignBiscuit: has joined #RubyOnRails
[18:21:34] quazimodo: has joined #RubyOnRails
[18:29:42] fryguy: is there a way to undo a call to `fixtures` for a specific test case? I have a users fixture and a test that wants to assert some user_counts based on very specific user configs (using factorygirl or some such). I'd like to start the test with an empty users table.
[18:30:39] mrgreenfur: thanks tbuehlmann
[18:40:58] quirkycoders: has joined #RubyOnRails
[18:47:19] tercenya: has joined #RubyOnRails
[18:52:54] ResidentBiscuit: has joined #RubyOnRails
[18:54:59] Technodrome: has joined #RubyOnRails
[19:00:08] ascarter: has joined #RubyOnRails
[19:00:59] syndikate: How do I go about authenticating and securing websocket channels?
[19:01:21] blackmesa: has joined #RubyOnRails
[19:01:24] syndikate: I have a user on a specific order page to whom I need to post updates.
[19:01:32] tercenya: has joined #RubyOnRails
[19:06:05] bmgoog: I'm following along with the basic guide to Rails, and it news @article = Article.new to instantiate the Article model. There is nothing different between Article.new and Article.new() in this case, is there?
[19:06:50] bmgoog: Both seem to work fine, and coming from other languages I'm sort of mentally trained to fully reference the function. Just want to make sure that won't get me into trouble in this very basic example.
[19:07:10] fryguy: bmgoog: there's no difference
[19:07:21] bmgoog: fryguy: thanks!
[19:07:22] fryguy: parenthesis are optional in ruby, except when they aren't (ambiguity)
[19:14:21] ascarter: has joined #RubyOnRails
[19:20:42] Aherin: has joined #RubyOnRails
[19:28:50] lxsameer: has joined #RubyOnRails
[19:29:16] xall: has joined #RubyOnRails
[19:29:27] armyriad: has joined #RubyOnRails
[19:40:43] quazimodo: has joined #RubyOnRails
[19:41:54] cam27: has joined #RubyOnRails
[19:51:43] srinidhi: has joined #RubyOnRails
[19:54:17] Saukk: has joined #RubyOnRails
[20:04:57] rgr: has joined #RubyOnRails
[20:05:37] gusrub: has joined #RubyOnRails
[20:05:39] martintepper: has joined #RubyOnRails
[20:08:29] martintepper: Hello everyone! Is there someone who could help me with a performance regression I've found after upgrading from ActiveRecord/ActiveSupport 3.2 to 4.2? After much profiling and headscratching it looks to me like instantiating a lot (hundreds) of records in a pretty deep eager loaded hierarchy has gotten ~40% slower just by upgrading the libraries :/
[20:09:08] martintepper: My question basically is, is that a known issue? I can't find anything with my Google-Fu
[20:11:03] matthewd: martintepper: I'd say it's not totally implausible, though more than I'd expect
[20:13:13] martintepper: hmm yeah I didn't expect it either :D I hoped for a performance boost...
[20:13:29] dnyy: are there any (actively maintained) appointment/booking gems? being able to set your availability and other users being able to book you based on that etc
[20:15:53] dionysus69: has joined #RubyOnRails
[20:16:28] gusrub: has joined #RubyOnRails
[20:16:55] dnyy: ice_cube seems useful, but i can't tell if it works for the use case of "Im available 9am, noon, and 3-5pm on mondays. 1pm-3pm on tuesdays"
[20:17:03] dnyy: i guess so if each day is stored separately
[20:21:42] martintepper: dnyy Heh, I've just implemented a Booking solution last year...and ice cube is an old frenemy, too :)
[20:22:37] martintepper: IceCube won't help you with the Availability/Booking part but it does schedules nicely...it's only semi-well maintained, though
[20:23:17] martintepper: I'm not aware of any frameworks etc.
[20:24:17] dnyy: the booking itself seems pretty easy to do myself, it was mostly the storing recurring availability part i was stuck on
[20:24:31] dnyy: the booking is always one off, so that (should lol) be as easy as storing a start and end date
[20:25:58] dnyy: https://github.com/seejohnrun/ice_cube/issues/350#issuecomment-289662369 seems basically what i need
[20:32:31] martintepper: We have these "Activity" models which describe "bookable" things to do, and they contain both the description and a serialized IceCube::Schedule object
[20:35:32] mdw: has joined #RubyOnRails
[20:41:04] gusrub: has joined #RubyOnRails
[20:44:29] ascarter: has joined #RubyOnRails
[20:53:35] blackmesa: has joined #RubyOnRails
[21:01:10] ur5us: has joined #RubyOnRails
[21:02:05] patarr: has joined #RubyOnRails
[21:08:59] patarr: has joined #RubyOnRails
[21:19:48] patarr: has joined #RubyOnRails
[21:26:17] patarr: has joined #RubyOnRails
[21:26:52] Pumukel: has joined #RubyOnRails
[21:34:07] tercenya: has joined #RubyOnRails
[21:38:26] ResidentBiscuit: has joined #RubyOnRails
[21:42:50] patarr: has joined #RubyOnRails
[21:44:42] GodFather: has joined #RubyOnRails
[21:53:46] patarr: has joined #RubyOnRails
[21:57:34] amperry: has joined #RubyOnRails
[22:00:47] tercenya: has joined #RubyOnRails
[22:01:23] itarato: has joined #RubyOnRails
[22:02:22] cagomez: has joined #RubyOnRails
[22:02:54] Technodrome: has joined #RubyOnRails
[22:05:34] edgr: has joined #RubyOnRails
[22:05:54] Pumukel: has joined #RubyOnRails
[22:11:24] amperry: hi folks, I kinda maybe figured out a problem I had, but don't trust my solution; I had a 'before_save' check on a model, and had two 'if' blocks in that method; the order doesn't seem like it should have mattered, but swapping them around allowed the record to save: https://gist.github.com/amp108/8b9a2d3ca8a786489088a814ee8c2eca
[22:12:17] amperry: the original order, to clarify, would always ROLLBACK.
[22:13:45] fryguy: ttp://stackoverflow.com/questions/4735141/rails-3-do-i-need-to-give-return-true-in-a-before-save-callback-for-an-object
[22:14:30] matthewd: See also http://blog.bigbinary.com/2016/02/13/rails-5-does-not-halt-callback-chain-when-false-is-returned.html
[22:15:01] amperry: well, then.
[22:15:18] amperry: it might fail either way, it seems, unless I literally add 'return true'?
[22:15:57] matthewd: Unless you're on a modernly-configured Rails 5.0 or later, yes
[22:15:58] fryguy: newer versions of rails forego this
[22:16:59] mitt3ns: has joined #RubyOnRails
[22:17:32] amperry: well, now I'm going to grep though my models and see what before_save methods I have waiting to explode on me :( Fortunately, it shouldn't be too many.
[22:17:51] banisterfiend: has joined #RubyOnRails
[22:18:50] Technodrome: has joined #RubyOnRails
[22:19:37] amperry: fewer than I had feared, mercifully
[22:30:07] patarr: has joined #RubyOnRails
[22:33:29] quirkycoders: has joined #RubyOnRails
[22:38:02] bruno-_: has joined #RubyOnRails
[22:46:37] Technodrome: has joined #RubyOnRails
[22:49:16] hahuang65: has joined #RubyOnRails
[22:53:58] jane_booty_doe: has joined #RubyOnRails
[22:54:04] quirkycoders: has joined #RubyOnRails
[23:07:31] amloelxer: has joined #RubyOnRails
[23:14:35] quirkycoders: has joined #RubyOnRails
[23:20:02] DLSteve: has joined #RubyOnRails
[23:22:20] amloelxer: Hey Rails Irc, I’m having a peculiar problem with action cable and was wondering if any of you could help me out. I’m working on a chat based messaging app, and everything works fine except for the first message that is being sent doesn’t show up in the chat box. On every login, I subcribe the user to all the channels they have convos in. This works fine and is confimed by the fact that if you have exisiting messages
[23:22:21] amloelxer: with a person, the chat works great. It’s only if you start a new conversation with someone where it doesn’t work. In my conversation controller on the create method, if you don’t have an existing conversation, it makes a new conversation and subscribes you to that channel based off the ID. This works fine in development, but suddenly stops working on heroku in production. On production it doesn’t show in the console
[23:22:22] amloelxer: log that the chnel is being subscribed to with the newly created convo id, so of course the first message doesn’t show up but the rest works fine. I’m happy to paste some code, but was wondering first if anyone has experienced this before, or would know a good place to start. It’s driving me crazy. Thanks in advance for the help!
[23:27:51] itarato: has joined #RubyOnRails
[23:29:30] jphase: has joined #RubyOnRails
[23:44:56] cagomez: has joined #RubyOnRails
[23:55:31] quirkycoders: has joined #RubyOnRails
[23:59:12] ascarter: has joined #RubyOnRails
[23:59:30] ascarter_: has joined #RubyOnRails