« Back to channel list

#RubyOnRails - 21 February 2018

« Back 1 day Forward 1 day »
[00:05:34] sameerynho: has joined #RubyOnRails
[00:06:17] Radar: amperry: ffi's latest release is causing those issues. Related thread here: https://github.com/ffi/ffi/issues/607. Seems like a fix will be coming soon.
[00:15:35] Cache_Money: has left #RubyOnRails: ()
[00:17:17] FCser: fryguy: Thanks for suggestion. environment.rb is empty / default. But adding perform_deliveries = false inside development.rb appears to made it work! Similar to this answer https://stackoverflow.com/a/30825093
[00:17:35] guacamole: has joined #RubyOnRails
[00:31:12] bijan_: has joined #RubyOnRails
[00:39:55] LiamW: has joined #RubyOnRails
[00:40:31] LiamW: https://gist.github.com/anonymous/ec5eae0adc1130100c84efcdaf26516b
[00:40:42] LiamW: I have a bunch of these queries that have been running for days
[00:40:44] LiamW: are they safe to kill
[00:44:45] cnk: has joined #RubyOnRails
[00:46:23] hahuang65: LiamW: unclear how this is related to Ruby on Rails...
[00:46:46] LiamW: rails creates them
[00:47:05] hahuang65: how do you know that
[00:47:13] LiamW: stackoverflow & prior knowledge
[00:47:26] LiamW: when you deploy to production rails doesn't read from the schema file, it instead reads the schema from the database directly using these queries
[00:47:46] hahuang65: why do you want to kill them
[00:47:53] LiamW: because they're taking up connection slots
[00:47:55] LiamW: I only have so many
[00:48:11] LiamW: also they've been running for 16 days
[00:48:12] LiamW: I just checked
[00:48:20] LiamW: safe to say they're not ever going to return results
[00:48:45] hahuang65: you should probably ask in the channel for whatever DB you're using
[00:48:57] hahuang65: #postgresql
[00:49:14] LiamW: this is a question about rails
[00:49:22] LiamW: I know how to use postgres
[00:49:31] LiamW: rails originates the query, I need to know if it's safe to kill
[00:50:00] hahuang65: just because rails originates the query, doesn't mean the DB will be unaffected by you killing it, even if it's safe from the rails perspective
[00:50:05] hahuang65: I'm just saying, double check there too.
[01:22:15] alfie: has joined #RubyOnRails
[01:41:42] kapil___: has joined #RubyOnRails
[01:41:43] Rodya_: has joined #RubyOnRails
[01:49:09] LiamW: has left #RubyOnRails: ("WeeChat 2.0.1")
[01:54:31] weaksauce: has joined #RubyOnRails
[01:57:59] Rodya_: has joined #RubyOnRails
[02:17:15] orbyt_: has joined #RubyOnRails
[02:20:41] zave: has joined #RubyOnRails
[02:22:02] _aeris_: has joined #RubyOnRails
[02:24:37] dnewkerk: has joined #RubyOnRails
[02:50:34] morenoh149: has joined #RubyOnRails
[02:52:31] darkhanb: has joined #RubyOnRails
[02:55:25] jackhum__: has joined #RubyOnRails
[03:10:52] Omnilord: has joined #RubyOnRails
[03:13:10] Olipro: has joined #RubyOnRails
[03:29:58] Saukk: has joined #RubyOnRails
[04:02:36] jackhum__: has joined #RubyOnRails
[04:19:28] emachnic: has joined #RubyOnRails
[04:25:00] Rodya_: has joined #RubyOnRails
[04:25:15] trautwein: has joined #RubyOnRails
[04:31:10] morenoh149: has joined #RubyOnRails
[04:32:48] Rodya_: has joined #RubyOnRails
[04:33:50] fragamus: has joined #RubyOnRails
[04:39:51] machinewar: has joined #RubyOnRails
[04:40:16] machinewar: is there any way in Rails 5.1 to set cache-control no-store?
[04:40:23] machinewar: it keeps setting it to cache-control no-cache, but I need no-store
[04:42:17] machinewar: could this be turbolinks thing
[04:52:05] Radar: HELPA HAS SPOKEN
[04:52:54] morenoh149: has joined #RubyOnRails
[04:53:02] Radar: machinewar: why do you need to set that?
[04:53:38] machinewar: looks like it works with response.set_header("Cache-Control", "no-store")
[04:53:48] machinewar: Radar: beacause I want the browser to request my image every time
[04:54:03] Radar: you can do expires_now in the controller too iirc
[04:54:34] machinewar: Radar: yeah I tried that but it was setting no-cache
[04:54:50] Radar: https://github.com/rails/rails/blob/5-1-stable/actionpack/lib/action_controller/metal/conditional_get.rb#L245-L250
[04:54:59] Radar: Oh right. Sorry, I read that wrong earlier.
[04:55:11] Radar: Maybe response.cache_control.replace(no_store: true) ?
[04:56:52] machinewar: Radar: this works response.set_header("Cache-Control", "no-store") in Rails 5.1
[05:05:51] machinewar: hmm so this is just general web dev question and prob not best channel, but anyone know how to make sure browser doesn't cache a content-url downloaded via a css :hover for example
[05:33:33] Rodya_: has joined #RubyOnRails
[05:34:37] s2013: has joined #RubyOnRails
[05:37:40] srinidhi: has joined #RubyOnRails
[05:41:02] srinidhi: has joined #RubyOnRails
[05:44:25] srinidhi: has joined #RubyOnRails
[06:03:01] kapil___: has joined #RubyOnRails
[06:04:12] sidx64: has joined #RubyOnRails
[06:08:09] darkhanb: has joined #RubyOnRails
[06:34:39] Rodya_: has joined #RubyOnRails
[06:37:29] fragamus: has joined #RubyOnRails
[06:43:03] dionysus69: has joined #RubyOnRails
[06:47:48] ome: has joined #RubyOnRails
[06:51:48] mtkd: has joined #RubyOnRails
[06:52:51] darkhanb: has joined #RubyOnRails
[07:05:48] reber: has joined #RubyOnRails
[07:06:45] DTZUZO: has joined #RubyOnRails
[07:21:43] jackhum__: has joined #RubyOnRails
[07:33:20] apeiros: has joined #RubyOnRails
[07:35:22] Rodya_: has joined #RubyOnRails
[07:37:02] sidx64: has joined #RubyOnRails
[07:45:58] conta: has joined #RubyOnRails
[07:48:12] agent_white: has joined #RubyOnRails
[07:54:01] emachnic: has joined #RubyOnRails
[07:57:52] Brisk-Branded: has joined #RubyOnRails
[07:58:50] orbyt_: has joined #RubyOnRails
[08:00:22] mr-spoon: has joined #RubyOnRails
[08:00:24] sidx64: has joined #RubyOnRails
[08:06:59] Dimik: has joined #RubyOnRails
[08:11:12] gambl0re: has joined #RubyOnRails
[08:11:34] emachnic: has joined #RubyOnRails
[08:15:40] jackhum_: has joined #RubyOnRails
[08:17:29] DrYockel: has joined #RubyOnRails
[08:22:39] DaniG2k: has joined #RubyOnRails
[08:22:53] DaniG2k: I'm trying to dynamically create a version of a Carrierwave image if the polymorphic association is of a certain model, and skip it otherwise.
[08:23:14] DaniG2k: Is there a way to dynamically get the model name to create versions so that I don't have to create new uploaders for each model (which seems to defeat the purpose of having a polymorphic Picture model in my opinion)?
[08:23:21] DaniG2k: I've posted my question in full on SO
[08:23:29] DaniG2k: https://stackoverflow.com/questions/48850510/rails-5-dynamically-get-the-model-name-to-create-versions-with-carrierwave
[08:23:43] DaniG2k: if anyone could help it would be cool :D
[08:28:02] mtkd: has joined #RubyOnRails
[08:36:52] noob_on_rails: has joined #RubyOnRails
[08:37:34] Rodya_: has joined #RubyOnRails
[08:40:27] defsdoor: has joined #RubyOnRails
[08:49:34] Ergo: has joined #RubyOnRails
[08:54:07] Sylario: has joined #RubyOnRails
[08:56:36] marr: has joined #RubyOnRails
[08:58:56] kapil___: has joined #RubyOnRails
[09:01:11] Andr3as: DaniG2k: what if you'd determin the class of the caller?
[09:01:16] Andr3as: *determine
[09:02:57] mikecmpbll: has joined #RubyOnRails
[09:08:11] DaniG2k: Andr3as how can I do that?
[09:11:05] Andr3as: idk ;) - was just a thought
[09:11:11] Andr3as: does this help? http://andreapavoni.com/blog/2012/3/using-one-carrierwave-image-uploader-with-different-sizes-on-several-models/
[09:11:21] ome: has joined #RubyOnRails
[09:11:57] sidx64: has joined #RubyOnRails
[09:15:14] DaniG2k: hmm I can try but last time I checked, model.class gave me Image
[09:15:44] DaniG2k: ah right I see why it works for him but not for me
[09:16:06] DaniG2k: he is not using a polymorphic image uploader
[09:16:51] DaniG2k: If you check the comments, Kartikey tanna asked my same question "How to achieve the same for the polymorphic relationship?"
[09:17:07] Andr3as: yeah, saw that (later)
[09:17:36] DaniG2k: its quite ridiculous though
[09:17:49] DaniG2k: the whole point of polymorphic tables is to do exactly this
[09:18:02] DaniG2k: have an image model that can be used across other models
[09:18:20] DaniG2k: this should basically have been the first thing Carrierwave does :/
[09:18:30] DaniG2k: not an afterthought
[09:18:44] Andr3as: and if you use a parameter when calling Picture.new? like Picture.new(image: pic, model: 'user')
[09:18:57] Andr3as: its a bit russian, though
[09:19:53] DaniG2k: I was thinking of doing something like that
[09:19:57] DaniG2k: passing down the model info
[09:20:09] Andr3as: it still feels awkward
[09:20:10] DaniG2k: it's a bit awful though haha
[09:20:58] Andr3as: maybe create an issue on their github
[09:21:15] Andr3as: you can always refactor later ;)
[09:22:39] DaniG2k: I already have
[09:22:48] DaniG2k: https://github.com/carrierwaveuploader/carrierwave/issues/2282
[09:23:14] DaniG2k: I cant believe I'm like the first person to flag this
[09:23:20] Andr3as: interesting that it seems to get the model name to determine the path before saving
[09:23:53] Andr3as: ah, no.. that was another post
[09:24:20] Andr3as: mixed that up.. you just save it to ..image..
[09:24:45] DaniG2k: Carrierwave has been around for years how can I be the only one to have encountered this
[09:24:52] DaniG2k: does everyone create a different uploader for each class?
[09:25:50] Andr3as: lotsa posts abt polymorphic models and carrierwave.. i think most of 'em use the same processing for each model
[09:26:13] Andr3as: or decided to do so after they realized that it doesnt work otherwise ;)
[09:27:26] Andr3as: btw.. re caller of the uploader https://stackoverflow.com/questions/5100299/how-to-get-the-name-of-the-calling-method
[09:27:54] Andr3as: whatcha get when you call "caller" from within the uploader?
[09:28:00] DaniG2k: let me try
[09:28:46] riotjones: has joined #RubyOnRails
[09:29:17] mikecmpbll: has joined #RubyOnRails
[09:30:04] DaniG2k: caller fails egregiously
[09:30:11] Tempesta: has joined #RubyOnRails
[09:30:27] Andr3as: and caller_locations ?
[09:30:39] Andr3as: as per another answer to that post
[09:30:59] DaniG2k: im not sure if the scope is correct here though
[09:31:11] DaniG2k: Ive dropped into a shell with binding.pry
[09:31:13] Andr3as: caller_locations(1,1)[0].label
[09:31:23] DaniG2k: so if I call caller or caller_locations then it might be trying to get pry's caller
[09:31:40] DaniG2k: because I get a stack trace
[09:31:47] Andr3as: i use better_errors gem.. can recommend it
[09:32:10] Andr3as: put a fail inside the processing methed
[09:32:19] DaniG2k: model gives me a Picture object
[09:32:27] Andr3as: and you have the right context and a live shell in your browser
[09:32:29] DaniG2k: model.caller gives me NoMethodError
[09:32:37] Andr3as: na, just caller
[09:33:52] rietta: has joined #RubyOnRails
[09:34:23] DaniG2k: caller[0] gives me "/Users/me/.rvm/gems/ruby-2.5.0/gems/pry-0.11.3/lib/pry/pry_instance.rb:355:in `eval'"
[09:34:33] DaniG2k: so yeah its returning pry
[09:34:51] Andr3as: was worth a try
[09:35:03] emachnic: has joined #RubyOnRails
[09:35:34] DaniG2k: I can try byebug
[09:36:18] DaniG2k: same thing
[09:36:22] DaniG2k: caller_locations(1,1)[0].label gives me "eval"
[09:36:24] yonahw: has joined #RubyOnRails
[09:38:07] Rodya_: has joined #RubyOnRails
[09:40:51] bijan_awaaaay: has joined #RubyOnRails
[09:42:21] bijan_: has joined #RubyOnRails
[09:52:33] beingjohnm: has joined #RubyOnRails
[10:13:11] mtkd: has joined #RubyOnRails
[10:25:36] quazimodo: has joined #RubyOnRails
[10:26:14] bijan_: has joined #RubyOnRails
[10:30:21] sidx64: has joined #RubyOnRails
[10:35:04] sidx64: has joined #RubyOnRails
[10:38:53] Rodya_: has joined #RubyOnRails
[10:50:07] sidx64: has joined #RubyOnRails
[11:09:30] jnollette: has joined #RubyOnRails
[11:13:54] arBmind: has joined #RubyOnRails
[11:13:57] Cavallari: has joined #RubyOnRails
[11:17:40] jackhum__: has joined #RubyOnRails
[11:27:01] emachnic: has joined #RubyOnRails
[11:32:09] apparition: has joined #RubyOnRails
[11:39:34] Rodya_: has joined #RubyOnRails
[11:46:03] fschuindt: has joined #RubyOnRails
[11:48:34] fschuindt: Hi there folks, what's the standard behaviour into using a different schema migration table other than "schema_migrations". I'm just trying to run a "rake db:schema:load" task, but using a different table for migration versions, one called "schema_migrations_ar". Any tip?
[11:53:42] apeiros_: has joined #RubyOnRails
[12:12:49] arBmind: has joined #RubyOnRails
[12:14:29] bijan_awaaaay: has joined #RubyOnRails
[12:18:23] mtkd: has joined #RubyOnRails
[12:19:25] DTZUZO: has joined #RubyOnRails
[12:19:38] cabotto: has joined #RubyOnRails
[12:20:03] emachnic: has joined #RubyOnRails
[12:24:03] gregf_: has joined #RubyOnRails
[12:28:33] alfiemax: has joined #RubyOnRails
[12:28:51] workmad3: has joined #RubyOnRails
[12:34:37] emachnic: has joined #RubyOnRails
[12:40:20] Rodya_: has joined #RubyOnRails
[12:41:20] jackhum_: has joined #RubyOnRails
[12:42:09] LenPayne: has joined #RubyOnRails
[12:48:05] sidx64: has joined #RubyOnRails
[12:52:18] sidx64: has joined #RubyOnRails
[12:58:35] sung: has joined #RubyOnRails
[12:59:49] emachnic: has joined #RubyOnRails
[13:00:49] sidx64: has joined #RubyOnRails
[13:14:57] syndikate: What is the best way to update around 600K records in rails? I need to recalculate a value and store
[13:16:04] desperek: has joined #RubyOnRails
[13:16:40] LenPayne: syndikate: Is this a one-time thing, or something you'll repeat over and over again?
[13:16:59] syndikate: One time thing
[13:17:30] LenPayne: Any reason you can't just go straight to the data store and update in SQL?
[13:18:13] syndikate: Nothing as such, just wanted to know the approach via Rails. This mostly involves timezone updates, so was checking if I could get it done via Rails.
[13:18:25] syndikate: But it's taking more time than expected
[13:20:33] cabotto: has joined #RubyOnRails
[13:22:35] LenPayne: More time as in running time? Or coding time? I imagine the coding time is Blah.all.each do |b| ... end
[13:23:12] LenPayne: But the running time may be pretty extensive.
[13:24:13] syndikate: Running time
[13:24:34] syndikate: Coding time is minimal and all done
[13:24:41] LenPayne: The biggest challenge I've found is that Rails is going to be loading each item one by one, depending on how you approach it. So like the Blah.all does SELECT * FROM blah. But then the .each do does a second SELECT * FROM blah WHERE id = ... for each of them.
[13:25:15] LenPayne: So it's probably hitting your DB several times for each record.
[13:26:15] syndikate: LenPayne, so I made use of find_each here
[13:26:15] LenPayne: ps- I may be incorrect on the exact SQL translation, but the general effects of using iterators with ActiveRecord is that it makes a LOT of DB requests. You can see this if you turn on SQL debugging.
[13:26:49] srinidhi: has joined #RubyOnRails
[13:27:01] LenPayne: We recently had a challenge with our reports suite. We were using find_each too. And it took 50min to run a single report.
[13:27:29] LenPayne: I switched to run a single SQL query instead, to get the aggregate. It sped up to 1-4sec.
[13:27:58] syndikate: Oh damn. Okay
[13:28:18] syndikate: My situation is that it's once in a life cycle issue.
[13:28:25] syndikate: This won't be needed again
[13:28:32] emachnic: has joined #RubyOnRails
[13:28:36] LenPayne: I'd say let it run.
[13:28:44] LenPayne: Does it affect any production workloads?
[13:29:12] LenPayne: If not: https://xkcd.com/303/
[13:29:39] syndikate: Was that situation more or less today
[13:29:52] syndikate: 20 minutes and still running
[13:29:59] syndikate: Not sure about workload yet
[13:30:03] syndikate: This is a single table query
[13:30:55] Puffball: has joined #RubyOnRails
[13:37:57] emachnic: has joined #RubyOnRails
[13:41:05] Rodya_: has joined #RubyOnRails
[14:03:22] ule: Hey guys, I have a situation here like this file:
[14:03:24] ule: https://github.com/lukkry/active_record_shards_test/blob/5feda3bd707a99e41d23272b4674fbad6e6a3651/db/migrate/20130929141909_create_accounts.rb#L2
[14:04:06] ule: How can I put this line on the ActiveRecord::Migration class in this way where I don't need to put this shard(:none) on all migration files?
[14:04:18] ule: A kind of MonkeyPatch on this Migration class
[14:04:55] ule: Whats the best way to do this? Creating my own "BaseMigration" and extend this from ActiveRecord::Migration?
[14:06:43] ule: How would you do?
[14:12:39] Tempesta: has joined #RubyOnRails
[14:23:25] mtkd: has joined #RubyOnRails
[14:33:05] apeiros_: has joined #RubyOnRails
[14:38:34] jackhum__: has joined #RubyOnRails
[14:38:46] krawchyk: has joined #RubyOnRails
[14:40:40] jackhum__: has joined #RubyOnRails
[14:41:49] Rodya_: has joined #RubyOnRails
[14:42:10] jackhum__: has joined #RubyOnRails
[14:43:42] jackhum__: has joined #RubyOnRails
[14:45:09] jackhum__: has joined #RubyOnRails
[14:46:28] jackhum__: has joined #RubyOnRails
[14:48:01] jackhum__: has joined #RubyOnRails
[14:49:45] jackhum__: has joined #RubyOnRails
[14:51:05] jackhum__: has joined #RubyOnRails
[14:55:57] morenoh149: has joined #RubyOnRails
[14:56:55] workmad3: has joined #RubyOnRails
[15:02:06] lxsameer: has joined #RubyOnRails
[15:05:58] chouhoulis: has joined #RubyOnRails
[15:06:35] cpruitt: has joined #RubyOnRails
[15:07:53] brewops: has joined #RubyOnRails
[15:09:25] brewops: Hello, I am using Puma to run some Rails apps. We package up ruby along with all of the other gems/dependencies the project needs using bundler. Since Puma then uses the packaged Ruby from our release, after any type of restart/reload the master process holds on to some of the Ruby files in the old project. Is there a way to work around this? Perhaps similar to how unicorn replaces the master?
[15:11:11] safetypin: has joined #RubyOnRails
[15:12:29] morenoh149: has joined #RubyOnRails
[15:13:56] tcopeland: has joined #RubyOnRails
[15:14:04] dminuoso: has joined #RubyOnRails
[15:14:11] dminuoso: Exception: ActiveRecord::AssociationTypeMismatch: House(#70257603296600) expected, got #<House id: 171675, street_id: 171521, zip_code ... >
[15:29:17] tcopeland: has joined #RubyOnRails
[15:29:55] cpruitt: I have a project owner that would like some stats/tracking added to his application. Specifically the number of times an item has been displayed. Adding view counters to models concerns me because of race conditions and the slowdown that SQL locking might cause. Adding individual records for each view into another table will bloat very quickly.
[15:30:14] cpruitt: Anyone have any suggestions on a good way to approach this without too much fuss?
[15:32:37] riotjoe: has joined #RubyOnRails
[15:36:04] workmad3: cpruitt: I'd typically keep metrics away from the DB by using something like librato, newrelic insights, or a similar self-hosted metrics platform
[15:37:00] workmad3: (we've been setting up a lot of events into a self-hosted snowplow system at work recently, so that we can feed that sort of data into Looker and expose it to internal users for reporting, dashboards, etc.)
[15:39:17] chouhoulis: has joined #RubyOnRails
[15:39:18] cpruitt: workmad3: Hmmm... In this case I have limited resources (think bare bones hosting & 1 DB) & customer budget to work with so I'm trying to do the best I have with what's available to him. These stats are to be displayed as part of the application (e.g. show a user the number of times their post has been displayed, etc...).
[15:40:10] Arkentias: has joined #RubyOnRails
[15:40:39] cpruitt: Even if imperfect, what pitfalls would you expect if I temporarily write individual records into a table for every stat recorded & then use those to update counters before deleting them?
[15:41:16] cpruitt: All that would be done async after page load. Should avoid blocking & keep a stats table to a minimum.
[15:42:33] Rodya_: has joined #RubyOnRails
[15:44:37] workmad3: if you're considering doing this async after page load, could you not just queue the increments with a background job queue and do a DB lock in the job?
[15:45:34] mrbubbles: has joined #RubyOnRails
[15:46:47] workmad3: then a page view just triggers what amounts to an event, and your event processing increments the counter out of band... as long as you're careful with your write transactions and wrap your reads with the right transaction isolation level in PG, you shouldn't hit any slowdowns in reads which can be processed while the writes take place
[15:47:50] cpruitt: workmad3: I guess that's not really much different than what I was proposing. Under high traffic that might lose some opportunity for optimization but honestly this isn't going to have high traffic any time soon and if it does he can pay for some improvements.
[15:48:09] kapil___: has joined #RubyOnRails
[15:48:50] cpruitt: workmad3: "wrap your reads with the right transaction isolation level in PG" <<-- any chance you could elaborate?
[15:48:52] workmad3: cpruitt: right, not that different but a bit simpler to implement I suspect :)
[15:49:07] cpruitt: workmad3: Probably simpler, yes
[15:49:40] workmad3: cpruitt: chances are you won't need to mess with them, but if you take a look at the docs for transaction isolation levels you should be able to get an idea: https://www.postgresql.org/docs/9.1/static/transaction-iso.html
[15:52:21] cpruitt: workmad3: Thanks. Really never even had a cause to encounter that before.
[15:54:38] workmad3: cpruitt: you may not need to use them even with this, as you might be fine with just using `with_lock` appropriately, as that shouldn't block reads of the data with postgresql
[15:55:47] cpruitt: workmad3: I don't think I will, but like to read through anything new I run across so I'm more familiar in the future. :-)
[15:57:33] s2013: has joined #RubyOnRails
[15:59:44] troys: has joined #RubyOnRails
[16:01:38] mrbubbles: If I want a random user or a random profile, is there a cleaner way than: [User.all.sample, Profile.all.sample].sample
[16:05:05] LateralOctober: has joined #RubyOnRails
[16:08:54] dionysus69: has joined #RubyOnRails
[16:09:16] dviola: has joined #RubyOnRails
[16:11:53] mtkd: has joined #RubyOnRails
[16:13:55] krawchyk: has joined #RubyOnRails
[16:15:19] lord4163: has joined #RubyOnRails
[16:22:39] tcopeland: has joined #RubyOnRails
[16:30:26] fschuindt: has joined #RubyOnRails
[16:36:50] chuchiperriman: has joined #RubyOnRails
[16:37:42] brewosp: has joined #RubyOnRails
[16:39:22] chuchiperriman: We are looking to remove all .js.erb files in our application and manage all the javascript in .js files
[16:40:16] chuchiperriman: As an example, we are developing a system that show a form in a bootstrap modal
[16:42:20] chuchiperriman: There are any gem to help us in this stage?
[16:43:19] Rodya_: has joined #RubyOnRails
[16:43:23] chuchiperriman: Sorry, the real quertion is:
[16:45:54] chuchiperriman: Can we replace the .js.erb system with another framework/utility with server renderning and all javascript in assets files?
[16:46:44] chuchiperriman: I don't like split all javascrpt logic in the assets/javascript/my_controller.js, new.js.erb, edit.js.erb etc...
[16:47:14] chuchiperriman: Sorry but my english is very bad :(
[16:50:13] cabotto: has joined #RubyOnRails
[16:51:15] choke: has joined #RubyOnRails
[16:52:21] choke: has joined #RubyOnRails
[16:55:50] fschuindt: has joined #RubyOnRails
[16:56:21] Sylario: chuchiperriman: do you need JS logic there? Are you doing bloc replacement or something more ?
[16:56:33] Sylario: Maybe you can render JSON instead
[16:59:11] Sylario: also JS related to an action will be in views not assets
[17:00:54] mikecmpbll: i have an intermittently failing test which checks a model to see if it's instance methods includes the setter method for an attribute, e.g. User.instance_methods.include?(:email=)
[17:01:40] mikecmpbll: clearly i'm not aware of some mechanism whereby activerecord detects database columns and defines setter/accessor methods
[17:01:59] mikecmpbll: is there a way I can force whatever that process is to happen so my test is robust?
[17:02:49] cabotto: has joined #RubyOnRails
[17:04:57] chuchiperriman: sylario, I call server and show the response (an html form) in a bootstrap modal
[17:05:05] one_zero: has joined #RubyOnRails
[17:06:01] chuchiperriman: then the user saves the form and the server returns a div with info and must replace the original div with this one
[17:06:05] Sylario: so I guess your js.erb is basically some_element_id.replace html_partial ?
[17:06:28] chuchiperriman: basically (about 30 .js.erb files)
[17:06:33] mikecmpbll: User.instance_methods.include?(:email=) => false
[17:06:37] mikecmpbll: User.instance_methods.include?(:email=) => true
[17:06:49] Sylario: chuchiperriman Your JS replace content with HTML
[17:06:57] Sylario: 1) the HTML should be in a partial
[17:07:04] cagomez: has joined #RubyOnRails
[17:07:24] chuchiperriman: sometimes we need to change some icons etc but basically we replace a div with the new content
[17:08:01] Sylario: 2) the JS should only be replace the content of this element with <%= render partial%>
[17:09:41] Sylario: Of course, it's how I do it in project without a JS framework, this is not a Rails convention
[17:09:51] safetypin: has anyone experienced problems accessing path helpers after adding a controller provided by a gem?
[17:09:55] choke: Hey all, working on bringing a php legacy application to rails. having an issue with my factories: https://gist.github.com/jblac/128df32bab746f78376f05ec5428f1e4. I'm sure i'm doing something dumb but no clue what to do.
[17:10:18] chuchiperriman: thank you very much sylario
[17:12:16] chuchiperriman: has joined #RubyOnRails
[17:12:47] s2013: has joined #RubyOnRails
[17:14:11] riotjones: has joined #RubyOnRails
[17:16:27] safetypin: for some reason i'm getting an "undefined variable or method" error on "root_path" after adding a gem that has generated a controller, but only looking at that controller. the root_path method works on all my other controllers.
[17:23:34] amiuhle: has joined #RubyOnRails
[17:26:18] safetypin: it seems to be related to mounting the engine included in the new gem.
[17:27:29] darkhanb: has joined #RubyOnRails
[17:38:56] JDeen: has joined #RubyOnRails
[17:40:22] JDeen: Is Rails (3) unable to handle validate uniqueness when multiple child objects are created in a nested form?
[17:41:03] jcarl43: has joined #RubyOnRails
[17:41:25] lacour: has joined #RubyOnRails
[17:41:40] JDeen: I have a form for 'Organization' that has multiple pledges which is unique by 'user_id' and 'year'. The validations work fine. But when I have them created simultaniously (ex: along with an organizaiton) it doesn't fail.
[17:44:04] Rodya_: has joined #RubyOnRails
[18:00:28] SteenJobs: has joined #RubyOnRails
[18:06:53] emachnic: has joined #RubyOnRails
[18:20:31] larissa: has joined #RubyOnRails
[18:20:38] armyriad: has joined #RubyOnRails
[18:21:32] moei: has joined #RubyOnRails
[18:32:05] mikecmpbll: has joined #RubyOnRails
[18:33:01] Saukk: has joined #RubyOnRails
[18:38:46] cabotto: has joined #RubyOnRails
[18:44:50] Rodya_: has joined #RubyOnRails
[18:46:58] cabotto: has joined #RubyOnRails
[18:52:04] cabotto: has joined #RubyOnRails
[18:52:49] roshanavand: has joined #RubyOnRails
[18:54:25] kies: has joined #RubyOnRails
[18:59:42] cagomez: has joined #RubyOnRails
[19:04:59] cabotto: has joined #RubyOnRails
[19:06:48] apeiros: has joined #RubyOnRails
[19:08:03] dminuoso: ActiveRecord::AssociationTypeMismatch: House(#70257609599660) expected, got #<House id: 174264, street_id: 30400 ... > which is an instance of House(#70257577952900)
[19:08:07] dminuoso: Uh. What the heck is breaking here
[19:08:17] dminuoso: Why are there two different House classes flying around
[19:12:38] cabotto: has joined #RubyOnRails
[19:17:02] mtkd: has joined #RubyOnRails
[19:23:13] krawchyk: has joined #RubyOnRails
[19:30:16] fragamus: has joined #RubyOnRails
[19:30:36] Cache_Money: has joined #RubyOnRails
[19:37:58] workmad3: has joined #RubyOnRails
[19:39:21] dyyylan: has joined #RubyOnRails
[19:43:31] Rodya_: has joined #RubyOnRails
[19:45:48] alfiemax: has joined #RubyOnRails
[19:46:11] cjohnson: I'm having a really strange behavior when using FactoryGirl. I've got a CI process which is: create database, seed some data, run tests
[19:46:33] cjohnson: In the tests, I'm using FactoryGirl.create(:option). Options also happen to be seeded in the seeding process
[19:47:33] cjohnson: For some reason when I create an option with FactoryGirl, the generated insert statement throws a primary key error, that id=2 is already in use. However, the generated query doesn't actually even specify an id
[19:48:12] cjohnson: Through testing I can confirm that if I call it a number of times greater than the number of seeded options, the first X will fail with that error, and then once the id gets high enough, it will stop failing since obviosuly teh id no longer conflicts
[19:48:29] cjohnson: My question is, is there any way rspec or factorygirl are resetting the postgres column sequences or something like that?
[19:49:25] Rodya_: has joined #RubyOnRails
[19:50:58] cjohnson: Actually it's the model itself, trying to call Option.create 3 times, the first 2 fail (there are 2 Options seeded) and the third succeeds
[19:52:27] cjohnson: Option.create(description: 'foo') gives me id:1, a seocnd call gives me id:2, a third gives me id:3
[19:52:47] cjohnson: How does the model come up with the id if the insert (returning id) is failing?
[19:54:35] cjohnson: https://gist.github.com/chrisjohnson/29d552130f75fae9c4506a6909afe9ed
[19:56:56] morenoh149: has joined #RubyOnRails
[20:00:01] Dimik: has joined #RubyOnRails
[20:06:48] marr: has joined #RubyOnRails
[20:07:47] cjohnson: Issue turned out to be that my seeds were specifying the ID manually and that doesn't update the postgres sequence
[20:07:57] cjohnson: so when the next insert happens and it pulls from the sequence, the pulled id is already used
[20:15:09] gambl0re: has joined #RubyOnRails
[20:24:19] sameerynho: has joined #RubyOnRails
[20:25:56] Rodya_: has joined #RubyOnRails
[20:26:35] cagomez_: has joined #RubyOnRails
[20:33:09] alfiemax: has joined #RubyOnRails
[20:45:57] alfiemax: has joined #RubyOnRails
[20:59:40] segy: has joined #RubyOnRails
[21:04:04] alfiemax: has joined #RubyOnRails
[21:04:42] Radar: GOOD MORNING
[21:13:41] fragamus: has joined #RubyOnRails
[21:19:03] cagomez: has joined #RubyOnRails
[21:32:02] alfiemax: has joined #RubyOnRails
[21:36:27] marr: has joined #RubyOnRails
[21:37:24] choke: has joined #RubyOnRails
[21:50:26] cagomez: has joined #RubyOnRails
[21:55:07] orbyt_: has joined #RubyOnRails
[21:58:05] dminuoso: Radar. Do you have any clue?
[21:58:08] dminuoso: 20:08 dminuoso | ActiveRecord::AssociationTypeMismatch: House(#70257609599660) expected, got #<House id: 174264, street_id: 30400 ... > which is an instance of House(#70257577952900)
[21:58:37] dminuoso: This happened out of a freshly spun up rails console, spring was shot in the head just before.
[21:59:33] alfiemax: has joined #RubyOnRails
[22:04:20] _aeris_: has joined #RubyOnRails
[22:07:55] cagomez: has joined #RubyOnRails
[22:10:39] bijan_: has joined #RubyOnRails
[22:10:58] Radar: dminuoso: I've seen this error many times before but forget what causes it eac h time
[22:11:14] Radar: Brain says "something something development mode class reloading"
[22:11:48] _aeris_: has joined #RubyOnRails
[22:12:20] dminuoso: Radar: Normally I'd agree, except no reload happens ever.
[22:12:32] Radar: dminuoso: I wish I could be more helpful
[22:13:20] dminuoso: Radar: Well thank you nevertheless. :)
[22:13:52] Radar: dminuoso: You only have one House model, right?
[22:18:43] dminuoso: Radar: Just checked, yes.
[22:19:05] helpa: ¯\_(ツ)_/¯ Sorry, Radar is not able to help you any further as they do not know.
[22:19:08] dminuoso: The whole thing happens sporadically too.
[22:19:12] dminuoso: So its real fun =)
[22:24:52] SteenJobs_: has joined #RubyOnRails
[22:48:05] capin: Radar: +1 for switching from refile to paperclip.
[22:52:53] choke: has joined #RubyOnRails
[22:55:02] alfiemax: has joined #RubyOnRails
[22:59:27] _aeris_: has joined #RubyOnRails
[23:03:48] ome: has joined #RubyOnRails
[23:16:02] Radar: capin: Oh you made that switch? Nice :)
[23:16:07] Radar: capin: I still personally want to try out shrine
[23:17:13] iWaffles: has joined #RubyOnRails
[23:18:13] iWaffles: So with ActiveStorage I'm able to upload files, I see them in S3, however I'm not seeing them in the `active_storage_attachments` table that it created. I can't see any errors in the web console or in the terminal – does anyone know how to fix this?
[23:18:32] iWaffles: I'm using rails 5.2.0.rc1
[23:23:55] capin: Radar: yeah man, finished up the switch the other day, I can successfully perform GET / POST / DELETE actions to my API using `curl` and created a custom `download` route / method. Overall it went rather well. I removed a bunch of BS to ie, coffeescript, jquery, and bootstrap.
[23:30:04] mitt3ns: has joined #RubyOnRails
[23:36:53] alfiemax: has joined #RubyOnRails
[23:39:25] morenoh149: has joined #RubyOnRails
[23:44:43] mitt3ns: has joined #RubyOnRails
[23:47:27] jnollette: has joined #RubyOnRails
[23:53:40] orbyt_: has joined #RubyOnRails
[23:55:14] mrbubbles: has joined #RubyOnRails
[23:55:26] ebsen: has joined #RubyOnRails
[23:55:37] mrbubbles: Has anyone ever seen where you install a gem and it starts kicking off about sqlite3 not being installed?
[23:55:44] mrbubbles: I'm using postgres on the app...
[23:57:56] ResidentBiscuit: has joined #RubyOnRails