« Back to channel list

#RubyOnRails - 16 May 2016

« Back 1 day Forward 1 day »
[00:01:32] yfeldblum: has joined #RubyOnRails
[00:01:41] Ropeney: has joined #RubyOnRails
[00:03:39] jancel: has joined #RubyOnRails
[00:03:46] RegulationD: has joined #RubyOnRails
[00:03:56] stannard: has joined #RubyOnRails
[00:04:53] y3: has joined #RubyOnRails
[00:06:45] Axilla: has joined #RubyOnRails
[00:09:49] jenrzzz: has joined #RubyOnRails
[00:13:02] Synthead: has joined #RubyOnRails
[00:13:27] edwin_: has joined #RubyOnRails
[00:18:49] stannard: has joined #RubyOnRails
[00:19:40] idefine: has joined #RubyOnRails
[00:22:11] idefine: has joined #RubyOnRails
[00:22:39] m_antis: has joined #RubyOnRails
[00:23:16] roamingdog: has joined #RubyOnRails
[00:32:14] Oliphaunte: has joined #RubyOnRails
[00:34:16] pawnbox: has joined #RubyOnRails
[00:37:42] allcentury: has joined #RubyOnRails
[00:39:45] idefine: has joined #RubyOnRails
[00:41:00] penguinpowernz: has joined #RubyOnRails
[00:46:18] Coldblackice: has joined #RubyOnRails
[00:49:41] PlasmaStar: has joined #RubyOnRails
[00:51:29] idefine: has joined #RubyOnRails
[00:57:22] Puffball: has joined #RubyOnRails
[00:58:54] noobsu: has joined #RubyOnRails
[01:01:52] mwcmitchell: has joined #RubyOnRails
[01:02:51] Synthead: has joined #RubyOnRails
[01:03:21] wethu: has joined #RubyOnRails
[01:06:42] ekinmur: has joined #RubyOnRails
[01:09:08] wigust: has joined #RubyOnRails
[01:10:16] tobyn: has joined #RubyOnRails
[01:11:24] jenrzzz: has joined #RubyOnRails
[01:11:42] noobsu: has joined #RubyOnRails
[01:12:03] macsteps: has joined #RubyOnRails
[01:12:58] patie: has joined #RubyOnRails
[01:14:54] edwin_: has joined #RubyOnRails
[01:14:56] idefine: has joined #RubyOnRails
[01:15:08] sevenseacat: has joined #RubyOnRails
[01:15:50] idefine: has joined #RubyOnRails
[01:16:37] tobyn: has joined #RubyOnRails
[01:16:55] rubyonrails101: has joined #RubyOnRails
[01:18:08] rubyonrails101: /msg NickServ VERIFY REGISTER rubyonrails101 ffcuukglbhzf
[01:18:24] wigust: has joined #RubyOnRails
[01:18:29] rubyonrails101: Hey guys, quick question about naming conventions and autoloading: I want to have a presenter ItemPresenter in app/presenters/items/item_presenter.rb. If I do: module Items class ItemPresenter, -- I get uninitialized constant error. So, how would I go about doing this? Couldn't find any meaningful answers on google.
[01:22:15] EXCHGR: has joined #RubyOnRails
[01:22:45] noobsu: has joined #RubyOnRails
[01:24:17] idefine: has joined #RubyOnRails
[01:24:44] Oliphaunte: has joined #RubyOnRails
[01:29:31] hive-mind: has joined #RubyOnRails
[01:31:44] stardiviner: has joined #RubyOnRails
[01:33:23] d0nn1e: has joined #RubyOnRails
[01:33:41] noobsu: has joined #RubyOnRails
[01:34:36] RegulationD: has joined #RubyOnRails
[01:36:37] sevenseacat: rubyonrails101: you'll need to restart your server after creating the presenters folder, to get it added to the autpload path
[01:37:15] Oliphaunte: has joined #RubyOnRails
[01:39:00] one_zero: has joined #RubyOnRails
[01:39:56] xall: has joined #RubyOnRails
[01:44:18] dandaman: has joined #RubyOnRails
[01:44:24] Oliphaunte: has joined #RubyOnRails
[01:45:13] pawnbox: has joined #RubyOnRails
[01:46:33] nickenchuggets: has joined #RubyOnRails
[01:51:31] jancel: has joined #RubyOnRails
[01:51:52] idefine: has joined #RubyOnRails
[01:52:27] gambl0re: hi sevenseacat
[01:59:50] enviable: has joined #RubyOnRails
[02:03:53] Oliphaunte: has joined #RubyOnRails
[02:06:15] kuroro: has joined #RubyOnRails
[02:08:07] Oliphaunte: has joined #RubyOnRails
[02:09:42] Devalo: has joined #RubyOnRails
[02:10:24] stardiviner: has joined #RubyOnRails
[02:11:41] jenrzzz: has joined #RubyOnRails
[02:13:11] joelwallis: has joined #RubyOnRails
[02:14:15] Devalo: has joined #RubyOnRails
[02:14:26] kgrz: has joined #RubyOnRails
[02:15:25] idefine_: has joined #RubyOnRails
[02:16:23] Devalo: has joined #RubyOnRails
[02:21:32] Oliphaunte: has joined #RubyOnRails
[02:21:40] xall: has joined #RubyOnRails
[02:22:59] The_Phoenix: has joined #RubyOnRails
[02:23:34] The_Phoenix: has joined #RubyOnRails
[02:24:41] dandaman1: has joined #RubyOnRails
[02:24:54] The_Phoenix: has joined #RubyOnRails
[02:26:06] Oliphaunte: has joined #RubyOnRails
[02:26:08] The_Phoenix: has joined #RubyOnRails
[02:27:13] The_Phoenix: has joined #RubyOnRails
[02:28:37] The_Phoenix: has joined #RubyOnRails
[02:29:05] Oliphaunte: has joined #RubyOnRails
[02:29:46] Gkj8899: has joined #RubyOnRails
[02:30:13] The_Phoenix: has joined #RubyOnRails
[02:33:32] p1k: has joined #RubyOnRails
[02:33:44] bronson: has joined #RubyOnRails
[02:36:14] kuroro: has left #RubyOnRails: ()
[02:36:27] quazimod1: any good helpdesk gems/engines out there?
[02:42:52] idefine: has joined #RubyOnRails
[02:47:55] blackmesa: has joined #RubyOnRails
[02:48:02] yaewa: has joined #RubyOnRails
[02:50:44] bruno-: has joined #RubyOnRails
[02:51:28] Oliphaunte: has joined #RubyOnRails
[02:57:04] nekomune: has joined #RubyOnRails
[02:58:34] czerasz: has joined #RubyOnRails
[02:59:13] wethu: has joined #RubyOnRails
[03:04:00] idefine: has joined #RubyOnRails
[03:07:47] codeurge: has joined #RubyOnRails
[03:08:33] smoitra: has joined #RubyOnRails
[03:09:44] stardiviner: has joined #RubyOnRails
[03:10:28] alfie_max15: has joined #RubyOnRails
[03:12:21] jenrzzz: has joined #RubyOnRails
[03:12:21] jenrzzz: has joined #RubyOnRails
[03:13:43] braincras: has joined #RubyOnRails
[03:16:02] edwin_: has joined #RubyOnRails
[03:16:05] pawnbox: has joined #RubyOnRails
[03:18:30] DoctorMonocular: has joined #RubyOnRails
[03:19:59] idefine: has joined #RubyOnRails
[03:22:56] moeabdol: has joined #RubyOnRails
[03:23:08] rafaelfranca: has joined #RubyOnRails
[03:28:10] jedmund: has joined #RubyOnRails
[03:28:38] jtd: has joined #RubyOnRails
[03:32:49] jedmund: If I need decorator functionality, is Draper really the best choice I have? Kind of worried about it being unmaintained (I asked this before, but I fell asleep)
[03:32:53] njero: has joined #RubyOnRails
[03:33:55] jedmund: Kind of hard to explain what I'm doing, but I'm building an API and was hoping to decorate the User model to query whether or not its following a Project model, and then put that response in a Rabl template
[03:34:14] sevenseacat: draper is unmaintained?
[03:34:27] jedmund: Besides just making a completely separate API endpoint, a decorator seemed like the easiest way to do that
[03:34:36] jedmund: sevenseacat: https://github.com/drapergem/draper/issues/735
[03:34:49] jedmund: maybe they're wrong but browsing the issues that kind of was a red flag to me
[03:35:41] jedmund: especially since i plan on upgrading to Rails 5... if its not gonna work then I'd rather find Another Way™
[03:35:58] sevenseacat: if there are some huge issues that need fixing, that might be a problem, but there doesn't seem to be, reallyt
[03:36:19] jedmund: oh? I'm not familiar with it so it could just be i'm reading way too much into it
[03:36:26] pawnbox: has joined #RubyOnRails
[03:36:29] sevenseacat: most of the issues seem to be questions, which isnt what an issue tracker is for
[03:37:06] jrandm: has joined #RubyOnRails
[03:37:42] lxsameer: has joined #RubyOnRails
[03:38:03] stannard: has joined #RubyOnRails
[03:38:16] pawnbox: has joined #RubyOnRails
[03:38:25] sevenseacat: i've had no problem using draper in projects
[03:39:40] agent_white: has joined #RubyOnRails
[03:41:09] sevenseacat: also, gem support for rails 5 will always lag behind rails 5 itself, and given rails 5 isnt even out, well
[03:41:45] idefine: has joined #RubyOnRails
[03:45:24] jedmund: thats also a fair point that i should have thought of but didn't
[03:45:33] jedmund: ok, i'll just use draper then, f it
[03:45:51] jedmund: my need to keep moving on this project is greater than my need for whatever it was i was trying to optimize for haha
[03:46:00] idefine: has joined #RubyOnRails
[03:51:36] blackmesa: has joined #RubyOnRails
[03:53:58] jancel: has joined #RubyOnRails
[03:54:26] rickmasta: has joined #RubyOnRails
[03:56:04] DoctorMonocular: has joined #RubyOnRails
[03:56:52] roamingdog: has joined #RubyOnRails
[04:02:15] Oliphaunte: has joined #RubyOnRails
[04:05:08] codeurge: has joined #RubyOnRails
[04:06:52] pawnbox: has joined #RubyOnRails
[04:07:30] dionysus69: has joined #RubyOnRails
[04:08:46] sypheren: has joined #RubyOnRails
[04:10:49] jobewan: has joined #RubyOnRails
[04:11:28] njero: hey, what's best practice for handling If-Modified-Since in static pages?
[04:13:21] jrandm: has joined #RubyOnRails
[04:13:59] jenrzzz: has joined #RubyOnRails
[04:14:28] Ropeney: n_e_o, can you elaborate some more?
[04:15:53] idefine: has joined #RubyOnRails
[04:17:06] edwin__: has joined #RubyOnRails
[04:17:15] njero: Ropeney: google webmasters says, it would be better to make server respond to If-Modified-Since header. For static pages since i don't have any model associated nor timestamp, what's usual way for tracking and providing 304
[04:17:53] Devalo: has joined #RubyOnRails
[04:18:36] Ropeney: Thopught that was handled in nginx?
[04:19:39] sypheren: has joined #RubyOnRails
[04:19:47] njero: Ropeney: OIC, let me check
[04:20:02] Ropeney: depends how your serving static files, I guess
[04:20:33] njero: Ropeney: I'm serving through rails only.. not exactly as a static file
[04:22:09] Ropeney: n_e_o, http://api.rubyonrails.org/classes/ActionController/ConditionalGet.html might be in your direction otherwise maybe someone else can be of better help doing it in rails
[04:25:49] njero: Ropeney: yeah, that'll do. Just need to change the timestamp while i'm changing the static page. I wish i could automate :)
[04:26:38] Ropeney: n_e_o, File.mtime("thefileyouupdated") ?
[04:27:13] njero: Ropeney: nice.. awesome :)
[04:27:44] njero: Ropeney: Thanks for the help
[04:29:19] SPYGAME: has joined #RubyOnRails
[04:30:36] dionysus69: has joined #RubyOnRails
[04:33:09] Oliphaunte: has joined #RubyOnRails
[04:36:21] bronson: has joined #RubyOnRails
[04:37:36] tobyn: has left #RubyOnRails: ()
[04:45:02] roamingdog: has joined #RubyOnRails
[04:46:04] eyeamaye1: has joined #RubyOnRails
[04:46:39] DoctorMonocular: has joined #RubyOnRails
[04:52:55] DoctorMonocular: has joined #RubyOnRails
[04:53:10] Cohedrin_: has joined #RubyOnRails
[04:53:37] blackmesa: has joined #RubyOnRails
[04:56:49] raunicolae: has joined #RubyOnRails
[05:00:44] dandaman: has joined #RubyOnRails
[05:06:32] SteenJobs: has joined #RubyOnRails
[05:12:17] roamingdog: ss7s67dDFD7f8d3
[05:17:23] idefine: has joined #RubyOnRails
[05:17:47] Synthead: is rails 5 out? I don't see it in rubygems.org
[05:21:52] janebootydoe: has joined #RubyOnRails
[05:26:38] ImmoveableOne: has joined #RubyOnRails
[05:29:03] konsolebox: has joined #RubyOnRails
[05:30:38] roamingdog: has joined #RubyOnRails
[05:31:36] Radar: Synthead: the release candidate is out.
[05:38:37] jheathco: has joined #RubyOnRails
[05:45:00] Axilla: has joined #RubyOnRails
[05:45:34] lxsameer: using turbolinks, Sometimes ( I could not figure out when exactly ) clicking on link causes the page to reload completely. Does any one know about this issue ?
[05:47:16] Palsson: has joined #RubyOnRails
[05:48:38] sevenseacat: 'sometimes turbolinks doesnt work. how fix?'
[05:48:57] duncannz: has joined #RubyOnRails
[05:49:47] duncannz: has joined #RubyOnRails
[05:51:03] DoctorMonocular: has joined #RubyOnRails
[05:51:18] roamingdog: has joined #RubyOnRails
[05:52:41] andrew9184: has joined #RubyOnRails
[05:54:38] blackmesa: has joined #RubyOnRails
[06:00:25] beauby: has joined #RubyOnRails
[06:00:59] moeabdol: has joined #RubyOnRails
[06:02:40] DoctorMonocular: has joined #RubyOnRails
[06:05:11] tobyn: has joined #RubyOnRails
[06:08:11] tobyn: has joined #RubyOnRails
[06:09:43] navneet_: has joined #RubyOnRails
[06:10:42] sypheren: has joined #RubyOnRails
[06:10:42] Synthead: what's the best way to do websockets in rails 4?
[06:10:56] Synthead: I'm trying websockets-rails, but it has all kinds of issues
[06:11:12] kgrz: has joined #RubyOnRails
[06:11:47] emilkarl: has joined #RubyOnRails
[06:12:53] lxsameer: Synthead: it depends on your needs
[06:13:10] beauby: Hi there. When building a gem, is there a recommended way to add "optional methods" (i.e. methods that will get defined *only* if some constant is defined at runtime (say ActionController for instance))?
[06:13:10] Synthead: I'm not looking for anything really complicated
[06:13:27] Synthead: I have a small app that is centered around background jobs
[06:13:32] Synthead: there's a "status" page for these
[06:13:35] lxsameer: Synthead: so action cable would be a good fit i guess
[06:13:53] Synthead: I want to send updates to the client so users can get a realtime update
[06:14:02] Synthead: lxsameer: actioncable will work with 4?
[06:14:20] SPYGAME: has joined #RubyOnRails
[06:14:30] lxsameer: Synthead: i think so
[06:14:56] sevenseacat: actioncable is rails 5.
[06:15:06] jenrzzz: has joined #RubyOnRails
[06:16:28] Synthead: any other ideas? :p
[06:16:54] sevenseacat: i've never used websockets, sorry.
[06:18:04] lxsameer: Synthead: in that case if you want it to be in ruby use event machine, and if you're using jruby there are plentty of options
[06:18:26] lxsameer: Synthead: how many concurrent user do you have ?
[06:18:30] emilkarl: Anyone been using react-rails, coffeescript and added a custom component such as https://github.com/troybetz/react-youtube? How do I do that?
[06:18:51] Synthead: lxsameer: I'm not sure yet, but it should be able to scale
[06:19:07] yfeldblum: has joined #RubyOnRails
[06:19:21] Devalo: has joined #RubyOnRails
[06:20:25] lxsameer: Synthead: a good solution would be to use a message queue or even a kafka instance to store the events as logs and a seperate websocket server ( in another language ) which reads the logs and serve them to user
[06:20:27] Synthead: lxsameer: are you talking about em-websocket? I don't see any reference to rails on the github page
[06:20:42] lxsameer: Synthead: personally i used the same solution for over 30M user
[06:21:14] freija: has joined #RubyOnRails
[06:21:27] Synthead: lxsameer: hm interesting
[06:21:36] Synthead: I'm using redis already
[06:22:15] lxsameer: Synthead: if you're data is very important you have to consider something else but if not redis will do the trick
[06:22:47] lxsameer: Synthead: personally i used Apache Kafka and a websocket server using clojure's http-kit
[06:22:54] DoctorMonocular: has joined #RubyOnRails
[06:23:53] Synthead: lxsameer: why consider something else? what's the downsides of redis?
[06:25:31] lxsameer: Synthead: while redis is a fantastic piece of software, its main purpose is not message passing, it supports Pub/Sub but something like kafka offers lot more features which can be helpful for scaling
[06:26:40] raunicolae: has left #RubyOnRails: ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
[06:30:06] Palsson: has joined #RubyOnRails
[06:30:08] ImmoveableOne: has joined #RubyOnRails
[06:37:55] bronson: has joined #RubyOnRails
[06:39:24] aganov: has joined #RubyOnRails
[06:39:31] jenrzzz: has joined #RubyOnRails
[06:39:31] jenrzzz: has joined #RubyOnRails
[06:39:55] tildes: has joined #RubyOnRails
[06:41:13] Pazician: has joined #RubyOnRails
[06:41:49] apotry: has joined #RubyOnRails
[06:45:10] navneet_: has joined #RubyOnRails
[06:45:15] neanderslob: has joined #RubyOnRails
[06:54:16] DoctorMonocular: has joined #RubyOnRails
[06:55:08] kgrz: has joined #RubyOnRails
[06:55:26] blackmesa: has joined #RubyOnRails
[06:59:00] freija1: has joined #RubyOnRails
[07:00:47] Olipro_: has joined #RubyOnRails
[07:02:29] jgt1: has joined #RubyOnRails
[07:06:21] tildes: has joined #RubyOnRails
[07:08:03] smoitra_: has joined #RubyOnRails
[07:08:44] Devalo: has joined #RubyOnRails
[07:15:49] Coldblackice: has joined #RubyOnRails
[07:16:08] Lytol: has joined #RubyOnRails
[07:16:13] AimlessRAven: has joined #RubyOnRails
[07:22:15] The_Phoenix: has joined #RubyOnRails
[07:30:08] jancel: has joined #RubyOnRails
[07:34:12] ravishankarjha: has joined #RubyOnRails
[07:37:12] mark_66: has joined #RubyOnRails
[07:40:15] edwin_: has joined #RubyOnRails
[07:45:54] Axilla: has joined #RubyOnRails
[07:49:09] ferr: has joined #RubyOnRails
[07:49:10] AzaToth: has joined #RubyOnRails
[07:56:10] blackmesa: has joined #RubyOnRails
[07:57:51] navneet__: has joined #RubyOnRails
[08:00:36] roshanavand: has joined #RubyOnRails
[08:03:51] edwin__: has joined #RubyOnRails
[08:05:11] matthias_: has joined #RubyOnRails
[08:07:07] njero: has joined #RubyOnRails
[08:08:59] jsrn_: has joined #RubyOnRails
[08:16:10] arBmind: has joined #RubyOnRails
[08:16:52] darutoko: has joined #RubyOnRails
[08:18:51] pawnbox: has joined #RubyOnRails
[08:20:05] roshanavand: has joined #RubyOnRails
[08:33:24] eyeamaye: has joined #RubyOnRails
[08:35:29] BDA: has joined #RubyOnRails
[08:37:33] artto: has joined #RubyOnRails
[08:37:40] czerasz: has joined #RubyOnRails
[08:37:46] adre: has joined #RubyOnRails
[08:38:23] stannard: has joined #RubyOnRails
[08:38:27] edwinkcw: has joined #RubyOnRails
[08:38:35] startupality: has joined #RubyOnRails
[08:40:15] bronson: has joined #RubyOnRails
[08:42:49] Ropeney: has joined #RubyOnRails
[08:43:13] pawnbox: has joined #RubyOnRails
[08:47:57] durexlw: has joined #RubyOnRails
[08:48:14] durexlw: morning all
[08:49:09] durexlw: I'm looking for a design pattern to authenticate users to modules: so there's bundles of articles and a user can 'activate' that bundle. Anyone has a suggestion about that?
[08:55:01] marr: has joined #RubyOnRails
[08:55:23] tbuehlmann: so you have a bundle and want to associate a user to it?
[08:56:32] durexlw: tbuehlmann: yeah, it's not so much the associations i'm looking for, more like: if you want to generate a code specific to a user
[08:56:43] durexlw: and if the code's right, the association is created
[08:57:21] blackmesa: has joined #RubyOnRails
[08:57:31] durexlw: I can figure something out, but I guess smart people already figured out some pattern for that
[08:58:24] tbuehlmann: well, you'd create a code for a specific user and a specific bundle
[08:58:26] tbuehlmann: such a thing is not a design pattern per se
[08:59:01] tildes: so would you have another class, BundleActivation for instance?
[08:59:02] lacce: has joined #RubyOnRails
[08:59:26] tildes: and user has_many bundle_activations, bundle has_many bundle_activations?
[09:00:08] tbuehlmann: yep, that'll do
[09:00:32] tbuehlmann: I assume some instance generates the bundle activation beforehand, though
[09:01:06] durexlw: tildes that's the direction I'm thinking in: bundle has_many activations; activations has_many users. In the activations class I'd link to the bundle to begin with, store the user ID in a for_user field, enter a code. Then when the user enters the code, I'd establish an asssociation between the user and the activations. Then a user has_many bundles through activations
[09:02:49] tildes: hmm you would probably have the connection in place already, so that a bundle would have many unactivated activations, and activated activations
[09:02:59] tildes: and have a boolean to track that
[09:03:27] tildes: this is how I also think about it, but I think the caveat is that with a lot of bundles and users and codes you end up with a maximum number objects basically, based on that set :D
[09:03:29] durexlw: tildes, that's an option I considered as well... that's probably an even cleaner way to do it... would allow for expirations
[09:03:42] startupality: has joined #RubyOnRails
[09:04:10] tildes: the thing is, activations will be a connector table (not sure what is the real term), with foreign key column for both user and bundle
[09:04:25] noobsu: has joined #RubyOnRails
[09:04:25] tildes: and codes I guess
[09:04:43] konsolebox: has joined #RubyOnRails
[09:04:48] tildes: and if code is specific to both bundle and user, you need to store the code somewhere, before giving it to the user
[09:05:00] tildes: or then you have some interesting parsing mechanism there :D
[09:05:12] tildes: ^alternatively
[09:05:30] durexlw: yeah, that's what I was concerning about
[09:06:20] durexlw: I won't be dealing with thousands of users, but still, I don't like to do monkey code that's not maintainable
[09:06:24] tildes: it will work. my concern is the potentially wild number of objects you end up with. not sure how well it scales, or at what point it becomes a concern
[09:06:43] defsdoor: has joined #RubyOnRails
[09:06:49] durexlw: much agreed
[09:07:11] durexlw: I just think this is a pretty common thing to do... should be examples of this out there
[09:07:22] matthewd: Depends whether most user-bundle pairs are destined to be activated, I would think
[09:07:39] tildes: you might look at generic authentication / role examples, and derive from there
[09:07:50] Talltree: this may or may not sound like a stupid question but i havent found any solution to it in multible hours of googling, i have 2 models associated with each other, and a nested form, it works great but isn't "script-able". I want to POST into 2 models via json if possible.... can you guys help me with that?
[09:07:55] matthewd: .. though I think I'd like to better understand the next-level-up problem you're solving, too
[09:08:00] tildes: you could expire codes too, enabling for clearing away unused objects
[09:08:44] tildes: durexlq: I think it's an interesting question, would be nice to hear what you end up with
[09:09:26] srinidhi: has joined #RubyOnRails
[09:09:51] sevenseacat: I don't get the scenario
[09:09:52] durexlw: matthewd: the end goals is: I give courses for a company, I build a website that can have articles, questions and articles are bundled in 'information bundles'. People who took the course can 'activate' that bundle and therefore see all the articles that reside in it
[09:10:18] sevenseacat: user has and belongs to many bundles?
[09:10:44] durexlw: sevenseacat: yeah, but how do you build a proper activation, how do you handle the codes generated
[09:11:03] lacce: has joined #RubyOnRails
[09:11:06] matthewd: durexlw: It's the code part we need more information on
[09:11:10] sevenseacat: okay, it's not a habtm then
[09:11:11] nighttime: has joined #RubyOnRails
[09:11:31] sevenseacat: why do you need a code to 'activate' a bundle?
[09:11:40] matthewd: (i.e., why are codes a requirement, and how will they be used)
[09:11:46] tildes: access control isn't it
[09:11:54] sevenseacat: don't know yet
[09:12:33] workmad3: has joined #RubyOnRails
[09:12:34] Hyuk: has joined #RubyOnRails
[09:12:39] durexlw: matthewd: so in the end I want to be able to do two things: have a generic activation that consists only of a start date, an end date and a code: so for during the course, I can just project a code have people register with that code for that bundle and be off. The code can only be used in the timeframe I set. (I know it's not the most safe thing to do, but it's not that high value material, so it's a maintained risk)
[09:12:54] Hyuk: has left #RubyOnRails: ()
[09:13:10] Hyuk: has joined #RubyOnRails
[09:13:16] durexlw: that one's easy to do
[09:13:23] sevenseacat: if bundles are tied to courses, why do you need this extras hoopla?
[09:13:36] sevenseacat: *I presume you've already got users and courses mapped correctly
[09:13:47] durexlw: the other end is that people can request or buy an information bundle: in that case a user specific code needs to be generated. It can only apply to a specific bundle and a specific user pair
[09:13:48] matthewd: So your application doesn't / can't know about course attendance?
[09:14:18] sevenseacat: again, why codes
[09:14:21] matthewd: Why would you need a code then? If they've made the purchase inside the app, you can just link it directly -- no need to force them to copy & paste a thing
[09:14:26] renegadeandy: has joined #RubyOnRails
[09:14:27] sevenseacat: if a user buys a bundle why do they need a code
[09:14:57] durexlw: sevenseacat: it's local government, as crazy as it sounds, they can't do online payments... law.. don't ask...
[09:15:34] sevenseacat: what does that have to do with codes?
[09:15:44] matthewd: Okay, but whatever you intend to use to generate the unique user+bundle code could instead be used to just link the account immediately
[09:16:20] sevenseacat: you're introducing extra moving parts to try and make one solution fit two different scenarios, when the solution doesnt work for either
[09:16:40] durexlw: matthewd: somehow that might not have crossed my mind yet... I might be over complicating it indeed
[09:16:56] startupality: has joined #RubyOnRails
[09:17:02] durexlw: sevenseacat: agreed. Worth thinking about
[09:17:05] matthewd: Yeah.. sounds like your solution is leaking into your problem
[09:17:43] durexlw: I guess why I wanted the codes is to have people in the course enter the site, enter the code so that they 'felt' the site
[09:18:12] yfeldblum: has joined #RubyOnRails
[09:18:16] durexlw: visited it on the course to begin with, interacted with it
[09:18:19] rubyonrails951: has joined #RubyOnRails
[09:18:33] durexlw: might not be the best way to go though
[09:19:06] matthewd: Assuming you don't have enrolment info, a shared code for that scenario doesn't seem unreasonable
[09:19:58] durexlw: in this case I have enrolment info
[09:20:10] durexlw: sounds more logical indeed to go in that direction
[09:20:13] gregf_: has joined #RubyOnRails
[09:21:08] matthewd: Oh, then yeah, if you know who's enrolled, you can just give them access (by creating the previously identified "activation" instances) directly
[09:21:09] durexlw: the other idea that crossed my mind was to make 'events', that have enlistings and are connected to bundles. In this case a user would be entitled to a bundle if they visited the event...
[09:22:00] durexlw: what bothered me in that scenario is that it's kinda symantically confusing if people buy a bundle... cause they never actually enrolled for the event
[09:22:33] sevenseacat: again, two scenarios
[09:22:48] durexlw: sevenseacat: so you're saying making two solutions?
[09:23:16] jgt1: has joined #RubyOnRails
[09:23:32] sevenseacat: one is easy. a user has access to bundles through courses, thats a straight association
[09:23:36] matthewd: Solve each, then look to unify the solutions.. don't solve one then try to rework the second problem to match
[09:24:14] durexlw: matthewd: I really appreciate the advice.
[09:24:30] durexlw: sevenseacat: same thing. Thanks. I value the advice a lot
[09:24:54] durexlw: thanks for asking beyond the question
[09:25:30] wethu: has joined #RubyOnRails
[09:25:56] nobitanobi: has joined #RubyOnRails
[09:25:57] sevenseacat: thats what we do, somewhat annoyingly :)
[09:26:50] moeabdol: has joined #RubyOnRails
[09:26:53] durexlw: heh, well, I can see why it could be annoying, but I think it's awesome if someone opens up your own limited vision on things
[09:27:34] durexlw: after a while you're so close to the problem, you just can't see clear and then it's nice to have an open vision on it of someone else
[09:27:58] durexlw: I'm goin to start with the courses. That's the actual problem today
[09:30:12] durexlw: hey, just as a side question sevenseacat matthewd: how do you guys know if you're trying to cover too much contingencies? In other words, for yourself: where do you draw the line of "making a flexible model that's capable and scalable" and "making it too complex"?
[09:30:37] sevenseacat: I don't know how guys know anything, because I'm not one.
[09:31:32] durexlw: someone stole your penis huh... we can live with that :) question stays the same :)
[09:32:53] universa1: experience.
[09:33:01] matthewd: durexlw: Wanna try that again?
[09:33:01] universa1: next (chuckle) ;)
[09:33:34] durexlw: universa1: I can live with that :)
[09:33:58] durexlw: I guess I'm always too scared i'd have a hard time scaling something... but I tend to then overthink it
[09:35:26] universa1: scaling as in: ohh now i have 10 times as many users as before and now my system is slowing down?! ...
[09:36:27] durexlw: yeah, but also: "shit now I have all this content on my site and I can't organize it as I want to"
[09:36:46] nobitanobi: Morning! Why when doing this query this way: `User.where("created_at = ?", DateTime.now).to_sql` I get: "SELECT `users`.* FROM `users` WHERE (created_at = '2016-05-16 09:28:46.487954')" and when I do it this way: `User.where(created_at: DateTime.now).to_sql` I don't get milisecond precision "SELECT `users`.* FROM `users` WHERE `users`.`created_at` = '2016-05-16 09:28:24'" ? - using mysql 5.6
[09:36:47] universa1: that is not scaling, that is software engineering.
[09:36:54] Devalo: has joined #RubyOnRails
[09:36:59] tildes: or UX or what not
[09:37:17] durexlw: universa1: fair enough... well, my confusion about the two terms says a lot right :)
[09:37:38] RegulationD: has joined #RubyOnRails
[09:37:57] blackmesa: has joined #RubyOnRails
[09:38:42] durexlw: nobitanobi: is it actually a problem?
[09:38:42] Devalo: has joined #RubyOnRails
[09:41:20] chipotle: has joined #RubyOnRails
[09:42:02] mdw: has joined #RubyOnRails
[09:46:44] Axilla: has joined #RubyOnRails
[09:49:26] AimlessRAven: has joined #RubyOnRails
[09:50:27] AimlessRAven: hello all, how to set labels for my radio_buttons
[09:50:50] AimlessRAven: my radio_buttons are enumerize and come from my admin panels
[09:53:13] Detch: has joined #RubyOnRails
[09:54:28] durexlw: AimlessRaven: you tried collection_select?
[09:54:42] durexlw: simple form is worth checking out by the way
[09:57:03] AimlessRAven: durexlw: how to exclude enumerize options for example if i have enumerize :states in .. [:a,:b, :v]
[09:57:19] AimlessRAven: how to set only :a option when i call = f.input :states as: :radio_buttons
[09:57:58] durexlw: AimlessRaven: you want to limit the amount of radio buttons displayed, based on a criteria?
[09:58:38] AimlessRAven: i have = f.input :payment_type, as: :radio_button
[09:58:44] AimlessRAven: bt my :payment_type accept 3 enumerize values
[09:58:48] AimlessRAven: i wanna show only one
[10:00:33] universa1: AimlessRaven: collection: [your_state] ?!
[10:00:51] durexlw: or "collection_select(:payment, :payment_type_id, Payment_types.all, ..." In stead of using PaymentTypes.all, use PaymentTypes.where(criteria: "whatever)"
[10:01:40] startupality: has joined #RubyOnRails
[10:02:30] wethu: has joined #RubyOnRails
[10:03:05] arup_r: has joined #RubyOnRails
[10:04:40] AimlessRAven: universa1: = f.input :payment_type, as: :radio_buttons, collection: [:pay_on_deliver]
[10:04:47] AimlessRAven: this work but how to humanize label and translate it
[10:05:11] joshua___: has joined #RubyOnRails
[10:06:12] universa1: AimlessRaven: enumerize gem? iirc it has support for simple form / localization
[10:06:39] joshua___: Just wondering when people think the rails 5 release version will be out?
[10:06:48] universa1: Joshua___: when it's done!
[10:06:50] sevenseacat: Joshua___: !when
[10:06:55] sevenseacat: ACTION nods.
[10:07:54] joshua___: This year do you think?
[10:08:08] antgel: has joined #RubyOnRails
[10:09:07] AimlessRAven: universa1: hmm my collection dont work
[10:09:22] AimlessRAven: = f.input :payment_type, as: :radio_buttons, collection: [:pay_on_deliver]
[10:09:34] AimlessRAven: show my result but value is different
[10:09:39] AimlessRAven: and dont save my selected value
[10:10:31] blackhuey: has joined #RubyOnRails
[10:10:53] universa1: AimlessRaven: if you only have a single value, why do you have a radio button at all?
[10:11:33] AimlessRAven: universa1: just for now
[10:11:38] AimlessRAven: need only 1 value to show
[10:11:54] AimlessRAven: now its work :) oks, but how to translate enumerized values label
[10:12:03] AimlessRAven: = f.input :payment_type, as: :radio_buttons, collection: [:pay_on_delivery], label: t('cart.delivery.payment_type.payment_type')
[10:12:20] AimlessRAven: this translate only title of my buttons but not their label
[10:12:50] universa1: AimlessRaven: https://github.com/brainspec/enumerize#usage --> I18n.
[10:12:52] Ergo: has joined #RubyOnRails
[10:13:51] AimlessRAven: universa1: how can i set custom label for my enumerize in my store-front.. i dont wanna translate in admin panel
[10:14:32] universa1: what has i18n today with store front and/or admin panel...
[10:14:43] universa1: s/today/to do/
[10:14:59] stardiviner: has joined #RubyOnRails
[10:15:09] AimlessRAven: amm is there a way to = f.input :payment_type, as: :radio_buttons, collection: [:pay_on_delivery]
[10:15:23] AimlessRAven: set label for my :pay_on_delivery
[10:15:51] edwin_: has joined #RubyOnRails
[10:16:27] universa1: probably, but why if the simple solution is already there?
[10:16:54] universa1: config/locales/YLC.enumerize.yml --> enter the translation, reload app and be done most likely...
[10:17:16] adlerdias: has joined #RubyOnRails
[10:17:55] Devalo: has joined #RubyOnRails
[10:18:56] AimlessRAven: universa1: because they came from my admin panel.. and my admin panel i module
[10:19:04] AimlessRAven: i dont wanna touch there
[10:19:30] universa1: you touch a view file, but a locale file not...
[10:19:34] helpa: http://i.imgur.com/m9m3wr9.gif
[10:20:18] AimlessRAven: universa1: yeah
[10:21:05] universa1: ok, that does not make any sense to me... but then you most likely have to manually render the input field... look at the simple_form docs how to do that.
[10:25:12] gregf_: has joined #RubyOnRails
[10:28:28] noobsu: has joined #RubyOnRails
[10:28:46] jgt1: has joined #RubyOnRails
[10:30:01] arBmind: has joined #RubyOnRails
[10:32:37] der-landgraf: has joined #RubyOnRails
[10:33:51] Ergo^: has joined #RubyOnRails
[10:35:21] Axilla: has joined #RubyOnRails
[10:36:02] ahmgeek: has joined #RubyOnRails
[10:36:11] ahmgeek: hello, can I ask
[10:36:46] tagaulap: has joined #RubyOnRails
[10:38:03] ahmgeek_: has joined #RubyOnRails
[10:38:21] artto: has joined #RubyOnRails
[10:39:51] ahmgeek_: I love you, I wanted to ask about something stupid a little. basically I have an authorization mechanizm with cancancan
[10:40:30] ahmgeek_: but I now need to add administration feature. with a different auth, I love this gem https://github.com/AnalyticsMediaGroup/strongbolt/
[10:41:01] ahmgeek_: it's just made a model called Role. but it's relevant table in the db is strong_bolt_roles
[10:41:13] alfie_max15: i haven't used that before
[10:41:52] ahmgeek_: well, my question is regard the mechanizm of naming in rails. I only have conflicts in Models not db/tables as the models called roles, both of them.
[10:42:10] ahmgeek_: but the tables are roles and strong-bolt-roles
[10:42:17] ahmgeek_: can I turn around this ?
[10:42:22] alfie_max15: model names should be singular
[10:43:25] alfie_max15: table names are created by using `tableize` method in ActiveSupport::Inflector
[10:43:59] lxsameer: has joined #RubyOnRails
[10:44:40] ahmgeek: has joined #RubyOnRails
[10:46:30] idefine: has joined #RubyOnRails
[10:48:33] rodfersou: has joined #RubyOnRails
[10:48:43] diegoaguilar: has joined #RubyOnRails
[10:50:36] artto: has joined #RubyOnRails
[10:51:43] ahmgeek: https://gist.github.com/
[10:56:34] elaptics: ahmgeek: what are you asking?
[10:56:36] jgt2: has joined #RubyOnRails
[10:56:48] elaptics: ahmgeek: you have two different models called Role?
[10:57:29] elaptics: why do you want 2 different auth mechanisms? That just sounds like you're asking for trouble
[10:57:44] artto: has joined #RubyOnRails
[10:57:52] eyck: has joined #RubyOnRails
[10:58:11] artto: has joined #RubyOnRails
[10:58:59] ahmgeek: I have a role model that cancancan uses, I depend on it, the new gem creates a new table called strongbolt_roles, and module Strongbolt class Role in the gem I want to install.
[10:59:11] ahmgeek: both of the auth are diferrent.
[10:59:17] ahmgeek: I use one with the main app.
[10:59:22] elaptics: so what is the specific issue you're having?
[10:59:23] ahmgeek: and the other with activeadmin
[10:59:57] ahmgeek: I have conflicts in the role model, I want to solve it without changing lots of the code base or the other way around, in the gem.
[11:00:36] elaptics: conflicts how? You mean your Role model isn't namespaced and the strongbolt code is assuming your Role model is its Role model?
[11:01:03] elaptics: you could namespace yours and make sure all yours are referenced with the namespace where there might be ambiguity
[11:01:38] roelof: has joined #RubyOnRails
[11:02:22] ahmgeek: yeah, so in my code I should make my role model somethung like Aurora::Role < ActiveRecord::Base ?
[11:02:31] ahmgeek: and call it with that name in all of my code
[11:02:38] roelof: I do not follow the Hartl's book but I see this error message when running minitest : ActionView::Template::Error: ActionView::Template::Error: File to import not found or unreadable: bootstrap-sprockets.
[11:03:07] roelof: Do I have to add bootstrap-sprockets to my gem file or did I do something else wrong ?
[11:04:19] roelof: wierd, when running rake test manually the test are all green
[11:04:41] emilkarl: has joined #RubyOnRails
[11:05:08] andywww: has joined #RubyOnRails
[11:06:27] andywww: I’m having some problems with deleting a record. I’m not sure where to start digging but think it may be something to do with counter cache attributes updating.
[11:06:30] andywww: https://gist.github.com/anonymous/7a19d1c62b6274a0a278d8139e5b9c5f
[11:07:02] andywww: whats the best way forward when i don’t have a stack trace to reference?
[11:12:43] blackmesa: has joined #RubyOnRails
[11:13:29] elaptics: andywww: sounds like maybe you have a circular dependency
[11:13:58] kareeoleez: has joined #RubyOnRails
[11:14:36] andywww: i’ve a feeling its going to be in a callback
[11:14:43] andywww: i’ll have a look, thakns
[11:14:50] elaptics: andywww: more than likely - this is why callbacks are problematic
[11:15:10] andywww: yeah, i’m phasing them out slowly
[11:15:10] kareeoleez: I am trying to change the value of an enum before updating/saving to the database, so the user can send any of the values included in each element's array of values: https://gist.github.com/chrisvel/c0697f9b64bc92cc3d4f0c86c4f5eb83
[11:15:46] kareeoleez: Can someone tell me why am I getting an ArgumentError if I try to .update(media: "Auto") for example ?
[11:16:10] kareeoleez: or .update(media: "10GbaseLR") ?
[11:16:25] andywww: is it likely this will cause me problems?
[11:16:27] andywww: belongs_to :mentionable, polymorphic: true, counter_cache: :mention_count, dependent: :destroy
[11:16:28] kareeoleez: it seems that the before_validation, before_save etc. don't work
[11:17:39] artto: has joined #RubyOnRails
[11:19:35] meoblast001: has joined #RubyOnRails
[11:20:10] Devalo: has joined #RubyOnRails
[11:21:18] elaptics: andywww: yes, that looks like it's trying to destroy "upwards" too
[11:21:45] elaptics: andywww: hence it'll be trying to destroy the thing that initiated the first one, and back "down" until you run out of stack
[11:23:06] srinidhi: has joined #RubyOnRails
[11:23:09] GodFather: has joined #RubyOnRails
[11:23:57] ldnunes: has joined #RubyOnRails
[11:24:29] andywww: of course, i’ve put it on the wrong side
[11:24:30] KevinSjoberg: has joined #RubyOnRails
[11:25:42] artto: has joined #RubyOnRails
[11:26:38] netzfisch: has joined #RubyOnRails
[11:27:04] kareeoleez: does anyone know If model callbacks work with enum actually ?
[11:27:47] elaptics: kareeoleez: add the stacktrace you're getting to your gist
[11:28:56] kareeoleez: elaptics: done
[11:29:54] artto: has joined #RubyOnRails
[11:31:15] artto: has joined #RubyOnRails
[11:31:24] jgt3: has joined #RubyOnRails
[11:33:14] noobsu: has joined #RubyOnRails
[11:36:43] crameth: has joined #RubyOnRails
[11:38:26] RegulationD: has joined #RubyOnRails
[11:38:32] elaptics: kareeoleez: you're trying to set it to a "disallowed" value - that's what it's moaning about -i.e. isn't not one of your valid enum values
[11:38:54] kareeoleez: elaptics: you see the array on the right of each element ?
[11:39:46] elaptics: kareeoleez: but "AUTO" isn't in your enum list at the top
[11:39:59] kareeoleez: elaptics: what I am trying to do is to post any string included in this array e.g. [ "10baseT", "UTP", "10UTP" ] and translate it to the IF_MEDIA symbol
[11:40:03] kareeoleez: elaptics: you're right
[11:40:19] elaptics: kareeoleez: personally I wouldn't do that in this model
[11:40:47] kareeoleez: elaptics: what do you suggest ?
[11:41:00] srinidhi: has joined #RubyOnRails
[11:41:06] artto: has joined #RubyOnRails
[11:41:27] kareeoleez: elaptics: but If I do .update(media: "100TX") it also won't work
[11:41:31] artto: has joined #RubyOnRails
[11:42:21] der-landgraf: has joined #RubyOnRails
[11:44:13] noobsu: has joined #RubyOnRails
[11:45:59] elaptics: kareeoleez: it sounds like all that IF_MEDIA stuff is just used to allow users to enter something then it should be done in a form object or elsewhere. It's not really the responsibility
[11:46:09] j_mcnally: has joined #RubyOnRails
[11:46:51] kareeoleez: elaptics: but it's just a waste of space in the controller to set this up there
[11:46:58] m_antis: has joined #RubyOnRails
[11:47:00] elaptics: it definitely shouldn't be in the controller
[11:47:05] kareeoleez: elaptics: so where ?
[11:47:09] kareeoleez: in the view ?
[11:47:15] elaptics: like I said I would create a form object
[11:47:49] kareeoleez: elaptics: but I need to do this conversion somewhere
[11:48:04] kareeoleez: it can't be ran inside a form object
[11:48:58] elaptics: sure it can
[11:49:41] elaptics: I think I might have a gist with an example
[11:50:00] edwin__: has joined #RubyOnRails
[11:50:18] elaptics: kareeoleez: https://gist.github.com/andyh/2840f474153cdf77e0db
[11:51:02] kareeoleez: I've never used form objects before to be honest
[11:51:08] kareeoleez: I have no idea how they work
[11:51:22] elaptics: kareeoleez: basically it's acting a bit like a typical active record object api but it can do whatever it wants and then it finally persists the massaged user data to update the underlying AR model
[11:51:57] kareeoleez: elaptics: but I might need those values elsewhere
[11:52:09] elaptics: kareeoleez: what values?
[11:52:12] kareeoleez: e.g. to get the Message from the array's element
[11:52:21] KevinSjoberg: has joined #RubyOnRails
[11:52:32] kareeoleez: IF_MEDIA[:AUTO][2]
[11:52:35] elaptics: kareeoleez: something to read http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/
[11:52:46] elaptics: kareeoleez: for what purpose?
[11:53:04] kareeoleez: display them
[11:53:24] elaptics: kareeoleez: display where and when?
[11:53:28] kareeoleez: Model::IF_MEDIA[:AUTO][2] should work fine
[11:53:44] kareeoleez: to the view for the beginning
[11:53:59] kareeoleez: I don't want them tied to a form object
[11:54:06] |2701: has joined #RubyOnRails
[11:54:24] kareeoleez: shouldn't the before_validation work in this case ?
[11:54:24] elaptics: create a simple value object then and use that in whatever other objects you need to access that data
[11:54:39] kareeoleez: this could work
[11:55:02] kareeoleez: in the /models folder or in /lib for example? Does it matter ?
[11:55:11] elaptics: doesn't really matter
[11:55:12] artto: has joined #RubyOnRails
[11:55:26] kareeoleez: but this won't solve the issue
[11:55:33] kareeoleez: It just organises things
[11:56:11] kareeoleez: The issue of entering a value and setting the key of the hash as enum value
[11:56:28] elaptics: kareeoleez: it will solve things because the form object which is for view purposes controls what users can see, enter and it massages their input into a suitable form that you want to actually persist to the database
[11:57:09] kareeoleez: elaptics: but I am going to do the same kind of conversion, either in the form model or the base model itself
[11:57:18] elaptics: If I understand what you want correctly you want them to effectively use aliases to choose the media type, e.g. they could pick any of 3 values and it would resolve to the "proper" enum value
[11:57:21] kareeoleez: it's the same procedure, only the structure changes right ?
[11:57:30] kareeoleez: elaptics: exactly.
[11:59:03] elaptics: well that's all view concerns so you let the form object manage that complexity. You've defined your valid enum values in the model for persistence so it doesn't need to be concerned with that
[11:59:27] godzillaenlacasa: has joined #RubyOnRails
[12:01:08] KevinSjoberg: has joined #RubyOnRails
[12:01:25] sinkensabe: has joined #RubyOnRails
[12:03:06] flashpoint9: has joined #RubyOnRails
[12:03:58] kareeoleez: elaptics: thank you
[12:04:09] jgt3: has joined #RubyOnRails
[12:06:09] sami: has left #RubyOnRails: ()
[12:06:33] gingray: has joined #RubyOnRails
[12:07:04] morfin: has joined #RubyOnRails
[12:07:22] morfin: which user do you use to start server on prod?
[12:07:59] epochwolf: morfin: the user you want to run the app.
[12:08:03] morfin: i mean system user
[12:08:08] Weavel: has joined #RubyOnRails
[12:08:19] GodFather: has joined #RubyOnRails
[12:08:41] epochwolf: Generally, you create a user and put the app in that user's home folder.
[12:09:07] aegis3121: has joined #RubyOnRails
[12:09:59] epochwolf: It also depend if you're using passenger to run the application or a different app server.
[12:10:14] morfin: well, i wish to start that on Puma
[12:11:34] epochwolf: Okay, so are you a developer trying to deploy an app for the first time?
[12:13:55] durexlw: has joined #RubyOnRails
[12:14:44] durexlw: I added "add_index :activations, [:user_id, :bundle_id], unique: true" to a rails migration. Now when I create a record, an error is generated. To catch that error, can I use an active record validation "uniqueness" on two columns?
[12:15:14] epochwolf: durexlw: yes
[12:15:32] epochwolf: validates_uniqueness_of :user_id, scope: :bundle_id
[12:15:48] durexlw: epochwolf: ow, scope, right... thanks man
[12:16:00] epochwolf: durexlw: it helps to read the docs :)
[12:16:40] durexlw: epochwolf: I have them open, I just didn't get that would be a solution to the problem. Makes sense now
[12:16:50] Craigimus: has joined #RubyOnRails
[12:16:55] morfin: well, i am not familiar with Systemd abomination
[12:17:16] epochwolf: morfin: um... I'm not either.
[12:17:21] morfin: ACTION hates Pottering thing
[12:17:48] morfin: basically some guides suggest using something like
[12:17:50] morfin: ExecStart=/usr/local/rvm/gems/ruby-2.2.1/gems/bundler-1.9.4/bin/bundle exec puma -e development -b unix:///var/www/shared/pids/puma.sock --pidfile /var/www/shared/pids/puma.pid
[12:18:17] bashusr: has joined #RubyOnRails
[12:19:05] epochwolf: morfin: can you link me to the guide?
[12:19:41] morfin: well, that's not exactly guides but i saw several pages suggesting that
[12:19:43] Devalo: has joined #RubyOnRails
[12:20:15] morfin: i found better way to do that: https://github.com/OpenBEL/openbel-api/wiki/Set-up-Puma-with-Systemd
[12:22:07] IrishGringo: has joined #RubyOnRails
[12:22:11] epochwolf: Are you using jruby?
[12:22:28] Devalo: has joined #RubyOnRails
[12:23:19] durexlw: epochwolf: how do you then catch that validation error with a statement like this "bundle.users << current_user" ?
[12:23:26] bashusr: hi #rubyonrails - wondering about best practices; I need to semvers = MyActiveRecord.all.pluck(:semver); # process semver constraint; records = MyActiveRecord.find_by_semver(semvers_that_match_constraint); Is it worth optimizing such that it is a single query to mysql that i get records = MyActiveRecord.all and do all the work in ruby?
[12:23:38] renegadeandy: has joined #RubyOnRails
[12:25:06] durexlw: bashusr: don't understand the question... can you use an example of what you are trying to do?
[12:25:18] epochwolf: durexlw: um... I'm going to need a lot more context for what you are doing.
[12:25:44] epochwolf: durexlw: because you are probably doing something wrong here.
[12:26:00] artto: has joined #RubyOnRails
[12:26:05] durexlw: epochwolf: fair statement :) here's some info:
[12:26:29] epochwolf: durexlw: put the code in a gist and then explain.
[12:27:20] epochwolf: bashusr: you left out a lot of information, do you happen to have the code written already?
[12:27:58] bbrowning: has joined #RubyOnRails
[12:28:02] bashusr: epochwolf, yeah, i do; i have the 1st version that does the pluck, then queries for the full record after going through the semantic versioning constraints
[12:28:19] bashusr: it bugs me that 2 queries are made to the DB instead of one, and i'm wondering if i shouldn't even bother
[12:28:24] Megamos: has joined #RubyOnRails
[12:29:05] bashusr: basically, first query is SELECT semver FROM my_active_record; 2nd query is SELECT * FROM my_active_record WHERE semver in ([hash_of_semvers_that_pass_constraint])
[12:29:23] durexlw: epochwolf: https://gist.github.com/anonymous/56152164dcb23d3ca3fe3fac35ef535c
[12:29:34] arBmind: has joined #RubyOnRails
[12:30:08] allcentury: has joined #RubyOnRails
[12:30:25] bashusr: (you can't do server constraint processing in mysql, it is just stored as a string... you have to pull out the whole list of semvers and process it manually to determine which semvers meet a certain constraint ( >= 2.1.0 for example)
[12:31:02] morfin: epochwolf, no - i am going to edit that and run stuff from .rbenv
[12:31:26] durexlw: a user can register to a bundle through an activation. But I want to restrict the same user creating mutiple activations for the same bundle. I setup the constraint in the migration (with index unique), but now I need to catch the error when the user tries to register twice for the same bundle. The registration happens on the line "bundle.users << current_user". This line throws a validation error when trying to save a double re
[12:32:31] Craigimus: has joined #RubyOnRails
[12:32:37] epochwolf: bashusr: well, you might want to rethink how your data model works. If everything is stored in a way that can't be queried, you can't query by it easily.
[12:33:39] morfin: basically i do not understand next thing: i want run server with different user from systemd(but server and other stuff installed only for that user via rbenv)
[12:34:29] epochwolf: durexlw: add Bundle#regiser(user) and have it handle adding the activation. Just have it ignore a duplicate registration.
[12:34:41] durexlw: bashusr: can't you do "MyactiveRecord.where(semver: MyActiveRecord.all.pluck(:semver))" ?
[12:35:25] Malgorath: has joined #RubyOnRails
[12:35:35] Veejay: has left #RubyOnRails: ("WeeChat 0.4.2")
[12:35:56] durexlw: epochwolf: sounds good to put it in a model, but how do you have it ignore the double?
[12:36:25] durexlw: never mind... asked too quick I think
[12:36:34] epochwolf: durexlw: you manually query to see if it already exists. :P
[12:36:49] bashusr: durexlw, still ends up in 2 queries
[12:36:57] durexlw: epochwolf: I'd rather catch the validation
[12:37:04] epochwolf: bashusr: use a join.
[12:37:04] bashusr: but more i'm thinking about this, the more 2 queries seems ok
[12:37:10] durexlw: bashusr: what epochwolf says
[12:37:20] mdw: has joined #RubyOnRails
[12:37:24] epochwolf: durexlw: the validation will do the same thing I'm suggesting.
[12:37:33] bashusr: epochwolf, gotta process semvers first.. i need to run it through a function to determine which semvers fall within a constraint
[12:37:34] jancel: has joined #RubyOnRails
[12:37:53] durexlw: epochwolf: hence why I'd like to use that... seems more maintainable than writing extra code
[12:37:55] epochwolf: bashusr: then you can't combine the queries.
[12:38:57] bashusr: so the constraint is (>=2.3.4), i need to pass all the semvers to the constraint and the constraint tells me that ["2.3.5", "2.3.7", and "3.0.0"] is valid; i need to take that array and get the full objects afterwards
[12:39:13] bashusr: hence, 2 queries... and i'm just wondering if 2 queries is the way to do it... but everything points in that direction
[12:40:04] epochwolf: durexlw: bundle.users << current_user unless bundle.users.find(user.id)
[12:40:04] Ergo__: has joined #RubyOnRails
[12:40:05] durexlw: bashusr: would be easier if you sketch the big picture of what you are trying to do... it seems that you are trying to make an association anyway
[12:41:08] bashusr: i'm implementing low level functions for a bundler type application except that it is backed by a DB
[12:41:18] durexlw: epochwolf: so I guess there's no way in this case to use the validation? If not your solution seems fine to me
[12:41:42] epochwolf: durexlw: I wouldn't bother with the validation unless you're creating the activation directly.
[12:41:56] epochwolf: validations on join models aren't the best idea...
[12:42:08] durexlw: epochwolf: got it
[12:42:30] durexlw: thanks for the help man. Appreciate it... saved me a bunch of searching
[12:43:43] durexlw: bashusr: more like what's with the versions? It seems that you have a bunch of versions, "some thing" that can only work for a bunch of versions and when "some thing" is created, you want to select the version it's suited for?
[12:43:51] bronson: has joined #RubyOnRails
[12:45:15] epochwolf: bashusr: if you want this to work efficently, you need to encode semantic version in a way that can be queried instead of just storing strings.
[12:45:37] bashusr: epochwolf, haha, have you looked at semver spec? i don't think its possible
[12:45:50] epochwolf: Honestly, it's been a while.
[12:47:02] bashusr: that is a thought though... you'd have to break everything up... not sure about handling build and pre-releases... but you probably could store each major, minor, and patch in its own column
[12:47:03] bamorim: has joined #RubyOnRails
[12:48:06] njero: hey.. How can i specify company logo within email? I mean to appear as contact image for gmail etc
[12:48:16] epochwolf: bashusr: not necessarily... what you want to do is make a way for "(>=2.3.4)" to be encoded as a range.
[12:48:42] Craigimus: has joined #RubyOnRails
[12:49:06] epochwolf: n_e_o: I don't know that you can do that with an image in an email.
[12:49:37] alfie_max15: n_e_o, you need to add that as attachemnt
[12:49:38] njero: epochwolf: i thought it was some meta or something. Then how these big guns do that :) ?
[12:49:51] bashusr: epochwolf, but 2.1.5 > 2.10.6 using string comparison, isn't it?
[12:50:01] njero: alfie_max15: just attachment?
[12:50:04] bashusr: i remember there were these type of problems that we decided against that in the first place
[12:50:19] adlerdias: has joined #RubyOnRails
[12:51:35] |2701: has joined #RubyOnRails
[12:51:35] |2701: has joined #RubyOnRails
[12:55:08] arup_r: has joined #RubyOnRails
[12:55:13] sinkensabe: has joined #RubyOnRails
[12:55:38] Devalo: has joined #RubyOnRails
[12:56:09] wolfravenous: has joined #RubyOnRails
[12:56:33] Axilla: has joined #RubyOnRails
[12:56:55] AnoHito_: has joined #RubyOnRails
[12:57:01] flashpoint9: has joined #RubyOnRails
[12:57:22] pawnbox: has joined #RubyOnRails
[12:57:23] Craigimus: has joined #RubyOnRails
[12:57:34] netzfisch: has joined #RubyOnRails
[12:57:37] monoprotic: has joined #RubyOnRails
[12:57:37] monoprotic: has joined #RubyOnRails
[12:57:50] Malgorath: anyone got a guide or tut on how to work with params? I'm trying to mount an engine as such http://localhost:3000/1/taskmaster/todolist/ which works fine but my issue is when I add or edit things, trying to save the first /1/ (routes file has /:projectid/taskmaster/) and I use params[:projectid] drops me an error No route matches [PATCH] "/1/taskmaster/tasklists" No route matches [PATCH]
[12:57:56] Malgorath: "/1/taskmaster/tasklists"
[12:58:19] pawnbox: has joined #RubyOnRails
[12:59:11] roamingdog: has joined #RubyOnRails
[12:59:58] epochwolf: Malgorath: you can't use a route unless you define it first.
[13:00:08] j_mcnally: has joined #RubyOnRails
[13:00:10] iamvery: has joined #RubyOnRails
[13:00:23] Malgorath: epochwolf: these work if I remove the :projectid from host apps route
[13:00:25] epochwolf: n_e_o: still looking into your problem. :)
[13:01:00] jwang: has joined #RubyOnRails
[13:01:02] njero: Actually Iam wrong that's only in Google Inbox only
[13:01:09] artto: has joined #RubyOnRails
[13:01:20] epochwolf: n_e_o: https://postmarkapp.com/blog/how-to-easily-add-a-sender-image-to-gmail
[13:01:41] epochwolf: It looks like you can use gravatar for a lot of email clients.
[13:02:49] njero: no, what i was trying to do.. something like google inbox to recognize company logo from mail sent to the clients
[13:03:40] epochwolf: n_e_o: how about including a vcard as an attachment?
[13:03:55] adlerdias_: has joined #RubyOnRails
[13:04:23] roamingd_: has joined #RubyOnRails
[13:04:31] stannard: has joined #RubyOnRails
[13:05:00] epochwolf: n_e_o: None of the emails in my inbox have company logos for the contact images.
[13:05:39] alfie_max15: epochwolf, i think he meant in the google `inbox for gmail`
[13:05:44] epochwolf: So I'm not entirely sure what you are looking to do here.
[13:05:49] sinkensabe: has joined #RubyOnRails
[13:06:02] alfie_max15: http://www.google.co.in/inbox/
[13:06:17] epochwolf: I didn't even know this existed.
[13:06:54] njero: epochwolf: yeah.. i thought if it's some meta tags or something
[13:07:13] meoblast001: has joined #RubyOnRails
[13:07:57] wolfravenous_: has joined #RubyOnRails
[13:08:12] epochwolf: n_e_o: http://marketingland.com/email-marketers-can-prepare-inbox-google-113265
[13:08:31] JackMc: Hey everyone, i'm getting super frustrated with the semantics of 'require' in ruby in regards to mocking tests
[13:08:48] epochwolf: JackMc: how so?
[13:09:03] macsteps: has joined #RubyOnRails
[13:09:16] ekinmur: has joined #RubyOnRails
[13:09:45] njero: epochwolf: yeah.. Thanks.. it explains everything
[13:09:52] epochwolf: n_e_o: may also be relavent: http://freshinbox.com/blog/how-to-get-your-logo-to-display-in-gmail-grid-view/
[13:10:10] JackMc: epochwolf: So I have this test here which is supposed to check that the after_create of the User class adds a role to the user. https://www.irccloud.com/pastebin/bMG4RtiF/
[13:10:42] JackMc: Unfortunately the Role's before_create does some stuff to a database I don't want to touch
[13:10:47] JackMc: So I try to mock it out
[13:11:15] JackMc: But the global @redshift doesn't seem to actually end up in the Role class
[13:11:20] sinkensabe: has joined #RubyOnRails
[13:11:20] wolfravenous: has joined #RubyOnRails
[13:12:00] epochwolf: JackMc: are instance variables in the test supposed to do something special?
[13:12:19] JackMc: epochwolf: Is the @whatever an instance variable? I thought it set a global
[13:12:24] epochwolf: @ = instance, @@ = class, $ = global
[13:12:34] epochwolf: Do not use $.
[13:13:23] JackMc: epochwolf: Hm... the module I'm testing uses @redshift to refer to that variable though
[13:13:29] apotry: has joined #RubyOnRails
[13:13:43] epochwolf: JackMc: that's an instance variable.
[13:13:43] JackMc: Well the module the module I'm testing uses
[13:13:55] Malgorath: is there anything I can do like this? resources :tasklists at: ':projectid/tasklists' do <-- I know that doesn't work but my issue seems to be only the route in the host app only works
[13:14:14] JackMc: This is the thing I'm trying to mock, specifically the @redshift variable https://www.irccloud.com/pastebin/HYMDjnPf/
[13:14:40] Malgorath: basically POST are not working is the issue, regular links work fine.
[13:14:57] epochwolf: What the fuck...
[13:15:09] JackMc: epochwolf: ?
[13:15:10] epochwolf: That is extremely unsafe code, do not use.
[13:15:18] JackMc: epochwolf: What's wrong with it?
[13:15:24] JackMc: I wrote it and I'm kinda new at this >.>
[13:15:26] roamingdog: has joined #RubyOnRails
[13:15:29] epochwolf: sql injection.
[13:15:48] JackMc: epochwolf: Yeah that's not the current issue, I'm working on that
[13:15:48] epochwolf: Use prepared statements.
[13:16:10] JackMc: The inputs are trusted and therefore getting it working is important, then I'll work on that
[13:16:13] JackMc: Point is I need tests
[13:16:15] eljimmy: has joined #RubyOnRails
[13:16:25] JackMc: So I can make sure my fancy stuff doesn't break it
[13:17:05] epochwolf: JackMc: mock out the redshift method.
[13:17:12] sinkensabe: has joined #RubyOnRails
[13:18:38] aegis3121: has joined #RubyOnRails
[13:20:03] iamvery: has joined #RubyOnRails
[13:21:13] jwang: has joined #RubyOnRails
[13:21:26] mrgreenfur: has joined #RubyOnRails
[13:21:28] artto: has joined #RubyOnRails
[13:21:31] epochwolf: JackMc: it looks like you can use ActiveRecord::Base.connection.quote
[13:21:59] pawnbox: has joined #RubyOnRails
[13:22:06] wolfravenous: has joined #RubyOnRails
[13:22:10] mrgreenfur: I’m using redis for Rails.cache, anyone know any way to get delete_matched working? Or a smart alternative to tell redis to expire via pattern?
[13:22:26] KevinSjoberg: has joined #RubyOnRails
[13:23:00] JackMc: epochwolf: b
[13:25:20] epochwolf: mrgreenfur: are you using redis-rails?
[13:25:25] mrgreenfur: epochwolf: yessir
[13:25:42] GodFather: has joined #RubyOnRails
[13:25:49] mrgreenfur: Rails.cache.delete_matched('view_*')
[13:25:49] epochwolf: mrgreenfur: looks like it implements delete_matched, what's the problem/
[13:25:55] mrgreenfur: it’s always falst
[13:26:15] epochwolf: mrgreenfur: https://github.com/redis-store/redis-activesupport/blob/master/lib/active_support/cache/redis_store.rb#L83
[13:26:42] epochwolf: Turn raise_errors on and see what the error is
[13:26:45] mrgreenfur: so there’s a connection problem
[13:26:58] epochwolf: mrgreenfur: step 1: is redis running?
[13:27:16] mrgreenfur: 1219 ? 00:48:56 redis-server
[13:27:51] mrgreenfur: how do i set raise errors?
[13:28:09] IrishGringo: has joined #RubyOnRails
[13:28:21] Ergo: has joined #RubyOnRails
[13:28:47] epochwolf: config.cache_store = :blah, param: "value"
[13:29:32] roshanavand: has joined #RubyOnRails
[13:30:58] kies: has joined #RubyOnRails
[13:31:47] KevinSjoberg: has joined #RubyOnRails
[13:32:48] edwin_: has joined #RubyOnRails
[13:33:46] mrgreenfur: epochwolf: thanks! redeploying
[13:33:57] syndikate: has joined #RubyOnRails
[13:38:01] d0nn1e: has joined #RubyOnRails
[13:40:24] andrew-l: has joined #RubyOnRails
[13:40:32] mrgreenfur: hrm, works in dev, tesitn gmore
[13:42:34] allcentury: has joined #RubyOnRails
[13:45:40] mrgreenfur: weird works now thanks for your help @epochwolf
[13:45:55] mrgreenfur: maybe it was the redis-namespace gem that I was using
[13:45:56] mrgreenfur: just remove dit
[13:46:20] stannard: has joined #RubyOnRails
[13:46:32] dandaman: has joined #RubyOnRails
[13:51:22] macsteps: has joined #RubyOnRails
[13:52:18] epochwolf: mrgreenfur: yay, I fixed something.
[13:57:08] startupality: has joined #RubyOnRails
[14:00:08] a346: has joined #RubyOnRails
[14:01:34] blackmesa: has joined #RubyOnRails
[14:02:05] godzillaenlacasa: has joined #RubyOnRails
[14:04:44] emilkarl: has joined #RubyOnRails
[14:07:59] fox_mulder_cp: has joined #RubyOnRails
[14:09:29] wolfravenous_: has joined #RubyOnRails
[14:09:34] mdw: has joined #RubyOnRails
[14:11:00] acovrig: has joined #RubyOnRails
[14:11:15] jancel: has joined #RubyOnRails
[14:12:52] mdw7: has joined #RubyOnRails
[14:13:48] allcentury: has joined #RubyOnRails
[14:13:58] DragonPunch: has joined #RubyOnRails
[14:14:01] wolfravenous_: has joined #RubyOnRails
[14:14:34] agent_white: has joined #RubyOnRails
[14:14:36] KevinSjoberg: has joined #RubyOnRails
[14:15:24] stardiviner: has joined #RubyOnRails
[14:16:31] AmiMoench: has joined #RubyOnRails
[14:16:39] acovrig: I’m having issues with CORS, https://gist.github.com/acovrig/cd5af4111963171d59ef01a15394fc40 has all my related code, is this a problem with rails or js?
[14:17:58] p1k: has joined #RubyOnRails
[14:20:34] finnnnnnnnnnn: has joined #RubyOnRails
[14:20:34] mustmodify: has joined #RubyOnRails
[14:20:38] finnnnnnnnnnn: anyone able to recommend a simple markdown field input js tool or gem? I have a model that needs to accept markdown as one of it’s properties.
[14:21:15] macsteps: has joined #RubyOnRails
[14:21:28] mustmodify: I had to roll back a deploy using capistrano. I've verified that we're now pointing to the old code. But the Angular resources used in the rolled-back version are still being served. Any suggestions? Dumping the cache did not fix the issue.
[14:21:58] mrgreenfur: @acovrig you can add a logger
[14:22:02] mrgreenfur: here’s mine: config.middleware.insert_before 0, "Rack::Cors", :debug => true, :logger => (-> { Rails.logger }) do
[14:22:02] mustmodify: finnnnnnnnnnn: yeah I've been using something... I'll look it up.
[14:22:02] Palsson: has joined #RubyOnRails
[14:22:11] finnnnnnnnnnn: mustmodify: thanks
[14:22:53] fryguy: mustmodify: try precompiling assets again
[14:23:13] artto: has joined #RubyOnRails
[14:23:46] akshat: has joined #RubyOnRails
[14:23:47] mrgreenfur: acovrig: also, i’ve seen lots of strange cors behavior when an application error happsn at the same time, or during non 20X http replies (esp from firefox)
[14:24:41] acovrig: mrgreenfur: OK, I’ll look into the json data thing
[14:25:13] mrgreenfur: yeah, make sure you’re sending json looks more like a regular param string to me: user[email]=test@example.com&user[password]=abc123
[14:25:56] mrgreenfur: data: JSON.stringify( {"user": {"email": $scope.email, "password": $scope.password}} ),
[14:26:07] mustmodify: finnnnnnnnnnn: https://github.com/toopay/bootstrap-markdown
[14:26:08] mrgreenfur: i can’t remember is jquery or ujs does this for you
[14:26:32] dstarh: has joined #RubyOnRails
[14:26:48] jobewan: has joined #RubyOnRails
[14:27:56] finnnnnnnnnnn: mustmodify: great, thanks again
[14:27:58] startupality: has joined #RubyOnRails
[14:28:24] ftj: has joined #RubyOnRails
[14:29:36] vedu: Hello. I edited my /etc/environment on my production server, can I make rails aware of this without rebooting the server?
[14:31:45] mustmodify: fryguy: That worked! Thanks.
[14:31:52] mustmodify: fryguy: Why did it work?
[14:32:01] mustmodify: Was Rails using the most-recently-created assets?
[14:32:05] pawnbox_: has joined #RubyOnRails
[14:32:06] antgel: has joined #RubyOnRails
[14:32:07] dandaman: has joined #RubyOnRails
[14:32:57] fryguy: mustmodify: there is a manifest file that controls what rails things are the current set of assets, it probably didn't get rolled back correctly
[14:33:21] drptbl: has joined #RubyOnRails
[14:33:22] yellow5: has joined #RubyOnRails
[14:33:37] sharkman: has joined #RubyOnRails
[14:33:42] mustmodify: fryguy: ok thanks.
[14:34:05] mustmodify: Yeah, now that you mention that, I have heard about the asset manifest.
[14:34:12] mustmodify: has left #RubyOnRails: ()
[14:34:34] maxx88: has joined #RubyOnRails
[14:34:36] sharkman: lets say i have a ruby view and right now it uses a method from a controller called "control_controller". how can i add a new method into a new controller called "new_controller" and let the view access this new_controller
[14:34:36] acovrig: mrgreenfur: that did it, it also helped to use valid credentials ;) I didn’t think a non-200 would cause that; thanks.
[14:34:57] mrgreenfur: acovrig: sure
[14:35:07] Tinyyy: has joined #RubyOnRails
[14:35:09] polishdub: has joined #RubyOnRails
[14:36:22] sharkman: i know thats a simple question but im new to this
[14:38:51] Oliphaunte: has joined #RubyOnRails
[14:41:48] jancel: has joined #RubyOnRails
[14:44:55] mdw: has joined #RubyOnRails
[14:45:10] mrgreenfur: sharkman: “control_controller” is not a very helpful name unless you have a model named “control” which is super confusing.
[14:45:24] mrgreenfur: also ususally views don’t access controllers
[14:45:30] mrgreenfur: they render the data prepared via controllers
[14:45:43] mdw: has joined #RubyOnRails
[14:45:44] mrgreenfur: and might access model methods
[14:46:08] mrgreenfur: rendering flow goes: request comes in -> router picks which controller method -> controller runs and prepares data -> view renders
[14:46:32] bronson: has joined #RubyOnRails
[14:47:51] sharkman: mrgreenfur okay i will take that into consideration i inherited this code from someone else. now im trying to factor our some functions to a new controller
[14:48:45] sharkman: yeah thats what i want to do, access data that is prepared via a controller
[14:48:59] mrgreenfur: views get data from one controller
[14:49:10] mrgreenfur: so get it allr aedy
[14:49:16] mrgreenfur: if you need stuff across lots of views, make it a helper
[14:49:24] mrgreenfur: or if it’s related to a model, put it in the model
[14:49:51] sharkman: one controller method? couldnt a view access various controller methods to get different types of data that need to be shown?
[14:51:34] fryguy: sharkman: as a general rule of them, it's pretty much always incorrect to manually or expliictly call any method on a class that inherits from ActionController::Base
[14:52:49] frem_: has joined #RubyOnRails
[14:52:52] sharkman: interesting
[14:53:09] mrgreenfur: sharkman: the point of the controller methods are to prepare data for the view. if the view needs other data, it should be in a model, view helper or … in that controller method :)
[14:53:17] artto: has joined #RubyOnRails
[14:53:29] j_mcnally: has joined #RubyOnRails
[14:53:59] Pupeno: has joined #RubyOnRails
[14:54:04] KevinSjoberg: has joined #RubyOnRails
[14:54:12] sharkman: i have an interface that shows a list of results. and the guy who uses my interface told me he wants certain results highlighted. so i figured id put that into the controller and make a helper method to let the view know if it should be highlighted
[14:55:05] sharkman: sorry if im not explaining myself well. am i doing that okay?
[14:55:49] mrgreenfur: hard to say what the right answer is, dpeending on how the highlighting rules change/persist/are complicated
[14:56:03] mrgreenfur: if you want to re-use the rules across views and they don’t change much, a view helper is okay
[14:56:58] mrgreenfur: that is, it should prepare data for the view to acutally do the highlighting presentation (e.g. <blink></blink>)
[14:58:13] sharkman: yup okay cool
[14:58:27] acovrig_: has joined #RubyOnRails
[14:58:50] sharkman: so right now there is a ton of code in this control_controllers view. so i thought maybe id make a new file highlight_rules_controller.rb and put these in there and then have the views access that
[14:58:55] sharkman: is that right? how would i do that?
[14:59:08] sharkman: (*not a TON of code, but it seems appropriate to start factoring it out)
[14:59:48] RegulationD: has joined #RubyOnRails
[14:59:51] mrgreenfur: becuase controlelrs prepare requests not little parts of requests
[15:00:16] The_Phoenix: has joined #RubyOnRails
[15:00:47] sharkman: okay i see thanks
[15:00:52] artto: has joined #RubyOnRails
[15:01:11] The_Phoenix: has joined #RubyOnRails
[15:01:55] jgt3: has joined #RubyOnRails
[15:02:11] The_Phoenix: has joined #RubyOnRails
[15:03:42] eljimmy: has joined #RubyOnRails
[15:03:46] The_Phoenix: has joined #RubyOnRails
[15:04:04] sharkman: can i tell a funny joke in here that is off topic
[15:05:01] The_Phoenix: has joined #RubyOnRails
[15:05:58] The_Phoenix: has joined #RubyOnRails
[15:05:58] hobodave: has joined #RubyOnRails
[15:06:57] kies: has joined #RubyOnRails
[15:07:34] insanedreamer: has joined #RubyOnRails
[15:08:21] qejk: has joined #RubyOnRails
[15:08:58] mvxlr: has joined #RubyOnRails
[15:09:10] chouhoulis: has joined #RubyOnRails
[15:09:58] mvxlr: has joined #RubyOnRails
[15:10:04] zave: has joined #RubyOnRails
[15:11:07] chopin: has joined #RubyOnRails
[15:11:41] Pupeno: has joined #RubyOnRails
[15:12:21] artto: has joined #RubyOnRails
[15:12:49] durexlw_: has joined #RubyOnRails
[15:13:30] epochwolf: sure, why not
[15:13:45] theRoUS`: has joined #RubyOnRails
[15:14:10] czerasz2: has joined #RubyOnRails
[15:14:46] wldcordeiro: has joined #RubyOnRails
[15:15:39] Pazician: has joined #RubyOnRails
[15:17:23] jgt3: has joined #RubyOnRails
[15:17:53] Guest99262: has joined #RubyOnRails
[15:18:20] eljimmy: has joined #RubyOnRails
[15:21:14] jancel: has joined #RubyOnRails
[15:22:04] moeabdol: has joined #RubyOnRails
[15:24:25] blackmesa: has joined #RubyOnRails
[15:25:32] djgraham: has joined #RubyOnRails
[15:27:28] dandaman1: has joined #RubyOnRails
[15:29:35] sharkman: whats the best way to make a ruby variable which equals this text with quotes... '[aria-controls="league-mlb-results"]' ... EXCEPT for i want to replace mlb with an interpolated variable
[15:30:35] fryguy: sharkman: check out %Q{}
[15:30:43] sharkman: sweet thanks fryguy
[15:30:59] fryguy: or know that you can use slashes (\) to escape quotes inside of quoted strings
[15:31:00] bashusr: has joined #RubyOnRails
[15:32:10] mrgreenfur: @epochwolf found somethign weird: https://gist.github.com/benhoxie/785e35dfa31589b855f13b4a84840956
[15:32:20] mrgreenfur: seems like a bug in redis-store but i can’t read that code for the life of me :)
[15:33:13] epochwolf: Where's the code?
[15:33:30] mrgreenfur: to’s just production rails console
[15:33:56] chouhoulis: has joined #RubyOnRails
[15:33:57] mrgreenfur: i can’t parse the code it’s using here: https://github.com/redis-store/redis-activesupport/blob/master/lib/active_support/cache/redis_store.rb#L83
[15:34:09] epochwolf: mrgreenfur: where's the code you're reading in redis-store?
[15:34:33] startupality: has joined #RubyOnRails
[15:34:42] epochwolf: mrgreenfur: it returns false if it's empty.
[15:34:59] mrgreenfur: epochwolf: oh well then it’s working perfectly just kind of consufing
[15:35:06] mrgreenfur: wow my typing is terrible today
[15:35:13] RegulationD: has joined #RubyOnRails
[15:35:24] pressingonalways: has joined #RubyOnRails
[15:35:25] epochwolf: yeah, I agree it's confusing.
[15:36:20] epochwolf: mrgreenfur: note, there's no documented return value. Don't expect the returns to mean anything.,
[15:36:26] disgrntld: has joined #RubyOnRails
[15:36:52] jhack: has joined #RubyOnRails
[15:37:54] mrgreenfur: epochwolf: ok will keep that in mind, confusing when trying to validate it in the console or put it in test cases. thanks again!
[15:39:39] wolfravenous: has joined #RubyOnRails
[15:39:40] sharkman: follow up question fryguy, when i make a ruby variable for instance it = %Q['what is ' this weirdess'] and then put it into .erb file the quotes turn into &#39;
[15:39:48] sharkman: how do i make it not do that
[15:40:27] epochwolf: sharkman: that's because it's doing html escaping, use the raw() helper to skip that.
[15:46:57] rafaelfranca: has joined #RubyOnRails
[15:46:57] rafaelfranca: has joined #RubyOnRails
[15:48:02] shibly: has joined #RubyOnRails
[15:48:11] shibly: has left #RubyOnRails: ()
[15:50:01] njero: has joined #RubyOnRails
[15:51:28] Weavel: has joined #RubyOnRails
[15:52:49] lxsameer: has joined #RubyOnRails
[15:55:36] macsteps: has joined #RubyOnRails
[15:55:43] mdw: has joined #RubyOnRails
[15:58:09] [Butch]: has joined #RubyOnRails
[15:58:38] RegulationD: has joined #RubyOnRails
[15:59:11] davidw: has joined #RubyOnRails
[15:59:47] codeurge: has joined #RubyOnRails
[16:00:30] hobodave_: has joined #RubyOnRails
[16:02:47] Coldblackice: has joined #RubyOnRails
[16:03:23] olegnikitashin: has joined #RubyOnRails
[16:03:28] macsteps: has joined #RubyOnRails
[16:04:24] [Butch]_: has joined #RubyOnRails
[16:05:09] wopi: has joined #RubyOnRails
[16:05:22] moeabdol: has joined #RubyOnRails
[16:05:39] smathy: has joined #RubyOnRails
[16:10:57] mrgreenfur: has joined #RubyOnRails
[16:11:45] Dimik: has joined #RubyOnRails
[16:12:04] ramortegui: has joined #RubyOnRails
[16:14:18] kgrz: has joined #RubyOnRails
[16:16:21] godzillaenlacasa: has joined #RubyOnRails
[16:17:31] artto: has joined #RubyOnRails
[16:21:13] robbyoconnor: has joined #RubyOnRails
[16:23:55] jiblet: has joined #RubyOnRails
[16:25:13] blackmesa: has joined #RubyOnRails
[16:25:53] robbyoconnor: has joined #RubyOnRails
[16:26:01] jiblet: Hello, I have a model1 which has an has_many on model2 and I want to get a list of all model1's which have more than 1 associated model2's, is this the right place for this question?
[16:26:24] jiblet: I know how to do this in SQL but not activerecord
[16:26:36] mrgreenfur: has joined #RubyOnRails
[16:26:37] noobsu: has joined #RubyOnRails
[16:30:04] jgt3: has joined #RubyOnRails
[16:30:33] tubbo: jiblet: yeah definitely. i think you can do `model1.model2s.any?`, believe that doesn't actually run a query. if it *does* run a query, just do `model1.model2s.count > 0` or whatever
[16:30:42] tubbo: a COUNT query is going to be a lot faster, though i think any? does a WHERE EXISTS
[16:30:48] tubbo: which is even faster than COUNT iirc
[16:36:29] n1lo: has joined #RubyOnRails
[16:37:09] stannard: has joined #RubyOnRails
[16:37:52] adgtl: has joined #RubyOnRails
[16:38:45] CJKinni: has joined #RubyOnRails
[16:40:49] tbuehlmann: isn't the solution joining and grouping by model1_id counting model2_ids?
[16:41:47] a346: has joined #RubyOnRails
[16:42:31] gingray: has joined #RubyOnRails
[16:42:56] tubbo: yeah...but i think AR actually can write that query for you
[16:45:11] phrozen77: has joined #RubyOnRails
[16:45:12] Xipho: has joined #RubyOnRails
[16:45:12] Xipho: \nick xipho
[16:45:17] manfrin: has joined #RubyOnRails
[16:47:01] tubbo: xipho: your nick was already xipho :)
[16:48:28] andywww: has left #RubyOnRails: ()
[16:48:36] bronson: has joined #RubyOnRails
[16:48:39] javierbuilder: has joined #RubyOnRails
[16:49:10] hobodave: has joined #RubyOnRails
[16:49:49] freija1: has joined #RubyOnRails
[16:50:02] jancel: has joined #RubyOnRails
[16:51:04] javierbuilder: hello, how can change the colours and style off administrate gem ?
[16:51:28] context: read the administrate docs/code and see?
[16:52:15] blackmesa: has joined #RubyOnRails
[16:53:47] shinnya: has joined #RubyOnRails
[16:54:40] n1lo: has joined #RubyOnRails
[16:55:15] chouhoulis: has joined #RubyOnRails
[16:55:49] macsteps: has joined #RubyOnRails
[16:56:29] wolfravenous: has joined #RubyOnRails
[16:58:52] aegis3121: has joined #RubyOnRails
[16:58:57] smoitra: has joined #RubyOnRails
[16:59:06] alfie_max15: has joined #RubyOnRails
[17:00:54] srinidhi: has joined #RubyOnRails
[17:07:32] Cohedrin: has joined #RubyOnRails
[17:09:07] roshanavand1: has joined #RubyOnRails
[17:12:16] theblang: has joined #RubyOnRails
[17:13:02] idefine: has joined #RubyOnRails
[17:16:37] moei: has joined #RubyOnRails
[17:16:59] mrgreenfur: has joined #RubyOnRails
[17:18:53] lapide_viridi: has joined #RubyOnRails
[17:21:04] CJKinni_: has joined #RubyOnRails
[17:22:28] Pupeno: has joined #RubyOnRails
[17:24:11] RegulationD: has joined #RubyOnRails
[17:24:12] jamto11: has joined #RubyOnRails
[17:26:36] Mia: has joined #RubyOnRails
[17:27:01] j_mcnally: has joined #RubyOnRails
[17:28:10] Axy: has joined #RubyOnRails
[17:29:25] javierbuilder: has left #RubyOnRails: ()
[17:30:11] jancel: has joined #RubyOnRails
[17:30:37] AntiSpamMeta: has joined #RubyOnRails
[17:31:02] ferr: has joined #RubyOnRails
[17:31:29] cabinB: has joined #RubyOnRails
[17:31:35] eljimmy: has joined #RubyOnRails
[17:32:01] chouhoul_: has joined #RubyOnRails
[17:32:51] Pupeno: has joined #RubyOnRails
[17:33:11] cnk: has joined #RubyOnRails
[17:35:33] chouhoul_: has joined #RubyOnRails
[17:36:02] joshua___: Does anyone have much experience with activeAdmin, administrate, and rails_admin? Starting a big project and finding it hard to figure out which is best
[17:36:21] Pupeno_: has joined #RubyOnRails
[17:37:30] pipework: Joshua___: My favorite admin ui is called 'rails'.
[17:37:39] cnk: "best" is very perseon / project dependent. But if you have no guesses based on looking at the docs, I would start by trying administrate because I like Thoughtbot's other open source gems
[17:38:09] cnk: personally my admin UI is generally 'rails scaffold Thing' and then modify
[17:38:10] adaedra: For administration panels, my favorite is still "do it yourself"
[17:38:35] joshua___: Yeah I hear you pipework, thoughbot create some great stuff
[17:38:45] adaedra: Because you too quickly run towards their limitation and they don't bring that much.
[17:39:18] joshua___: adaedra are they quite limiting when you want to do more complex stuff? I'm happy to write my own solution too
[17:40:18] adaedra: when you want to go a path not planned by the panel's code
[17:40:31] noobsu: has joined #RubyOnRails
[17:41:29] joshua___: Right I see, thanks
[17:41:49] yellow5: has joined #RubyOnRails
[17:43:16] akshat: has joined #RubyOnRails
[17:43:20] hahuang65: has joined #RubyOnRails
[17:43:43] alfie_max15: has joined #RubyOnRails
[17:47:53] AntiSpamMeta: has joined #RubyOnRails
[17:51:54] cschneid_: has joined #RubyOnRails
[17:52:45] dopie: has joined #RubyOnRails
[17:52:51] cschneid_: I am writing an api controller - I want a before_filter calling an ApiAuth class with the logic. Is there a way to get at that class after the before_filter is done, so that further on I can ask "oh, what user were you authed as" or similar?
[17:54:47] dopie: Hey all here is my error im getting and im not sure why
[17:54:47] dopie: https://gist.github.com/staycreativedesign/5d6ba9fe8ecf157ca2a430a4e12b2032
[17:54:54] eyeamaye: has joined #RubyOnRails
[17:57:06] j_mcnally: has joined #RubyOnRails
[17:57:37] cnk: dopie: try inlining your make_request and see if that does anything
[17:57:44] mdw: has joined #RubyOnRails
[17:58:46] dopie: cnk, what doe that mean?
[17:59:06] cnk: replace 'make_request' with the post
[17:59:29] cabinB: this is a git question (but since I'm coding ror)... If I want to restore everything back to the last commit, and delete any files created since that time, what is the git command?
[18:00:48] wolfravenous: has joined #RubyOnRails
[18:00:57] cnk: git reset HEAD --hard will do most of it - but will not delete uncommitted files
[18:00:58] kgrz: git reset --hard HEAD^ should help
[18:01:00] Devalo: has joined #RubyOnRails
[18:01:15] cnk: there is a command a full cleanup by you'll have to consult google for that
[18:01:25] noobsu: has joined #RubyOnRails
[18:01:27] dopie: cnk, nope :\
[18:01:32] kgrz: is it HEAD^ or HEAD? I always get confused :/
[18:01:48] cnk: HEAD is the last commit HEAD^ is the one before that
[18:01:52] kgrz: git clean -nf should help cleaning up uncommitted files
[18:02:11] cnk: still complaining about a string ?
[18:02:14] cabinB: cool then I can do git clean and then git checkout and all should be good
[18:02:21] cnk: dopie: ^
[18:02:29] kgrz: the -n flag is for doing a dry run. It won't delete the files, but will output the list of all the files that will get deleted without it
[18:03:02] cabinB: very cool thanks kgrz didn't know that
[18:03:53] cabinB: so for a "real" run it would be git clean -f right?
[18:04:11] kgrz: you can also filter files which need to be deleted. For instance, `git clean -nf -- spec` would remove all the untracked files under spec directory
[18:05:34] cnk: Same error "undefined method 'permit' for "1":String?
[18:05:55] cnk: I would put a print statement in office_params and see what you are getting before that filtering
[18:06:57] cnk: and what is permit!? is that the syntax for permit all attributes office location?
[18:07:14] kgrz: yeah, shorthand for permitting everything
[18:09:16] et0x: has joined #RubyOnRails
[18:09:34] cd83x: has joined #RubyOnRails
[18:10:22] kgrz: try out params.require
[18:10:39] kgrz: sorry, params.slice
[18:10:45] dopie: i know what it is
[18:10:48] cnk: I think it is especting params like {office_location: {attr: 'ting', attr1: 'other'}}
[18:11:06] SPYGAME: has joined #RubyOnRails
[18:11:15] blackmesa: has joined #RubyOnRails
[18:11:27] kgrz: params.require is used for params that has a 2-level structure. Like what cnk mentioned there
[18:11:58] kgrz: if those are the params, then params.require(:office_location) would return {attr: 'ting', attr1: 'other' }
[18:12:54] sharkman: has joined #RubyOnRails
[18:12:58] yellow5: has joined #RubyOnRails
[18:13:01] kgrz: but if you have a 1-level structure for params like { office_location: 'ting'}, then params.require(:office_location) would return a string 'ting'. params.slice(:office_location) would return a parameter hash instead that has the method permit! defined on it
[18:13:03] circuit_eight: has joined #RubyOnRails
[18:13:04] digitalfiz: has joined #RubyOnRails
[18:13:31] digitalfiz: hey guys i am a devops dude trying to set up a travis build for a ruby app and was wondering is there a way to make the app not require the database when running unit tests?
[18:13:32] kgrz: http://api.rubyonrails.org/classes/ActionController/Parameters.html#method-i-slice
[18:14:11] kgrz: but they have slightly different functionality, you've been warned :)
[18:14:18] SPYGAME: has joined #RubyOnRails
[18:14:21] mdw: has joined #RubyOnRails
[18:14:29] kgrz: slice won't throw an error if key is not found. require throws an error.
[18:14:31] jenrzzz: has joined #RubyOnRails
[18:15:37] emilkarl: has joined #RubyOnRails
[18:16:32] dopie: ok makes sense
[18:16:46] mrgreenfur: Can anyone recommend a framework for javascript test cases that they like?
[18:17:03] mrgreenfur: I’m using rails for my preprocessor and a testing UI
[18:17:11] dopie: OfficeLocation(id: integer, name: string, address: string, city: string, state: string, zipcode: string, email: string, user_id: integer, created_at: datetime, updated_at: datetime)
[18:17:57] adgtl: has joined #RubyOnRails
[18:18:18] epochwolf: digitalfiz: generally not, you can use sqlite though, doesn't require a daemon running.
[18:18:19] davidw: has joined #RubyOnRails
[18:18:28] pawnbox: has joined #RubyOnRails
[18:18:33] circuit_eight: Does anyone here use disqus with rails, and whats the best commenting gem solution in your opinions?
[18:18:49] epochwolf: digitalfiz: assuming they aren't testing some database specific things.
[18:19:16] digitalfiz: epochwolf: they are not i think its 100% AR models so that will probably work
[18:19:19] IrishGringo: has joined #RubyOnRails
[18:19:21] digitalfiz: ill look into it thanks
[18:19:36] epochwolf: digitalfiz: rails has some postgres specific features in AR. :)
[18:20:11] digitalfiz: well i at least have a path
[18:20:13] epochwolf: They are optional. Rails doesn't require you use postgres.
[18:20:15] digitalfiz: devs just said no lol
[18:20:25] epochwolf: digitalfiz: no to what?
[18:20:37] digitalfiz: that there was no way around it
[18:20:54] digitalfiz: IF thats true i need why though
[18:21:11] dopie: needed Fabricate_attributes_for
[18:21:13] B1n4r10: has joined #RubyOnRails
[18:21:32] epochwolf: digitalfiz: there isn't a good way to mock operations at the DB level without a database, so rails just assumes it's there if you're testing AR.
[18:21:34] VeryBewitching: has joined #RubyOnRails
[18:21:43] Pupeno: has joined #RubyOnRails
[18:22:28] Devalo_: has joined #RubyOnRails
[18:23:25] njero: OMG.. HTTP HEADERS...
[18:23:34] epochwolf: n_e_o: back in your hole.
[18:23:35] jancel: has joined #RubyOnRails
[18:23:44] dopie: Quick question, would i use HMT association or this...
[18:24:05] dopie: A user has one office location but there as many office_locations
[18:24:14] dopie: would that be a normal belongs_to ?
[18:24:32] njero: while playing with cache, i set cache to public,, when will these dump proxies clear that cache :(
[18:24:48] dopie: I did a user has_one office_location, office_location belongs_to user
[18:25:24] njero: epochwolf: ;)
[18:25:50] epochwolf: n_e_o: depends on the proxy's settings. If it's misconfigured, never.
[18:26:18] dopie: The thing is the user is made first and then the admin sets the office_location
[18:26:43] njero: epochwolf: is that something i have control? i mean i use aws ec2
[18:28:35] jheathco: has joined #RubyOnRails
[18:29:05] jheathco: has joined #RubyOnRails
[18:30:00] eyeamaye1: has joined #RubyOnRails
[18:30:42] beauby: has joined #RubyOnRails
[18:31:14] epochwolf: n_e_o: are you running a proxy in front of your servers?
[18:32:11] njero: epochwolf: nope.. just single ec2 instance
[18:32:37] epochwolf: n_e_o: then you have little to no control.
[18:32:41] njero: epochwolf: with standalone passenger
[18:32:51] njero: amazing..
[18:33:41] Oliphaunte: has joined #RubyOnRails
[18:33:44] crdpink: has joined #RubyOnRails
[18:34:38] DoctorMonocular: has joined #RubyOnRails
[18:35:28] AndroidLoverInSF: has joined #RubyOnRails
[18:36:00] chipotle: has joined #RubyOnRails
[18:36:16] eyeamaye: has joined #RubyOnRails
[18:36:46] sharkman: if i have a rails button on an internet page that gets clicked, and it runs a job on the backend that takes a few minutes to run, how would i set it up to refresh the web page AFTER that back end job finishes?
[18:38:27] tubbo: sharkman: open a persistent websocket connection when the page loads, and push data down the pipe when the backend job finishes, then bind a JS event to refresh the page when that data is received on the websocket connection.
[18:38:51] tubbo: sharkman: this is, at least partially, the problem that tools such as ActionCable or Faye solve.
[18:39:46] robbyoconnor: has joined #RubyOnRails
[18:39:55] Malgorath: has joined #RubyOnRails
[18:39:58] sharkman: interesting. there is just a small piece of data displayed through a render that i want updated when the job is done. another option i have is to just continually refresh that one piece of data. is there a preference for which method i should choose?
[18:42:02] njero: sharkman: depends on your scale of users. It'll be a nightmare for facebook that kind of shortcut.
[18:42:28] sharkman: its a private thing, just needs to handle a few uses
[18:42:36] durexlw: has joined #RubyOnRails
[18:42:46] bazzy: is routing "resources" only good for scaffolds or CRUD controllers?
[18:42:57] AndroidLoverInSF: has joined #RubyOnRails
[18:43:04] klbzz1: has joined #RubyOnRails
[18:43:04] durexlw: bazzy: what do you mean?
[18:43:19] tubbo: sharkman: honestly, if you're not using Rails 5 setting up a whole websockets system is probably not worth the work. if i were you, i'd just make periodic ajax requests.
[18:43:22] bazzy: I'm not I understand them to begin with :3
[18:43:27] bazzy: http://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/Resources.html
[18:43:28] tubbo: sharkman: and poll for changes
[18:43:58] sharkman: thanks tubbo. ive never done ajaz either haha nether will be easy for me. but ill start out checking out ajax
[18:44:07] tubbo: bazzy: restful resource routing is for controllers that respond to the following methods: index, new, show, edit, create, update, destroy.
[18:44:11] rafaelfranca: has joined #RubyOnRails
[18:44:11] rafaelfranca: has joined #RubyOnRails
[18:44:18] tubbo: bazzy: s/methods/actions. that's about most of what you need to know.
[18:44:51] bazzy: tubbo, is it permissable to consider that as a "CRUD" controller? and that controller may have other actions too?
[18:44:54] tubbo: sharkman: well, i can guarantee you that websockets will be harder because you need to learn another library to get it working, whereas with ajax you can just do it with the tools you're already using.
[18:45:06] sharkman: okay thanks tubbo gonna check out the ajax
[18:45:08] celly: has joined #RubyOnRails
[18:45:13] robbyoconnor: has joined #RubyOnRails
[18:45:53] tubbo: bazzy: definitely. the rails routing DSL will let you add new routes to the default CRUD actions in `resources`.
[18:46:19] srinidhi: has joined #RubyOnRails
[18:47:07] aegis3121: has joined #RubyOnRails
[18:47:49] edwinvdgraaf: has joined #RubyOnRails
[18:48:19] durexlw: bazzy: a simple example can be a "pages" controller... it could have a "home" method, driving you to the pages/home view... so a static page that contains your html for the home page
[18:50:06] bazzy: I don't see how that has to do with "resources" but I think tubbo explained it already.. although I don't yet understand the full power of "resources" I see you can even attach parameters to their declaration for some purpose
[18:50:24] davidw: has joined #RubyOnRails
[18:50:33] idefine: has joined #RubyOnRails
[18:50:34] chouhoulis: has joined #RubyOnRails
[18:51:30] wigust: has joined #RubyOnRails
[18:51:52] alaing: has joined #RubyOnRails
[18:52:07] blackmesa: has joined #RubyOnRails
[18:54:09] durexlw: bazzy: I misread the question. The resources are more "use one line to explode in multiple routes to common methods"
[18:54:27] tubbo: it's basically a convention for something you probably do/should probably be doing already
[18:55:18] idefine: has joined #RubyOnRails
[18:56:01] durexlw: a resource can be considered as a model of a real world item. And to interact with that model, you need database traffic: reading, updating, deleting... so a resource in a routes file is just "give me all routes to the common actions to interact with my models (that represent a real life thing)"
[18:58:22] nzst: has joined #RubyOnRails
[19:00:18] nzst: Any good documentation on self-referentail associations for rails 4?
[19:05:01] tgeeky: any idea on how to systematically tell rails to use the full name of a field with _id in it?
[19:05:10] tubbo: nzst: not that i know of, but check out the awesome_nested_set gem for a decent implementation of such a thing
[19:05:16] tubbo: tgeeky: what do you mean?
[19:05:22] tgeeky: i have a table called Contacts with an (indexed) field .peachtree_id
[19:05:23] edwinvdgraaf: has joined #RubyOnRails
[19:05:29] tgeeky: and it wants to call it Peachtree
[19:05:44] tgeeky: .peachtree_id is the primary key for the table
[19:05:48] tgeeky: it's a legacy db
[19:06:10] tubbo: tgeeky: ah ok, yeah...you can add an option to the `belongs_to`, like `belongs_to :contact, foreign_key_id: :peachtree_id`.
[19:06:12] edwinvdgraaf: has joined #RubyOnRails
[19:06:39] tgeeky: oh, yes, when I get there. but how do I make the scaffolding do the right thing for the Contact table itself?
[19:06:42] cnk: You can also define the field name for the primary key when defining the Peachtree class
[19:06:43] tgeeky: or just correct it by hand?
[19:06:52] tgeeky: there is no Peachtree class :o
[19:07:01] tubbo: tgeeky: don't use the scaffolding.
[19:07:12] nzst: tubbo: thanks, will do
[19:07:14] tgeeky: but my levels of noobiness are this high
[19:07:21] tgeeky: i figured that was the answer, so I'll do it that way
[19:07:21] cnk: tell contacts its primary key is peachtree_id
[19:07:59] njero: Hey, i'm trying to provide etag and last-modified headers for static page. Localhost running with puma seems works fine and browser gets a 304, however on server with passenger standalone it's not providing a 304. https://gist.github.com/NeoElit/dd8d9f22142db12cee077723b7cd8bf5
[19:08:03] tgeeky: i'm surprised it didn't figure that out, given that it was in the schema
[19:08:28] tubbo: tgeeky: rails/AR operates off of convention, so while these things are configurable AR makes it a lot easier to just work with conventions than to configure things all over the place.
[19:08:50] tgeeky: tubbo: yeah, I get it. Rails wasn't designed to be built around a legacy db.
[19:08:57] tubbo: ruby and rails make simple things easy, and adding complexity hard.
[19:09:00] tgeeky: unfortunately, as always, I haven't a choice.
[19:09:05] tubbo: definitely
[19:09:07] edwinvdg_: has joined #RubyOnRails
[19:09:16] tubbo: i do a lot of client work and pretty much everyone has a legacy DB
[19:09:34] tgeeky: well my legacy DB is actually my target. a different legacy DB is the source, and it's DBF
[19:09:38] tgeeky: so it's not really accessible with rails
[19:09:46] tubbo: i feel like it's a fool's errand to rebuild a rails app using a legacy DB. instead, one should actually convert the database to the new data model.
[19:10:01] tgeeky: tubbo: I can't. There is a Windows GUI program that works directly off the DB.
[19:10:29] tubbo: the problem with building a rails app around a legacy DB is that your app is limited by how good the legacy data model is, which is typically not very good.
[19:10:32] tgeeky: i'm building an extract-transform-load tool from an older legacy DB to this legaby db
[19:10:35] tgeeky: tubbo: yeah
[19:10:45] tgeeky: well, luckily, I only need access to about 5 or 6 of the 120 tables.
[19:11:00] tgeeky: so it's not a nightmare from elm street, just a nightmare from jenny's block
[19:11:14] tubbo: doubling down on the 80s references, nice
[19:11:29] cnk: Well there are config options for most stuff. Or you could look into substituting Sequel for ActiveRecord
[19:11:49] tgeeky: cnk: yeah. I have considered sequel.
[19:12:03] tgeeky: I wanted to see what kind of instant-up ActiveRecord would give me in terms of errors and whatnot
[19:12:19] cnk: I have done a bunch of work iwth legacy dbs in AR so it is doable
[19:12:35] cnk: Do you need read and write? or just read?
[19:12:41] tgeeky: basically, this program is to sync a very old database to a new one, but the sync process is simplified based on assumptions (like, of the 136 columns in the Contacts table in the old database, they never used about 60 of them)
[19:13:00] tgeeky: well, my gem that gives me access to the source (.dbf file -- Foxpro) is READ only anyway
[19:13:09] tgeeky: so i told my customer that, for the time being, I wasn't going to tackle that.
[19:13:14] tgeeky: (write access to there)
[19:13:27] tgeeky: so it's a one-way sync, with error reporting that says what WOULD be synced in the other direction
[19:13:28] cnk: hmmmm so creating database views is out
[19:13:52] tgeeky: so the whole GUI will just be a list of things this program would try to do, but can't
[19:14:01] tgeeky: and we're going to see if we can get off the old program entirely
[19:14:11] smoitra_: has joined #RubyOnRails
[19:14:32] tgeeky: i've got about 16k Customers->Contacts
[19:14:41] tgeeky: and about 200k Jobs/WorkOrders -> WorkOrders
[19:14:58] tgeeky: new database is Microsoft SQL Server 2012
[19:16:15] tgeeky: i *really* wanted to try Rails Composer
[19:16:20] tgeeky: to see what kind of scaffolding that thing could whip up
[19:16:23] noobsu: has joined #RubyOnRails
[19:16:36] tgeeky: but it wouldn't work properly for a reason I ran out of time to figure out
[19:17:38] cnk: tgeeky: not this rails composer? http://www.railscomposer.com/
[19:18:02] tgeeky: cnk: yeah, there is a .rb file behind all of that... one sec
[19:18:34] tgeeky: https://github.com/RailsApps/rails_apps_composer
[19:18:36] tgeeky: see 'options'
[19:18:39] tgeeky: where you get to choose each step
[19:18:52] tgeeky: wrong link!
[19:19:00] godzillaenlacasa: has joined #RubyOnRails
[19:19:20] tgeeky: https://github.com/RailsApps/rails-composer#options
[19:19:24] tubbo: tgeeky: 99% sure that gem hasn't been updated in *years*
[19:19:26] tubbo: like since rails 3.x
[19:19:32] tgeeky: tubbo: this one I just linked
[19:19:50] tgeeky: i mainly wanted: zurb 5
[19:20:04] tgeeky: and one of the other options not listed there
[19:20:16] jancel: has joined #RubyOnRails
[19:20:29] tubbo: tgeeky: i used to be into that but recently, i've been more into using the generic rails app templates: http://guides.rubyonrails.org/rails_application_templates.html
[19:20:42] tubbo: tgeeky: especially if all you need is a gem and to run a generator after_bundle..
[19:21:17] tgeeky: ah yes, I could see how that would be useful
[19:21:22] Oliphaunte: has joined #RubyOnRails
[19:25:07] tgeeky: grr, now another issue related to legacy.
[19:26:10] jamto11: has joined #RubyOnRails
[19:27:57] methcook_: has joined #RubyOnRails
[19:28:53] methcook_: I had a problem when deploying the rails on heroku.
[19:29:31] methcook_: it shows "Application error"
[19:29:40] methcook_: What might be the problem ?
[19:29:46] methcook_: Can anyone help ?
[19:30:08] chouhoulis: has joined #RubyOnRails
[19:30:15] tgeeky: methcook_: almost surely gonna need more info than that
[19:30:37] allcentury: has joined #RubyOnRails
[19:31:07] methcook_: tgeeky, yeah so when you push your sample app on heroku and when you open up the domain
[19:31:17] GodFather: has joined #RubyOnRails
[19:31:19] methcook_: after that it shows the error
[19:31:28] methcook_: https://thawing-atoll-69590.herokuapp.com/
[19:31:50] methcook_: tgeeky, you can see the error here.
[19:32:13] tgeeky: methcook_: look at the application logs
[19:32:17] jenrzzz: has joined #RubyOnRails
[19:32:18] tgeeky: looks like heroku setup problems
[19:32:23] celly: has joined #RubyOnRails
[19:32:27] tgeeky: i can't help you actually, but I was just pointing out that 'application error' was not enough
[19:32:34] tgeeky: methcook_: you might try #heroku also
[19:33:07] methcook_: ohkay, btw thanks!
[19:35:03] zave: has joined #RubyOnRails
[19:36:47] idefine_: has joined #RubyOnRails
[19:37:30] tubbo: yeah definitely sounds like you need to run `heroku logs` and take a look
[19:39:00] maxx88: has joined #RubyOnRails
[19:40:53] methcook_: has left #RubyOnRails: ("Leaving")
[19:41:07] adre: has joined #RubyOnRails
[19:41:09] r0bby_: has joined #RubyOnRails
[19:42:01] lxsameer: has joined #RubyOnRails
[19:42:02] lxsameer: has joined #RubyOnRails
[19:42:07] matthias_: has joined #RubyOnRails
[19:44:07] wolfravenous: has joined #RubyOnRails
[19:45:10] yellow5: has joined #RubyOnRails
[19:46:47] r0bby_: has joined #RubyOnRails
[19:48:21] rockhardstar: has joined #RubyOnRails
[19:50:05] akshat_: has joined #RubyOnRails
[19:53:19] judetucker: has joined #RubyOnRails
[19:53:52] rockhardstar: Hello. I have a small project where I've created a single controller called 'search, and a route to search#index, with the corresponding search/index.html.erb view. This all works properly. I have defined a function in app/assets/javascripts/search.js which I plan to use as an onsubmit function inside of search/index.html.erb, but for some reason it won't bind.
[19:54:02] judetucker: has left #RubyOnRails: ()
[19:54:04] rockhardstar: I have verified that the javascript file is executing on view load.
[19:54:45] dmz: has joined #RubyOnRails
[19:54:54] rockhardstar: I have verified that rails sets up a script src line for the corresponding javascript asset in the index.html.erb DOM.
[19:54:56] cnk: rockhardstar: you will need to show code
[19:55:58] jhack: has joined #RubyOnRails
[19:56:03] rockhardstar: cnk: http://sprunge.us/QAcL?js and http://sprunge.us/PaAi?html
[19:58:02] r0bby_: has joined #RubyOnRails
[19:58:32] durexlw: laterz all
[19:58:46] tgeeky: when I get the irb-like console on a webpage at the bottom
[19:58:57] pipework: webconsole, right
[19:59:03] rockhardstar: cnk: it's very simple.
[19:59:06] tgeeky: and *everything* I enter gives "NoMethodError: private method 'eval' called for nil"
[19:59:12] tgeeky: what should I think?
[19:59:29] macsteps: has joined #RubyOnRails
[19:59:29] cnk: rockhardstar: I assume you say won't bind because you have a log in that function that isn't firing
[19:59:29] tekk: has joined #RubyOnRails
[19:59:44] cnk: 'cause right now, doing nothing is what the code should do
[19:59:47] cnk: console.log
[19:59:51] wolfravenous_: has joined #RubyOnRails
[20:00:16] rockhardstar: i say it won't bind because it doesn't prevent the submit event
[20:00:21] rockhardstar: event.preventDefault(); should event that submission
[20:00:37] pawnbox: has joined #RubyOnRails
[20:01:20] pawnbox: has joined #RubyOnRails
[20:01:23] jgt3: has joined #RubyOnRails
[20:01:42] m_antis: has joined #RubyOnRails
[20:02:13] rockhardstar: the only thing i could think is that the html code can't find that function at the time of relation, but it seems that the script is src'd inside of <head>, so i'm a bit confused
[20:03:10] cnk: well your options are console.log or breakpoints in the browser debugger
[20:04:53] rockhardstar: cnk: http://sprunge.us/IEMR?js this code binds properly
[20:05:01] rockhardstar: but only when inside window.onload as present
[20:05:24] jstransky: has joined #RubyOnRails
[20:06:44] ctrlrsf: has joined #RubyOnRails
[20:06:52] cnk: interesting
[20:07:10] flopsec: has joined #RubyOnRails
[20:07:39] cnk: any reason you are building html forms by hand instead of with the rails form_for?
[20:07:53] pawnbox: has joined #RubyOnRails
[20:08:01] DoctorMonocular: has joined #RubyOnRails
[20:08:08] rockhardstar: i'm fairly new to rails, so i was just doing what i knew
[20:08:25] rockhardstar: should it make a difference?
[20:08:44] pipework: rockhardstar: !gettingstarted
[20:08:44] helpa: rockhardstar: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy and Ryan Bigg
[20:08:52] pipework: !formbuilder
[20:09:21] rockhardstar: i don't see why using form_for against using a vanilla html form would make a difference in this case.
[20:09:42] rockhardstar: the form is about as simple as they get.
[20:10:59] maxx88: has joined #RubyOnRails
[20:11:04] mbreedlove: has joined #RubyOnRails
[20:12:46] cnk: rockhardstar: agreed. Let us know when you have figured out why you are not seeing binding
[20:13:27] rockhardstar: thanks for the effort, i'll report back asap
[20:13:46] tubbo: rockhardstar: the only difference is that rails ujs provides some facilities for remote form rendering in the page
[20:14:30] jancel: has joined #RubyOnRails
[20:14:48] stannard: has joined #RubyOnRails
[20:15:03] Maletor: has joined #RubyOnRails
[20:15:13] zel: has joined #RubyOnRails
[20:15:23] alaing: Hi, I'm having problems with associations. Rubymine cannot find one of my models. Here is a gist of tables, models, specs and results https://gist.github.com/aliuk2012/1891d2a32067d8b6c8711401466da6f2
[20:16:43] celly: I'm trying to get the cancancan gem working with my app (which uses devise and omniauth). i'm a little lost, though. I'm not sure how to handle the cancancan authorization for when a user authenticates using omniauth.
[20:19:26] brunto: has joined #RubyOnRails
[20:21:22] P4Titan: has joined #RubyOnRails
[20:21:29] alaing: is there a restriction on the length a model name can be?
[20:21:42] alaing: DocumentAttachmentType
[20:22:02] pipework: alaing: AsLongAsYouWantBruv
[20:22:11] tgeeky: filesystem length restriction
[20:22:11] jhack: has joined #RubyOnRails
[20:22:12] tgeeky: if there is one
[20:22:20] emptyflask: has joined #RubyOnRails
[20:22:22] pipework: Depends on your FS then
[20:22:34] alaing: I just dont know why Rails cant find my model
[20:22:42] tubbo: alaing: the filename is wrong
[20:22:44] pipework: Also, it could depend on your shell too, but that's mostly only going to happen if you try.
[20:22:49] tubbo: ACTION is clairvoyant
[20:22:57] alaing: and associate the two models
[20:23:13] P4Titan: Hello all. I have a solution where I have data set in `session` by one controller. I display a link which is connected to different controller, yet in the handler function, `session` has no contents. Would anyone know as to why?
[20:23:26] pipework: tubbo: The only kind of 'voyant' you are is eclairvoyant, you tubbo.
[20:24:11] alaing: tubbo: well spotted but that was just a mistake i introduced when i created the gist
[20:25:28] alaing: back up.....tubbo which file?
[20:25:42] tubbo: alaing: i didn't even look at your gist, there's just a limited amount of reasons why that error could happen and the most common one is you named the file differently than the class.
[20:25:51] tubbo: or you changed the class's name without changing the file's name
[20:26:26] P4Titan: Would anyone have an idea for my issue?
[20:27:30] cnk: P4Titan: show code
[20:27:31] alaing: tubbo: ah yes I've had that before I've used rails generate model and haven't renamed any of the files
[20:27:47] rockhardstar: cnk: found out
[20:28:03] cnk: rockhardstar: ahh what?
[20:28:26] Craigimus: has joined #RubyOnRails
[20:28:40] alaing: for some odd reason Rubymine doens't like the document_attachment_type.rb file. It doesn't have syntax highlighting and the little icon next to the filename isn't a ruby icon
[20:28:44] rockhardstar: cnk: the issue was that i was trying to use the 'event' parameter in the submission function, but as illustrated in the correct answer here http://stackoverflow.com/questions/16262797/html-form-action-and-onsubmit-issues without jquery there's a different method for stopping the event
[20:28:51] rockhardstar: for a submission, at least
[20:28:56] idefine: has joined #RubyOnRails
[20:29:11] tubbo: alaing: ah sorry i read your full question and that's not a rails problem, it's a rubymine problem.
[20:29:21] tubbo: honestly i've never used rubymine
[20:29:51] tubbo: please make sure to be more specific next time, you've been in here long enough to know the difference between rubymine and rails...
[20:30:32] tubbo: also the error you're getting "(DocumentAttachment does not have a document_attachment_type_id foreign key.)" has nothing to do with class loading, and everything to do with a faulty schema.
[20:30:39] alaing: tubbo: but my spec fails so rails is't picking it up either
[20:30:42] tubbo: like it seems your db isn't migrated properly, because that field doesn't exist.
[20:30:48] rockhardstar: so, rails was working as intended, but the javascript was erroneous.
[20:30:54] tubbo: alaing: you ever read the error message in your spec? they tend to be very informative...
[20:31:07] alaing: lol, yes I have
[20:31:22] tubbo: "DocumentAttachment does not have a document_attachment_type_id foreign key." is not "cannot load such file" or "no such file to load" or "uninitialized constant".
[20:31:26] xall: has joined #RubyOnRails
[20:31:37] P4Titan: cnk: https://gist.github.com/anonymous/35a65df2407550df81d217cf0a41dee1
[20:31:51] wolfravenous: has joined #RubyOnRails
[20:31:59] tubbo: alaing: it tells you, specifically, that :document_attachment_type_id isn't in the schema for some reason. did you make sure to rake db:migrate?
[20:32:41] P4Titan: in link_linker_job, I send the respective user a notification with a url, of which that goes to a controller that I would like to access `session`
[20:32:52] alaing: should the column name be singular or plural?
[20:32:59] djbkd: has joined #RubyOnRails
[20:33:14] jenrzzz: has joined #RubyOnRails
[20:34:07] alaing: tubbo should the column name be singular or plural?
[20:34:26] alaing: I'm thinking the id would be singular
[20:34:41] tubbo: yeah it's gonna be singular
[20:35:02] netzfisch: has joined #RubyOnRails
[20:35:04] P4Titan: alaing: This doc may be useful: http://guides.rubyonrails.org/active_record_migrations.html
[20:35:15] sneakerhax: has joined #RubyOnRails
[20:35:37] P4Titan: Though, anyone thoughts on my code?
[20:36:14] cnk: P4Titan: I don't see anything about session in link_linker_job
[20:37:02] P4Titan: link_linker_job creates a notification with a url to review_requests_controller.rb
[20:37:12] P4Titan: and there, session contains all nil
[20:37:31] P4Titan: line 33 of link_linker_job.rb creates the notif
[20:38:24] cnk: I am pretty sure that clicking in a link in a notification starts a new session
[20:38:45] cnk: Unelss you have database sessions
[20:39:18] ur5us: has joined #RubyOnRails
[20:39:25] djbkd: has joined #RubyOnRails
[20:41:23] alaing: tubbo: thanks I'll have a read, I've just done a db:drop, db:create and db:migrate and still have the same errors
[20:41:27] cnk: P4Titan: you might be able to get what you want working but it is going ot be unreliable because sessions are ephemeral I think you need to persist the info you want in the notification so it is there if a user logs out and back in again
[20:41:50] alaing: tubbo: i've add part of my schema to the gist as well
[20:42:00] P4Titan: cnk: I see
[20:42:10] P4Titan: tho do u know why the link creates a new session?
[20:42:13] P4Titan: by chance?
[20:43:43] damireh: has joined #RubyOnRails
[20:50:22] cnk: You will have to verify that assumption by watching the cookie setting in your browser
[20:52:57] matthias_: has joined #RubyOnRails
[20:54:28] DoctorMonocular: has joined #RubyOnRails
[20:57:25] alaing: I bet its something like a typo
[20:59:14] Terens: I am using spree and it defines some routes through that
[20:59:25] Terens: is there a way to disable a route ? =>404
[21:00:41] cnk: disable one of the spree routes?
[21:01:17] cnk: probalby the easiest thing is to try to define a duplicate route with higher precidence to intercept and send where you want
[21:02:29] alaing: Hi, I'm having problems with associations. Rubymine cannot find one of my models and I have failing specs. Here is a gist of tables, models, specs and results https://gist.github.com/aliuk2012/1891d2a32067d8b6c8711401466da6f2
[21:03:41] djbkd: has joined #RubyOnRails
[21:03:59] djbkd: has joined #RubyOnRails
[21:04:38] visionary: has joined #RubyOnRails
[21:05:42] visionary: any advice on setting up a json rest api?
[21:07:28] pipework: "Take chances, make mistakes, get messy!" – Ms.Frizzle
[21:08:12] visionary: Started playing with Rails 5 api-only
[21:08:27] eljimmy: has joined #RubyOnRails
[21:08:33] visionary: Any thoughts on that vs using Rails 4?
[21:08:41] nofxx: has joined #RubyOnRails
[21:08:53] nofxx: has joined #RubyOnRails
[21:09:36] cnk: How experienced are you and what are your deadlines?
[21:09:52] jancel: has joined #RubyOnRails
[21:09:59] m_antis: has joined #RubyOnRails
[21:10:01] cnk: I would try 5 to avoid having to upgrade later. but YMMV
[21:10:07] DoctorMonocular: has joined #RubyOnRails
[21:10:13] Craigimus: has joined #RubyOnRails
[21:10:48] flashpoint9: has joined #RubyOnRails
[21:10:54] hashtd: has joined #RubyOnRails
[21:11:55] akshat: has joined #RubyOnRails
[21:12:00] visionary: I have get working. Trying to figure out post.
[21:12:42] tgeeky: so I have some things partially working, but I'm wondering: does rails depend on a migration happening, or can I always just rely on db/schema.rb
[21:14:56] Craigimus: has joined #RubyOnRails
[21:14:59] tgeeky: that is to say: do i have to create an empty migration?
[21:15:00] eljimador: has joined #RubyOnRails
[21:15:04] visionary: As I recall migration is the way to go.
[21:15:14] tgeeky: i don't *actually* want to change the database though
[21:16:23] visionary: guessing you should be fine then
[21:17:21] startupality: has joined #RubyOnRails
[21:17:34] HenriettaSalt: has joined #RubyOnRails
[21:18:50] Craigimus: has joined #RubyOnRails
[21:20:48] GodFather: has joined #RubyOnRails
[21:20:56] gingray: has joined #RubyOnRails
[21:21:26] smathy: alaing, maybe it's getting confused with polymorphic association because of the `_type` suffix.
[21:24:08] Mia: has joined #RubyOnRails
[21:24:08] Mia: has joined #RubyOnRails
[21:25:00] netzfisch: has joined #RubyOnRails
[21:25:10] mbreedlove: has joined #RubyOnRails
[21:25:45] wbs_: I am having a hard time figuring out how stream_for is used in AC, anyone know of any good posts for usecases?
[21:27:12] Axy: has joined #RubyOnRails
[21:29:02] mbreedlove: has joined #RubyOnRails
[21:29:13] kgrz: has joined #RubyOnRails
[21:30:19] jhack: has joined #RubyOnRails
[21:30:54] djbkd: has joined #RubyOnRails
[21:31:55] eyeamaye1: has joined #RubyOnRails
[21:32:38] ma489: has joined #RubyOnRails
[21:32:58] SteenJobs: has joined #RubyOnRails
[21:33:06] mbreedlove: has joined #RubyOnRails
[21:33:27] SteenJobs: does anyone know if there’s a best practice of sorts for resending an email confirmation when using devise :confirmable
[21:33:37] ma489: has left #RubyOnRails: ("Ex-Chat")
[21:33:40] pipework: ensure delivery
[21:33:49] mbreedlove: has joined #RubyOnRails
[21:33:56] alaing: thanks smathy, I think it was confused about something. I've just renamed it to doc_attachment and doc_attachment_type and it seems to like it now
[21:34:28] SteenJobs: pipework: that’s not the reason we need to resend
[21:34:47] SteenJobs: but nevermind, i looked through devise’s methods list and think i found st
[21:35:02] smathy: alaing, cool.
[21:35:42] tlaxkit: has joined #RubyOnRails
[21:36:02] SteenJobs: also - does devise generate a new token when resending? when testing it manually, it seemed like it was the same token
[21:36:06] SteenJobs: but the code seems to indicate otherwise
[21:36:15] pipework: SteenJobs: It was a joke because 'best practice' is a funny term to use to not say, "I'm not sure how to do this, does anyone else do this?" :D
[21:36:25] SteenJobs: pipework: haha but i do know how!
[21:36:34] edwinvdgraaf: has joined #RubyOnRails
[21:36:35] SteenJobs: there are just too many ways that come to mind, most of which are hacky
[21:36:41] SteenJobs: so was hoping for something a bit cleaner
[21:38:52] SteenJobs: pipework: heh, turns out there’s a really simple way!
[21:39:20] pipework: SteenJobs: yay! Because it tends to only go two ways on that, you know? :D
[21:39:35] SteenJobs: pipework: haha yea totally
[21:39:56] SteenJobs: pipework: i usually ask for best practices in particular when i’m too overwhelmed by differeing options so instead i ask the best
[21:40:19] SteenJobs: it’s intersting how very often reading through the source of a library offers much more elegant answers than asking other people?
[21:40:28] chipotle_: has joined #RubyOnRails
[21:40:58] pipework: SteenJobs: I'm just persnickety, the phrase I'd use is "cleanest and simplest way" over whatever the fuck 'best practices' is. Best practices used to be taking a crap in the street with all the other refuse and bodily excretions.
[21:41:32] SteenJobs: deal. i’ll adopt a similar practice
[21:42:09] sharkman: has joined #RubyOnRails
[21:42:30] deur-_: has joined #RubyOnRails
[21:43:03] yfeldblum: has joined #RubyOnRails
[21:43:43] SteenJobs: pipework: i saw all these workarounds, so i read through the source code and lo and behold there’s a method called “resend_confirmation_instructions” haha
[21:44:07] SteenJobs: which simply belongs to confirmable.rb model, so if your user model is confirmable, then there you have it
[21:52:56] bronson: has joined #RubyOnRails
[21:58:03] netzfisch: has joined #RubyOnRails
[22:00:39] mbreedlove: has joined #RubyOnRails
[22:02:07] StaticVoid: has joined #RubyOnRails
[22:04:22] neshmi: has joined #RubyOnRails
[22:05:00] jenrzzz_: has joined #RubyOnRails
[22:06:25] patie: has joined #RubyOnRails
[22:14:07] r0bby_: has joined #RubyOnRails
[22:14:14] wilsonc91: has joined #RubyOnRails
[22:14:33] wilsonc91: has joined #RubyOnRails
[22:14:34] mrgreenfur: I’m getting started with teaspoon for js test cases, anyone know a secret to getting around the ol “Asset was not declared to be precompiled in production” problem?
[22:14:48] mrgreenfur: I’d rather not put every js file name into the asset precompilation ...
[22:15:22] wilsonc91: Kind of a dumb question - I have a model, and I'd like to include it in a module to use a fucntion on it. Is it as simple as doing include modelName?
[22:15:41] smathy: mrgreenfur, you only have two options, put them in a manifest or list them in the precompile list.
[22:16:08] smathy: (unless this is something specific to the test environment, and then !Rails ;)
[22:16:44] HenriettaSalt: has joined #RubyOnRails
[22:16:50] mrgreenfur: nah, it’s rails testing
[22:16:54] mrgreenfur: i have a manifest for client.js
[22:17:05] mrgreenfur: but it still wants me to add the assets.precomiple +=… line for all the .js files inside it
[22:17:26] mrgreenfur: alrady have this config.assets.precompile += %w( client.js )
[22:17:54] mrgreenfur: what am I missing?
[22:18:44] smathy: mrgreenfur, most like that this JS test environment is loading the file individually, and hence triggering that check in Rails.
[22:19:01] mrgreenfur: ah, so i should just eat it and put them all in?
[22:19:05] smathy: mrgreenfur, you could just add it to the config before the test is run.
[22:20:07] visionary: has joined #RubyOnRails
[22:20:25] smathy: wilsonc91, kinda dumb because you know that's not how OOP works?
[22:21:14] moeabdol: has joined #RubyOnRails
[22:21:18] Radar: smathy: not very nice
[22:22:03] smathy: Radar, read up, he said it was kind of a dumb question, I'm asking genuinely.
[22:23:29] mrgreenfur: has left #RubyOnRails: ()
[22:26:07] tgeeky: so what is a (the) default way to 'jazz up' the scaffolding that rails produces by default
[22:26:12] tgeeky: say, to make the tables not look like crap
[22:27:04] smathy: tgeeky, there's no default way.
[22:27:14] cnk: css. Bootstrap was popular for a whie
[22:27:21] tgeeky: is there a ... minimum effort way?
[22:27:24] tgeeky: zuma foundation?
[22:27:37] tgeeky: does it inolve me rewriting things, or can I just regenerate
[22:27:46] |2701: has joined #RubyOnRails
[22:28:03] eyeamaye: has joined #RubyOnRails
[22:28:04] mrgreenfur: has joined #RubyOnRails
[22:28:14] mrgreenfur: first passing js test case
[22:28:14] smathy: You'll generally need/want to write something.
[22:28:20] mrgreenfur: thanks smathy
[22:28:25] smathy: mrgreenfur, all you baby!
[22:28:33] smathy: Well done.
[22:28:39] mrgreenfur: just 10,000 left to go ;)
[22:28:58] mrgreenfur: i’m psyched that I’ve got a real browser to automatically test against, no more production bugs for meee
[22:29:10] smathy: Very cool.
[22:29:29] smathy: "Less bugs" might be an easier ask ;)
[22:29:39] jenrzzz: has joined #RubyOnRails
[22:30:36] tubbo: tgeeky: it involves you rewriting things.
[22:31:03] tgeeky: anyone know of an example site for that?
[22:31:08] tgeeky: in the sense, it shows off what it looks like
[22:31:45] startupality: has joined #RubyOnRails
[22:31:47] smathy: tgeeky, are you really asking for http://foundation.zurb.com/ ?
[22:32:26] smathy: What are you after here? Tables generated by Rails are styled the same as tables generated any other way.
[22:32:53] tgeeky: something like foundation's case studies
[22:33:06] smathy: Oh, then you're looking for foundation's case studies.
[22:33:06] tgeeky: a webpage that uses foundation but not too far off the default config
[22:33:29] roshanavand1: has joined #RubyOnRails
[22:33:31] mwlang: has joined #RubyOnRails
[22:33:36] smathy: So no is the answer, there's no "make my app pretty" generator.
[22:34:07] Radar: smathy: you forgot about rails 5's "rails g pretty" generator
[22:34:32] tgeeky: in a world without sarcasm, /me wants
[22:34:46] tubbo: IN A WORLD.
[22:34:58] smathy: tgeeky, I hear libraries have much less sarcasm than the internet, YMMV
[22:34:59] Radar: bazzy: saw your comment about chapter 1's resource
[22:35:02] sumobob: has joined #RubyOnRails
[22:35:27] Oliphaunte: has joined #RubyOnRails
[22:35:36] flashpoint9: man I miss you guys! been stuck in php channel for work...
[22:35:55] Radar: bazzy: It's intentionally vague in CH1 to give a high-level overview of what Rails can do. I think we explain it much better in Chapter 3.
[22:36:13] tubbo: flashpoint9: i'm so sorry
[22:36:26] tubbo: 20% of why i left php was because of ##php :P
[22:36:33] droptone: has joined #RubyOnRails
[22:36:33] flashpoint9: its been really rough
[22:36:36] smathy: Things I wish, after all this time, I'd stop doing: using path helpers without remembering to add the _path suffix.
[22:37:15] srinidhi: has joined #RubyOnRails
[22:37:17] tubbo: link_to 'order history', orders y u not work
[22:37:23] flashpoint9: tubbo: yea for me 20% is ##php 20% is the language and 60% is drupal
[22:37:39] cnk: flashpoint9: poor you
[22:37:50] Radar: flashpoint9: time to find a new job ?:)
[22:37:59] mwlang: how is the authenticity token handled when you POST a form to another server (for credit card processing) and that server then calls back to your rails server with all parameters passed plus the result of processing the credit card?
[22:38:08] smathy: tubbo, at least now it asks me: Did you mean? foo_bar_path or foo_bar_url? Yes HAL, yes I did.
[22:38:11] tubbo: yeah drupal is asshole
[22:38:15] flashpoint9: Radar: haha maybe, my current company aside from the stack is great
[22:38:28] tubbo: smathy: haha yeah i find did_you_mean to be a decent gem
[22:38:55] cnk: There was someone in this channel who wanted to know how to dynamically specified content types in rails.
[22:38:55] mrgreenfur: mwlang: should probably turn it off or add it as some kind of meta pass-through param
[22:38:58] workmad3: mwlang: you'd need to skip the authenticity token check at that point
[22:39:16] smathy: tubbo, yeah, it's my only friend.
[22:39:18] mwlang: that’s what I was thinking.
[22:39:18] mrgreenfur: they might have their own way to verify authenticity
[22:39:27] cnk: Wonder what happened. Did he recreate Drupal in Rails? or go back to Drupal
[22:39:46] mwlang: so what should I watch out for security wise sans authenticity token?
[22:39:53] workmad3: mwlang: the point of the authenticity token is to prevent cross-site requests... but that's exactly what you want at that point, so you need to turn it off and verify the request in a different way
[22:39:59] Radar: mwlang: which payment gateway?
[22:40:07] mwlang: Radar: DIBS
[22:40:11] Radar: never heard of it
[22:40:20] mwlang: It’s European.
[22:40:27] Radar: mwlang: But yeah, everyone has said what I was going to say anyway :P
[22:40:37] mwlang: Big in Denmark, Sweden, Norway
[22:41:00] mwlang: well, at least y’all confirmed my suspicions. :-)
[22:41:17] workmad3: mwlang: also, the request from the payment gateway is almost certainly not going to have a rails session cookie as part of the request, and if it does it wouldn't match an authenticity token from the user (which puts a crimp in mrgreenfur's suggestion of passing it through somehow :) )
[22:41:24] mrgreenfur: mwlang: some places pass along their own thing, like for example shopify webhooks have a signature hash that you can verify
[22:41:34] workmad3: ^ that's what you should be looking out for
[22:41:37] mwlang: I’ll probably configure nginx to only accept callback posts from their servers (constrain to specific IP addresses)
[22:41:54] smathy: Yeah, it's not possible to use it with a third party API.
[22:41:56] workmad3: mwlang: do they definitely have a limited, fixed number of servers and will they notify you if they add a new one?
[22:42:05] smathy: (by design)
[22:42:24] mrgreenfur: mwlang: http://tech.dibspayment.com/DX/api/hmac_calculation
[22:42:25] mwlang: workmad3: not sure yet, but I’m definitely going to inquire before blindly locking down.
[22:42:44] mrgreenfur: i think the hmac is a hash used to verify each message
[22:42:44] smathy: mwlang, it's MUCH better to send a checksum - in that field they're going to return to you, and check that everything they're coming back with makes sense.
[22:42:48] mrgreenfur: but i haven’t erally read this page
[22:42:58] mrgreenfur: looks like the same thing I did with shopify a few months back
[22:43:17] mrgreenfur: (enjoy stubbing those test cases :)
[22:43:24] workmad3: mwlang: the best way would be if there's some form of signature or authentication with the request to validate it came from the right place, and then verify the result of processing as well/
[22:43:34] mwlang: let me see if their flexwin integration has such security features.
[22:44:18] DragonPunch: has joined #RubyOnRails
[22:44:45] mwlang: awesome, just found the docs for allowing me to pass hmac even on their hosted flexwin platform, so this’ll do.
[22:45:10] mwlang: thanks everyone for pointing dead-on in the right direction here.
[22:45:25] Darmani: has joined #RubyOnRails
[22:45:33] jenrzzz: has joined #RubyOnRails
[22:45:50] Darmani: Hi everyone! Quick question,
[22:46:11] Darmani: What's the rails command to generate a namespaced admin controller for my users model?
[22:46:23] Darmani: Would it be like... Rails g controller admin/users ?
[22:46:34] smathy: Darmani, !try
[22:46:34] helpa: Darmani: Why don't you try it and find out for yourself?
[22:46:50] Darmani: smathy: Great help there smathy.
[22:46:54] pawnbox: has joined #RubyOnRails
[22:47:29] smathy: Teaching people to fish since 1993.
[22:48:02] Darmani: smathy: ha. that's the year I was born.
[22:48:13] mrgreenfur: jesus i’m old
[22:48:27] Radar: Darmani: Chapter 7 of Rails 4 in Action.
[22:48:46] Darmani: Radar: I was looking through the book and couldn't remember what chapter that shit was on xD
[22:49:17] ma489: has joined #RubyOnRails
[22:49:17] Darmani: mrgreenfur: Dude that's not a bad thing. Speaking as a Millennial I wish I was born earlier lol
[22:49:21] Radar: Darmani: If you've got the book downloaded locally, you can "ack admin"
[22:49:28] Radar: in the terminal and that'll show you where it is
[22:49:39] Radar: Darmani: I was born in '87 and I am still a millenial
[22:49:40] mrgreenfur: Darmani: lol positive metal attitude!
[22:49:55] Radar: https://www.reddit.com/r/Jokes/comments/4im38i/remember_when_we_cried_as_kids_and_our_parents/
[22:50:08] pipework: Speaking as a millenial, I wish I had been born earlier so I could destroy markets for the next generation instead of being on the inheriting end of that bullshit.
[22:50:10] Darmani: Radar: Lmao that's a good one.
[22:50:30] Darmani: pipework: Amen brother. Amen.
[22:51:37] smathy: ACTION still thinks his recommendation was the best
[22:52:00] Darmani: ACTION does not like this strategy
[22:52:00] pipework: Darmani: I'm '91 so
[22:52:30] Darmani: pipework: You know what's really funny?
[22:52:36] pipework: Darmani: Genitals, usually.
[22:52:43] pipework: Weird things, quite odd.
[22:52:51] Darmani: yeah that's true. but listen lol
[22:53:09] pipework: ACTION strains to hear the text coming from his screen
[22:53:11] Radar: ACTION raises eyebrow
[22:53:22] Darmani: lmao I like you pipework
[22:53:45] pipework: Darmani: Great, I'll make sure you get the address to my fan club, you'll be the founding member. :(
[22:53:58] Darmani: pipework: I tell people I'm learning programming on my own and they look at me like I'm crazy. They think I'm wasting my time and my life. Like wasting thousands of dollars to go to a university and is the only way to be successful in this world.
[22:54:30] Darmani: I would like that address btw.
[22:54:38] ebbflowgo: has joined #RubyOnRails
[22:54:52] pipework: Darmani: You can do it, but only if you can really distinguish yourself from all other candidates without anyone knowing you're autodidactic.
[22:55:04] pipework: Clever people can do clever things.
[22:55:14] Darmani: ACTION had to google that word.
[22:55:56] pipework: Darmani: Polymath is another good one.
[22:56:03] workmad3: pipework: why would Darmani be the founding member? The 'We hate pipework' fan club has been going strong for years!
[22:56:17] pipework: workmad3: Wrong fan club, workmad3.
[22:56:38] emptyflask: has joined #RubyOnRails
[22:56:43] Darmani: So... Pipework is a Polymathic person? Or Pipework is the epitomy of Polythamy?
[22:56:50] Radar: workmad3: I'm more preferential toward the "ambivalent about pipework" club
[22:57:59] workmad3: polymath is the cool modern term for 'Renaissance man'
[22:58:31] Darmani: Radar: Bruh
[22:58:34] Darmani: today's my birthday.
[22:58:39] Radar: Darmani: HAPPY BIRTHDAY
[22:58:39] allcentury: has joined #RubyOnRails
[22:59:14] pipework: One who does not know me might say I'm an autodidactic polymath, but most will just utter or shout the phrase "asshole".
[22:59:31] jancel: has joined #RubyOnRails
[23:01:13] Darmani: Alright well I should get back to struggling with the most basic Rails functions like figuring out how to make namespaced controllers... Or how to add more functionality to an already established class... And inevitably spending 3 or 4 hours with something that should only take me 10 minutes.
[23:01:43] Darmani: ACTION sighs
[23:02:13] pipework: Darmani: Stick around for a while, it's a good way to get harder better faster stronger.
[23:02:27] pipework: Both for your own questions and seeing what other people ask, what they have trouble with, etc.
[23:02:45] Darmani: pipework: No one likes that song. That song died in 2014.
[23:03:02] Radar: Darmani: less QQ more pew pew
[23:03:05] workmad3: Darmani: welcome to the club... almost every problem takes about 10 minutes to solve once you know how to do it
[23:03:10] Radar: yeah you'll struggle. It's the whole point of learning.
[23:03:16] Darmani: Radar: I'm gonna get that tattooed on my forehead.
[23:03:21] pipework: Radar: I thought that was the point of the restraints.
[23:03:25] Radar: Darmani: Good idea.
[23:03:25] pipework: The struggling.
[23:03:37] tgeeky: until that asshole Adolf Hitler stole that title
[23:03:39] Darmani: workmad3: Isn't that the beauty of everything??
[23:03:56] pipework: Darmani: Only if you're into S&M
[23:04:01] pipework: Anyways, rails, anyone?
[23:04:18] workmad3: Darmani: the joy is in solving, the beauty is in an elegant solution with no excess :)
[23:04:33] workmad3: ACTION beats pipework with a rail
[23:04:44] pipework: ACTION rails on workmad3 with a ruby
[23:04:57] Darmani: ACTION cannot stop laughing
[23:05:20] workmad3: ACTION throws a python at pipework and laughs at his struggles
[23:05:21] pipework: That sounds like something you should get checked out immidately.
[23:05:33] workmad3: Darmani: check for leaks in your laughing gas supply...
[23:05:48] GodFather: has joined #RubyOnRails
[23:06:03] Darmani: what better way to die than laughing?
[23:06:05] Darmani: That's how I want to go.
[23:06:22] Darmani: Dying of laughter in my 2016 Lexus
[23:06:50] workmad3: I'd rather go while observing the heat-death of the universe, having lived a nice, full life of several billion years...
[23:06:56] workmad3: ACTION crosses his fingers for the singularity
[23:07:23] pipework: workmad3: Given all the hot gas that you expel on the daily, I'd say you're well on your way.
[23:07:32] workmad3: pipework: :)
[23:08:01] Darmani: you two are distracting.
[23:08:11] Darmani: ACTION will be back
[23:08:18] workmad3: ACTION is off to bed
[23:08:39] Darmani: workmad3: goodnight sweet prince
[23:08:56] workmad3: Darmani: ok, you just went weird... :P
[23:09:14] Darmani: workmad3: Oh I wasn't weird before?
[23:09:19] Darmani: Must not be trying hard enough
[23:09:28] pipework: workmad3: Have well-railed dreams.
[23:09:48] workmad3: Darmani: nah, before you were well within the bell curve for normal IRC behaviour
[23:09:55] dalbuschat: has joined #RubyOnRails
[23:09:58] workmad3: you just went 2sd off the deep end though ;)
[23:10:07] Darmani: workmad3: Must be losing my touch xP
[23:10:31] workmad3: or you're underestimating the bell curve of IRC behaviour :)
[23:10:44] Darmani: workmad3: go to bed lol
[23:10:55] workmad3: bah, you're not my mother!
[23:11:11] workmad3: (although I do need to go... my wife's telling me the same...)
[23:11:12] pipework: I'm still holding out for the ballmer curve of IRC behaviour study to be published.
[23:11:35] Darmani: pipework: I'd read that. Lol
[23:12:37] pipework: Maybe then I can put out proper scientific analysis of exactly how much one ought to drink to be most able to put up with this shit. :D
[23:13:46] Darmani: pipework: Lol I'd say 40oz of whatever beer is cheapest at your local 7 eleven.
[23:14:12] r0bby_: has joined #RubyOnRails
[23:14:27] pipework: Darmani: In Oregon, we brew our own 40oz 7-11 quality beer.
[23:15:14] Darmani: pipework: lmao in Los Angeles, we don't have time for that shit xD
[23:15:37] pipework: I only drink from liquor bottles. Can't trust anything else, it might contain water. I wouldn't touch the stuff, fish fuck in it.
[23:15:51] cg72: has joined #RubyOnRails
[23:16:07] Darmani: You are an interesting person.
[23:16:38] ebbflowgo: has joined #RubyOnRails
[23:16:43] cg72: has joined #RubyOnRails
[23:16:50] pipework: has left #RubyOnRails: ("nope, too much")
[23:16:57] visionary: how would I store an array of hashes
[23:17:54] smathy: visionary, what have you tried?
[23:18:16] cg72: has left #RubyOnRails: ()
[23:18:55] jancel: has joined #RubyOnRails
[23:19:44] visionary: This is an api_only. I tried passing a json array to a field and the result is null.
[23:20:31] visionary: I tried creating a field of t.string :left, array: true, default: []
[23:20:40] visionary: but migration failed.
[23:21:43] kies: has joined #RubyOnRails
[23:22:44] smathy: visionary, are you using postgres?
[23:23:13] smathy: visionary, this will probably help then: http://guides.rubyonrails.org/active_record_postgresql.html
[23:25:00] quazimodo: has joined #RubyOnRails
[23:27:36] Darmani: ACTION pretends to be visionary
[23:27:51] Darmani: smathy: wow thanks for your help man! I appreciate you responding to me.
[23:29:29] tobyn: has joined #RubyOnRails
[23:31:20] visionary: I am a little rusty on the rails.
[23:31:28] m_antis: has joined #RubyOnRails
[23:34:50] visionary: trying t.json :payload
[23:37:32] SteenJobs: has joined #RubyOnRails
[23:37:55] flashpoint9: has joined #RubyOnRails
[23:38:24] visionary: "SyntaxError: /app/db/migrate/20160516224918_create_tests.rb:5: syntax error, unexpected tSTRING_BEG, expecting keyword_end
[23:38:24] visionary: t.json 'right',"
[23:42:04] wigust: has joined #RubyOnRails
[23:43:17] visionary: I got something working. Only one field named "payload".
[23:43:28] visionary: at least migrated.
[23:43:35] roshanavand1: has joined #RubyOnRails
[23:44:34] Cohedrin: has joined #RubyOnRails
[23:46:23] tgeeky: in development mode, do I need to restart rails server for changes in [models, views, controllers]? I assume no,no,no, but I keep finding myself restarting
[23:49:41] visionary: migrate works post does not
[23:50:12] visionary: NoMethodError (undefined method `left' for #<Test:0x007f35294cd1b8>):
[23:50:38] visionary: left is a field in the json
[23:53:10] arBmind: has joined #RubyOnRails
[23:53:20] eyeamaye: has joined #RubyOnRails
[23:53:24] pwnd_nsfw: code probably helps
[23:53:33] pwnd_nsfw: tgeeky, depends
[23:56:44] blackmesa: has joined #RubyOnRails
[23:59:23] tgeeky: ... is a brand of diapers?
[23:59:32] tgeeky: pwnd_nsfw: on what? if that cache setting is enabled or not?