#RubyOnRails - 06 April 2018
« Back 1 day Forward 1 day »
[00:02:45] WalterPeck: does anyone here use develop using a docker container as their database server?
[00:18:44] dgsan: My url helpers seem to have stopped working and are giving "undefined method `empty?' for nil:NilClass" messages.
[00:24:49] dgsan: Figured out my problem, seems esoteric. Probably misunderstanding what default_url_options in routes does.
[02:50:42] fcser_: Is there some way to have a ‘virtual object’ ? For example there is a “Reservation” model that has a field vehicle_location that belongs_to a Location model. I also want to include an option within collection_select for “No Vehicle”. If a Location is chosen I want to validate it, if No Vehicle is chosen I want to let the model proceed with creation… But just have one select list instead of a separate virtual attribute check box for ‘No
[03:26:17] fcser_: ok well figured out a way it may not be right but it works - to create a real object with a special attribute to make it ‘inactive’ so it doesn’t appear with other options - there must be a better way
[07:29:40] dminuoso: Neat. This looks cleanly written https://github.com/tjchambers/paper_trail_scrapbook =)
[07:30:03] dminuoso: Just needs a touch of polishing with i18n and it goes very nicely along paper_trail
[10:03:28] pavelz: hi i wonder if I can move csrf token check to be performed after validation of a logged in user
[10:13:17] dminuoso: pavelz: http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html
[14:58:05] istrasci: For a has_one/has_many with conditions, what are the pros/cons of putting the conditions directly on the association vs. making a scope on the associated class and using that?
[15:13:00] Inside: Hey guys - working on a RoR application to store manufacturing test results in a database (currently stored as... paper). There are a few dozen different tests w/ different parameters recorded by each person.
[15:13:43] Inside: K:V column would be good since I can store the user who did the test and then see everything that someone has ever worked on
[16:27:13] thomasfedb: Inside: probably need to know more detail to make a really informed decision, both options have trade-offs, but I would probably tend towards a key value column
[16:30:06] dgsan: I can't imagine a scenario where you want unique tables for every instance of similar data/unique tables per test. I can imagine that you need multiple tables with relationships to each other to keep track of your tests if they vary in dimensionality or arity.
[16:46:24] Torrone: hello, I'm trying to use http://api.rubyonrails.org/classes/ActiveRecord/ModelSchema/ClassMethods.html#method-i-ignored_columns-3D but it's not working for me, the columns don't get ignored, has this happened to you?
[16:49:23] thomasfedb: Torrone: what's not working? Can you gist your code and an example of what's going wrong?
[16:51:11] Torrone: thomasfedb, basically I wrote a concern that I use a lot that has a method 'average_rating', since I'm working on a long going project, one of the models that includes the concern has a column named 'average_rating'
[16:52:03] Torrone: so what I'm trying to do is to ignore that column since it's not really used anymore and trying not to delete it for safety
[16:53:57] Torrone: that's because I check if has_attribute?(:average_rating) and it still returns true
[16:55:24] Torrone: but actually I found that if I use ignored_columns combined with commenting out the line with attribute :average_rating I get the correct value
[17:06:35] Inside: thomasfedb: Sure. Each record represents a test run on a single component. A component is uniquely identified by a serial number string. Each test captures a small number of parameters (ie: voltage reading, pressure readout, etc). Each type of test has different parameters that it captures and there are also different components so not every test can be run on every component, etc.
[17:07:19] Inside: So for example: "a drink module test" captures 4 readouts and the test result code that comes from a PLC.
[23:37:40] conceivably: Hi. Why does 'find_each' log 'BEGIN' 'COMMIT', even if no changes to a record are made?