« Back to channel list

#RubyOnRails - 18 May 2016

« Back 1 day Forward 1 day »
[00:01:57] eljimmy: has joined #RubyOnRails
[00:01:59] nergdnulg: has joined #RubyOnRails
[00:02:19] Hyuk: has joined #RubyOnRails
[00:02:35] eljimbo: has joined #RubyOnRails
[00:02:50] nergdnulg: someone knows how could i update to sass 3.3 so i can use BEM syntax on rails 4.1.5 ?
[00:03:13] nergdnulg: the sass versions before 3.3 doesnt supports BEM syntax
[00:03:46] nettoweb: has joined #RubyOnRails
[00:04:22] patrick99e99: why does this not work? validates :metadata, :acceptance => true, :message => 'is required'
[00:04:32] patrick99e99: docs say "The default error message for validates_associated is "is invalid". Note that each associated object will contain its own errors collection; errors do not bubble up to the calling model."
[00:04:54] patrick99e99: "The default error message for this helper is "must be accepted". You can also pass custom message via the message option."
[00:05:19] patrick99e99: when I try to use the message option I get unknown validator "MessageValidator" ???
[00:05:35] Oliphaunte: has joined #RubyOnRails
[00:05:43] nergdnulg: anyone knos how to use BEM with rails 4.1.5?
[00:06:32] |2701: has joined #RubyOnRails
[00:06:32] |2701: has joined #RubyOnRails
[00:07:14] patrick99e99: so the docs just lie..
[00:08:04] RegulationD: has joined #RubyOnRails
[00:08:08] nergdnulg: man, this channel used to be more active...
[00:08:31] nergdnulg: someone still alive over here or Radar is scaring everybody?
[00:09:23] patrick99e99: nergdnulg: it's because rails doesn't scale and most developers have moved back to programming 6502 assembly
[00:09:24] quazimodo: i have to build an opencv extension for this app i have to write :D
[00:09:33] quazimodo: that's gonna be awesome
[00:10:46] nergdnulg: patrick, its because theres a very spoiled brat here called Radar, that thinks everybody should accept his politically correct agenda
[00:11:08] nergdnulg: so everybody now cant talk, because he loves to show power banning people
[00:11:35] nergdnulg: to mitigate his problems, i believe
[00:13:01] DoctorMonocular: has joined #RubyOnRails
[00:13:25] hahuang65: has joined #RubyOnRails
[00:13:29] markalanevans: has joined #RubyOnRails
[00:14:48] adre: has joined #RubyOnRails
[00:15:00] nergdnulg: really, this place became a devastated land
[00:15:08] nergdnulg: SOCIALISM AT ITS BEST
[00:16:10] nergdnulg: very similar to Venezuela
[00:16:24] Ropeney: has joined #RubyOnRails
[00:16:39] chouhoulis: has joined #RubyOnRails
[00:16:51] jancel: has joined #RubyOnRails
[00:17:03] RegulationD: has joined #RubyOnRails
[00:19:37] baweaver: !ban nergdnulg
[00:19:47] ChanServ: +q *!*@
[00:19:48] ModusPwnens: has joined #RubyOnRails
[00:19:53] baweaver: there we go
[00:20:00] ModusPwnens: How do I intercept exceptions in a rails engine and throw something else instead?
[00:20:01] weaksauce: and all was right in the world
[00:21:36] baweaver: insulting an op (or for that matter anyone on here) is not acceptable
[00:21:43] Synthead: is there a way for sidekiq to notify the rails server when a job finishes?
[00:22:01] baweaver: Synthead past a callback I haven't found one
[00:22:18] baweaver: ActiveJob can do that at least with an after hook
[00:22:19] Synthead: baweaver: what kind of callback?
[00:22:31] cnk: ModusPwnens: exception from where?
[00:22:53] cnk: probalby you need to override the code that calls into the engine - e.g. override the controller
[00:23:02] aghalarp: has joined #RubyOnRails
[00:23:04] macsteps: has joined #RubyOnRails
[00:23:08] baweaver: Synthead need to find it again
[00:23:15] ModusPwnens: This is actually more of a Jruby on Rails engine. We have some java clients that are making calls and when they fail because of a 404, it ends up getting wrapped in a 500. I want to re-wrap it back in a 404.
[00:23:20] is_null: has joined #RubyOnRails
[00:23:25] baweaver: http://edgeguides.rubyonrails.org/active_job_basics.html#callbacks
[00:23:28] baweaver: There we go
[00:23:30] is_null: has left #RubyOnRails: ()
[00:23:31] Synthead: baweaver: perhaps it could do something with redis that the server responds with?
[00:23:47] Synthead: oh I see, after_perform
[00:25:50] kripx: has joined #RubyOnRails
[00:27:53] rickmasta: has joined #RubyOnRails
[00:34:03] nickenchuggets: has joined #RubyOnRails
[00:34:04] nickenchuggets: has joined #RubyOnRails
[00:39:58] smathy_: has joined #RubyOnRails
[00:46:31] moei: has joined #RubyOnRails
[00:47:08] Synthead: baweaver: ah, yeah... that will run after the job finishes, but it'll run on the worker process
[00:47:31] Devalo: has joined #RubyOnRails
[00:47:39] baweaver: only way I've found so far is to get that to call back to an endpoint.
[00:47:40] Synthead: baweaver: I'm going some work with websockets and I have to have the rails server actually run something instead
[00:47:51] Oliphaunte: has joined #RubyOnRails
[00:47:54] Synthead: baweaver: yeah, I've considered that
[00:48:13] Synthead: baweaver: I'm kinda thinking ... redis picks up on the queue and runs jobs
[00:48:20] baweaver: Short of ActionCable (which is new and probably not quite stable) and subscribing to it, it'd be fun.
[00:48:21] Synthead: baweaver: so why not have the rails server do the same?
[00:48:43] baweaver: anyways, flight's about to board so I have to get off.
[00:48:45] Synthead: baweaver: yeah actioncable will solve everything
[00:48:58] Synthead: baweaver: ah cool! have a good flight! thanks for the help!
[00:49:24] sypheren: has joined #RubyOnRails
[00:51:57] ashleyw: has joined #RubyOnRails
[00:57:59] Radar: Well that was fun. I missed nergdnulg.
[00:58:37] Radar: Oh it was glundgren.
[01:02:11] aloneintheworld: has joined #RubyOnRails
[01:05:14] pawnbox: has joined #RubyOnRails
[01:07:34] aloneintheworld: has joined #RubyOnRails
[01:07:46] nickenchuggets: has joined #RubyOnRails
[01:07:46] nickenchuggets: has joined #RubyOnRails
[01:11:11] zave: has joined #RubyOnRails
[01:11:28] alfie_max15: has joined #RubyOnRails
[01:15:52] B1n4r10: has joined #RubyOnRails
[01:15:58] hahuang65: has joined #RubyOnRails
[01:18:54] sevenseacat: has joined #RubyOnRails
[01:22:28] bronson: has joined #RubyOnRails
[01:22:47] _3dwardsharp: has joined #RubyOnRails
[01:24:01] sneakerhax: has joined #RubyOnRails
[01:33:41] Radar: What's a name that isn't "decorator" for something that is used to determine how something is displayed?
[01:34:07] Radar: We have an advert which has a "lowest_price" method on it, and "lowest_price" is determined by a series of factors, like if a variant within that advert has a price or sale_price.
[01:34:20] Radar: I don't want the logic on the model, I want it in something else... but I can't come up with a good anme for it.
[01:34:56] Hyuk_: has joined #RubyOnRails
[01:37:07] nickenchuggets: has joined #RubyOnRails
[01:38:10] one_zero: has joined #RubyOnRails
[01:40:07] moeabdol: has joined #RubyOnRails
[01:41:02] sevenseacat: displayer? formatter?
[01:41:14] pawnbox: has joined #RubyOnRails
[01:41:29] Hates_: has joined #RubyOnRails
[01:42:29] Limix: has joined #RubyOnRails
[01:42:57] IrishGringo: has joined #RubyOnRails
[01:51:25] jscheel: has joined #RubyOnRails
[01:51:41] pepee: has joined #RubyOnRails
[01:54:59] kevr: has joined #RubyOnRails
[01:55:05] creature: Why don't you want the logic on the model? Being able to write @advert.lowest_price feels fairly natural to me.
[01:55:40] kevr: I'm using Devise for user authentication. I'd like to edit the default views for Devise, but I can't seem to find them in the app/views folder.
[01:55:43] kevr: Does anybody know where they are located?
[01:56:19] alfie_max15: kevr, you need to generate the views first
[01:56:27] creature: kevr: There's a generator for that. It's in the Devise docs.
[01:56:35] creature: Something like rake devise:generate:views.
[01:56:46] alfie_max15: rails generate devise:views
[01:56:53] alfie_max15: see here: https://github.com/plataformatec/devise#configuring-views
[01:57:48] roshanavand1: has joined #RubyOnRails
[01:58:09] blackmesa: has joined #RubyOnRails
[02:01:19] mrgreenfur: has joined #RubyOnRails
[02:06:12] jancel: has joined #RubyOnRails
[02:12:33] HenriettaSalt: has joined #RubyOnRails
[02:12:52] kevr: So, I'm new to rails, and I assume that it can't be hard to hash some text in ruby with a gem; I'm wondering, would it be stupid to write my own simple user authentication rather than using devise? it seems like devise is huge and complicated for my purposes.
[02:13:29] alfie_max15: kevr, what's your purpose?
[02:14:25] kevr: i'm writing a small application that has some users, and a table that stores some user <=> post relations, where posts have just a few columns.
[02:14:46] kevr: sorry, a database that stores*
[02:15:13] alfie_max15: what's the issue you are facing with devise?
[02:15:43] alfie_max15: if you want to go with simpler auth methods, you can write some on your own using bcrypt
[02:15:54] alfie_max15: for encrypting the passwords
[02:15:59] jscheel: has joined #RubyOnRails
[02:16:17] kevr: i'm not really facing issues with it, it's just that i'm not that familiar with rails, so i need to practice a bit, and i'd rather spend my time learning how to implement something in rails rather than spending the time learning how to change something in devise
[02:16:33] kevr: so i'm trying to make that decision at the moment.
[02:17:09] kevr: (devise is missing some columns in it's implementation that i'd like to have)
[02:17:48] jhass: you can just add columns to the User model, no issue
[02:17:54] kevr: like a username, perhaps a real name column, a few other user-specific columns for my scenario
[02:18:18] alfie_max15: you can just add that to the user table like jhass just said
[02:18:27] jhass: https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-using-their-username-or-email-address
[02:18:33] alfie_max15: you can even handle username/email login with devise
[02:18:36] kevr: i can add them to the table, but i do have to go through controllers and views and add all those fields to sign up etc
[02:19:15] kevr: alfie_max15: how would i go about handling a username field with devise?
[02:19:34] alfie_max15: kevr, just try it out, i too tried out devise and did all what you are trying to do within the first week of when i got into rails
[02:19:38] kevr: am i approaching this incorrectly? i was intending to change the devise controller for this
[02:19:56] alfie_max15: kevr, you won't have to change the controller
[02:20:03] creature: kevr: https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-with-something-other-than-their-email-address might be helpful.
[02:20:07] alfie_max15: please see the link jhass provided
[02:24:24] HenriettaSalt: has joined #RubyOnRails
[02:26:17] chipotle: has joined #RubyOnRails
[02:28:26] rodfersou: has joined #RubyOnRails
[02:46:20] jancel: has joined #RubyOnRails
[02:50:12] kevr: is attr_accessible still valid in newer versions of rails? this guide suggests that it's only valid in older ones
[02:50:31] sevenseacat: it was replaced in rails 4 by strong parameters
[02:54:43] drupald_: has joined #RubyOnRails
[02:58:08] chouhoulis: has joined #RubyOnRails
[02:58:24] aghalarp: has joined #RubyOnRails
[03:00:13] blackmesa: has joined #RubyOnRails
[03:08:58] moeabdol: has joined #RubyOnRails
[03:11:54] Maletor: has joined #RubyOnRails
[03:14:53] codeurge: has joined #RubyOnRails
[03:17:53] braincrash: has joined #RubyOnRails
[03:18:27] Radar: GOOD AFTERNOON
[03:21:50] JesseH: has joined #RubyOnRails
[03:23:29] sypheren: has joined #RubyOnRails
[03:23:48] pawnbox: has joined #RubyOnRails
[03:25:40] kevr: that wasn't that complicated at all; so magical.
[03:29:01] hahuang65: has joined #RubyOnRails
[03:31:17] brendan-: has joined #RubyOnRails
[03:33:25] njero: has joined #RubyOnRails
[03:34:09] macsteps: has joined #RubyOnRails
[03:40:41] Oliphaunte: has joined #RubyOnRails
[03:41:05] ftj: has joined #RubyOnRails
[03:43:32] agent_white: has joined #RubyOnRails
[04:00:12] Oliphaunte: has joined #RubyOnRails
[04:02:24] blackmesa: has joined #RubyOnRails
[04:04:08] pawnbox: has joined #RubyOnRails
[04:05:45] HenriettaSalt: has joined #RubyOnRails
[04:10:24] duncannz: has joined #RubyOnRails
[04:16:21] adre: has joined #RubyOnRails
[04:18:15] pwnd_nsfw`: has joined #RubyOnRails
[04:24:59] bronson: has joined #RubyOnRails
[04:29:06] lxsameer: has joined #RubyOnRails
[04:31:27] tildes_: has joined #RubyOnRails
[04:34:43] lxsameer: has left #RubyOnRails: ("Leaving")
[04:34:55] lxsameer: has joined #RubyOnRails
[04:35:09] D9: has joined #RubyOnRails
[04:39:27] pawnbox: has joined #RubyOnRails
[04:41:30] nertzy2: has joined #RubyOnRails
[04:42:11] Inside: has joined #RubyOnRails
[04:43:14] kgrz: has joined #RubyOnRails
[04:43:34] Inside: So.... where do I go to learn about the right way(tm) of doing things with RoR? I've got some super basic/half-workable stuff going on at work - basic database access, charts/dashboards, got some cobbled together react.js/some other single-page controllers, etc
[04:45:19] Inside: things I still need to learn: TDD/BDD, large-scale web development
[04:45:20] kgrz: Inside: There's a book by Avdi Grimm called Objects on Rails. One more book I can recommend is Growing Rails Applications in Practice
[04:47:24] kevr: does the 'super' keyword inside of a derived classes method run everything that the parent classes method of the same name does?
[04:48:33] kevr: sigh, devise confuses the fuck out of me.
[04:48:52] Inside: I've been trying to implement it into my intranet site as well
[04:49:12] Inside: only problem is that it's a manufacturing environment so not everyone has an LDAP record (typically only the office personnel have it)
[04:49:19] Devalo: has joined #RubyOnRails
[04:49:23] Inside: but I also need some unique way to identify who works at the company so I can log what they do
[04:49:29] dandaman: has joined #RubyOnRails
[04:49:32] Radar: Inside: !r4ia will give you a good idea of how to do TDD/BDD
[04:49:32] helpa: Inside: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[04:49:34] Inside: so now I have 3 user classes.
[04:49:47] Inside: Login, User, and HRUser
[04:50:04] Radar: `Login` sounds like our app's `Email` model which, is no longer for emails
[04:50:29] Radar: It's clubs, retailers, private sellers and whole salers.
[04:50:41] Inside: well, Login is only used to authenticate against active directory
[04:51:05] Inside: "User" is the record that all actions are logged against
[04:51:09] Devalo: has joined #RubyOnRails
[04:51:21] Inside: "HRUser" is the record of a person in an HR database
[04:51:49] Inside: and that's a total clusterfuck in itself because you'd think that a person would have a unique employee ID that could be used as the key
[04:51:58] Inside: you start off with one employee ID and then go on to get another later
[04:52:02] Inside: (temp to perm)
[04:55:54] rvanlieshout: has joined #RubyOnRails
[05:02:28] jetpack_joe: has joined #RubyOnRails
[05:04:50] wkoszek: has joined #RubyOnRails
[05:04:54] kevr: what if you add a TempUser to mitigate that problem, then you could use unique perm ids in your actual user tables
[05:04:59] kevr: TempUser table* that is
[05:05:01] yaewa: has joined #RubyOnRails
[05:06:52] habitullence_: has joined #RubyOnRails
[05:07:08] djinni`_: has joined #RubyOnRails
[05:07:32] mwlang_: has joined #RubyOnRails
[05:07:33] SalexW_: has joined #RubyOnRails
[05:08:08] Sanguine1nomaly: has joined #RubyOnRails
[05:08:18] camilasann: has joined #RubyOnRails
[05:08:20] thorgi_: has joined #RubyOnRails
[05:08:22] silverdu1t: has joined #RubyOnRails
[05:08:28] ltd_: has joined #RubyOnRails
[05:08:35] rarruda: has joined #RubyOnRails
[05:08:35] _Ducky-: has joined #RubyOnRails
[05:08:48] quazimod1: has joined #RubyOnRails
[05:11:23] yfeldblum: has joined #RubyOnRails
[05:11:43] tiago_: has joined #RubyOnRails
[05:11:46] eduardodeoh_: has joined #RubyOnRails
[05:11:51] vircung__: has joined #RubyOnRails
[05:12:00] Talltree_: has joined #RubyOnRails
[05:12:00] enkristoffer_: has joined #RubyOnRails
[05:12:03] tris-: has joined #RubyOnRails
[05:12:11] kitallisii: has joined #RubyOnRails
[05:12:14] Olipro_: has joined #RubyOnRails
[05:12:15] martinbjeldbak_: has joined #RubyOnRails
[05:12:22] elaptic``: has joined #RubyOnRails
[05:13:26] theRoUS: has joined #RubyOnRails
[05:14:39] HenriettaSalt: has joined #RubyOnRails
[05:14:53] naavinm: has joined #RubyOnRails
[05:15:28] void__: has joined #RubyOnRails
[05:16:09] AntiSpamMeta: has joined #RubyOnRails
[05:17:29] Cork: has joined #RubyOnRails
[05:24:06] Oliphaunte: has joined #RubyOnRails
[05:25:23] emilkarl: has joined #RubyOnRails
[05:27:07] elaptic``: has left #RubyOnRails: ("Bye")
[05:27:35] elaptics: has joined #RubyOnRails
[05:34:12] matt_d: quazimod1: shoot
[05:34:39] quazimod1: iven that we have a graph of AR objects, eg user -> client_profiles -> clients , and I set up up a user and it's clients manually (not via assign_attributes) then call user.valid?, then does this validation only consider if the clients are valid if accepts_nested_attributes is correctly set up on user and client_profiles ?_
[05:35:10] quazimod1: because I have a similar situation, only nested 1 more time, and the top level object save! works fine , but some clients go missing. On debug i found they were invalid, but save! didn't raise
[05:37:24] istrasci: has joined #RubyOnRails
[05:37:40] quazimod1: I think that's the case
[05:38:17] alfie_max15: has joined #RubyOnRails
[05:42:32] istrasci: Hello, I used to be able to do ActiveRecord::Base.connection.disable_referential_integrity in Rails 3, but it looks like it's gone in Rails 4. Is there something equivalent?
[05:44:15] chipotle: has joined #RubyOnRails
[05:46:42] ravishankarjha: has joined #RubyOnRails
[05:47:00] Radar: istrasci: It's not gone in Rails 4.
[05:47:21] istrasci: Radar: You're right, I just found it in the docs.
[05:47:26] istrasci: But seems not to work.
[05:47:27] Radar: https://github.com/rails/rails/blob/v4.2.6/activerecord/lib/active_record/connection_adapters/postgresql/referential_integrity.rb
[05:47:31] Radar: !didntwork
[05:47:32] helpa: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[05:48:32] istrasci: Trying to drop a table within the disable_referential_integrity block, but it's still enforcing the RI.
[05:49:10] Radar: Can you reproduce the issue in a new app?
[05:49:37] Radar: _maybe_ related to https://github.com/rails/rails/commit/72c1557254aef2bca8a72f16a4f67862c9cca5cb
[05:50:05] MEATCHICKEN: User has an address. Address has validations. User editing himself will fail because the edit screen allows address editing..so unless they fill out the entire address..it fails
[05:50:08] MEATCHICKEN: what is the best pattern for this?
[05:50:12] MEATCHICKEN: Just take out the address validations?
[05:50:32] Radar: meatchicken: You're not populating the address fields with their current values?
[05:50:46] MEATCHICKEN: Radar, user signup doesn't set an initial address
[05:50:53] MEATCHICKEN: so they are empty when first navigating to the edit
[05:51:04] MEATCHICKEN: Would the right answer be to add address to user signup?
[05:51:18] MEATCHICKEN: Or to remove address validations?
[05:51:23] MEATCHICKEN: I guess that would be a business answer
[05:51:41] kevr: maybe default an address?
[05:51:52] kevr: like, an empty address string
[05:52:54] Coldblackice: has joined #RubyOnRails
[05:52:55] MEATCHICKEN: kevr, that's the thing - empty address strings are invalid to presence validations
[05:53:06] MEATCHICKEN: I suppose it isn't a technical issue as I know how to solve it - just looking for thoughts
[05:53:47] istrasci: Radar: https://gist.github.com/anonymous/0aa52abfa7bb5e1f713f94f9e1907d48
[05:54:46] Radar: istrasci: rake db:drop db:create doesn't float your boat?
[05:55:32] istrasci: Radar: Does not db:drop delete the entire database?
[05:55:46] Radar: Yeah, it does.
[05:55:47] sevenseacat: whats left in the database after you drop all the tables?
[05:56:03] Radar: I am trying to understand the purpose of this new rake task.
[05:56:25] jscheel: has joined #RubyOnRails
[05:57:01] istrasci: Could be a bunch of other DB objects: stored procs, functions, triggers, etc.
[05:57:48] istrasci: But that's not the issue. That code should work.
[05:58:09] sevenseacat: and what does it do?
[05:58:10] istrasci: (that's also not the whole rake task. Just the relevant section)
[05:58:19] Radar: istrasci: Yup, I agree that it should work. I would suggest filing an issue on rails/rails on GH about it
[05:58:35] Palsson: has joined #RubyOnRails
[06:01:44] njero: Can anyone suggest the possible reason for this https://groups.google.com/forum/#!topic/phusion-passenger/eZgw3TqrfSI or any method how to tackle this?
[06:02:14] njero: Issue is weak If-None-Match not reaching rails request env
[06:02:56] moeabdol: has joined #RubyOnRails
[06:03:27] njero: 3rd day on such a small issue.. OMG
[06:03:29] Alazoral: has joined #RubyOnRails
[06:03:41] arup_r: has joined #RubyOnRails
[06:04:00] blackmesa: has joined #RubyOnRails
[06:04:08] Radar: n_e_o: is it that you're not forwarding headers? http://stackoverflow.com/questions/19751313/forward-request-headers-from-nginx-proxy-server
[06:04:12] Radar: ACTION is guessing here
[06:04:34] lxsameer: has joined #RubyOnRails
[06:05:24] njero: Radar: I'm running passenger 5.0.22 standalone on aws
[06:05:56] apotry: has joined #RubyOnRails
[06:07:16] njero: and a single instance any loadbalancer nothing infront :(
[06:08:55] njero: Does passenger standalone have a default nginx config file?
[06:09:29] alfie_max15: n_e_o, which config file are you using now?
[06:10:30] njero: alfie_max15: nothing. I'm not using passing any config template rt now. Just rvmsudo bundle exec passenger start
[06:11:32] njero: the crazy part is that same version working fine in localhost :(
[06:14:31] matthias_: has joined #RubyOnRails
[06:15:17] njero: has joined #RubyOnRails
[06:15:39] agent_white: What reason would someone have to use a framework like Grape? -- Doesn't Rails inherintly create RESTful API's?
[06:15:54] agent_white: (trying to understand my devs when they say they're looking into using Grape)
[06:16:01] pLaToOn: has joined #RubyOnRails
[06:16:09] Radar: agent_white: because they think that the grape API helpers are helpful
[06:16:10] HenriettaSalt: has joined #RubyOnRails
[06:16:26] Radar: I think that grape is good for simple APIs, but quickly breaks down when you try to build anything complex
[06:16:50] Radar: Source: we tried using Grape to build LIFX's Cloud API. It broke down at a large scale, and we re-implemented everything using typical Rails controllers in a day or two.
[06:17:01] Radar: by "large scale" I mean that there was a lot of code.
[06:17:56] solars: has joined #RubyOnRails
[06:18:55] Oliphaunte: has joined #RubyOnRails
[06:19:31] agent_white: Radar: Ah I see... I think? -- This is my first time being able to comprehend the code at the shop, and it doesn't seem 'super complex' to me. But I'm not sure if I'm a good judge of that.
[06:20:53] agent_white: Radar: I was invited to code reviews by our lead dev to 'get a feel for the process' since I'm the only 'support-engineer who can code'. Any tips on good, general, questions to ask?
[06:21:21] Radar: Code reviews like PR reviews?
[06:21:31] agent_white: (my first thought is simply 'why is Grape necessary?')
[06:21:56] Radar: I think if they can't answer that concretely then it's not.
[06:22:04] Radar: then grape isn't necessary*
[06:22:09] crystal77: has joined #RubyOnRails
[06:22:10] Radar: It's "let's use the new shiny just because!"
[06:22:14] agent_white: Ah alrighty. So start from that eh?
[06:22:39] Radar: That's what I'd do. Try and figure out the reason for the code being written that way
[06:22:45] Radar: Then I would check for any obvious stylistic mistakes
[06:22:51] Radar: then lastly: does the code do what they said it should do?
[06:25:02] dudepare: has joined #RubyOnRails
[06:26:54] mvxlr: has joined #RubyOnRails
[06:27:43] bronson: has joined #RubyOnRails
[06:28:19] agent_white: Radar: Alrighty! Thank you. We're a small shop (we have 5 developers, only 3 of which are full-time), so getting answers shouldn't be too hard.
[06:32:23] agent_white: I was actually invited to join the review process after I caused some bug, and reported it with a solution. Very simple thing (some controller parameter was used but not checked for existance)... but it was exciting to file my first bug report :)
[06:32:57] d0nn1e: has joined #RubyOnRails
[06:32:57] aganov: has joined #RubyOnRails
[06:33:19] agent_white: Ironically enough (relating to use of grape), it was in a 'api-controller'.
[06:34:06] tetraktys: has joined #RubyOnRails
[06:35:00] lxsameer: has joined #RubyOnRails
[06:35:00] lxsameer: has joined #RubyOnRails
[06:36:34] kripx: has joined #RubyOnRails
[06:37:21] qejk: has joined #RubyOnRails
[06:38:33] agent_white: Radar: Also -- what did you mean by "PR reviews" peer-reviews? Or?
[06:38:40] Radar: agent_white: Pull request
[06:38:52] Radar: i.e. someone submits a PR and then you sign it off
[06:39:29] agent_white: Ahhh. I couldn't say. I'll need to see their workflow once I speak more with our lead.
[06:40:23] agent_white: Radar: And how is something determined to be a 'large project' or 'complex'? -- Maybe, I just won't know until I have enough experience?
[06:40:45] agent_white: Sorry, kinda OT questions.
[06:43:48] emilkarl: has joined #RubyOnRails
[06:46:44] Radar: agent_white: np there's not a lot of other discussion going on at the moment
[06:46:52] Radar: agent_white: but yes, it comes with experience
[06:47:15] agent_white: Radar: No worry. I appreciate your responses!
[06:47:49] idefine: has joined #RubyOnRails
[06:48:17] jstransky: has joined #RubyOnRails
[06:48:20] clement59: has joined #RubyOnRails
[06:49:11] andywww: has joined #RubyOnRails
[06:50:10] clement59: Is it difficult to migrate a mailserver adminitration app using ruby 1.8.7 and rails 3.1.3 to the last ?
[06:50:33] arBmind: has joined #RubyOnRails
[06:50:34] Jet4Fire: has joined #RubyOnRails
[06:50:43] clement59: i'm not a developer, just a sysadmin, i'm looking for someone to help me on
[06:51:00] andywww: how do you refactor an if statement with two conditions, one dependent on the other?
[06:51:02] andywww: https://gist.github.com/anonymous/0427d98ae411ecff63753f7937b5c220
[06:51:19] andywww: it feels wrong having two of the same statements in there
[06:52:21] sevenseacat: the first one is unnecessary
[06:52:33] sevenseacat: just remove it
[06:53:07] Radar: what is this eql? business.
[06:53:14] Radar: params[:trending] == "down"
[06:53:42] tbuehlmann: this? https://gist.github.com/tbuehlmann/bafe6f8be1b9e34aed7ff561ede27570
[06:54:21] Radar: Would be better if params[:trending] value would be renamed to 'asc' instead of 'down' too
[06:54:42] Radar: https://gist.github.com/radar/21ba3e6ef3deecc22cc6770a069a19c5
[06:55:10] comrad: has joined #RubyOnRails
[06:55:45] sevenseacat: eh, that one I would let slide
[06:56:01] sevenseacat: because now you're letting people generate invalid SQL
[06:56:03] tbuehlmann: updated https://gist.github.com/tbuehlmann/bafe6f8be1b9e34aed7ff561ede27570
[06:56:03] agit0: has joined #RubyOnRails
[06:56:18] tbuehlmann: you can do that with a hash, too. but I'd prefer the first one
[06:56:26] agit0: has joined #RubyOnRails
[06:56:32] ur5us: has joined #RubyOnRails
[06:56:39] clement59: difficult to upgrade an old app using ruby 1.8.7 and rails 3.1.3 to the last ?
[06:56:50] sevenseacat: clement59: probably.
[06:56:57] sevenseacat: depends on the app and how it was written.
[06:57:16] Radar: clement59: depends on the complexity of the application.
[06:57:32] sevenseacat: clement59: !rule12
[06:57:32] helpa: clement59: Do not PM members of the channel without first asking if that is OK.
[06:58:15] edwinvdgraaf: has joined #RubyOnRails
[06:58:16] norc: has joined #RubyOnRails
[06:59:32] norc: Hi. I want to select a number of rows from a table (100,000+) at a time but would like to avoid AR object generation for each row due to the costs involved. Does AR provide an interface to yield plain arrays?
[07:01:44] norc: Oh! I think I just found it by accident. ActiveRecord::ConnectionAdapters::DatabaseStatements#select_rows seems like what Im looking for.
[07:02:04] Radar: norc: You could also use find_in_batches
[07:02:12] Radar: Depends on what you want to do once you've got them
[07:02:28] tbuehlmann: there's also this: http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html#method-i-select_values
[07:05:12] blackmesa: has joined #RubyOnRails
[07:05:13] bazzy: Radar, Listing 3.8 (Rails 4 in Action) is this a subtle plug for Sublime Text 3 or what?! xD
[07:05:32] kevr: man, i wish there were some actual explanations about how these things work in rails instead of instruction on how to do things.
[07:05:46] bazzy: the funny thing is I'm using it already xD
[07:05:51] ur5us: has joined #RubyOnRails
[07:05:52] Radar: bazzy: Yes it is :)
[07:06:00] Radar: bazzy: Wait until we start mentioning Internet Explorer.
[07:06:27] bazzy: oh boy X_X
[07:07:49] bazzy: Radar, are the co-authors in here? I'd like to know their handles
[07:07:55] Radar: bazzy: sevenseacat
[07:08:04] Radar: steve and yehuda aren't in here
[07:08:07] sevenseacat: <-- Rebecca Skinner, one of the co-authors
[07:08:20] bazzy: sevenseacat, nice to meet you (again) hehe I'm bad with names sry!~
[07:09:38] bazzy: I'm really digging writing this first Capybara test .. it's inspiring me to write my own integration testing framework that "emulates GUI interaction" for applications written in SDL (I don't know if one exists already) ...
[07:10:04] sevenseacat: capybara is one of the most excellent things about testing in Ruby.
[07:10:09] sevenseacat: I miss it a lot in other languages.
[07:10:11] artto: has joined #RubyOnRails
[07:10:25] bazzy: written *with* SDL I should say .. (It's a cross platform multimedia library in C)
[07:10:32] sevenseacat: capybara + rspec together are grooooooooovy
[07:11:06] istrasci: has left #RubyOnRails: ()
[07:11:12] bazzy: sounds terrific .. I will be inspired
[07:13:13] bazzy: I once had a potential client who ... along with some comrades, were drunk while they proposed a potential project I could execute .. They seemed completely closed to idea of user experience documentation ... I was pretty put-off by that ... I think a part of my dreams of approaching these people (they are friends after all) again after finishing this book and maybe closing a deal
[07:14:09] Radar: Having these kinds of tests is invaluable. The amount of bugs that have been prevented going into production because I've had broken tests...
[07:14:25] Radar: Broken tests mean that I messed something up and should fix it before it goes to production
[07:14:33] Radar: I'm actually running some tests RIGHT NOW before some code goes into production
[07:14:42] ravishankarjha: has joined #RubyOnRails
[07:14:52] Radar: http://i.imgur.com/C2VDWNv.png
[07:14:58] sevenseacat: the amount of times I've said 'this is just a tiny change, can't possibly hurt anything else.... oh wow it broke some tests'
[07:15:30] moeabdol: has joined #RubyOnRails
[07:15:38] bazzy: these people kind of just expected to understand exactly what they wanted without explanation .. I honestly think I would have to "experience" their current infrastructure at work in full detail to be able to know exactly what to do without their direct guidance
[07:15:42] Radar: In another feature I was working on today: I had to implement some crazy pricing logic. I wrote tests for each bit of the craziness as I needed it, watched the tests fail, then implemented the functionality and watched the test pass.
[07:15:58] Radar: And now for that craziness I have a test suite that says "at this point in time, the code behaved this way"
[07:16:54] bazzy: Radar, is that another way of saying "I've practically proven the logic is sound" at that point in time?
[07:16:54] sevenseacat: my current project is an accounting app, that crunches numbers from xero, quickbooks, etc. and does business forecasting. lemme tell you, I have formulas to calculate all kinds of junk and having tests to prove they're working as intended is invaluable
[07:16:55] HenriettaSalt: has joined #RubyOnRails
[07:16:59] Radar: bazzy: yes
[07:17:35] bazzy: sevenseacat, that's great to hear, because I imagine "junk formulas" coming my way hehehe
[07:18:48] bazzy: I'm really excited to be a Rails developer!~ Would you believe I'm (trying) to improve my C++ at the same time!
[07:18:55] sevenseacat: my boss gave me a spreadsheet full of data with calculations out the wazoo, I built another spreadsheet manually to make sure I understood them all, and then put all those numbers directly into tests
[07:18:56] Radar: Good to hear :)-
[07:20:00] kgrz: has joined #RubyOnRails
[07:21:13] DoubleMalt: has joined #RubyOnRails
[07:23:51] Hyuk: has joined #RubyOnRails
[07:23:53] bazzy: I actually first got involved with Rails in 2008 but I was far too young to really grasp it .. It was for an internship with MITRE straight out of highschool... and then even after a year or 2 I would build projects such as something out of this book, and I quickly realized I had no real project in mind ... (or a company to give me one, but I didn't want that at the time (even now)) and was lost without one .. and back then, somehow had a new rails way of
[07:23:53] bazzy: doing something every day! It was quite frustrating to me. I immediately accepted the notion that I would not be coding rails again until a real project fell into my lap .. and they are now!
[07:25:03] bazzy: Seemingly from the heavens, I happened upon an IRC bot framework written in Ruby (Cinch),
[07:25:03] bazzy: and that somehow was accepted by me (even though I hadn't coded Ruby in 5 years). This time around, the language feels wonderful, probably both due to my maturity as a programmer and the advancement of the language
[07:25:27] bazzy: and yes, I happened to want to write an IRC bot!~
[07:25:41] sevenseacat: Radar: is helpa based on cinch?
[07:25:52] Radar: sevenseacat: hell no. I wrote my own library.
[07:25:59] Radar: https://github.com/radar/summer
[07:26:24] bazzy: after that, I wanted to share data between "her" and a website! and I figured why not Rails!~ have the whole thing in Ruby.. Easier to share models I though! I hope it's a good idea to stay in the same language in this way..
[07:27:23] gingray: has joined #RubyOnRails
[07:28:14] sevenseacat: our bot helpa writes stuff to a database and then we did have a logs site written in Ruby, but it got ported to Elixir, reading from the same db
[07:28:20] sevenseacat: well, Radar's bot
[07:28:22] inspectah_stack: has joined #RubyOnRails
[07:28:38] bazzy: I'm interested why it got ported?
[07:29:05] Radar: I wanted to learn Elixir/Phoenix and it was a small enough app that I could do it.
[07:29:07] sevenseacat: fun, games and speed I think
[07:29:19] Radar: And my experiments with Phoenix showed that it was 5-13x faster than Rails.
[07:29:25] bazzy: ..."games"?
[07:29:35] Radar: bazzy: "fun and games" ?
[07:29:53] sevenseacat: "shits and giggles" more appropriate? <_<
[07:29:58] bazzy: wasn't sure you had a speed requirement because of a game app
[07:29:59] Radar: Also during the porting I found out that some of the DB queries were inefficient, and so I added indexes and then it became even faster.
[07:30:03] lxsameer: has joined #RubyOnRails
[07:30:03] lxsameer: has joined #RubyOnRails
[07:30:24] bazzy: sounds like a bunch of stuff I ought not worry bout till I get there
[07:30:30] Palsson: has joined #RubyOnRails
[07:30:33] Radar: hometime. Toodles.
[07:30:59] bazzy: yeah I've actually never heard of Elixir..
[07:32:01] bazzy: I'm tempted to investigate into it but I feel I should take smaller steps and really finish this book first and focus on rails, even if it may be slower
[07:32:25] universa1: and you've to be aware that for probably 95% rails is fast enough.
[07:32:34] sevenseacat: Rails is perfectly sufficient for 99% of apps :)
[07:32:52] universa1: and if you are one of the 1% you'll probably know it already ;)
[07:33:25] bazzy: what memory usage.. I have preconviction that rails might be a hog.. (though feeling this way doesn't really help my effort to learn)
[07:33:46] universa1: bazzy: lemme check ;)
[07:34:08] sevenseacat: no idea. that isnt relevant to me
[07:34:22] defsdoor: has joined #RubyOnRails
[07:34:29] bazzy: maybe not rails .. but perhaps ruby in general .. but I have no solid basis for my thought ..
[07:35:03] bazzy: I tend to prematurely optimize so I'll try not to worry about it
[07:36:22] mark_66: has joined #RubyOnRails
[07:36:47] bazzy: lately I've been using Github issues actually as my Todo XD .. I actually enjoy it, wouldn't do it otherwise .. but I have a certain "higher-scope" that I need to tend to, and I have no real location to manage .. and honestly a text file doesn't "feel good" ..
[07:38:14] universa1: 600mb ... nothing really to worry about
[07:38:43] bazzy: I can't take that seriously without a lot more context, but don't waste your time ..
[07:39:01] bazzy: I'm actually not quite interested
[07:39:34] jstransky: has joined #RubyOnRails
[07:39:41] bazzy: (not meant to sound rude)
[07:41:11] antgel: has joined #RubyOnRails
[07:44:57] jgt3: has joined #RubyOnRails
[07:53:28] finnnnnnnnnnn: has joined #RubyOnRails
[07:55:10] Morkel: has joined #RubyOnRails
[07:55:51] Morkel: I have real data in my production DB . My test fixtures are really tiny (3-4 datasets). Is it possible to copy the real data to my test data with fixtures?
[07:57:54] Ropeney: I don't know about others, but I prefer my tests to be data agnostic. Though you could write a script to load a production db into your test db at the start of your specs.
[07:59:02] sevenseacat: Morkel: what would you gain from doing that?
[07:59:18] ql6wlld: has joined #RubyOnRails
[07:59:26] Morkel: sevenseacat: I have real test data
[07:59:26] sevenseacat: does your real data expose some flaw in your app that your tests don't? if so, you should build test data to mimic it
[07:59:27] ImmoveableOne: has joined #RubyOnRails
[07:59:42] Morkel: sevenseacat: and i save time
[07:59:58] sevenseacat: you have real test data already
[08:00:12] sevenseacat: and what time do you save?
[08:00:42] Morkel: sevenseacat: to create complex test data
[08:00:59] sevenseacat: why do you need complex test data?
[08:02:05] artto: has joined #RubyOnRails
[08:02:08] Morkel: sevenseacat: to test every szenario
[08:02:27] chipotle: has joined #RubyOnRails
[08:02:39] sevenseacat: so you're going to go and backfill tests for every permutation of data under test?
[08:02:46] sevenseacat: that sounds more time consuming than time saving
[08:03:16] sevenseacat: your tests should already cover all the scenarios you care about, and that has nothing to do with data
[08:03:43] Morkel: sevenseacat: Ok, thanks. I will thing about my test data
[08:04:28] sevenseacat: great. by all means, create lots of different sets of test data to test all kinds of possibilities. but that's standalone from using production data for testing
[08:06:23] blackmesa: has joined #RubyOnRails
[08:07:16] jsrn_: has joined #RubyOnRails
[08:14:12] pawnbox: has joined #RubyOnRails
[08:14:51] adre: has joined #RubyOnRails
[08:16:19] akkmaxon: has joined #RubyOnRails
[08:16:49] srinidhi: has joined #RubyOnRails
[08:18:15] darutoko: has joined #RubyOnRails
[08:18:53] Ergo: has joined #RubyOnRails
[08:19:09] Palsson: has joined #RubyOnRails
[08:19:26] HenriettaSalt: has joined #RubyOnRails
[08:20:03] ferr: has joined #RubyOnRails
[08:20:45] lxsameer: has joined #RubyOnRails
[08:20:45] lxsameer: has joined #RubyOnRails
[08:26:13] jstransky: has joined #RubyOnRails
[08:28:42] noobsu: has joined #RubyOnRails
[08:29:35] bronson: has joined #RubyOnRails
[08:30:33] chipotle: has joined #RubyOnRails
[08:30:49] blackmesa: has joined #RubyOnRails
[08:31:16] jwang: has joined #RubyOnRails
[08:32:40] tetraktys: has joined #RubyOnRails
[08:33:38] moep: has joined #RubyOnRails
[08:36:32] antgel: has joined #RubyOnRails
[08:37:34] ravishankarjha: has joined #RubyOnRails
[08:39:21] Mweshi: has joined #RubyOnRails
[08:41:00] nertzy3: has joined #RubyOnRails
[08:41:06] Regulati_: has joined #RubyOnRails
[08:41:09] noobsu_: has joined #RubyOnRails
[08:41:49] proboszcz: has joined #RubyOnRails
[08:42:48] joeytwiddle_: has joined #RubyOnRails
[08:43:04] mikecmpbll: has joined #RubyOnRails
[08:43:14] robbkidd_: has joined #RubyOnRails
[08:43:15] ewilliam_: has joined #RubyOnRails
[08:43:18] deeprave_: has joined #RubyOnRails
[08:43:19] mwlang_: has joined #RubyOnRails
[08:43:27] jlpeters_: has joined #RubyOnRails
[08:43:37] podman_: has joined #RubyOnRails
[08:43:37] ebryn_: has joined #RubyOnRails
[08:43:44] Lloyd__: has joined #RubyOnRails
[08:44:32] BBHoss_: has joined #RubyOnRails
[08:44:36] chridal_: has joined #RubyOnRails
[08:44:39] itkin-: has joined #RubyOnRails
[08:44:43] humding3r: has joined #RubyOnRails
[08:44:48] alexblom_: has joined #RubyOnRails
[08:44:49] jcp_: has joined #RubyOnRails
[08:44:54] FooBarWidget_: has joined #RubyOnRails
[08:44:54] jtdowney_: has joined #RubyOnRails
[08:44:58] Spaceghost|work: has joined #RubyOnRails
[08:45:01] lz-dylan_: has joined #RubyOnRails
[08:45:01] MalcolmReynolds: has joined #RubyOnRails
[08:45:02] abracada-: has joined #RubyOnRails
[08:45:06] LBRapid_: has joined #RubyOnRails
[08:45:08] spion_: has joined #RubyOnRails
[08:45:08] sunya7a__: has joined #RubyOnRails
[08:45:11] finnnnnnnnnnn: has joined #RubyOnRails
[08:45:14] rarruda_: has joined #RubyOnRails
[08:45:26] jarib: has joined #RubyOnRails
[08:45:26] jarib: has joined #RubyOnRails
[08:45:45] Emily: has joined #RubyOnRails
[08:45:46] bodie__: has joined #RubyOnRails
[08:45:46] Seich: has joined #RubyOnRails
[08:45:46] upgrayeddd: has joined #RubyOnRails
[08:45:47] AmiMoench: has joined #RubyOnRails
[08:45:48] yodeler: has joined #RubyOnRails
[08:45:49] chridal: has joined #RubyOnRails
[08:46:05] alxndr: has joined #RubyOnRails
[08:46:06] Emily: has joined #RubyOnRails
[08:46:18] kevr: has joined #RubyOnRails
[08:46:18] Diabolik: has joined #RubyOnRails
[08:46:19] bazzy: has joined #RubyOnRails
[08:46:22] Majadon: has joined #RubyOnRails
[08:46:29] upgrayeddd: has joined #RubyOnRails
[08:46:41] srinidhi: has joined #RubyOnRails
[08:46:42] snowy: has joined #RubyOnRails
[08:46:43] CustosLimen: has joined #RubyOnRails
[08:47:22] daytime: has joined #RubyOnRails
[08:47:25] mcr-credil: has joined #RubyOnRails
[08:47:30] pawnbox: has joined #RubyOnRails
[08:47:35] blackjid: has joined #RubyOnRails
[08:47:36] zz_timnovinger: has joined #RubyOnRails
[08:47:56] mordocai: has joined #RubyOnRails
[08:47:59] AntiSpamMeta: has joined #RubyOnRails
[08:48:10] bedouin: has joined #RubyOnRails
[08:48:18] tpendragon: has joined #RubyOnRails
[08:48:22] IrishGringo_: has joined #RubyOnRails
[08:48:40] subsonik: has joined #RubyOnRails
[08:49:33] eggoez: has joined #RubyOnRails
[08:50:11] idefine: has joined #RubyOnRails
[08:50:46] krainboltgreene: has joined #RubyOnRails
[08:50:59] Macaveli: has joined #RubyOnRails
[08:51:46] marr: has joined #RubyOnRails
[08:51:58] amitchellbullard: has joined #RubyOnRails
[08:53:04] hayden__: has joined #RubyOnRails
[08:53:57] Didac: has joined #RubyOnRails
[08:54:32] machty: has joined #RubyOnRails
[08:54:51] Shidash: has joined #RubyOnRails
[08:55:41] jutah: has joined #RubyOnRails
[08:56:36] workmad3: has joined #RubyOnRails
[08:57:24] acalewin: has joined #RubyOnRails
[08:57:29] daemonwrangler: has joined #RubyOnRails
[08:57:47] zrl_: has joined #RubyOnRails
[08:57:49] alethea: has joined #RubyOnRails
[08:58:16] WhereIsMySpoon_: has joined #RubyOnRails
[08:58:22] Hyuk: has joined #RubyOnRails
[08:58:40] iamdevnul: has joined #RubyOnRails
[08:59:22] digitalfiz: has joined #RubyOnRails
[08:59:27] daxroc: has joined #RubyOnRails
[08:59:42] jhill: has joined #RubyOnRails
[08:59:54] jcugno__: has joined #RubyOnRails
[09:00:29] startupality: has joined #RubyOnRails
[09:00:39] kdisneur: has joined #RubyOnRails
[09:01:16] gmci: has joined #RubyOnRails
[09:01:28] circuit_eight: has joined #RubyOnRails
[09:02:11] d0nn1e: has joined #RubyOnRails
[09:03:11] sdn90: has joined #RubyOnRails
[09:04:37] SuppliedRelic: has joined #RubyOnRails
[09:04:57] snowy: has joined #RubyOnRails
[09:09:58] alfie_max15: has joined #RubyOnRails
[09:11:20] hjdivad: has joined #RubyOnRails
[09:12:39] Talltree_: does someone know if the gem ActiveModelSerializers enables more advanced PUT via json too?
[09:12:58] Talltree_: or rather POST
[09:15:40] AzaToth: has joined #RubyOnRails
[09:15:57] lxsameer: has joined #RubyOnRails
[09:16:29] mdw: has joined #RubyOnRails
[09:18:27] JohnBat26: has joined #RubyOnRails
[09:18:50] weckl: has joined #RubyOnRails
[09:20:10] HenriettaSalt: has joined #RubyOnRails
[09:20:44] Travis-42: has joined #RubyOnRails
[09:21:16] edwinvdgraaf: has joined #RubyOnRails
[09:21:54] universa1: Talltree_: what is a more advanced put?!
[09:25:20] inspectah_stack: has joined #RubyOnRails
[09:27:04] cgfbee: has joined #RubyOnRails
[09:29:34] bashusr: has joined #RubyOnRails
[09:29:55] Talltree_: universa1 apperantly i am not good at posting into multible models like i would via nested forms
[09:30:07] arBmind: has joined #RubyOnRails
[09:30:24] universa1: replicate the parameter structure from nested forms and it works.
[09:30:38] universa1: serializer has nothing to do with that, as the name implies: it is a serializer ;)
[09:32:29] Talltree_: i tried so many times, if i paste you my form can you help me with an example json? i managed to post into one model perfectly fine, the nested one is the problem
[09:33:09] universa1: Talltree_: create a nested form -> look at the parameters -> replicate that with json
[09:33:35] Talltree_: i thought maybe the jsonapi format would give me a sturcture that is a "industry standard"
[09:34:05] Talltree_: i read that rails format is not the best. weird.
[09:34:50] universa1: rails has his own convention. if you want to deviate from that, you have to do some stuff manully.
[09:36:37] ferr: has joined #RubyOnRails
[09:38:53] solars: quick question: if you're using factory girl, is there any way to test activerecord queries without actually persisting the instances (build only)? like can it hook into it somehow? or isn't this possible in general
[09:39:14] universa1: solars: how would you test a DATABASE query without data in the database?
[09:40:34] solars: well as you are executing the query on the model class, you could eventually hook into it somehow
[09:40:58] sevenseacat: are you actually testing the query then?
[09:41:25] universa1: solars: so your proposal could be adopted to this: I (actually me) write some data on a sheet of paper, now the database query has to be somehow rebuild to match the behavior as if the data were actually in the db
[09:41:30] solars: that's a matter of implementation, you're not testing sql
[09:41:32] universa1: if you want to reimplement sql... sure
[09:42:31] universa1: if you want the result of a database query, you need the data to be in the db basically.
[09:42:51] universa1: if you just want to check that the query has some condition, look at the relation object
[09:43:12] solars: well it depends on what you want to test I assume, but I think if you don't want to test the query the way to do it is to just mock the call
[09:43:33] sevenseacat: solars: you asked how to test the query
[09:43:57] solars: you're right, it as not what I meant
[09:44:18] sevenseacat: what did you mean then?
[09:44:31] antgel: has joined #RubyOnRails
[09:44:32] solars: sevenseacat, see above, basically the call to the object itself
[09:44:44] mdw: has joined #RubyOnRails
[09:44:51] sevenseacat: you can stub a find or a where call, yes
[09:44:51] fbandov: has joined #RubyOnRails
[09:44:59] solars: it was not an explicit question I was just thinking out loud as I'm trying to figure out how to speed things up
[09:45:09] solars: sevenseacat, yeah I think it boils down to doing that
[09:45:10] sevenseacat: I'll keep that in mind then
[09:45:29] solars: always friendly.
[09:45:53] MaDErroR123: has joined #RubyOnRails
[09:47:25] moeabdol: has joined #RubyOnRails
[09:48:01] srinidhi: has joined #RubyOnRails
[09:52:51] artto: has joined #RubyOnRails
[09:55:20] Talltree_: i am so dumb, i dindt use model_attributes
[09:58:56] shwoodard_: has joined #RubyOnRails
[10:02:12] artto: has joined #RubyOnRails
[10:06:39] jgt3: has joined #RubyOnRails
[10:07:16] alaing: has joined #RubyOnRails
[10:07:44] Cork: is it possible to tell rails to no merge a javascript file? (keep it as a separate script tag)
[10:08:25] sevenseacat: dont include it in your manifest file?
[10:09:17] Robtop__: has joined #RubyOnRails
[10:09:28] Cork: my what?
[10:09:59] universa1: Cork: !assets
[10:09:59] helpa: Cork: http://guides.rubyonrails.org/asset_pipeline.html - The Asset Pipeline Guide by Ryan Bigg, Richard Hulse & Mohammad Typaldos
[10:10:27] Cork: ya, i know about that one but...
[10:10:43] universa1: you are lazy? ;-)
[10:11:10] Cork: the only way i know to get a file to be separated into it's own tag is to add a separate javascript_include_tag
[10:11:23] Cork: my question was if there was another way
[10:11:39] Cork: that page as far as i've found doesn't answer that
[10:11:56] universa1: whoah, no offense... ...but from your original question, this was not what i've understood at all from your question.
[10:12:18] universa1: so, what other possibility of including a js file in a html page do you think off?
[10:13:17] Cork: the asset pipeline merges all files into one big js file when you go into production
[10:13:32] Cork: my question was (and still is); can i exclude one file from this merge
[10:13:57] universa1: as sevenseacat already answered: do not include it in your manifest (application.js)
[10:15:57] Cork: well duh...
[10:15:57] diegoaguilar: has joined #RubyOnRails
[10:16:04] Cork: but the problem is then it doesn't get included
[10:16:24] sevenseacat: thats what you wanted?
[10:16:30] Cork: so, again can i group include files from a folder without javascript_include_tag merging them
[10:16:32] universa1: so you have to add it to the precompile
[10:16:50] sevenseacat: javascript_include_tag just includes the file
[10:16:51] universa1: http://guides.rubyonrails.org/asset_pipeline.html#controller-specific-assets
[10:16:54] Cork: or do i have to add each one of them as a separate javascript_include_tag entry in the html
[10:17:04] sevenseacat: it does not merge anything - sprockets and the manifest does that
[10:17:36] universa1: you can create cork_wants_multiple_files.js (include the other js files there) and js_include_tag the cork_wants_... file.
[10:18:12] roelof: has joined #RubyOnRails
[10:18:18] universa1: adopt the content of the section of controller specific assets.
[10:18:30] roelof: if I have this json : [{"name"=>"Piero di Cosimo", "unFixedName"=>"Piero di Cosimo", "placeOfBirth"=>"Florence", "dateOfBirth"=>"1462-01-01", "dateOfBirthPrecision"=>nil, "dateOfDeath"=>"1522-04-12", "dateOfDeathPrecision"=>nil, "placeOfDeath"=>"Florence", "occupation"=>["tekenaar"], "roles"=>["schilder"], "nationality"=>nil, "biography"=>nil, "productionPlaces"=>["Florence"], "qualification"=>nil}]
[10:18:51] AimlessRAven: has joined #RubyOnRails
[10:20:00] roelof: why does this not work : naam = parsed_data["artObject"]["makers"]["name"] . I see then this error message : no implicit conversion of String into Integer
[10:20:05] AimlessRAven: can i use exist modal structure in my storefront to my amdin panel
[10:20:16] universa1: AimlessRaven: yes.
[10:20:17] AimlessRAven: i tolk about js.coffee view
[10:20:40] universa1: roelof: code + error => gist
[10:20:56] HenriettaSalt: has joined #RubyOnRails
[10:20:58] AimlessRAven: universa1: i mean js.coffee view in my storefront .. i wanna use it in my admin panel
[10:21:03] AimlessRAven: juist change parameters
[10:21:13] universa1: AimlessRaven: so? do that
[10:23:17] klbzz1: has joined #RubyOnRails
[10:24:16] Palsson: has joined #RubyOnRails
[10:24:20] roelof: universa1: here you have it : https://gist.github.com/rwobben/7631440051648dd9080ae1f7d8b93d19
[10:24:44] universa1: roelof: what is line 20?!
[10:25:28] universa1: roelof: https://gist.github.com/rwobben/7631440051648dd9080ae1f7d8b93d19#file-schilderij_controller-rb-L4 -- your json does not contain artobject.
[10:25:41] yfeldblum: has joined #RubyOnRails
[10:25:42] roelof: universa1: p name . Here I try to output the name out of the json
[10:25:57] universa1: gist the full controller.
[10:26:07] universa1: so line 20 is actually line 20.
[10:27:03] roelof: I have put the whole json output now on the gist
[10:27:31] roelof: no, line 20 is line 5 on the gist
[10:27:57] universa1: roelof: no offense. but p naam does not raise the error.
[10:28:28] universa1: roelof: and then: makers is an array!
[10:28:34] chipotle: has joined #RubyOnRails
[10:28:48] roelof: yep. a array that contains a hash
[10:28:56] universa1: roelof: look at each step: parsed_data["artObject]; parsed_data["makers"]
[10:29:12] universa1: roelof: you CAN NOT access an array with a string index.
[10:29:13] rubyonrails767: has joined #RubyOnRails
[10:29:17] universa1: that is what the error tells you.
[10:29:30] universa1: *parsed_data["artObject"]["makers"]
[10:29:31] roelof: oke, so I have to do first and then the name part ?
[10:29:46] rubyonrails767: i have a user model and a location model . I want to point all the users to the first ocurrence of their location in the location table as shown
[10:29:47] universa1: i don't know, depends on what you want.
[10:30:09] ur5us: has joined #RubyOnRails
[10:30:16] Detch: has joined #RubyOnRails
[10:30:22] universa1: but you'll figure it out, it is a simple array / hash selection.
[10:30:33] Robtop__: has joined #RubyOnRails
[10:30:44] roelof: I want to get only the value of the name out of the makers part
[10:31:48] bronson: has joined #RubyOnRails
[10:35:23] roelof: universa1: thanks, this works : naam = parsed_data["artObject"]["makers"].first["name"]
[10:44:33] srinidhi: has joined #RubyOnRails
[10:44:33] jgt3: has joined #RubyOnRails
[10:44:47] bazzy: Woo hoo Ch3 done
[10:45:18] emilkarl: has joined #RubyOnRails
[10:47:43] artto: has joined #RubyOnRails
[10:49:49] matthias_: has joined #RubyOnRails
[10:52:01] thorgi: has joined #RubyOnRails
[10:53:02] idefine: has joined #RubyOnRails
[10:56:19] tetraktys: has joined #RubyOnRails
[10:56:38] andywww: has joined #RubyOnRails
[10:58:15] JonasOSDever: has joined #RubyOnRails
[10:59:19] diegoaguilar: has joined #RubyOnRails
[10:59:20] barttenbrinke: has joined #RubyOnRails
[10:59:25] mvxlr: has joined #RubyOnRails
[11:00:04] antgel: has joined #RubyOnRails
[11:01:21] andywww: i want to build a service object that is called from a controller which manages cookies. i’d like all the functionality of the controllers: get :index, params: {} etc but inside my service object
[11:01:25] nettoweb: has joined #RubyOnRails
[11:01:36] andywww: i’m not sure how i’d structure the testing of the object
[11:02:06] andywww: would i do it through the controllers spec file and use the SO inside the controller?
[11:02:10] andywww: or is that cowboy?
[11:04:31] MaDErroR123: has joined #RubyOnRails
[11:07:06] Mweshi: has joined #RubyOnRails
[11:08:11] ravishankarjha: has joined #RubyOnRails
[11:10:09] srinidhi: has joined #RubyOnRails
[11:11:48] Mweshi: has joined #RubyOnRails
[11:20:29] elaptics: andywww: you'd just pass the cookies stuff into your service object
[11:20:51] elaptics: andywww: what are you trying to do exactly?
[11:21:40] HenriettaSalt: has joined #RubyOnRails
[11:23:32] bashusr: has joined #RubyOnRails
[11:24:31] Cervajz: has joined #RubyOnRails
[11:26:37] WilfredTheGreat: has joined #RubyOnRails
[11:32:15] newbie: has joined #RubyOnRails
[11:32:18] Mweshi: has joined #RubyOnRails
[11:33:54] newbie: Execuse me, I am veeeeeeery new to ruby and rails! how can i override before_save for all models (maybe overide ActiveRecord::base)
[11:35:58] ldnunes: has joined #RubyOnRails
[11:36:06] Mweshi: has joined #RubyOnRails
[11:36:26] rvanlieshout: newbie: have your models extend a custom class
[11:36:30] rvanlieshout: and not ActiveRecord::base
[11:36:38] rvanlieshout: then have that custom class extend ActiveRecord::Base
[11:37:01] sevenseacat: thats done for you in rails 5 :)
[11:37:38] chipotle: has joined #RubyOnRails
[11:38:13] jhass: newbie: also elaborate why you want to do it, maybe there's an easier way
[11:38:36] newbie: tnx for ur reply, is there any way to override a class of activeRecord::base
[11:38:55] newbie: jhass: I want to overide before save for redmine
[11:39:15] newbie: actually i want to convert all dates to timestamp, then use my custom calendar
[11:39:23] jhass: I can imagine the folks in #redmine have a better solution for your actual problem
[11:39:58] newbie: thnx, I will ask there too
[11:39:58] jhass: and that sounds like a wrong approach, sorry
[11:41:20] startupality: has joined #RubyOnRails
[11:41:35] Ropeney: has joined #RubyOnRails
[11:42:54] srinidhi: has joined #RubyOnRails
[11:47:05] ImmoveableOne: has joined #RubyOnRails
[11:52:12] artto: has joined #RubyOnRails
[11:52:40] |2701: has joined #RubyOnRails
[11:53:59] idefine: has joined #RubyOnRails
[11:54:16] Pumukel: has joined #RubyOnRails
[11:57:21] cgfbee: has joined #RubyOnRails
[11:58:44] andywww: elaptics: i want to read the params on every call to an action and manage the state of some filters, which i want to do with cookies so i don’t have to maintain a set of url parmeters
[11:59:19] rodfersou: has joined #RubyOnRails
[12:00:24] andywww: i’m up to here but i’m not sure i’m on the right track because it requires interaction with the controller
[12:00:24] andywww: https://gist.github.com/anonymous/50793b605bbe24029d84d6a425ab4b3d
[12:02:47] elaptics: andywww: so you're wanting to set a load of cookies?
[12:03:11] andywww: i want to offload the params and have the service object manage the cookies
[12:03:31] andywww: based on what is in the parames and the current state of the cookies
[12:03:32] RubyNewbey_____: has joined #RubyOnRails
[12:03:39] elaptics: just have your service object take in the params and cookies from the controller and return the managed cookies which you can use and set in the controller
[12:04:26] elaptics: e.g. cookies = FilterManagementService.new(params, cookies).managed_cookies or whatever
[12:04:40] andywww: and clear the cookies and reset them with whats returned from the SO on each request?
[12:05:01] andywww: thats probably better actually, yeah
[12:05:15] andywww: thanks i’ll have a look into it
[12:05:56] andywww: on a side note, is there a better way to persist filters across page loads?
[12:06:01] andywww: this feels very hacky
[12:06:16] elaptics: what sort of filters?
[12:06:57] tbuehlmann: andywww: is this cookiething a must-have? it's not bookmarkable
[12:07:10] andywww: well, thats the other thing
[12:07:10] artto: has joined #RubyOnRails
[12:07:18] ramblex: has joined #RubyOnRails
[12:07:27] andywww: in the app there are a number of buttons which toggle filters on and off
[12:07:31] tbuehlmann: if it's not a must-have, I'd recommend something I wrote *cough*
[12:07:34] andywww: i want to persist that across page loads
[12:08:00] mdw: has joined #RubyOnRails
[12:08:03] tbuehlmann: might be too much for your use case, might be exactly what you're looking for: https://github.com/tbuehlmann/lappen
[12:08:45] andywww: bookmarked :)
[12:09:09] andywww: i basically have two filters, one which selects a time period with 3 options
[12:09:22] andywww: one which orders the results asc or desc
[12:09:52] andywww: i want to, say, if the user selects 24 hours, persist that selection if they then click sort desc
[12:10:31] andywww: i figure i can do it by either URL parameters and maintaining state in cookies
[12:10:56] tbuehlmann: I personally would only use GET params, but well
[12:11:01] tbuehlmann: launch, brb!
[12:11:03] andywww: or by maintaining state by holding maintaining the URL parameters
[12:11:58] andywww: either way i want to do it in an SO and need some way of interacting with the controller
[12:12:11] chouhoulis: has joined #RubyOnRails
[12:12:17] andywww: but either way is sorted by elaptics suggestion so…
[12:12:21] andywww: i’m just gonna flip a coin
[12:12:23] andywww: thanks guys
[12:12:31] Juanchito: has joined #RubyOnRails
[12:12:43] artto: has joined #RubyOnRails
[12:14:22] roshanavand: has joined #RubyOnRails
[12:16:27] flashpoint9: has joined #RubyOnRails
[12:17:48] artto: has joined #RubyOnRails
[12:19:02] nickenchuggets: has joined #RubyOnRails
[12:21:28] Craigimus: has joined #RubyOnRails
[12:22:18] chipotle: has joined #RubyOnRails
[12:22:25] HenriettaSalt: has joined #RubyOnRails
[12:24:21] artto: has joined #RubyOnRails
[12:24:33] maucar: has joined #RubyOnRails
[12:25:16] someish: has joined #RubyOnRails
[12:25:31] Craigimus: has joined #RubyOnRails
[12:28:02] blackmesa: has joined #RubyOnRails
[12:30:31] artto: has joined #RubyOnRails
[12:34:05] pawnbox: has joined #RubyOnRails
[12:37:01] Oliphaunte: has joined #RubyOnRails
[12:40:46] timmyBsd: has joined #RubyOnRails
[12:40:54] jscheel: has joined #RubyOnRails
[12:41:45] cheeti: has joined #RubyOnRails
[12:43:13] cheeti: hi verify_recaptcha giving error in production i am using rails 4.2.5. how to solve this?
[12:43:21] jancel: has joined #RubyOnRails
[12:43:41] universa1: well, look at the error, figure it out, ...
[12:43:52] ashleyw: has joined #RubyOnRails
[12:43:54] universa1: google it...
[12:43:59] universa1: or show it.
[12:44:06] context: cheeti: resolve the error
[12:44:10] context: thats what i usually do
[12:44:55] context: universa1: "figure it out" ? not sure thats been taught at schools in a long while
[12:45:26] universa1: context: ;)
[12:45:29] pawnbox: has joined #RubyOnRails
[12:45:56] silverdu1t: What do I use to log something from an action to the rails server
[12:46:12] workmad3: `logger.info "blah blah"`
[12:46:13] cheeti: context i know i have to resolve but don't know how that's why asking
[12:46:28] silverdu1t: right. Thanks workmad3
[12:46:31] universa1: cheeti: so my r program broke, how to fix it?
[12:46:40] workmad3: silverdu1t: also, it's just logging something... the `to the rails server` part at the end of your sentence is pretty meaningless
[12:47:39] cheeti: universa1 tell me what error?
[12:48:08] jhass: ACTION grabs popcorn
[12:48:09] silverdu1t: I just wanted to make it clear so I don't get `render plain: 'blah blah' and return` as response
[12:48:17] gingray: has joined #RubyOnRails
[12:48:33] silverdu1t: because I wanted to see it on cli not a view
[12:48:44] universa1: cheeti: o0. show your code, error trace, ...
[12:50:23] Ropeney: has joined #RubyOnRails
[12:50:55] workmad3: silverdu1t: right... that's why I'm clarifying that just asking how to log something is enough ;)
[12:52:05] workmad3: silverdu1t: also, minor correction too - using `logger.info` will write to the appropriate log in `logs/` (such as `logs/development.log`), not write directly to the console. It's just a nicety that most rails servers in development mode will also tail that log file out to the console
[12:53:01] workmad3: silverdu1t: if you're in production, you'll want to be aware of that distinction so that you know to look in the right place (or so you know what to search for in order to direct your log output somewhere else)
[12:53:40] cheeti: universa1 https://gist.github.com/mamatharao/30ca00f1da4ccf4c21622507736c7843
[12:54:13] universa1: cheeti: !gist-usage
[12:54:13] helpa: cheeti: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[12:54:23] sevenseacat: there's no error in that gist
[12:55:33] tetraktys: has joined #RubyOnRails
[12:57:39] workmad3: cheeti: helpa has been taught to only answer to people it trusts
[12:58:17] cheeti: workmad3 what?
[12:58:51] ramortegui: has joined #RubyOnRails
[12:58:56] workmad3: cheeti: you can't use helpa bot commands if you haven't been granted permission
[12:59:15] workmad3: (I just like anthropomorphising our friendly chatbot)
[12:59:44] aegis3121: has joined #RubyOnRails
[13:00:12] pawnbox: has joined #RubyOnRails
[13:01:41] GorillaApe: has joined #RubyOnRails
[13:01:47] adre: has joined #RubyOnRails
[13:02:27] pawnbox_: has joined #RubyOnRails
[13:02:57] GorillaApe: I am trying to reuse .add_search_scope code block
[13:02:59] GorillaApe: https://gist.github.com/parhs/c4384172f22f17dd159b99d083c73309
[13:03:06] GorillaApe: however everything I try fails
[13:03:15] GorillaApe: any idea how to do this?
[13:03:57] cheeti: universal https://gist.github.com/mamatharao/a25bac6671de35364cd7d3afd12ff05f
[13:04:15] universa1: cheeti: error=
[13:04:59] cheeti: universa1 sorry i am not getting it is also not clear
[13:05:21] universa1: how do you know there is an error then?
[13:06:05] Lonloren: has joined #RubyOnRails
[13:06:17] camilasan: has joined #RubyOnRails
[13:07:54] wolfravenous: has joined #RubyOnRails
[13:08:30] artto: has joined #RubyOnRails
[13:09:11] quazimodo: has joined #RubyOnRails
[13:10:14] mrgreenfur: has joined #RubyOnRails
[13:11:07] mvxlr: has joined #RubyOnRails
[13:15:37] silverdu1t: How can I use the after_database_authentication as shown here http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/DatabaseAuthenticatable#after_database_authentication-instance_method
[13:15:58] silverdu1t: I have it in my users sessions controller and it does nothing
[13:16:41] silverdu1t: What I'm simply trying to achieve is move some data from cookie to database on sign in
[13:16:51] universa1: silverdu1t: .../master/Devise/Models/... do you notice something?
[13:17:13] silverdu1t: oops yes Model
[13:19:14] context: did he just say he is not getting the error, and also it is not clear
[13:19:24] context: meh, he left
[13:22:10] universa1: context: yep ;)
[13:23:10] HenriettaSalt: has joined #RubyOnRails
[13:24:43] rbr: has joined #RubyOnRails
[13:24:59] Lonloren: has joined #RubyOnRails
[13:28:16] Mweshi: has joined #RubyOnRails
[13:28:43] moeabdol: has joined #RubyOnRails
[13:29:00] yos7ph: has joined #RubyOnRails
[13:31:34] Oliphaunte: has joined #RubyOnRails
[13:31:43] aegis3121: has joined #RubyOnRails
[13:32:56] alaing: has joined #RubyOnRails
[13:33:23] BaNzounet: Hey, depending on the type of an object I want to use diffrent route helper, is it possible to write something shorter than `@foo.instance_of(User) ? user_a_real_path : organization_a_real_path` ?
[13:33:40] BaNzounet: only the prefix will change depending on the type
[13:33:45] universa1: BaNzounet: polymorphic routing?
[13:34:20] context: uhh. you dont have any "objects" at the routing layer
[13:34:20] bronson: has joined #RubyOnRails
[13:34:49] Lonloren: has left #RubyOnRails: ()
[13:35:01] context: banzounet: is the controller itself really doing that different of work between a user and an org ?
[13:35:13] context: banzounet: you can use different views based off the class easily
[13:35:53] VeryBewitching: has joined #RubyOnRails
[13:36:49] context: banzounet: your "blah_path" relate to urls. so if thats what you wanna do just have your controller, and redirect the user to that specific url. otherwise make your org/user interfaces the same and use some sort of profile_controller to show them both. you can do _user.html.erb and _organization.html.erb (the model names) to show different partials for different classes
[13:37:44] Lonloren: has joined #RubyOnRails
[13:38:04] macsteps: has joined #RubyOnRails
[13:38:05] startupality: has joined #RubyOnRails
[13:38:10] cold_zero: has joined #RubyOnRails
[13:39:41] emilkarl: has joined #RubyOnRails
[13:40:03] chipotle: has joined #RubyOnRails
[13:40:11] pepee: has joined #RubyOnRails
[13:41:17] eljimbo: has joined #RubyOnRails
[13:43:17] antgel: has joined #RubyOnRails
[13:45:16] BaNzounet: universa1: thanks, didn't know about that, look like I will able to use that
[13:46:52] BaNzounet: context: nope, there are the same controllers, but one use /my-account/* and the other /organization/:id/*, nice idea about using different view, but that would duplicated the menu just to have different URls helper
[13:49:59] Oliphaunte: has joined #RubyOnRails
[13:52:31] jancel: has joined #RubyOnRails
[13:54:55] cold_zero: has left #RubyOnRails: ("Ex-Chat")
[13:55:19] HenriettaSalt: has joined #RubyOnRails
[13:56:34] alfie_max15: has joined #RubyOnRails
[13:56:55] andyjeffries: has joined #RubyOnRails
[13:58:46] akshat: has joined #RubyOnRails
[14:01:34] akshat_: has joined #RubyOnRails
[14:02:25] artto: has joined #RubyOnRails
[14:02:36] gremly: has joined #RubyOnRails
[14:05:20] macsteps: has joined #RubyOnRails
[14:06:35] idefine: has joined #RubyOnRails
[14:10:23] Travis-42: Is there any current well supported method of connecting to Amazon RedShift with ActiveRecord (there is a somewhat unmaintained hacky looking solution for rails 4, nothing for rails 5 that I could find)? Or is the best solution at the moment still just to connect directly with PG?
[14:11:37] brendan-_: has joined #RubyOnRails
[14:12:08] umdstu: has joined #RubyOnRails
[14:13:52] umdstu: Despite curl working, and browser access working, RestClient can’t seem to establish an SSL connection to a host. ‘alert certificate unknown’ error. Using the same cert and ca with curl is fine. what could be wrong?
[14:14:08] IrishGringo: has joined #RubyOnRails
[14:14:24] chipotle: has joined #RubyOnRails
[14:14:58] tvw: has joined #RubyOnRails
[14:15:01] idefine_: has joined #RubyOnRails
[14:16:08] wolfravenous: has joined #RubyOnRails
[14:16:44] startupality: has joined #RubyOnRails
[14:17:09] jscheel: has joined #RubyOnRails
[14:18:30] insanedreamer: has joined #RubyOnRails
[14:19:13] Mweshi: has joined #RubyOnRails
[14:19:36] cd83x: has joined #RubyOnRails
[14:20:34] neanderslob: has joined #RubyOnRails
[14:21:28] arBmind1: has joined #RubyOnRails
[14:24:14] Oliphaunte: has joined #RubyOnRails
[14:24:46] mozzarel1: has joined #RubyOnRails
[14:24:59] JakFrist: has joined #RubyOnRails
[14:26:36] crystal77: has joined #RubyOnRails
[14:26:43] tetraktys: has joined #RubyOnRails
[14:28:58] mikecmpbll: has joined #RubyOnRails
[14:30:02] blackmesa: has joined #RubyOnRails
[14:35:47] iamvery: has joined #RubyOnRails
[14:37:16] qejk: has joined #RubyOnRails
[14:38:13] epochwolf: Travis-42: I don't see any up to date ODBC connectors for ActiveRecord.
[14:39:11] wolfravenous: has joined #RubyOnRails
[14:39:16] cpruitt: has joined #RubyOnRails
[14:40:55] akshat: has joined #RubyOnRails
[14:44:19] Axilla: has joined #RubyOnRails
[14:44:33] Axilla: hey all, whats the prefered way to return a true/false json response for something like "favorites"
[14:44:49] Axilla: when making an ajax request and returning json
[14:45:09] JesseH: has joined #RubyOnRails
[14:47:56] silverdust: has joined #RubyOnRails
[14:48:42] srinidhi: has joined #RubyOnRails
[14:48:59] tubbo: axilla: what do you mean, like an acknowledgment of success?
[14:50:05] epochwolf: ok: true, status: "ok", success: true
[14:51:41] durexlw: has joined #RubyOnRails
[14:51:42] epochwolf: Github uses the http response code 200 to acknowledge success.
[14:51:52] epochwolf: A non 200 response is an error.
[14:52:01] durexlw: afternoon all
[14:52:02] epochwolf: (in general, I haven't read all of it)
[14:52:20] agent_white: has joined #RubyOnRails
[14:52:24] durexlw: epochwolf: hacking github again?! :)
[14:52:47] workmad3: epochwolf: I'm pretty sure github sticks to the HTTP standard, so 2xx codes are success, 3xx include things like redirects, 4xx are client errors and 5xx are server errors
[14:53:15] epochwolf: durexlw: nah, I hacked furaffinity.net
[14:53:15] epochwolf: workmad3: probably, haven't read all of it.
[14:53:18] workmad3: epochwolf: so a 204 is also fine as a success (and clients that treat `code != 200` as an error are likely to get things wrong) :)
[14:53:29] alfie_max15: has left #RubyOnRails: ("Leaving")
[14:53:51] epochwolf: workmad3: we can agree github has probably the best example of a proper json api, right?
[14:54:23] epochwolf: hmm... 201 Created is the response code for a new gist.
[14:54:45] epochwolf: They even include the location in the header.
[14:54:57] workmad3: epochwolf: they also support HTTP cache headers and the `304 Not Modified` response
[14:55:00] durexlw: epochwolf: lol :)
[14:55:11] epochwolf: workmad3: stop, I can only get so erect.
[14:55:14] Axilla: tubbo: nevermind, i worked it out
[14:55:21] njero: has joined #RubyOnRails
[14:55:21] Axilla: nah i just wanted to return a json response
[14:55:26] Axilla: with is_favorite: true or false
[14:55:28] durexlw: mornin' agent_white
[14:55:35] workmad3: epochwolf: they have a good JSON api with decent use of HTTP where appropriate... not sure I'd go as far as to say 'the best example', but I'm typically very hesitant about superlatives
[14:55:51] workmad3: axilla: JSON supports true/false booleans directly
[14:55:51] epochwolf: workmad3: how british of you
[14:56:01] Axilla: workmad3: yea i'm an idiot :)
[14:56:04] Axilla: typing it out helped..
[14:56:08] Axilla: already got it going :P
[14:56:17] Axilla: thanks guys as always <3
[14:58:35] Rixius: has joined #RubyOnRails
[14:59:16] durexlw: anyone has experience using s3 to store assets of a website? I'm kinda wondering how I should go about that: say I store images/vids on my s3 and I want to access those images/vids on my site, how do you go about that then? I guess the image_tag doesn't work anymore then?
[14:59:26] Axilla: just did it
[14:59:32] Axilla: i am using paperclip
[14:59:36] Axilla: plus aws-sdk gem
[15:00:00] workmad3: durexlw: it works fine, you just need to set the asset_host in your config and point it at your bucket
[15:00:57] durexlw: I see, that makes sense... I'll read up on the aws-sdk gem first. I guess it'll describe the asset_host thing
[15:01:53] purrkode: has joined #RubyOnRails
[15:02:07] existensil: has joined #RubyOnRails
[15:02:18] mordocai: Anyone know of any actually good open source reporting services stuff? Something similar in feature set to Jaspersoft/Microsoft SQL Reporting Services. Rails integration a plus.
[15:03:15] workmad3: durexlw: the aws-sdk gem is just a ruby client for AWS services
[15:03:27] workmad3: durexlw: what you probably want to look at is the asset_sync gem
[15:03:32] JakFrist: has joined #RubyOnRails
[15:03:57] workmad3: durexlw: or you could look at something like fastly as a CDN that can use your rails app as an origin server
[15:03:58] ferr: has joined #RubyOnRails
[15:04:43] durexlw: fastly ? I'll ask google first :) thanks for the asset_sync gem... sounds interesting
[15:05:40] workmad3: durexlw: but basically, they all work the same in terms of rails config for the running app - you set the asset_host config variable, and that adjusts the behaviour of things like `image_tag` so it generates links to assets using a fully-qualified URL using your asset host
[15:06:45] workmad3: durexlw: the rest is basically just the logisitics of how you get your data onto that separated domain (asset_sync is for uploading all your precompiled assets to something like s3, fastly is a CDN that will cache your assets when they're requested, etc.)
[15:07:09] durexlw: I see... so basically the s3 gems allow to define a bucket instance I guess that 'has' the credentials in it, from there we point the asset pipeline to the bucket and have rails do it's thing. Like that?
[15:08:41] tubbo: i would also suggest serving assets from a CDN. in fact, S3 is not really a recommended place to originate your static files from
[15:08:50] errakeshpd: has joined #RubyOnRails
[15:09:07] durexlw: tubbo: I mostly consider this for video... not so much the images
[15:09:24] tubbo: in that case, you definitely should be serving from a CDN :)
[15:09:34] tubbo: durexlw: what kind of video are you trying to stream? i'm doing the same thing myself actually.
[15:10:01] durexlw: tubbo: e-learning courses, or vids that support real life courses
[15:11:57] durexlw: tubbo: I'm not really concerned by speed too much. I'd probably prefer s3 couse I have an account there... I'd like to keep my bookkeeping simple :) You see a problem in using s3 for streaming vids?
[15:13:00] circuit_eight: I thought s3 was a CDN? What are the key differences?
[15:13:03] tubbo: not really. that's where i'm hosting my videos because i'm using AWS Elastic Transcoder to get them in HLS format. i figure that will be the cheapest way to stream.
[15:13:53] tubbo: circuit_eight: S3 is a cloud object storage platform. amazon also provides a CDN service called CloudFront (that I also use)
[15:14:38] Rixius: has joined #RubyOnRails
[15:14:42] antgel: has joined #RubyOnRails
[15:14:45] tubbo: cloudfront can do additional things like providing edge locations and relays for RTMP and HLS, used to stream live video
[15:14:53] workmad3: circuit_eight: the main differences are around things like edge-server caching that CDNs use in order to reduce the geographical distance from users and servers with their desired content
[15:15:36] tubbo: right. think of it more like a cache that you put in front of some kind of originating storage
[15:15:46] theRoUS: has joined #RubyOnRails
[15:16:00] circuit_eight: Ah I see, so you store on S3, then distribute with cloudfront?
[15:16:20] circuit_eight: Cool thanks :)
[15:16:22] durexlw: tubbo: is cloudfront needed?
[15:16:24] tubbo: or, in my case, you upload to S3, transcode with Elastic Transcoder, then distribute on CloudFront
[15:16:42] circuit_eight: And you transcode to reduce file size / change the format?
[15:16:47] workmad3: circuit_eight: pretty much... CDNs aren't intended to be a canonical source, they're the caching layer intended to make serving your assets fast (and also so you don't suck up all your server resources serving static files)
[15:16:56] durexlw: I seem to find people that stream from s3 straight
[15:17:02] yellow5: has joined #RubyOnRails
[15:17:13] workmad3: durexlw: oh, people do it... but that doesn't mean it's a recommended practice ;)
[15:17:45] workmad3: durexlw: especially not for high-volumes of static files that are so easily served by CDNs
[15:17:50] durexlw: true... there's probably the one guy that stuck his pinky in a blender once...
[15:18:19] durexlw: gonna check CloudFront pricing then
[15:18:31] circuit_eight: workmad3: Ah i see thanks
[15:18:41] tubbo: the real issue is cost. you pay a lot more for each download of an S3 file than you do for a download of a file off the CDN. but you pay more to have the CDN in operation. so it really depends.
[15:18:44] ereslibre: has joined #RubyOnRails
[15:18:44] ereslibre: has joined #RubyOnRails
[15:20:06] durexlw: tubbo: agreed
[15:20:06] markalanevans: has joined #RubyOnRails
[15:20:35] durexlw: I think it's not the easiest thing to do, to estimate cost on the whole thing
[15:20:39] disgrntld: has joined #RubyOnRails
[15:21:11] workmad3: durexlw: it really isn't... most of these services charge by transfer volume in some form, which means that you pay more as your userbase increases
[15:21:21] jhack: has joined #RubyOnRails
[15:21:58] durexlw: workmad3: then I should reconsider monetizing: currently it's like an extra service to real courses... but I don't like working for free :)
[15:22:02] tubbo: thankfully, a CDN is pretty easy to move around imho
[15:22:24] durexlw: tubbo: what do you mean by 'move around'?
[15:22:33] workmad3: durexlw: change provider
[15:22:56] durexlw: ow, ok... well, they all charge at one point. I guess differences won't be that bog
[15:23:01] workmad3: and yeah, I'd agree (within certain constraints)
[15:23:43] workmad3: e.g. there's more difficulty involved in changing from a CDN that does origin pulls to one that expects pushs of updated assets (because you need to modify your deployment processes)
[15:24:11] tubbo: they're priced for different levels of scale. like akamai, limelight, fastly, or maxcdn are all priced differently and work out for different businesses.
[15:24:13] workmad3: but most of the cost of change is deployment-based rather than code-based
[15:24:19] hobodave: has joined #RubyOnRails
[15:24:28] jhack_: has joined #RubyOnRails
[15:24:29] durexlw: tubbo: the streaming, how protected are your vids then?
[15:25:20] workmad3: (or, in the case of our current fastly use, a lot of cost of change would be in transferring all of our different services across to a new provider)
[15:26:00] tubbo: durexlw: well in my case, i don't have to protect them. but if you do want to protect them, there are ways to do that. all of my videos are public because that's the point of the site.
[15:26:29] durexlw: tubbo: One thing I'm wondering is: is it worth the cost? In the end I'm doing this cause anyone can copy/paste an URL of a youtube vid... but if the whole s3, cloudfront doesn't offer a fair layer of preventing the user to copy the video around, I might as well use youtube
[15:26:49] durexlw: tubbo: how do you then monetize the whole thing?
[15:27:32] workmad3: durexlw: ah, if you want access-control, s3 could make sense... and so could serving yourself but using nginx's sendfile features to avoid the load on your rails app
[15:27:33] tubbo: durexlw: well in my case, these are videos of a live streaming electronic music party (sorta like boilerroom.tv). so i monetize the whole thing by charging money at the door haha
[15:28:17] tubbo: also it doesn't make money, in fact it loses hundreds of dollars each party. the site is served from heroku's free tier, and i pay less than $25/mo for all my S3/CloudFront/Route53 resources which includes that site.
[15:28:21] durexlw: "door to internet"... you might have found a solid business there: :)
[15:28:25] tubbo: so it doesn't really cost anything to operate
[15:28:51] workmad3: durexlw: if you're not monetizing yet though, I doubt there's much need to worry about access control on your youtube vids either :)
[15:28:53] tubbo: it's *going* to however, which is why i'm working costs out for the CDN right now
[15:28:55] durexlw: tubbo: why then not use youtube? and embed that?
[15:29:03] tubbo: GOOD FUCKING QUESTION :P
[15:29:11] tubbo: in fact, we *do* use youtube right now: http://brother.ly
[15:29:25] tubbo: notice how most of those videos are muted? that's because of youtube's fucking draconian copyright policy
[15:29:39] tubbo: so fuck those people we're going to host our own videos on our own network that we pay for so nobody can bother us.
[15:29:44] Oliphaunte: has joined #RubyOnRails
[15:30:05] durexlw: ok, that's a fair motivation :)
[15:30:06] tubbo: i'm over here trying to get people's names out and their record labels are muting my videos.
[15:30:19] tubbo: it's not their fault it's just the automated system is way too clever
[15:30:33] tubbo: and i have no idea how to get my channel just excluded from all that..
[15:30:38] durexlw: we should get those robots fired man
[15:31:03] durexlw: is buying google an option?
[15:31:06] tubbo: i suppose youtube, much like most big things, would rather ban everything than try to figure out each edge case
[15:31:11] workmad3: tubbo: insert some subsonic noise into your audio streams, see if you can foil the youtube fingerprinting :)
[15:31:30] durexlw: that going deep :)
[15:31:31] tubbo: workmad3: for the whole video? haha yeah that'll get people listening.. :P
[15:31:55] durexlw: "subsonic" is the keyword :)
[15:31:56] maucar: has joined #RubyOnRails
[15:31:59] tubbo: unlike soundcloud, youtube seems to check out the whole thing. all 6 hours. so the next morning after a party i get over 100 emails for each individual copyright violation.
[15:32:16] tubbo: yeah it's pretty obnoxious
[15:32:49] tubbo: and considering i've had a few years experience developing apps on S3 and with video streaming in particular, i figure it's just easier for me to do it and eat the cost than to deal with the politics.
[15:33:09] durexlw: workmad3: you said for authorization s3 would make sense... you still see use for cloudfront in that scenario?
[15:33:41] workmad3: durexlw: access-control is something that's typically not possible with CDNs (or at a minimum, pretty damn difficult to scale)
[15:33:47] durexlw: tubbo: can you say something about userbase, gb's per month and cost?
[15:33:56] durexlw: workmad3: ok
[15:34:00] workmad3: durexlw: so if you need access-control, chances are you want to keep that content off the CDN
[15:34:04] tubbo: durexlw: i'm not sure what you mean
[15:34:23] |2701: has joined #RubyOnRails
[15:34:23] |2701: has joined #RubyOnRails
[15:34:43] durexlw: tubbo: well, if you go on a site, right click and see the content, you can snip out most of the times the link to the video
[15:35:05] durexlw: the same goes when storing on s3, but acessing it directly will violate policy and the download should fail
[15:35:11] durexlw: ... that's the plan... :)
[15:36:41] durexlw: but I'm still wondering if it's worth all the trouble... if I wanted a vid, I most of the time got them ripped anyway. But on the other hand, having people right click on the youtube vid, copy the link and paste them to their neighbor... I'd probably want to make it a bit harder than that
[15:36:47] tubbo: i don't see how accessing a video directly will violate policy
[15:36:58] tubbo: if i'm logged in to your site and i access a video, no matter how i access it, i should be able to see it right?
[15:36:59] bronson: has joined #RubyOnRails
[15:37:18] durexlw: see on the site yes, but downloading it
[15:37:33] tubbo: what's the difference?
[15:37:51] epochwolf: tubbo: uploading it to bittorrent.
[15:37:51] tubbo: if i send your server an http request for a video, how do you know whether i'm downloading it or just streaming it? :
[15:38:23] tubbo: that's one reason why you might want to go with transcoding to HLS. that way it's an m3u8 playlist playing thousands of small segments of the video
[15:38:33] epochwolf: tubbo: it's more about stopping moderately technically savy people from cheating the system.
[15:38:39] durexlw: tubbo: if I can find a link to a site, and I can use that site to paste on facebook let's say, that's an easy copy
[15:38:42] tubbo: another reason is to lower the costs of streaming...you can encode to many different bitrates and let the client handle it.
[15:38:46] durexlw: what epochwolf says :)
[15:38:52] tubbo: no you are missing my point
[15:39:05] durexlw: I might... be patient with me and repeat :)
[15:39:09] durexlw: ... slower :)
[15:39:23] Psy-Q: can i destroy the session of a single user, only knowing their user_id from the db? i'm using devise with a cookie session store
[15:39:35] wolfravenous: OT: So I was on here a few weeks back stuglling with a problem and someone invited me into a github group Ruby Sherpas to share a resource. I was thankful for the add and resource, but then a couple days ago I got a notice from github that I was removed from the group. I looked and the group only has one person now. Just wondering how I might go about joining a similar group on github. Thanks.
[15:39:38] Psy-Q: so that this particular user is no longer logged in the next time they visit?
[15:40:12] tubbo: you can't know whether i'm going to download something. your server is just serving video content. so if you're just serving an MP4 video, i can download that content instead of stream it. but if you're serving an M3U8 playlist of thousands of TS segments, it's a little harder for me to download the actual video content. i can only download the playlist that points to each piece of video.
[15:41:11] epochwolf: Psy-Q: only if you have a user id on the sessions table.
[15:41:11] tubbo: HLS is a lot better for streaming video for a hell of a lot of other reasons than just obfuscating where a video is coming from, like you can adapt the bitrate to the client's internet connection automatically. instead of trying to figure out your client's connection, you can just encode several streams of the same content in the m3u8 and let the client pick which stream it wants
[15:41:16] durexlw: might be... I don't know the format... it's new to me
[15:41:29] tubbo: durexlw: check it out...HLS rocks. (HTTP Live Streaming)
[15:41:43] tubbo: apple invented it and has a bunch of docs on how it works.
[15:42:06] epochwolf: tubbo: I'll have to read up on that.
[15:42:07] durexlw: tubbo: I'll check it out. Thanks
[15:42:20] idefine: has joined #RubyOnRails
[15:42:41] idefine: has joined #RubyOnRails
[15:42:55] tubbo: Psy-Q: not sure you can do that if you're storing sessions in cookies, given cookies live on the client machine.
[15:43:17] idefine: has joined #RubyOnRails
[15:43:22] durexlw: Psy-Q: you should be able to do that... but exact code... you could look into the devise controller code if there are no docs. In the end devise will just delete the user session with the 'log_out'
[15:43:41] durexlw: ah, he means erasing the cookie?
[15:43:49] durexlw: shit, that's evil :)
[15:43:59] tubbo: yeah like the easiest thing to do might be a before_filter { sign_out current_user }, if: :user_sucks? or whatever
[15:44:18] durexlw: nice one indeed :)
[15:44:22] tubbo: or maybe overriding authenticate_user! is easier..
[15:45:09] Psy-Q: durexlw, tubbo: hmm. yes, ok, probably i can figure it out that way...
[15:45:18] Psy-Q: yeah, i wanted to delete the cookie on the user's side after the next login :)
[15:45:27] Psy-Q: since i use cookiestore and can't just delete a line in the DB
[15:45:37] tubbo: Psy-Q: why do you want to do this?
[15:45:46] tubbo: just curious
[15:45:52] Psy-Q: it's apparently a "legal requirement" to log out this particular user so he cannot possibly ever log in again
[15:46:33] Psy-Q: but the user can't be deleted because they have contracts, invoices and the like in the database. and i was probably stupid to set up devise with that session store back then. had i known this ever becomes necessary...
[15:46:45] Psy-Q: hmm. maybe devise has a "disabled user" flag or something, didn't see one though
[15:47:17] startupality: has joined #RubyOnRails
[15:47:54] norc: has joined #RubyOnRails
[15:47:57] durexlw: Psy-Q: tubbo just gave the code
[15:48:00] circuit_eight: tubbo: What's browser compatibility like with streaming HLS?
[15:48:22] jancel: has joined #RubyOnRails
[15:48:48] durexlw: circuit_eight: I guess that's more the player's thing... if like video.js supports it, it'll be pretty good. If you can just use html5 players, then it'll somewhat suck to older things
[15:48:57] tubbo: circuit_eight: it's supported in all major browsers from what i can tell. https://developer.apple.com/streaming/ has all the info you guys need.
[15:49:57] durexlw: tubbo: first vid I click on does shit :)
[15:50:08] durexlw: I'm not impressed by it's support :)
[15:50:12] nettoweb: has joined #RubyOnRails
[15:50:12] circuit_eight: Sweet thanks guys
[15:51:17] smoitra: has joined #RubyOnRails
[15:51:55] MEATCHICKEN: has joined #RubyOnRails
[15:51:58] Psy-Q: durexlw: yeah, i suppose that works
[15:52:00] tubbo: durexlw: what?
[15:52:09] Psy-Q: tubbo: thanks. would be fun to have a one-off method but this works
[15:52:14] durexlw: before_filter { sign_out current_user }, if: :user_sucks?
[15:52:26] Psy-Q: yeah, something like that does work :)
[15:52:27] MEATCHICKEN: To clarify - to ensure that a method is called in rspec. I write -> expect(obj).to receive(:method), correct?
[15:53:10] tubbo: durexlw: oh i see, on the ADC site. yeah i think it matters what format you have them encoded in.
[15:53:20] tubbo: i mostly care about chrome, firefox, and safari..
[15:53:31] durexlw: chrome here
[15:53:54] JakFrist: has joined #RubyOnRails
[15:53:57] durexlw: Psy-Q: what do you mean by "have a one-off method"?
[15:54:15] davidw: has joined #RubyOnRails
[15:54:59] LastWhisper____: has joined #RubyOnRails
[15:56:02] durexlw: Psy-Q: http://stackoverflow.com/questions/5629480/rails-devise-is-there-a-way-to-ban-a-user-so-they-cant-login-or-reset-their
[15:56:32] durexlw: the guy added a 'ban' column tests for that. Basically the same as tubbo suggests in the end I guess
[15:57:54] LastWhisper____: has joined #RubyOnRails
[15:58:01] kailido: has joined #RubyOnRails
[15:58:14] purrkode: kailido hello
[15:58:15] kailido: can I send url parameters with submit_tag ?
[15:58:47] kailido: after submit and redirect for other page, to add a parameter in the url
[15:58:58] macsteps: has joined #RubyOnRails
[15:59:11] durexlw: hidden field is an option, no?
[15:59:15] LastWhisper____: hey guys if I'm using factory_girl trait :as_house_event do
[15:59:15] LastWhisper____: association :house_eventable, factory: :vendor_contact_event
[15:59:20] durexlw: params is possible as well
[15:59:31] LastWhisper____: can I pass it an attribute? like event_date: '12/02/2015'
[15:59:47] matthias_: has joined #RubyOnRails
[16:00:00] Psy-Q: durexlw: "one-off" as in "i fire something on the server-side, similar to deleting a session record from the db"
[16:00:05] Psy-Q: with nothing to add to the code
[16:00:11] kailido: with link_to I do it like this : link_to l(:label_add_new), params[:wizard]=="true"? new_organizational_process_path(wizard: 'true')
[16:00:19] Psy-Q: but this is good, so thanks :)
[16:00:36] kailido: thats just a part
[16:00:38] durexlw: Psy-Q: I'd like to have that for developping apps too: go from idea to product :)
[16:01:06] durexlw: kailido: what are you trying to do?
[16:01:27] durexlw: smells like taking the hard road for a simple thing
[16:02:18] kailido: im want to add "?wizard=true" in the url after a submit_tag
[16:02:34] durexlw: kailido: what are you trying to achieve with that?
[16:03:13] kailido: in the other page if the url have that it continues a wizard im making
[16:03:49] durexlw: wizard like 'magic' or wizard like multi step form?
[16:04:01] kailido: like a tour
[16:04:05] kailido: for new users
[16:04:40] tubbo: user type: wizard
[16:04:54] durexlw: good luck kailido
[16:05:11] durexlw: tubbo: epochwolf workmad3 thanks for the help on the s3!
[16:05:43] kailido: any suggestions on how to parse parameters after submit_Tag ?
[16:07:22] mustmodify: has joined #RubyOnRails
[16:08:00] mustmodify: lazy-question: What method does Rails uses on models-or-integers in it's *_path methods? Must be like "Give me your ID if you're a model or self if you're an id"
[16:09:40] tubbo: mustmodify: it attempts to call to_param on the object passed into it
[16:09:46] tubbo: otherwise it assumes it's some kind of params hash
[16:10:17] mustmodify: Oh... that doesn't seem very much like the right way to duck type that.
[16:10:24] tubbo: mustmodify: https://gist.github.com/jcasimir/1209730
[16:10:24] mustmodify: I see that 3.to_param works...
[16:10:41] mustmodify: tubbo: Thanks again. If I ever start a company you will be my first employee. :)
[16:11:25] quazimodo: has joined #RubyOnRails
[16:13:15] idefine: has joined #RubyOnRails
[16:17:19] chrisja: has joined #RubyOnRails
[16:17:59] Devalo: has joined #RubyOnRails
[16:20:26] srinidhi: has joined #RubyOnRails
[16:21:36] wldcordeiro: has joined #RubyOnRails
[16:21:47] lxsameer: has joined #RubyOnRails
[16:21:47] lxsameer: has joined #RubyOnRails
[16:22:07] lubekpl: has joined #RubyOnRails
[16:22:42] blackmesa: has joined #RubyOnRails
[16:23:32] SalexW: has joined #RubyOnRails
[16:23:42] SalexW: has joined #RubyOnRails
[16:24:13] gremly: has joined #RubyOnRails
[16:24:18] mordocai: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")
[16:24:19] hahuang65: has joined #RubyOnRails
[16:25:12] emachnic: has joined #RubyOnRails
[16:27:15] njero: I can't believe this
[16:28:44] rogue_koder: has joined #RubyOnRails
[16:28:48] njero: My ISP had some shitty proxy and is been removing If-None-Match headers before reaching the server.. all those thread and 2 days a waste
[16:29:04] mustmodify: If I had a time machine and I could only use it once, I know what I would do. I would take a bunch of Ruby documentation back to the author of javascript and say, "No no, do it this way."
[16:30:21] purrkode: has joined #RubyOnRails
[16:32:23] smathy: has joined #RubyOnRails
[16:33:34] njero: Radar: you were right.. but was not done by my server, my shitty ISP. Tried another service and headers are reaching server and it's functioning normally
[16:36:11] moeabdol: has joined #RubyOnRails
[16:36:32] lxsameer: has joined #RubyOnRails
[16:43:43] flashpoint9: has joined #RubyOnRails
[16:44:18] artto: has joined #RubyOnRails
[16:46:31] shinnya: has joined #RubyOnRails
[16:47:20] smoitra: has joined #RubyOnRails
[16:47:25] manfrin: has joined #RubyOnRails
[16:48:04] mrgreenfur: has joined #RubyOnRails
[16:49:24] srinidhi: has joined #RubyOnRails
[16:50:24] eljimador: has joined #RubyOnRails
[16:55:08] jds: has joined #RubyOnRails
[16:55:52] chipotle: has joined #RubyOnRails
[16:56:24] tildes_: has joined #RubyOnRails
[16:58:28] wolfravenous: has joined #RubyOnRails
[16:58:57] mikecmpbll: has joined #RubyOnRails
[17:00:42] Mweshi: has joined #RubyOnRails
[17:01:10] artto: has joined #RubyOnRails
[17:01:24] Weavel: has joined #RubyOnRails
[17:03:17] Mweshi: has joined #RubyOnRails
[17:07:51] aegis3121: has joined #RubyOnRails
[17:13:14] chouhoulis: has joined #RubyOnRails
[17:13:21] jds_: has joined #RubyOnRails
[17:15:15] MaDErroR123: has joined #RubyOnRails
[17:16:36] Cohedrin: has joined #RubyOnRails
[17:18:17] moeabdol: has joined #RubyOnRails
[17:18:46] Oliphaunte: has joined #RubyOnRails
[17:19:24] konsolebox: has joined #RubyOnRails
[17:21:31] Oliphaunte: has joined #RubyOnRails
[17:22:03] hcnewsom: has joined #RubyOnRails
[17:23:33] lxsameer: has joined #RubyOnRails
[17:23:54] hcnewsom: I recently did a migration from rails 3.2.22 to 4.2. Upgraded Devise as well. Now, getting reports of people getting randomly logged out on the site. Especially on mobile devices. Anyone familiar with this problem?
[17:24:33] blackmesa: has joined #RubyOnRails
[17:26:10] Craigimus: has joined #RubyOnRails
[17:28:33] zhunting: has joined #RubyOnRails
[17:30:56] jancel: has joined #RubyOnRails
[17:31:51] Craigimus: has joined #RubyOnRails
[17:33:23] ashleyw: has joined #RubyOnRails
[17:33:26] startupality: has joined #RubyOnRails
[17:34:10] djbkd: has joined #RubyOnRails
[17:34:16] Craigimus: has joined #RubyOnRails
[17:35:18] noobsu: has joined #RubyOnRails
[17:35:43] tubbo: hcnewsom: did you regenerate your secret_key_base?
[17:36:35] mikecmpbll: has joined #RubyOnRails
[17:37:14] tubbo: hcnewsom: well unless you configured devise's config.secret_key in config/initializers/devise.rb, you just invalidated all existing tokens.
[17:37:22] tubbo: i *think* that extends to session tokens as well.
[17:37:38] tubbo: you should pretty much never regenerate that if you have an app in production unless it gets exposed.
[17:38:07] purrkode: has joined #RubyOnRails
[17:39:03] bronson: has joined #RubyOnRails
[17:39:16] hcnewsom: tubbo: hmm, yeah think i did something dumb
[17:39:24] hcnewsom: I added a secrets.yml
[17:39:54] tubbo: yeah it might have generated a new one, as rails defaults to using whatever you have set to secret_key_base
[17:40:04] hcnewsom: and under production: -> secret_key_base: XXX I include the new secret_key_base
[17:40:11] hcnewsom: and in devise
[17:40:26] hcnewsom: i noticed I have I have the old secret_token
[17:40:42] hcnewsom: i.e. config.secret_key = YYY
[17:41:06] hcnewsom: tubbo: should this be rectified if devise uses the same value?
[17:42:04] tubbo: yeah i would just use the same secret_key_base for everything, i wouldn't use that for devise.
[17:42:07] tubbo: it just introduces errors.
[17:42:15] akshat_: has joined #RubyOnRails
[17:42:37] trco: has joined #RubyOnRails
[17:43:56] trco: Hey there. I am configuring puma and have my RAILS_ENV environment variable set to development. Puma picks it up in the config just fine but for some reason active_record is trying to connect to the database using my production settings. Where would I tell active_record to use the RAILS_ENV environment var?
[17:44:28] tubbo: trco: you shouldn't have to.
[17:44:45] tubbo: can you git grep your codebase for something like `ENV["RAILS_ENV"] =`?
[17:44:57] akshat: has joined #RubyOnRails
[17:45:34] trco: tubbo: I didn't think I should have to either! it's weird... and yes I can
[17:45:57] tubbo: if your app server is connecting to one env and AR is connecting to a different env, something is wrong.
[17:46:09] tubbo: because AR is just going to use the same connection as everything else
[17:46:20] tubbo: so is it possible that there are 2 instances of the app running?
[17:46:46] trco: I can check for that
[17:47:20] h7br1x: has joined #RubyOnRails
[17:47:47] tildes_: has joined #RubyOnRails
[17:49:20] trco: tubbo: That was it I think :/ I had another session running it and it was screwing up or something
[17:49:49] hahuang65: has joined #RubyOnRails
[17:50:48] running_rails: has joined #RubyOnRails
[17:50:53] h7br1x: Hey guys, I'm running into an uninitialized constant error. The strange part is if I make any changes to the controller or model files (like adding a space) and refresh the page it works no problem. Refresh once more and uninitialized constant again. Any suggestions?
[17:51:20] tvw: has joined #RubyOnRails
[17:55:16] mustmodify: has left #RubyOnRails: ()
[17:56:07] noobsu: has joined #RubyOnRails
[17:57:16] blackmesa: has joined #RubyOnRails
[18:01:36] cpruitt: has joined #RubyOnRails
[18:03:53] mikecmpbll: has joined #RubyOnRails
[18:06:30] aegis3121: has joined #RubyOnRails
[18:12:20] SalexW: has left #RubyOnRails: ()
[18:12:56] smoitra_: has joined #RubyOnRails
[18:17:33] marr: has joined #RubyOnRails
[18:17:36] vrMarc: has joined #RubyOnRails
[18:19:41] cnk: has joined #RubyOnRails
[18:19:45] hiddenloop: has joined #RubyOnRails
[18:22:36] Coldblackice: has joined #RubyOnRails
[18:24:59] ftj: has joined #RubyOnRails
[18:25:46] ftj: I have a self-referential many-to-many relationship for Users (which have_many Customers through CustomerRelationships). I can add a customer for a User by doing @user.customer_relationships << other_user.
[18:26:13] ftj: I want to add additional data to the relationship. What would be the syntax for that?
[18:26:46] ftj: Actually: @user.customers << other_user (plus I want to add this_other_id_for_the_relationship)
[18:26:46] tbuehlmann: I guess you'd create CustomerRelationships manually
[18:26:52] ftj: Simple enough
[18:27:58] snowy: has joined #RubyOnRails
[18:30:13] daveomcd: has joined #RubyOnRails
[18:32:49] Scriptonaut: has joined #RubyOnRails
[18:33:13] Scriptonaut: does anyone know the distinction in the routes file that determines if a path helper is generated?
[18:33:13] Scriptonaut: some of my routes have helpers, some don't
[18:33:15] Scriptonaut: I'd like a helper for a couple of routes that don't, but not sure how
[18:33:40] Scriptonaut: get "people/filters/:scope" => 'people#filter'
[18:34:12] startupality: has joined #RubyOnRails
[18:34:45] macsteps: has joined #RubyOnRails
[18:36:07] MaDErroR123: has joined #RubyOnRails
[18:36:36] emachnic_: has joined #RubyOnRails
[18:38:02] cnk: Scriptonaut: add 'as: :somename' and you will get somename_path helper
[18:38:10] cnk: http://guides.rubyonrails.org/routing.html#naming-routes
[18:40:18] jenrzzz: has joined #RubyOnRails
[18:40:43] hahuang65: has joined #RubyOnRails
[18:41:17] jancel: has joined #RubyOnRails
[18:42:23] jheathco: has joined #RubyOnRails
[18:43:07] yellow5: has joined #RubyOnRails
[18:44:07] sypheren: has joined #RubyOnRails
[18:44:25] hahuang65: has joined #RubyOnRails
[18:45:41] vedu: Hello. How can I correctly unit test my ruby class? code: https://gist.github.com/vedant1811/1f55b512ba7a84caf63ff60415a4eb0c
[18:51:47] purrkode: If I'm calling an API and then storing that response in local DB, what's the sort of naming structure you'd use for these methods within the model to call from the controller. Something like `create_from_api`?
[18:53:35] netzfisch: has joined #RubyOnRails
[19:03:31] ur5us: has joined #RubyOnRails
[19:08:18] jhass: I'd probably use the specific name of the API
[19:08:24] jhass: create_from_paypal or whatever
[19:10:28] chipotle: has joined #RubyOnRails
[19:11:58] arBmind: has joined #RubyOnRails
[19:13:27] Synthead: I want to add a custom "something_i_want do" block in an activejob job. I have "module ClassMethods", "def something_i_want(&block)" in there, but I want to store the block (with the proc) as an accessor on the job. How can I put this proc into the job instance?
[19:13:28] tercenya: has joined #RubyOnRails
[19:14:29] jhass: just add an instance method that delegates to a class method that returns the instance variable you store the block in ?
[19:14:47] jheathco1: has joined #RubyOnRails
[19:15:27] blackmesa: has joined #RubyOnRails
[19:16:22] Mweshi: has joined #RubyOnRails
[19:18:17] chouhoulis: has joined #RubyOnRails
[19:19:02] noobsu: has joined #RubyOnRails
[19:20:00] andywww_: has joined #RubyOnRails
[19:20:25] bbrowning: has joined #RubyOnRails
[19:21:09] Synthead: jhass: giving it a shot, thanks!
[19:21:24] alfie_max15: has joined #RubyOnRails
[19:22:55] bbrowning: has joined #RubyOnRails
[19:23:16] JakFrist: has joined #RubyOnRails
[19:24:03] Synthead: jhass: I'm having trouble accessing the instance from methods inside the ClassMethods module
[19:24:18] Synthead: jhass: lemme make a paste
[19:24:59] wolfravenous: has joined #RubyOnRails
[19:25:42] yfeldblum: has joined #RubyOnRails
[19:26:19] arup_r: has joined #RubyOnRails
[19:26:56] manfrin: has joined #RubyOnRails
[19:27:02] Scriptonaut: has left #RubyOnRails: ()
[19:27:43] Synthead: jhass: something like this
[19:27:46] Synthead: http://pastie.org/private/sl0oax6tjijcdms0e3nfya
[19:28:11] moei: has joined #RubyOnRails
[19:28:24] Synthead: this way, in a job, I could just do "prerequisites do; ... some prerequisites ...; end"
[19:29:40] jhass: Synthead: so just add a attr_reader :prequisites_block to the ClassMethods module and do self.class.prequisites_block.call
[19:30:29] crystal77: has joined #RubyOnRails
[19:30:37] Synthead: jhass: ok, giving it a shot :)
[19:30:45] aldodelgado: has joined #RubyOnRails
[19:30:47] RegulationD: has joined #RubyOnRails
[19:31:02] andywww_: has joined #RubyOnRails
[19:31:41] eljimmy: has joined #RubyOnRails
[19:32:04] aldodelgado: Question? I'm tryign to change DateTime.now to Gregorian seconds. I know how to change it to epoch but not to sure how to get it to Gregorian seconds.
[19:32:26] aldodelgado: https://github.com/2600hz/kazoo/blob/master/applications/crossbar/doc/cdrs.md#user-content-get---fetch-a-time-range-of-cdrs
[19:33:12] maxdoubt: has joined #RubyOnRails
[19:33:28] Polysics: has joined #RubyOnRails
[19:33:56] Polysics: hello! is there a way to see controller logs when running a request spec?
[19:34:19] maxdoubt: is it just me or is https://github.com/seuros/state_machine more current than https://github.com/pluginaweek/state_machine - is there a way to get ruby gem pointed at the right repo?
[19:35:38] aldodelgado: maxdoubt: you can specify the git user and point to his repo
[19:35:49] epochwolf: aldodelgado: what's gregorian seconds?
[19:35:50] jstransky: has joined #RubyOnRails
[19:36:12] maxdoubt: aldodelgado: yeah, i know… its just not intuitive if folks are assuming that gem ‘state_machine’ is current
[19:36:13] aldodelgado: maxdoubt: You can do something liek this gem 'kazoo-rb', git: 'https://github.com/drcbo/kazoo-rb.git'
[19:36:17] aldodelgado: epochwolf: Not sure
[19:36:26] aldodelgado: epochwolf: its what the readme is asking for
[19:36:33] maxdoubt: ACTION trying to help the community?
[19:36:46] Polysics: I have a failing spec I can't seem to figure out
[19:36:57] habitullence: has joined #RubyOnRails
[19:37:03] aldodelgado: epochwolf: I tried to use epoch but I get an error
[19:37:25] tubbo: maxdoubt: have you seen aasm?
[19:37:34] tubbo: https://github.com/aasm/aasm
[19:37:44] alfie_max15: epochwolf, gregorian calender is just a more accurate calander
[19:38:01] maxdoubt: tubbo: is that better? i know its an older lib
[19:38:09] MaDErroR123: has joined #RubyOnRails
[19:38:09] alfie_max15: usually we consider an year to be 365 days and 6hours
[19:38:19] aldodelgado: alfie_max15: Do you know how to get todays date in gregorian seconds?
[19:38:31] tubbo: maxdoubt: well it was forked from acts_as_state_machine i think, but it's clearly being maintained still.
[19:38:32] epochwolf: aldodelgado: add 62167219200 to the unix timestamp.
[19:38:39] tubbo: and it's called 'aasm' so as not to conflict
[19:38:45] epochwolf: http://erlangcentral.org/wiki/index.php/Converting_DMYHMS_to_Seconds
[19:39:10] Polysics: aasm has never failed us in years
[19:39:31] alfie_max15: aldodelgado, i think there is some reference to it in ruby-doc
[19:39:33] tubbo: polysics: pretty sure controller logs can be seen in log/test.log
[19:39:37] alfie_max15: let me see if i can find it
[19:39:40] srinidhi: has joined #RubyOnRails
[19:39:49] Polysics: tubbo: the file is somehow always empty
[19:39:58] maxdoubt: tubbo: yup, very active repo… thanks!
[19:41:07] idefine_: has joined #RubyOnRails
[19:41:26] aldodelgado: epochwolf: Worked! You the man! Thanks
[19:41:28] bronson: has joined #RubyOnRails
[19:41:49] noobsu: has joined #RubyOnRails
[19:42:06] epochwolf: aldodelgado: you're weclome.
[19:42:09] maxdoubt: tubbo: searching rubygems for “state machine” doesn’t reveal aasm… guess cause there’s a hyphen in the aasm description
[19:42:10] Synthead: jhass: that worked beautifully! thanks!
[19:42:20] maxdoubt: thus more downloads for inactive repos
[19:42:54] Synthead: jhass: one more for you if you want to help crack the mystery :) Line 5 in the second file http://pastie.org/private/yzivvrmclp9qum5yoorg4a
[19:43:01] idefine_: has joined #RubyOnRails
[19:43:43] jhass: Synthead: instance_eval(&self.class.prequisites_block)
[19:44:02] Akuma: has joined #RubyOnRails
[19:44:28] unreal: has joined #RubyOnRails
[19:45:27] Akuma: Hello, I'm encountering an issue with delayed jobs. My delayed jobs table is empty, but I am seeing a lot of updates on the logs
[19:46:02] Akuma: the application is currently being slowed down by many of these updates which are preventing normal operation of the rails app
[19:46:28] Akuma: I have tried clearing the jobs with rake jobs:clear and restarting the instance without success, these updates keep on happening
[19:47:29] Akuma: Here is an excerpt of the log: https://gist.github.com/autronix/4f2b11ac3c07d1ff193bf86ed11fe9c3
[19:49:05] fryguy: Akuma: how are you sure those queries are what is slowing down your site?
[19:49:33] Akuma: yes, we had this issue in the past, normal operation stops as soon as the delayed jobs end
[19:49:43] YourManCJ: has joined #RubyOnRails
[19:49:52] Akuma: by delayed jobs, I mean the types of operations shown in the log
[19:50:02] YourManCJ: basic question, what is the best way to organized pdf files in a database for a rails app
[19:50:14] fryguy: YourManCJ: not in a database
[19:50:17] fryguy: files belong on a filesystem
[19:50:55] YourManCJ: what is the best way to access them and organize them from a rails app?
[19:51:00] YourManCJ: keep the urls in a database?
[19:51:43] mostlybadfly: has joined #RubyOnRails
[19:52:00] Polysics: tubbo: it looks like I am only seeing the "login" action logs
[19:52:06] Polysics: not the actual POST
[19:52:08] fryguy: YourManCJ: that can work
[19:52:17] fryguy: YourManCJ: or just filenames on the filesystem, depending on locality needs
[19:52:33] YourManCJ: alright thanks
[19:52:49] mrfoto: has joined #RubyOnRails
[19:56:18] djbkd: has joined #RubyOnRails
[19:59:12] edwinvdgraaf: has joined #RubyOnRails
[20:01:15] JonasOSDever: has joined #RubyOnRails
[20:02:33] jenrzzz: has joined #RubyOnRails
[20:03:28] goodfella: has joined #RubyOnRails
[20:03:44] goodfella: Is anyone here?
[20:04:23] goodfella: I'm learning programming and was told to go to some IRCs
[20:04:36] goodfella: and "get familiar" with the community
[20:04:42] alfie_max15: what are you learning?
[20:04:54] goodfella: Is that a good idea?
[20:05:03] goodfella: I have some familiarity with html and css
[20:05:22] alfie_max15: you are in a RubyOnRails channel, and what answer would you expect?? :D
[20:05:39] goodfella: someone told me RoR was a cult lol
[20:05:52] goodfella: i don't care though I'll drink the kool-aid
[20:06:34] cschneid_: has joined #RubyOnRails
[20:06:44] alfie_max15: so, how long have has it been since you started ruby?
[20:06:45] goodfella: So I'm taking the codeacademy tutorial on Ruby
[20:06:53] goodfella: Its been 3 days
[20:07:13] alfie_max15: any other languages you are familiar with?
[20:07:19] goodfella: html and CSS
[20:07:22] adre: has joined #RubyOnRails
[20:08:18] alfie_max15: https://rubymonk.com/learning/books/1-ruby-primer
[20:08:44] goodfella: This looks cool.
[20:08:58] klausmeyer: has joined #RubyOnRails
[20:09:14] cnk: CodeSchool's TryRuby is also pretty good https://www.codeschool.com/courses/try-ruby
[20:09:24] cnk: has left #RubyOnRails: ()
[20:09:26] manfrin: has joined #RubyOnRails
[20:09:32] cnk: has joined #RubyOnRails
[20:09:34] alfie_max15: but don't spend too much time on these, you'll learn ruby as you go..
[20:09:35] goodfella: I tried that one.
[20:10:11] goodfella: So should I download an editor or an IDE?
[20:10:27] cnk: goodfella: Try sublimetext
[20:10:31] Synthead: jhass: instance_exec(&self.class.prerequisites_proc) did the job perfectly! thanks so much for the help!
[20:11:24] alfie_max15: goodfella, IDE for what?
[20:11:28] cnk: has joined #RubyOnRails
[20:11:39] goodfella: i dont know...
[20:12:16] alfie_max15: you can get an interactive ruby console using IRB withing your terminal
[20:12:20] goodfella: I want to practice and run what I learn
[20:12:46] jancel: has joined #RubyOnRails
[20:12:50] alfie_max15: to write code and such, go with sublime text as cnk suggested
[20:12:53] noobsu_: has joined #RubyOnRails
[20:12:53] cnk: gem install pry
[20:12:59] cnk: it's a nicer version of irb
[20:13:04] goodfella: do you guys code for a living?
[20:13:08] alfie_max15: yeah, you might want to try that too
[20:13:10] Terens: nsfw: https://vimeo.com/133518676#t=297s he asked me for rails help once time ago
[20:13:44] alfie_max15: i speak for myself and i do :D
[20:13:49] eljimmy: has joined #RubyOnRails
[20:13:53] cnk: https://www.sitepoint.com/rubyists-time-pry-irb/
[20:14:21] jstransky: has joined #RubyOnRails
[20:14:22] goodfella: okay I wasn't prepared for that...
[20:14:40] alfie_max15: prepared for??
[20:14:49] goodfella: that link that Terens put
[20:15:30] cabinB: has joined #RubyOnRails
[20:16:26] klausmeyer: has joined #RubyOnRails
[20:17:05] arup_r: I still didn't get the joke of putting the shit link
[20:17:09] Terens: modern art
[20:17:32] goodfella: download sublime text... install pry
[20:17:42] neanderslob_: has joined #RubyOnRails
[20:17:43] alfie_max15: that's just too modern, even for this time
[20:18:57] xall: has joined #RubyOnRails
[20:19:04] futilegames: has joined #RubyOnRails
[20:19:58] goodfella: you're at Cal Tech?
[20:20:07] goodfella: I live in Pasadena
[20:20:13] cnk: but we spell it Caltech
[20:20:22] xall: has joined #RubyOnRails
[20:20:23] cnk: Ah excellent
[20:20:41] cnk: You doing rails for work? or pleasure?
[20:21:26] goodfella: I want to learn code to work
[20:21:37] goodfella: it is pleasurable though
[20:21:52] cnk: I can definitely recommend some of the local Ruby meetups for learning.
[20:22:00] goodfella: That would be excellent
[20:22:13] edwinvdgraaf: has joined #RubyOnRails
[20:22:27] cnk: There are some pretty close Tues, Wed, Thurs
[20:22:53] futilegames: has joined #RubyOnRails
[20:23:00] pawnbox: has joined #RubyOnRails
[20:23:20] goodfella: I have only a few days experience. I'm a little intimidated
[20:23:23] jancel: has joined #RubyOnRails
[20:23:33] baweaver: Terens avoid posting anything NSFW or not directly related to Rails
[20:23:50] cnk: Don't worry. Everyong at those meetups started where you are at one point
[20:24:51] goodfella: I'd like to attend one and get some face to face answers.
[20:25:38] goodfella: why ruby? Can it do the same thing C++ does? Python?
[20:25:52] triptec: has joined #RubyOnRails
[20:25:59] cnk: Python and Ruby are pretty similar
[20:26:17] cnk: C++ less so since it is compiled and complicated
[20:26:23] flashpoint9: has joined #RubyOnRails
[20:26:53] baweaver: For just Ruby though, you may have better luck in #ruby
[20:27:34] goodfella: ok can you tellme the difference between the two?
[20:28:17] cnk: goodfella: which 2?
[20:28:26] goodfella: ruby and RoR
[20:28:51] smathy: Ruby is a language, RoR is a framework for web app development (written *in* ruby).
[20:28:54] cnk: ruby is a general purpose programming language. Ruby on Rails is a web framework built using ruby
[20:29:03] wilsonc91: has joined #RubyOnRails
[20:29:43] goodfella: so if I write a program using Ruby, it can only be executed using Rails?
[20:29:59] andywww_: has joined #RubyOnRails
[20:30:26] goodfella: you guys are very helpful but I gotta go. maybe chat in about 30 mins
[20:30:47] voker57: has joined #RubyOnRails
[20:30:47] voker57: has joined #RubyOnRails
[20:30:59] mdw: has joined #RubyOnRails
[20:32:32] noobsu: has joined #RubyOnRails
[20:32:42] leeky: has joined #RubyOnRails
[20:32:54] neanderslob: has joined #RubyOnRails
[20:33:00] jsrn: has joined #RubyOnRails
[20:33:47] wilsonc91: Should an inclusion validation allow empty strings?
[20:33:52] wilsonc91: Mine seems to be allowing them
[20:34:29] tubbo: goodfella: hi
[20:34:40] tubbo: goodfella: oh shit sorry my scrollback was way far up
[20:34:42] alfie_max15: wilsonc91, try passing in allow_nil => false
[20:35:07] smathy: wilsonc91, shouldn't, no.
[20:38:36] edwinvdg_: has joined #RubyOnRails
[20:38:43] hahuang65: has joined #RubyOnRails
[20:39:30] wilsonc91: validates :average_payment, inclusion: AVERAGE_PAYMENT_KEY.values, allow_nil: false, allow_blank: false
[20:39:37] wilsonc91: The inclusion validation works if i pass it nonsense
[20:39:43] wilsonc91: but if i pass it empty string it doesn't
[20:40:36] centrx: has joined #RubyOnRails
[20:41:13] smathy: wilsonc91, !gist your model and the log showing the incoming parameters
[20:41:13] helpa: wilsonc91: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[20:41:32] smathy: ...or your rails console session if that's what you're doing.
[20:41:41] JonasOSDever: has joined #RubyOnRails
[20:43:03] tgeeky: anyone know the 'cleanest' (involving the least amount of paths possible) way of loading all of the models for a rails application?
[20:43:14] tgeeky: supposedly eager_load! should do it, but it seems not to be working or I can't find it.
[20:46:44] noobsu: has joined #RubyOnRails
[20:47:18] Talltree_: excuse my noobishness but <% @characters.joins(:experiences).order("value").each do |character| %> how do i select the last value instead of a general value here?
[20:47:19] eljimador: has joined #RubyOnRails
[20:47:34] Talltree_: <- sql noob
[20:47:35] sypheren: has joined #RubyOnRails
[20:47:42] tgeeky: Talltree_: order("value").last ?
[20:47:48] Craigimus: has joined #RubyOnRails
[20:48:05] tgeeky: Talltree_: and you are selecting all values, not one general value currently
[20:48:29] Talltree_: tgeeky, and still the each at the end?
[20:48:41] Talltree_: its the table generation in the view...
[20:49:24] ur5us: has joined #RubyOnRails
[20:49:33] Talltree_: i print the value i want to sort with in a column with character.experiences.last.value
[20:49:44] Talltree_: but this is really confusing now.
[20:49:45] tgeeky: Talltree_: nope
[20:50:08] tgeeky: Talltree_: anytime you see |blah| you think: we're actually inside a block, and we're looping through something.
[20:50:29] tgeeky: Talltree_: so it would be something like <% @charcaters.joins(:experiences).order("value").last %>
[20:50:40] startupality: has joined #RubyOnRails
[20:52:16] Talltree_: i think i dont understand you correctly
[20:52:17] Mweshi: has joined #RubyOnRails
[20:52:31] Talltree_: @characters.joins(:experiences).order("value").last.each returns an error :D
[20:52:48] Talltree_: grml, sorry :-/
[20:53:18] frem_: has joined #RubyOnRails
[20:53:58] edwinvdgraaf: has joined #RubyOnRails
[20:54:05] tgeeky: Talltree_: no each.
[20:54:22] tgeeky: Talltree_: how many...things do you want to appear in this location, in your view?
[20:54:36] tgeeky: just one?
[20:54:50] Talltree_: its the index, so like 100 per page?
[20:55:11] tgeeky: excuse my noobishness but <% @characters.joins(:experiences).order("value").each do |character| %> how do i select the last value instead of a general value here?
[20:55:16] tgeeky: what do you mean by 'last value'?
[20:55:48] Talltree_: one character has a history of exp values, i want to sort the ladder by the last (think highest) exp value that each char has
[20:56:27] centrx: .last.each
[20:56:39] Talltree_: that throws an erorr for me
[20:56:50] centrx: What’s the error?
[20:56:52] Talltree_: undefined method `each' for #<Character:0x007f52a5a6e808>
[20:57:05] goodfella: hey <tubbo>
[20:57:06] tgeeky: I'm not an expert, but I think that's wrong anyway. the .order("value") should be ordering your results
[20:57:10] tgeeky: so you should not need .last
[20:57:26] tgeeky: if you find yourself with the wrong thing coming first, just reverse the order
[20:57:27] centrx: Talltree_: oh well if you want the last, then there’s only one result and you don’t need to use each, right?
[20:57:30] Talltree_: tgeeky, it doesnt, but thank you very much for trying!
[20:57:49] Talltree_: centrx, the last exp value per char, there are many chars
[20:57:51] tgeeky: Talltree_: what happened when you did your original .each
[20:57:54] goodfella: is everyone here self taught?
[20:58:00] tgeeky: goodfella: probably
[20:58:05] Talltree_: maybe i'm thinking about it completly wrong
[20:58:17] tgeeky: Talltree_: what did your original code (assuming it worked) do?
[20:58:22] Talltree_: original each is a list of my characters
[20:58:27] alfie_max15: goodfella, i'm
[20:58:31] Talltree_: i can sort by character name etc
[20:58:40] tgeeky: is "value" their exp?
[20:58:42] Talltree_: but the nested exp value, not so much
[20:58:50] tgeeky: <% @characters.joins(:experiences).order("value").each do |character| %>
[20:59:03] Talltree_: value is in this case all exp's
[20:59:03] tgeeky: Talltree_: oh, nested? maybe that makes a difference.
[20:59:19] tgeeky: Talltree_: can you post more? the model, the view
[20:59:25] tgeeky: (both models)
[20:59:43] goodfella: ok well I will learn more code and comeback :)
[20:59:44] Talltree_: do 2 screen suffice? :D
[21:00:00] Talltree_: they got pretty much all thats in the model anyway
[21:00:30] tgeeky: screen...shots?
[21:00:36] King_Rex: has joined #RubyOnRails
[21:00:43] Talltree_: tgeeky https://i.imgur.com/J0Dqmcu.png the table
[21:00:44] goodfella: is <cnk> still here?
[21:00:52] tgeeky: i'm confused as to why that is less difficult than pastiing :o
[21:01:55] goodfella: any helpful advice before I go into the dark unknown of learning to code?
[21:01:57] noobsu_: has joined #RubyOnRails
[21:02:09] Talltree_: goodfella, codeacademy
[21:02:42] cnk: goodfella: Decide on something you want to build and let that drive your learning.
[21:02:45] goodfella: thanks! <Talltree> I started that yesterday. It was rough at first but I did the lessons a second time and it starts to make sense
[21:02:47] tgeeky: Talltree_: this screenshot probably won't suffice; it doesn't have anything called 'value' on it.
[21:02:49] Talltree_: https://i.imgur.com/wkJIjvc.png tgeeky each char
[21:02:57] cnk: Otherwise it's hard to keep focused
[21:03:17] Talltree_: the exp values is a column named value
[21:03:25] goodfella: that is a thinker... what do I want to build...?
[21:03:39] Talltree_: with the typical rails columns, created_at modified_at id
[21:03:43] cabinB: can someone tell me what's wrong w/ my syntax: <% if @team.meetings.where(:participants == 1).present? %>
[21:03:45] Talltree_: and association to char
[21:03:58] cabinB: seems that whatever value I set for :participants, results comes out positive
[21:04:02] tgeeky: Talltree_: so characters is the ladder?
[21:04:15] refinerysource: has joined #RubyOnRails
[21:04:17] Talltree_: yes, you know? like a leader board?
[21:04:33] Dimik: has joined #RubyOnRails
[21:04:35] goodfella: ok. see you all soon
[21:04:40] djbkd: has joined #RubyOnRails
[21:04:40] Talltree_: bundesliga, each team has a history of matches (points)
[21:04:42] goodfella: not literally see
[21:04:59] Talltree_: and the points add up over time
[21:05:03] flopsec: has joined #RubyOnRails
[21:05:13] cnk: goodfella: try Rails 4 in Action book
[21:05:14] ferr: I have files at lib/datatables/payrolls.rb and lib/datatablels/employees_payrolls.rb, I've added that to config.autoload_paths lib/datatables, however, it is not autoloaded
[21:05:16] Talltree_: so getting all points is bad, getting the last one is the most accurate one :D
[21:05:44] nettoweb: has joined #RubyOnRails
[21:05:51] alfie_max15: ferr, server restart?
[21:06:00] Talltree_: oh, btw those are ofc random values now, wont be with real data tgeeky
[21:06:07] futilegames: has left #RubyOnRails: ()
[21:06:17] centrx: cabinB: where(participants: 1)
[21:06:25] tgeeky: Talltree_: I don't think that's relevant to my confusion. What you really want to do is sort by date, but perhaps not.
[21:06:55] tgeeky: so, looking at this:
[21:06:55] Talltree_: no, since value can go down.
[21:06:57] tgeeky: <% @characters.joins(:experiences).order("value").each do |character| %>
[21:07:07] tgeeky: Talltree_: does the above code do *something*?
[21:08:08] tgeeky: Talltree_: anyway, try this: <% @characters.joins(experiences).max(:value).each do |character| %>
[21:08:09] Talltree_: yes, takes ages with 100 chars and 10000 values to load, dunno what it actually takes of those values
[21:08:34] tgeeky: Talltree_: oops, maximum, not max
[21:09:00] workmad3: has joined #RubyOnRails
[21:09:09] Talltree_: undefined method `each' for 9999505:Fixnum
[21:09:19] sypheren: has joined #RubyOnRails
[21:09:25] tgeeky: Talltree_: well that's progress.
[21:09:40] Talltree_: if i could only select _just_ what's in those brackets
[21:09:50] Talltree_: like i said, i have the number i want printed
[21:09:53] tgeeky: <% @characters.joins(:experiences).maximum(:value) %>
[21:09:54] tgeeky: ^ do that
[21:09:57] Talltree_: you see it in the first screenshot
[21:10:16] tgeeky: possibly <%= ... %> instead
[21:10:19] tgeeky: i forget the difference
[21:10:50] cabinB: centrx thanks! been wrestling with that for 30 min!
[21:10:51] Talltree_: shows one value
[21:11:29] centrx: cabinB: yeah the == is being evaluated before it get passed into the where, so it becomes a true or false value
[21:11:52] centrx: cabinB: participants: 1 makes it be a hash (same as :participants => 1)
[21:12:04] centrx: or keyword argument which acts similar
[21:12:09] smathy: Talltree_, can you (re)describe your problem for me please.
[21:12:15] tgeeky: try: <% @characters.joins(:experiences).order("value").each do |character| character.max(:value); end %>
[21:12:26] tgeeky: try: <% @characters.joins(:experiences).order("value").each do |character| character.maximum(:value); end %>
[21:12:41] cabinB: now i get it. thx again centrx
[21:13:19] Talltree_: smathy: okay, i have this <% @characters.joins(:experiences).order("value").each do |character| %> as the table "loop"
[21:13:39] Talltree_: but instead of value, i want the last value that is the value column of the experience db
[21:13:51] Talltree_: ladder site with elo
[21:13:56] Talltree_: it goes up it goes down
[21:13:58] Craigimus: has joined #RubyOnRails
[21:14:10] tgeeky: Talltree_: we would really be better off seeing a pastie of your code, I think
[21:14:12] Talltree_: but you sort the leader board by the latest and most recent value
[21:14:24] Talltree_: what code exactly? the view?
[21:14:33] tgeeky: Talltree_: the view, and both models that you are joining
[21:14:40] tgeeky: Talltree_: actually, I was almost right before, I think
[21:14:44] Talltree_: http://pastie.org/10842835
[21:14:46] smathy: Talltree_, this is going to be hard to discuss with "value" as the name of the column :) So you want a single value?
[21:15:07] Talltree_: i allready have the single value
[21:15:16] Talltree_: its character.experiences.last.value
[21:15:17] tgeeky: try: <% @characters.joins(:experiences).order("value").each do |character| %> \ <%= character.maximum(:value %> \ <% end %>
[21:15:22] tgeeky: Talltree_: try that ^
[21:15:34] tgeeky: try: <% @characters.joins(:experiences).order("value").each do |character| %> \ <%= character.experiences.maximum(:value %> \ <% end %>
[21:15:39] tgeeky: where \ is a new line
[21:15:41] smathy: :eyeroll:
[21:15:58] tgeeky: smathy: the blind leading the blind over here.
[21:16:33] JonasOSDever: has joined #RubyOnRails
[21:16:56] smathy: Talltree_, so you're basically wanting to replace this line: http://pastie.org/10842835#41
[21:17:34] smathy: ...with something that finds the maximum value from experiences?
[21:17:42] ferr: alfie_max15: https://gist.github.com/Fercell/cb91f14f26d48e6d53a5fb90ec24b350
[21:17:49] Talltree_: i want to sort the whole table ascending with that value.
[21:17:51] jstransky: has joined #RubyOnRails
[21:18:05] Talltree_: smathy, https://i.imgur.com/J0Dqmcu.png
[21:18:09] Talltree_: look at that screen
[21:18:28] Talltree_: the exp value is the latest exp value in that screen
[21:18:51] smathy: Ok, so you want to still produce the same output, just in a different order?
[21:19:08] Talltree_: i want to sort the table with that value, its a nested "attribute"
[21:19:36] tgeeky: smathy: every character has a list of exp values. He wants that table to show the maximum from that list, for each character.
[21:19:48] Talltree_: not the maximum
[21:19:52] Talltree_: i allready told you that
[21:19:54] Talltree_: the latest.
[21:19:57] VeryBewitching: The last, bur ordered by
[21:19:58] chouhoulis: has joined #RubyOnRails
[21:20:09] smathy: Talltree_, and that value is the maximum `experiences.value` for the joined records? Or it's (as you are displaying it) just the last record in whatever order the `experiences` happened to be JOINed in?
[21:20:09] tgeeky: Talltree_: which is the maximum or minimum if you order by date.
[21:20:11] jstransky: has joined #RubyOnRails
[21:20:28] tgeeky: Talltree_: you don't want the largest value of EXP, you want the most recent.
[21:21:22] Talltree_: the most recent that a char has, sorted by the highest number or all chars
[21:21:26] ferr: Anyone could help with auto load paths? https://gist.github.com/Fercell/cb91f14f26d48e6d53a5fb90ec24b350
[21:21:29] tgeeky: ah, that is why you were saying last. But you are ordering by "value", which presumably is the amount of exp, and you want to order by modified_date.
[21:21:35] tgeeky: nevermind I'm out
[21:21:42] smathy: Talltree_, ok, so want to sort the `characters` rows based on the values of the most recently updated `experiences.value` value for each row?
[21:21:43] davidw: has joined #RubyOnRails
[21:22:03] rafaelfranca: has joined #RubyOnRails
[21:22:13] Talltree_: smathy, if my english is not completly failing me thats absoluty correct sir
[21:22:36] Talltree_: sort the character by their latest exp value
[21:22:43] Talltree_: *characters
[21:22:57] Talltree_: like a leader board
[21:23:27] Talltree_: since every character has a history of Experience values, like Chess ELO for example.
[21:23:37] smathy: Understood.
[21:23:59] jstransky: has joined #RubyOnRails
[21:24:44] gingray: has joined #RubyOnRails
[21:24:50] Talltree_: thinking about this stuff i should have proably have started out with something simple, like a blog app
[21:25:02] Talltree_: nothing that handels 10000s of entries of data
[21:25:34] djbkd: has joined #RubyOnRails
[21:26:03] Mweshi: has joined #RubyOnRails
[21:26:10] smathy: So, as you have your current structure I think you'd need to do a sub-select in your ORDER clause. I think I'd approach this by caching the latest experiences.value in your characters table.
[21:26:14] jancel: has joined #RubyOnRails
[21:26:28] VeryBewitching: Talltree_: Learning something the hard way is a good, albeit sometimes frustrating, way to learn.
[21:27:11] Talltree_: VeryBewitching, i like this, its fun, learning by doing and stuff^
[21:27:18] smathy: ...you might be able to get it done with a group and order clause.
[21:28:04] Talltree_: sooooooo, go through all the exp values in the table
[21:28:06] xall: has joined #RubyOnRails
[21:28:10] VeryBewitching: smathy: I was thinking the same, select value join where max(exp.created_at) etc.
[21:28:33] Talltree_: i dont have the slightest idea how to do that :D
[21:28:53] ferr: Keep digging and you will
[21:29:29] VeryBewitching: Talltree_: When I query a database with an ORM object, I usually do the SQL in my head first (or in a workbench of some kind) then port it to the ORM
[21:30:02] Talltree_: why can't i use "rails" syntax inside the () of .order
[21:30:28] Talltree_: i mean, getting the number is really easy with rails, afaik the order("") is SQL
[21:31:13] Talltree_: VeryBewitching, maybe i should actually take a course of sql, i never did...
[21:31:38] Craigimus: has joined #RubyOnRails
[21:31:44] VeryBewitching: Talltree_: Using an ORM before learning SQL is going to make you frustrated, because you can't visualize what the ORM is going to build by way of a raw query.
[21:31:48] Talltree_: thats party the reason i like rails so much, it takes the sql stuff and makes it easy i thought :D
[21:32:05] VeryBewitching: That's an assumption though, I've been writing SQL since before Clinton was in the white house.
[21:32:09] djbkd: has joined #RubyOnRails
[21:32:49] Talltree_: you can't say that in a year anymore (sadly)
[21:32:53] cabinB: centrx, wondering if i wanted to add another condition into participants: 1. Let's say i wanted participants: 1 and room:4. I tried syntax <% if @team.meetings.where(participants: 1 && room:4).present? %>
[21:33:15] centrx: cabinB: use a comma
[21:33:32] zel: has joined #RubyOnRails
[21:34:02] centrx: cabinB: You can also chain together multiple where statements, if you have different kinds, e.g.: where(participants: 1).where(‘room > 4’)
[21:34:16] centrx: both will be AND
[21:34:39] Talltree_: can you smathy or VeryBewitching explain what you meant by caching the exp.value in the table?
[21:35:02] VeryBewitching: Talltree_: When you add a new exp value to the experiences table, add the same value to the user record in last_exp column
[21:35:05] VeryBewitching: That's the idea.
[21:35:32] Talltree_: can't i create a job that does that?
[21:35:45] VeryBewitching: You can create a callback on the Experience model that'll do that.
[21:35:51] ferr: Talltree_: Rows.includes(:exp).order("exp.updated_at asc") is that what u need?
[21:36:30] mrgreenfur: has joined #RubyOnRails
[21:37:01] cabinB: centrx great!
[21:37:27] Talltree_: ferr that confuses me since its not the function format i think
[21:38:14] ferr: I'm not sure what you have, but what I've heard is that you need to sort table by parent table updated_at value, is that correct?
[21:38:23] beauby: has joined #RubyOnRails
[21:39:04] Talltree_: by child updated_at = created_at
[21:39:51] smathy: Talltree_, you can also use a trigger in the DB itself.
[21:40:01] startupality: has joined #RubyOnRails
[21:40:09] Talltree_: no idea how to do that either
[21:40:23] Talltree_: i like the idea of storing the latest value in the char table
[21:40:32] smathy: ferr, and no, that's not what he's after.
[21:40:50] Talltree_: this is way harder to explain than i thought :D
[21:41:06] smathy: Talltree_, triggers are simple, nothing to do with Rails though. Start with VeryBewitching's suggestion of using a callback: http://guides.rubyonrails.org/active_record_callbacks.html
[21:41:37] Talltree_: i really appreciate your help, thanks guys
[21:41:41] smathy: Talltree_, honestly, it isn't helped because of your naming :)
[21:42:22] Talltree_: yeah it sucks, i should redo that
[21:42:32] smathy: ...and using shorthand like char and exp (both of which have other meanings in IT) adds to the confusion :)
[21:42:37] bronson: has joined #RubyOnRails
[21:42:50] Talltree_: gaming background you know
[21:42:57] Talltree_: char = character, exp = experience :D
[21:43:24] hahuang65: has joined #RubyOnRails
[21:43:29] SteenJobs: has joined #RubyOnRails
[21:43:37] Talltree_: i got a cool analogy i think
[21:44:55] noobsu: has joined #RubyOnRails
[21:44:55] Talltree_: i look into my wallet each day, and note how much money i got in it on a paper, at the end of the month i compare it to my 10 friends, sort the table by the latest (current) value of money i have in my wallet
[21:45:16] Talltree_: compare it to the friends ofc.
[21:45:29] Talltree_: i'm so done for today, good night :P
[21:46:54] djbkd: has joined #RubyOnRails
[21:48:19] djbkd: has joined #RubyOnRails
[21:50:06] ferr: Just do calculations at the end of the month and put results into new table
[21:54:38] StaticVoid: has joined #RubyOnRails
[21:55:20] Talltree_: you know you are working on something complicated when your music stopped an hour ago and you didnt notice :D
[21:56:04] ctrlrsf: has joined #RubyOnRails
[21:58:50] superlou: has joined #RubyOnRails
[21:59:18] Radar: GOOD MORNING
[22:00:09] Pumukel: has joined #RubyOnRails
[22:00:27] JFlash: has joined #RubyOnRails
[22:00:40] jancel: has joined #RubyOnRails
[22:01:51] StaticVoid: Morning (evening)
[22:03:35] yfeldblum: has joined #RubyOnRails
[22:03:55] JFlash: has left #RubyOnRails: ()
[22:04:07] creature: has joined #RubyOnRails
[22:04:07] creature: has joined #RubyOnRails
[22:04:44] xall_: has joined #RubyOnRails
[22:05:24] yfeldblum: has joined #RubyOnRails
[22:08:09] adre: has joined #RubyOnRails
[22:08:22] wldcordeiro: has joined #RubyOnRails
[22:09:42] Darmani: Hi everyone, quick question
[22:10:28] Darmani: I'm trying to add a reference to my forums table from my topics table (within the db).
[22:10:30] Darmani: https://gist.github.com/mfifth/28859d87263f13f751b4da6e8183a823
[22:10:34] Darmani: Am I doing this right? o.o
[22:12:10] Jasaka|NA: has joined #RubyOnRails
[22:13:20] noobsu: has joined #RubyOnRails
[22:14:31] Radar: Darmani: what happens when you try it?
[22:14:52] Darmani: Radar: I haven't I don't want to do something I can't reverse.
[22:15:01] Radar: Darmani: migrations are reversible with `rake db:rollback`
[22:15:25] Darmani: Radar: Ah. That's good to know. Lol
[22:15:44] Synthead: I can do "def some_method(*args); ...; end" to be able to call some_method with any number of arguments. can I do the same using "define_method(:some_method) do |args|; ...; end" ?
[22:17:22] Radar: Synthead: do |*args|
[22:17:33] Synthead: Radar: that's brilliant
[22:17:35] Synthead: Radar: thanks!
[22:19:20] VeryBewitching: Synthead: irb and pry are good tools for playing with stuff like that.
[22:19:50] netzfisch: has joined #RubyOnRails
[22:19:57] hahuang65: has joined #RubyOnRails
[22:19:57] Synthead: VeryBewitching: touche, I use binding.pry extensively :) I just didn't even consider that being a possibility!
[22:20:27] Cork: has joined #RubyOnRails
[22:22:10] VeryBewitching: Synthead: First comment: http://apidock.com/ruby/Module/define_method
[22:22:34] Synthead: VeryBewitching: heh yeah I saw that right at the same time radar suggested it :)
[22:23:04] Radar: who reads the comments online?
[22:23:14] VeryBewitching: Radar: I've found gems in the eratta
[22:23:21] Synthead: ghostbusters!
[22:23:30] VeryBewitching: No pun intended :D
[22:23:43] Synthead: ACTION slaps knee
[22:23:48] bios: has joined #RubyOnRails
[22:24:13] Talltree: has joined #RubyOnRails
[22:25:34] bios: hey *.. if I have a link_to new_model_name link and I'm sending an object into the model_name#new form, how can I select the object I sent in for an association field?
[22:25:39] bios: I hope that makes sense
[22:25:57] VeryBewitching: |a,b,c,...| is the same as any argument list I think, at any rate, and can have defaults too |a,b,c=nil,...|
[22:26:19] rafaelfranca: has joined #RubyOnRails
[22:26:59] VeryBewitching: bios: !gist Better show us the view and controller code for that.
[22:26:59] helpa: bios: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[22:27:08] noobsu: has joined #RubyOnRails
[22:27:32] bios: ok.. thanks.. will post in a min
[22:34:31] bios: https://gist.github.com/mikesaltsman/a4f2aa349c887c3eac1bab7c405fccbf
[22:35:19] bios: so I send a reference into the new method, i want to use that for my association in the form
[22:35:43] akshat: has joined #RubyOnRails
[22:36:02] snowy: has joined #RubyOnRails
[22:37:48] sneakerhax: has joined #RubyOnRails
[22:38:30] VeryBewitching: bios: Why do you have a model named PstAssetDeploymentWater and an object named @pst_asset_deployment; and is that link in the same view as the form?
[22:41:08] bios: I have a model named PstAssetDeploymentWater and another model, PstAssetDeployment, that I'm referencing ... so in the form for a new PstAssetDeploymentWater the form allows to manually select a PstAssetDeployment record to associate with, but I want to send an object in to that new method and have that be the associated PstAssetDeployment and allow the user to fill out the rest of the fields.
[22:41:14] bios: does that make sense?
[22:41:24] HenriettaSalt: has joined #RubyOnRails
[22:42:53] yfeldblum: has joined #RubyOnRails
[22:43:00] Radar: bios: simple_form_for [@pst_asset_deployment, @pst_asset_deployment_water]
[22:43:07] zel: has joined #RubyOnRails
[22:43:42] Radar: Assuming you set up a @pst_asset_deployment from the pst_asset_deployment_id parameter available in the new action
[22:48:58] ctrlrsf: has joined #RubyOnRails
[22:50:13] pawnbox: has joined #RubyOnRails
[22:51:40] rockhardstar: has joined #RubyOnRails
[22:51:53] jenrzzz: has joined #RubyOnRails
[22:52:54] startupality: has joined #RubyOnRails
[22:54:41] _3dwardsharp: has joined #RubyOnRails
[22:55:17] refinerysource: has joined #RubyOnRails
[23:01:10] macsteps: has joined #RubyOnRails
[23:01:44] rockhardstar: has joined #RubyOnRails
[23:05:04] srinidhi: has joined #RubyOnRails
[23:05:54] Kallis: has joined #RubyOnRails
[23:06:42] Darmani: Is this a viable way to create a delete link?
[23:06:42] Darmani: https://gist.github.com/mfifth/a06b9f2d9c9a5b8441afc34692175580
[23:07:01] Radar: Darmani: does it work?
[23:07:31] dalbuschat: has joined #RubyOnRails
[23:07:31] Radar: Darmani: !didntwork
[23:07:31] helpa: Darmani: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[23:07:38] JesseH: has joined #RubyOnRails
[23:08:06] Darmani: No route matches [POST] "/forums/2/topics/2"
[23:09:28] Radar: Darmani: what request is being made according to your rails server?
[23:09:50] Darmani: Radar: Post...
[23:10:34] Radar: Darmani: !rule0
[23:10:34] helpa: Darmani: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[23:10:40] Radar: Copy and paste the output please.
[23:10:52] Radar: Or was it as above?
[23:11:00] Radar: Is the code on GitHub somewhere?
[23:11:09] arBmind: has joined #RubyOnRails
[23:11:23] Darmani: It's some new code I worked on today. I haven't made the commit yet.
[23:13:13] Radar: Ok. I don't know what's going wrong. Code looks fine.
[23:14:43] MaDErroR123: has joined #RubyOnRails
[23:15:19] BhavyaM: has joined #RubyOnRails
[23:15:22] Darmani: Radar: I found some of the errors that were giving me trouble. Think I just needed to look a little harder.
[23:15:24] Darmani: Thank you though.
[23:19:13] aghalarp: has joined #RubyOnRails
[23:20:37] idefine: has joined #RubyOnRails
[23:21:31] jutah: has left #RubyOnRails: ()
[23:22:04] am55: has joined #RubyOnRails
[23:22:14] giom: has joined #RubyOnRails
[23:24:22] rockhardstar: has joined #RubyOnRails
[23:24:26] bios: Ok.. Thanks Radar and VeryBewitching for taking the time to look at this.. it got me rolling in the right direction and I was able to get it!
[23:24:58] rockhardstar: I have a model, which has a field :a and :b, and i would like to enforce a unique pair of :a and :b together in the migration. how would i go about achieving this?
[23:25:33] rockhardstar: that is, there can be many :a's, but only one :b for all :a's
[23:27:18] rockhardstar: or at least, a unique :b for all :a's
[23:28:21] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[23:29:10] apotry: has joined #RubyOnRails
[23:30:42] Synthead: is there any way to run a bit of code when sidekiq starts? I'm looking to do something particular with the rails environment but only when sidekiq loads
[23:30:53] am55: put a method in your controller to check for the b value you want
[23:31:44] Radar: Synthead: !xy
[23:31:44] helpa: Synthead: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[23:32:22] rockhardstar: am55: ah, so there's no way to enforce it on the migration level?
[23:32:49] Darmani: Radar: When creating a "delete" link why do we put method: :delete as part of the code? Wouldn't method: :destroy make more sense?
[23:33:01] Radar: Darmani: because it's using the HTTP method DELETE
[23:33:30] Darmani: Radar: Ah. Got it.
[23:34:32] giom: has joined #RubyOnRails
[23:34:36] rockhardstar: am55: to be clear, i don't want a specific :b value, i just want :b to be unique in a collection of :a, let's say i have a collection where {:a = 1 and :b = 'a', :a = 1 and :b = 'b', :a = 1 and :b = 'a'}
[23:34:56] rockhardstar: i'd like the last entry there to be denied since it has the same pair as the first, but the second entry is valid
[23:35:22] rockhardstar: is the only way to do a database check in a method?
[23:37:30] quazimodo: has joined #RubyOnRails
[23:37:34] insanedreamer: has joined #RubyOnRails
[23:38:58] Radar: rockhardstar: !fake
[23:38:58] helpa: rockhardstar: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[23:39:16] rockhardstar: Radar: the theoretical question is absolutely valid, it shouldn't be misleading to you at all.
[23:39:32] rockhardstar: please stop prompting me with that command.
[23:39:37] ChanServ: +q *!*@unaffiliated/rockhardstar
[23:39:44] Radar: Please don't argue with the people who are trying to help you.
[23:39:46] Radar: 15 minute timeout.
[23:39:48] mikecmpbll: has joined #RubyOnRails
[23:40:25] Radar: rockhardstar: It's now an hour for insulting me in PM
[23:40:31] Radar: rockhardstar: And a day for the second insult.
[23:40:45] Radar: Please, continue.
[23:41:22] ChanServ: +b *!*@unaffiliated/rockhardstar
[23:41:22] ChanServ: ChanServ kicked rockhardstar: abusive to ops
[23:41:40] Radar: Can't say he wasn't warned.
[23:41:44] JFlash: has joined #RubyOnRails
[23:44:35] ChanServ: -b *!*@unaffiliated/rockhardstar
[23:45:19] Trynemjoel: has joined #RubyOnRails
[23:48:15] Axilla: has joined #RubyOnRails
[23:50:14] idefine: has joined #RubyOnRails
[23:51:05] RegulationD: has joined #RubyOnRails
[23:53:15] jhack: has joined #RubyOnRails
[23:55:36] maxdoubt: has joined #RubyOnRails
[23:56:41] _3dwardsharp: has joined #RubyOnRails