« Back to channel list

#RubyOnRails - 30 September 2015

« Back 1 day Forward 1 day »
[00:01:07] Guest54769: has left #RubyOnRails: ()
[00:01:21] SteenJobs: has joined #RubyOnRails
[00:02:24] Rohanezio: has joined #RubyOnRails
[00:02:44] crdpink: has joined #RubyOnRails
[00:05:11] apg: has joined #RubyOnRails
[00:05:53] passbe: has joined #RubyOnRails
[00:07:15] EminenceHC: has joined #RubyOnRails
[00:07:18] passbe: has joined #RubyOnRails
[00:08:26] passbe: anyone who has deployed rails with passenger 4 + nginx. Everything i read points to using the locations.ini file as passenger_root, and using the rvm wrapper as passenger_ruby, however the locations.ini file contains the original vendor_ruby which seems to be stuffing everything up. can anyone point me in the right direction ?
[00:08:38] sadaf2605: has joined #RubyOnRails
[00:10:58] lele: has joined #RubyOnRails
[00:11:22] Joufflu: has joined #RubyOnRails
[00:11:49] Detch: has joined #RubyOnRails
[00:11:53] Rohanezio: has joined #RubyOnRails
[00:13:52] bmurt: has joined #RubyOnRails
[00:15:55] EminenceHC: has joined #RubyOnRails
[00:16:49] roxtrongo: has joined #RubyOnRails
[00:19:24] tjbiddle: has joined #RubyOnRails
[00:19:51] baweaver: has joined #RubyOnRails
[00:21:03] justin_pdx: has joined #RubyOnRails
[00:21:30] roxtrongo: has joined #RubyOnRails
[00:21:48] Detch: has joined #RubyOnRails
[00:22:24] neanderslob: has joined #RubyOnRails
[00:23:54] rhizome: deleting an afternoon's worth of puts'
[00:24:24] rhizome: passbe: when you build the gem it gives you lines to use
[00:27:05] apg: has joined #RubyOnRails
[00:27:05] apg: has joined #RubyOnRails
[00:31:38] passbe: rhizome: unfortunately it doesn't for me. this rvm / passenger nightmare is killing me.
[00:32:14] passbe: rhizome: every command i run points to everything using rvms ruby but when passenger saves out its stack trace it tells me its using the vendor_ruby
[00:32:42] neanderslob: has joined #RubyOnRails
[00:32:55] annlewis: has joined #RubyOnRails
[00:32:55] Scient: soooo when I define my scope as a class method, I cannot apparently use build() in it
[00:32:57] Scient: since when
[00:39:09] _djbkd: has joined #RubyOnRails
[00:40:00] herbst: has joined #RubyOnRails
[00:43:08] EminenceHC: has joined #RubyOnRails
[00:43:19] bklane: has joined #RubyOnRails
[00:46:21] baweaver: has joined #RubyOnRails
[00:47:05] ellisTAA: i???m getting this error message: undefined method `messages_path' for #<#<Class:0x
[00:47:11] ellisTAA: for this line: <% form_for [@user, @message] do |f| %>
[00:47:27] ellisTAA: but i have the route for users/:id/messages/new
[00:47:36] pwnd_nsfw: has joined #RubyOnRails
[00:48:07] batasrki: has joined #RubyOnRails
[00:50:48] EminenceHC: has joined #RubyOnRails
[00:51:49] roxtrongo: has joined #RubyOnRails
[00:51:57] theery: has joined #RubyOnRails
[00:52:26] abhishekvasisht: has joined #RubyOnRails
[00:52:54] abhishekvasisht: has left #RubyOnRails: ()
[00:53:42] rushed: has joined #RubyOnRails
[00:54:31] FailBit: http://www.cnn.com/videos/world/2015/09/29/robert-mugabe-homosexuality-un-speech-zimbabwe-sot-kriel.cnn
[00:54:42] FailBit: zimbabwe pls
[00:55:14] chandlerbing: has joined #RubyOnRails
[00:55:22] abhishekvasisht: has joined #RubyOnRails
[00:55:29] Aeyrix: FailBit: Even satan wasn't gay.
[00:55:45] Aeyrix: In what realm of possibility is that a defence against bigotry
[00:56:16] Aeyrix: against/of
[00:57:32] FailBit: I'm only 25% gay
[00:57:33] apg: has joined #RubyOnRails
[00:57:48] nettoweb: has joined #RubyOnRails
[00:58:22] Lytol: has joined #RubyOnRails
[00:59:13] quantux: has joined #RubyOnRails
[00:59:22] lytol_: has joined #RubyOnRails
[00:59:32] towski_: has joined #RubyOnRails
[00:59:41] sevenseacat: has joined #RubyOnRails
[01:00:20] roxtrongo: has joined #RubyOnRails
[01:00:43] baweaver: offtopic things are offtopic.
[01:01:08] Aeyrix: There ain't much ontopic going on here
[01:01:23] Aeyrix: http://media.giphy.com/media/bzABak3LHAHwA/giphy.gif
[01:01:25] lampshades: has joined #RubyOnRails
[01:02:04] dikaio: has joined #RubyOnRails
[01:02:10] batasrki: Torquebox 3.1.2, Rails 4.2.4, PermissionError when loading assets (i.e. CSS, JS, images)
[01:02:15] FailBit: my face hurts, and it's killing ms
[01:02:28] lytol__: has joined #RubyOnRails
[01:02:41] batasrki: https://github.com/torquebox/torquebox/issues/225
[01:02:41] Aeyrix: batasrki: no
[01:04:36] quantux: rubyonrails sucks.
[01:05:03] quantux: just kidding
[01:05:05] batasrki: quantux: what happened
[01:05:53] quantux: i would give my life for ror.
[01:05:55] allcentury: has joined #RubyOnRails
[01:07:04] baweaver: ACTION slowly lowers hammer
[01:07:17] Lytol: has joined #RubyOnRails
[01:07:32] blackmesa: has joined #RubyOnRails
[01:09:59] chipotle: has joined #RubyOnRails
[01:10:39] rushed: has joined #RubyOnRails
[01:13:09] dikaio: has joined #RubyOnRails
[01:13:32] krz: has joined #RubyOnRails
[01:14:02] montagesoftware: has joined #RubyOnRails
[01:16:54] havenwood: has joined #RubyOnRails
[01:19:27] SteenJobs: has joined #RubyOnRails
[01:20:08] USvER: has joined #RubyOnRails
[01:21:49] USvER: But how do i "throttle" active record database updating
[01:22:28] USvER: If some code updates the same record too often and i want it to update it only once in a sec
[01:22:50] Aeyrix: How did you get yourself into that situation.
[01:23:03] Aeyrix: More importantly, why would you want to delay database writes on actively used objects?
[01:23:13] batasrki: USvER: I don't think there's anything in ActiveRecord nor Rails specifically for that. There might be gems that do, though
[01:23:29] USvER: I need to run a delayed job
[01:23:36] USvER: And want to store the progress
[01:24:00] baweaver: if only records had an updated_at that you could hook into
[01:24:04] Aeyrix: baweaver: lol
[01:24:05] USvER: It's not directly rails question
[01:24:08] Aeyrix: baweaver: Even then, bad.
[01:24:11] USvER: just general Ruby
[01:24:20] Aeyrix: Well, it's more a logistical question.
[01:24:26] Aeyrix: "Why the fuck would you want to do that"
[01:24:38] Aeyrix: The appropriate answer is generally "I actually don't, but I'm not sure how to do x"
[01:24:41] FrankD: has joined #RubyOnRails
[01:24:49] USvER: Because i have threads all over the place
[01:25:06] Aeyrix: In a rails app?
[01:25:08] USvER: And i want a central database to store the progress right near the model
[01:25:17] FrankD: has joined #RubyOnRails
[01:25:29] USvER: So any instance can access it?
[01:26:02] ahmgeek: has joined #RubyOnRails
[01:26:14] USvER: In my case progress is a state of model and i want to store it...
[01:26:34] USvER: It happens that this state is changing rapidly
[01:26:36] Aeyrix: USvER: Why is more than one thread accessing this at a time.
[01:26:43] Aeyrix: Welcome to race conditions.
[01:26:45] batasrki: USvER: what is the problem that you're seeing
[01:27:10] batasrki: USvER: multiple threads updating the database should be ok, provided you aren't updating the same row
[01:27:10] USvER: The problem, i have alot of database queries
[01:27:14] pydave6367: has joined #RubyOnRails
[01:27:17] USvER: Wich is unnecesarry )
[01:27:36] Rohanezio: has joined #RubyOnRails
[01:27:38] USvER: batasrki, im not (reed only)
[01:27:59] batasrki: USvER: what's the problem exactly?
[01:28:12] batasrki: USvER: read-only multi-threaded access should give you no issues
[01:28:20] Aeyrix: unless Time.now - 1.second < Object.updated.at
[01:28:29] USvER: Ok. Question: how can i throttle method invocation in Ruby =)
[01:28:30] bmurt: has joined #RubyOnRails
[01:28:31] Aeyrix: updated_at
[01:28:56] Aeyrix: I still think your method is problematic and horribly misguided.
[01:29:05] Aeyrix: But I don't have a stake in whatever you're building so I honestly don't care that much.
[01:29:08] hcoleharr_: has joined #RubyOnRails
[01:29:21] USvER: Aeyrix, fair anough.. thanks
[01:29:26] batasrki: USvER: I can't answer that until you describe why you need to throttle access
[01:31:20] USvER: batasrki, i guess Aeyrix updated_at method would do the trick...
[01:31:30] Aeyrix: It would.
[01:31:37] Aeyrix: Add a line in the "do thing" part:
[01:31:42] Aeyrix: puts "This is a shit idea."
[01:31:48] Aeyrix: Then do your thing.
[01:32:00] baash05: has joined #RubyOnRails
[01:32:32] USvER: Ok... Couple words about why "This is a shit idea."?
[01:32:46] Aeyrix: Did you have me on ignore until just now?
[01:32:49] baash05: Hey guys.. I have two tables with retailer_id and user_id.. I was wondering if there a way to associate them in rails
[01:32:53] ahmgeek: has joined #RubyOnRails
[01:33:06] Aeyrix: baash05: With such harrowingly limited information I could give you a hundred possible solutions.
[01:33:14] Aeyrix: I couldn't at all tell you which way is correct.
[01:33:19] USvER: Aeyrix, no... you basicaly say it's "bad idea"
[01:33:32] baash05: Okay.. I have what I view as contractors..
[01:33:43] baash05: they have an hourly rate table..
[01:33:44] ahmgeek: has joined #RubyOnRails
[01:33:49] cih: has joined #RubyOnRails
[01:33:58] baash05: and they have an permitted table.
[01:34:33] baash05: I don't want to muddy the hourly rate table with the permitted data.
[01:35:04] Aeyrix: I'm kind of interested as to your logic behind not just having the hourly rate as an attribute of the contractor.
[01:35:17] ahmgeek: has joined #RubyOnRails
[01:35:36] Aeyrix: Or is it more like "pay grades" and many contractors can have one pay grade?
[01:36:44] baash05: Well that wouldn't discount the logic to having it being part of the same table :) It's more that they get paid differently on different days of the week/hours of the day..
[01:37:04] baash05: And Yeah the contractor table could have that data on it..
[01:37:09] lampshades: has joined #RubyOnRails
[01:37:41] baash05: So retailer_user has reatiler_id, user_id, permited_at, permited_by
[01:37:57] baash05: and type_of_user
[01:38:10] baash05: so while for this discussion it's a contractor table
[01:38:15] baash05: it is an STI..
[01:38:23] RegulationD: has joined #RubyOnRails
[01:38:25] baash05: contractor, admin, sales staff
[01:38:47] baash05: I don't want it dirtied with specifics about hourly rates and such.
[01:38:48] rushed: has joined #RubyOnRails
[01:39:01] jgpawletko: has joined #RubyOnRails
[01:40:06] baash05: But I was wondering if there was a way to reference it.. sort of like with a has_many thing
[01:40:19] baash05: It's not mission critical, Just wondering.
[01:40:48] roxtrongo: has joined #RubyOnRails
[01:41:34] paulcsmith_: has joined #RubyOnRails
[01:44:32] quazimodo: is faye working with puma/
[01:45:35] batasrki: quazimodo: I doubt it. Thin is still better for that, unfortunately
[01:46:24] rickmasta: has joined #RubyOnRails
[01:48:24] havenwood: quazimodo: https://github.com/faye/faye/blob/master/faye.gemspec#L33
[01:49:31] roxtrongo: has joined #RubyOnRails
[01:49:40] havenwood: quazimodo: dunno the answer but seems it at least contemplates its existence in development
[01:52:57] rushed: has joined #RubyOnRails
[01:53:43] seank_: has joined #RubyOnRails
[01:53:54] bklane: has joined #RubyOnRails
[01:54:22] baash05: is there a way to get all records created on a specific day
[01:54:24] bklane: has joined #RubyOnRails
[01:56:39] baash05: got it.. sorry should have found the article first.
[01:56:51] roxtrongo: has joined #RubyOnRails
[02:02:41] jkamenik: has joined #RubyOnRails
[02:06:47] quazimodo: has joined #RubyOnRails
[02:09:58] justin_pdx: has joined #RubyOnRails
[02:10:20] tawaffan: has joined #RubyOnRails
[02:10:44] bklane: has joined #RubyOnRails
[02:10:44] pwnd_nsfw: has joined #RubyOnRails
[02:13:32] ellisTAA: has joined #RubyOnRails
[02:15:54] sypheren: has joined #RubyOnRails
[02:17:27] rubyonrails680: has joined #RubyOnRails
[02:17:49] Guest9: has joined #RubyOnRails
[02:20:38] EminenceHC: has joined #RubyOnRails
[02:24:53] joshkovach: has joined #RubyOnRails
[02:29:38] ahmgeek: has joined #RubyOnRails
[02:30:40] ahmgeek: hey fellas, I've asked that question. and they gave me an answer, my question now, I want to write a test for processing image or any back-end job is there any article or a thing to help me ?
[02:30:51] ahmgeek: as I am pretty new for testing in rails.
[02:32:33] Rohanezio: has joined #RubyOnRails
[02:32:53] RadioNick2: has joined #RubyOnRails
[02:33:35] montagesoftware: has joined #RubyOnRails
[02:34:36] Grundell: has joined #RubyOnRails
[02:34:42] michaeldeol: has joined #RubyOnRails
[02:35:12] maz-dev: has joined #RubyOnRails
[02:36:53] Lytol: has joined #RubyOnRails
[02:37:18] ahmgeek: :( shame on me
[02:37:30] aruntomar: has joined #RubyOnRails
[02:38:11] Detch: has joined #RubyOnRails
[02:39:02] CheckYourSix: has joined #RubyOnRails
[02:39:22] crdpink: has joined #RubyOnRails
[02:40:29] crdpink2: has joined #RubyOnRails
[02:41:31] herbst: has joined #RubyOnRails
[02:41:55] wldcordeiro: has joined #RubyOnRails
[02:42:16] das3in: has joined #RubyOnRails
[02:44:24] das3in: Hey everyone, I asked this question a couple days ago but had to leave before I got a lot of help. I'm attempting to build a basic survey/poll application. However I can't seem to do forms correctly (form_for won't work on nested models) gist with relevant files
[02:44:51] das3in: https://gist.github.com/das3in/cac1a1fd8c55448176da
[02:53:57] passbe: has left #RubyOnRails: ("WeeChat 1.3")
[02:54:24] arBmind1: has joined #RubyOnRails
[02:54:30] seank_: has joined #RubyOnRails
[02:55:45] ahmgeek: das3in: what's the error ?
[02:56:03] pydave6367: has joined #RubyOnRails
[02:57:20] yaymukund: has joined #RubyOnRails
[02:57:40] dopie: has joined #RubyOnRails
[02:58:03] jun_: has joined #RubyOnRails
[02:58:04] sadaf2606: has joined #RubyOnRails
[02:58:30] roxtrongo: has joined #RubyOnRails
[02:58:31] ahmgeek: you should use accepts_nested_attributes_for :questions in your UserResponse Model too ?
[03:00:36] rushed: has joined #RubyOnRails
[03:01:06] mrtomme_: has joined #RubyOnRails
[03:01:36] srinidhi: has joined #RubyOnRails
[03:02:00] baweaver: has joined #RubyOnRails
[03:02:47] Creeves: has joined #RubyOnRails
[03:02:58] roxtrongo: has joined #RubyOnRails
[03:03:38] bruno-: has joined #RubyOnRails
[03:04:16] otacon-: guys, how bad is this? -> https://gist.github.com/brdrgz/b133cb37a27e723da5f9
[03:05:20] otacon-: mostly concerned about calling a method (that calls render) inside of find
[03:08:12] havenwood: has joined #RubyOnRails
[03:08:38] bklane: has joined #RubyOnRails
[03:09:55] tweeeaks: has joined #RubyOnRails
[03:10:33] braincrash: has joined #RubyOnRails
[03:11:19] das3in: ahmgeek undefined method `question_name' for #<ActionView::Helpers::FormBuilder:0x007fa603430e30>
[03:11:55] mehwork: when i type 'rails' in osx it says "Stub rails command to load rails from Gems or print an error if not installed" which comes from /usr/bin/rails ruby script. But what installed that script?
[03:12:44] das3in: ahmgeek that's just when trying to view the form, nothing else
[03:13:05] michaeldeol: has joined #RubyOnRails
[03:14:28] ahmgeek: try the accept_nested_attributes
[03:15:16] rushed: mehwork: don't use system ruby :) follow a guide that uses rvm (or a similar tool)
[03:16:08] mehwork: rushed: right, just wondering where that command came from. Does osx come with that installed by default?
[03:16:15] rushed: mehwork: yes it does
[03:17:21] bklane: has joined #RubyOnRails
[03:19:31] elton: has joined #RubyOnRails
[03:19:45] ElSif: has joined #RubyOnRails
[03:21:48] michaeldeol: has joined #RubyOnRails
[03:25:14] theery: has joined #RubyOnRails
[03:26:19] unreal: has joined #RubyOnRails
[03:29:24] annlewis: has joined #RubyOnRails
[03:31:13] EminenceHC: has joined #RubyOnRails
[03:33:18] SteenJobs: has joined #RubyOnRails
[03:34:29] aruntomar: has joined #RubyOnRails
[03:34:32] _djbkd: has joined #RubyOnRails
[03:35:46] creature: Is acts_as_list still the "best" gem for ordering my models? Is there something more contemporary that's recommended instead?
[03:36:18] Jon30: has joined #RubyOnRails
[03:38:51] pwnd_nsfw: has joined #RubyOnRails
[03:47:08] ahmgeek: anyone around
[03:48:23] Spami: has joined #RubyOnRails
[03:50:19] jun_: has joined #RubyOnRails
[03:50:41] rushed: has joined #RubyOnRails
[03:51:16] concernedcitizen: has joined #RubyOnRails
[03:53:52] VeryBewitching: In theory, yes.
[03:54:18] closer: has joined #RubyOnRails
[03:57:36] ahmgeek: well, I have a problem regards dragonfly after_assign process
[03:57:44] ahmgeek: can I show the code ?
[03:57:56] ahmgeek: or no one has anything to do with dragonfly ?
[03:58:38] adam12: Let's see it
[04:00:22] Maletor: has joined #RubyOnRails
[04:01:14] ahmgeek: https://gist.github.com/ahmgeek/7f22d5a0fc8eb6d921e8
[04:01:23] ahmgeek: the problem is the processing never fired !
[04:02:36] arup_r: has joined #RubyOnRails
[04:02:52] doubl_m: has joined #RubyOnRails
[04:03:45] wldcordeiro: has joined #RubyOnRails
[04:03:45] adam12: ahmgeek: are you trying to re-assign a new image to itself?
[04:03:47] adam12: I'm trying to figure this out.
[04:04:14] VeryBewitching: ahmgeek: Haven't used Dragonfly yet, sorry.
[04:04:40] ahmgeek: adam12: I am trying to run the optimizer on the image and got it saved instead of the old one.
[04:05:06] adam12: Right. Can you put something inside that block to indicate if it's fired or not?
[04:05:12] adam12: It might be firing but your assignment is failing.
[04:06:38] ahmgeek: let me try
[04:07:29] neanderslob: has joined #RubyOnRails
[04:08:17] ahmgeek: the block: affter_assign is firing indeed.
[04:08:37] CheckYourSix: has joined #RubyOnRails
[04:10:03] adam12: ahmgeek: I'm curious if you can access the model from iside that block
[04:10:24] wldcordeiro_: has joined #RubyOnRails
[04:10:31] adam12: What about converting the after_assign block into a symbol for a method
[04:10:41] adam12: and then that method can access the dragonfly accessor.
[04:11:17] qejk: has joined #RubyOnRails
[04:11:27] ahmgeek: adam12: didn't got you, could you do a fast written code on gist for it please :( :*
[04:11:33] adam12: ahmgeek: See my fork: https://gist.github.com/adam12/7e6db5840980da918dde
[04:11:42] adam12: Specifically image.rb (I didn't change anything else)
[04:11:53] nickenchuggets: has joined #RubyOnRails
[04:12:06] adam12: My only concern with this is, possible infinite loop?
[04:12:48] adam12: Actually, I guess you could of accessed the model using self.
[04:13:16] baegle: has joined #RubyOnRails
[04:14:27] adam12: ahmgeek: Updated again, closer to your original code: https://gist.github.com/adam12/7e6db5840980da918dde
[04:14:40] ahmgeek: adam12: I fuckin love you :* :* :*
[04:14:47] ahmgeek: from my all Egyptian fuckin heart :D
[04:15:08] ahmgeek: cheers, and *MAD HUGS*
[04:15:23] ahmgeek: thanks mate
[04:16:25] ahmgeek: give me your twitter handler than :D
[04:16:27] baegle: I am running a Hello,World rails application using NginX and uWSGI. I can get the application working just fine with a dedicated vhost, but I can't get routing to work in a subdirectory. I've set PATH_INFO and REQUEST_URI but the subdirectory is still being used as part of the request and routing fails. I've been trying to debug for hours. Does anyone have any ideas?
[04:18:30] adam12: Subdirectories are always a mess
[04:18:56] sanjayu: has joined #RubyOnRails
[04:19:08] neanderslob: has joined #RubyOnRails
[04:19:10] adam12: You might need to set relative_url_root
[04:19:16] baegle: I've gotten it working for other languages, one needed REQUEST_URI, another needed PATH_INFO, but neither work with Rails it seems
[04:19:33] baegle: I did set the relative_url_root. It seems it's only used when generating URLs
[04:19:34] adam12: or even root_directory
[04:19:43] baegle: hmm, root_directory...
[04:19:58] adam12: Rails.application.config.root_directory
[04:20:02] adam12: Similiar to relative_url_root
[04:20:21] adam12: Just spitballing here. Subdirectory deploys have been messy for as long as I remember - sans the way Passenger does it.
[04:21:33] adam12: There was an ENV variable at one point in time too. I wonder if it still works. ENV["RAILS_RELATIVE_URL_ROOT"]
[04:21:56] baegle: That's unfortunate. I really want to be able to use a Rails to serve a specific set of routes defined in my forward proxy config instead of defined by the Rails app itself
[04:22:29] baegle: yes, the environment variable appears to be the same thing, used to generate URLs from within the app
[04:24:00] adam12: What version of Rails?
[04:25:19] Lytol: has joined #RubyOnRails
[04:27:41] bklane: has joined #RubyOnRails
[04:28:13] Scriptonaut: has joined #RubyOnRails
[04:30:06] baegle: I don't see root_directory as a member of Rails.application.config
[04:30:12] annlewis: has joined #RubyOnRails
[04:30:18] baegle: it doesn't show up in the inspect
[04:31:15] adam12: I'm not familiar with uWSGI
[04:31:20] adam12: Can you combine a few env variables
[04:31:43] adam12: I'd try setting SCRIPT_NAME to subfolder? and still set RAILS_RELATIVE_URL_ROOT
[04:32:07] baegle: attempted that, no dice
[04:32:11] baegle: will try again for sanity
[04:32:48] adam12: Subdomains is a huge mess. Passenger does some trickery, setting RAILS_RELATIVE_URL_ROOT and RACK_BASE_URI
[04:32:55] adam12: s/subdomains/subfolders
[04:32:59] Cork: has joined #RubyOnRails
[04:33:13] quazimodo: Faye with faye-rails looks to be running pretty ok on puma
[04:33:53] baegle: RACK_BASE_URI that's what I was trying to find doc on but couldn't find it
[04:34:11] baegle: let me try setting that as just an environment variable
[04:34:14] adam12: Passenger sets SCRIPT_NAME too
[04:34:23] adam12: To base URL, which my guess is folder name
[04:34:58] jenrzzz: has joined #RubyOnRails
[04:35:30] Grundell: has joined #RubyOnRails
[04:36:03] cih: has joined #RubyOnRails
[04:36:38] baegle: no change. It's trying to access a route with the subdirectory as the base
[04:36:57] baegle: I just cannot figure out how rails/rack is actually getting this value!
[04:37:55] chipotle: has joined #RubyOnRails
[04:37:56] adam12: A mystery indeed.
[04:39:01] adam12: Rails.application.routes.default_url_options[:script_name] = ENV['RAILS_RELATIVE_URL_ROOT']
[04:40:11] sanjayu: has joined #RubyOnRails
[04:40:23] kp666: has joined #RubyOnRails
[04:40:28] Spami: has joined #RubyOnRails
[04:40:52] kp666: has joined #RubyOnRails
[04:41:03] baegle: Where would you suggest putting that?
[04:41:35] adam12: An initializer is fine
[04:41:44] adam12: At least to make sure it works
[04:42:16] adam12: Can move it to production.rb or something afterwards (or now, if you feel like it).
[04:43:06] herbst: has joined #RubyOnRails
[04:44:44] montagesoftware: has joined #RubyOnRails
[04:45:30] baegle: environment variable is showing that it's set but putting just that one line in an initializer had no effect
[04:45:34] mehwork: when i run 'rails new myapp' it says 'run bundle exec spring binstub --all' What does that do?
[04:48:55] adam12: mehwork: generates binstubs (those files in bin/) customized to launch spring
[04:49:08] adam12: baegle: Weird. I'm all out of ideas. :|
[04:50:06] adam12: baegle: I'm not sure why subdirectory deploys is such a pain, but it's been like that for a long time. As long as I can remember :|
[04:50:26] trung: has joined #RubyOnRails
[04:50:57] baegle: you know what I could try.... I could tcpdump the connection between NginX and uWSGI to see how the subdirectory is making it over there
[04:51:03] ardian: has joined #RubyOnRails
[04:51:05] adam12: That's a good idea.
[04:51:18] adam12: It's late and I'm crashing, so good luck.
[04:51:22] baegle: (this is the part where you say "better you than me")
[04:51:34] adam12: :) I woulda deployed Passenger and said ferget it
[04:51:50] baegle: I'm trying something somewhat stupid
[04:51:54] ardian: Hello I am watching a tutorial on devise and the author is using this to make a "note" be assigned to the current user
[04:51:58] ardian: def new @client = current_user.clients.build
[04:52:22] baegle: I'm trying to configure uWSGI to serve applications in 5 language so I can have a single polyglot dev environment
[04:52:24] ardian: but I am getting undefined method `clients' for #<User:0x000000023c0f08>
[04:52:39] trung: has left #RubyOnRails: ()
[04:52:40] srinidhi: has joined #RubyOnRails
[04:52:44] adam12: ardian: in your User model, you'll need a `has_many :clients` line
[04:53:27] barathum12093810: has joined #RubyOnRails
[04:53:53] ardian: adam12: I have it http://fpaste.org/272976/
[04:54:19] ardian: and Client, belongs_to :user
[04:54:49] ardian: http://fpaste.org/272977/ clients controller
[04:54:53] lampshades: has joined #RubyOnRails
[04:55:18] seank_: has joined #RubyOnRails
[04:55:20] adam12: if you loaded up a Rails console and did `User.first.clients` - does it work?
[04:55:24] adam12: I'm assuming yes.
[04:56:57] ardian: adam12: ou ye, and the web view works now too
[04:57:06] ardian: not sure why it works now
[04:57:07] barathum12093810: has left #RubyOnRails: ()
[04:57:17] adam12: Very strange.
[04:57:31] adam12: ... seems I'm saying that a lot tonight. LOL
[04:57:49] ardian: lol, thank you
[04:58:07] adam12: Cheers. Have fun! Wish I was back in 06 learning it all again. Fun times.
[04:58:29] Radar_: has left #RubyOnRails: ()
[04:58:30] yfeldblum: has joined #RubyOnRails
[04:58:39] Radar: has joined #RubyOnRails
[04:58:48] Radar: !botsnack
[04:58:48] helpa: Nom nom. Thanks, Radar!
[05:00:50] baweaver: welcome back Radar
[05:00:54] Radar: thank you
[05:01:01] baweaver: we only burned half the channel
[05:01:02] Radar: Two more flights until home
[05:01:14] baweaver: I forget which half
[05:01:21] baweaver: ah well, probably doesn't matter
[05:01:35] tuckfrump: has joined #RubyOnRails
[05:01:50] ahmgeek: guys, where to put image_optim.yml in my rails app ? I'v put it in config/ but it didn't read it
[05:01:58] Radar: tuckfrump: it's not working
[05:02:22] tuckfrump: Is it possible to re-use a rails app???s controller as a library (like the Rails console, except in a ruby project instead the need to access the console itself)
[05:02:39] Radar: ahmgeek: https://github.com/toy/image_optim#configuration
[05:02:53] Radar: tuckfrump: what exactly are you trying to do?
[05:03:01] tuckfrump: Radar: testing
[05:03:07] Radar: tuckfrump: Be more specific.
[05:03:14] Radar: baweaver: Just flew from Montreal to Vancouver. About to fly Vancouver -> Sydney which is ~14 hours.
[05:03:21] Radar: Then Sydney -> Melbourne
[05:03:36] sevenseacat: sux 2 be Radar today
[05:03:39] mehwork: adam12: ok. Also how come rails new myapp says 'se `bundle show [gemname]` to see where a bundled gem is installed' but when i do it says 'Could not locate Gemfile or .bundle/ dir'?
[05:03:39] quazimodo: how're your deep vein thromboses
[05:03:46] Radar: quazimodo: immune :D
[05:04:00] quazimodo: i was with a girl from montreal
[05:04:05] ahmgeek: Radar: changed it to .image_optim.yml, didn't read it too, am gonna deploy it on heroku so I don't have .config/
[05:04:07] sevenseacat: then again, at least its only today
[05:04:09] quazimodo: don't be with girls from montreal
[05:04:11] sevenseacat: sux 2 be sevenseacat all the time
[05:04:25] quazimodo: so we got faye-rails and puma working
[05:04:32] Radar: ahmgeek: *shrug* I've never used this before
[05:04:38] quazimodo: it's pretty annoying tbh
[05:04:40] srinidhi: has joined #RubyOnRails
[05:04:46] ahmgeek: I need girls from monteral
[05:04:51] tuckfrump: Radar: well I am doing some integration tests and it???s hard without control over the test db. I could do SQL, but I figure it???s better to reuse the Rails controller when it comes to seeding test data
[05:05:10] Radar: tuckfrump: Seems... weird? Why would you want to use the controller for that?
[05:05:13] quazimodo: ahmgeek: you don't
[05:05:14] Radar: Why not just use the model?
[05:05:14] rvanlieshout: has joined #RubyOnRails
[05:05:27] quazimodo: unless you're a big asshole and can deal with them
[05:05:51] Radar: what baweaver said
[05:05:59] ahmgeek: quazimodo: I am one of the nicest ass holes anyone will ever hope to meet.
[05:06:00] Aeyrix: EDGE DETECTED
[05:06:01] tuckfrump: Radar: any other suggestion? I suppose the ORM/activrecord & access to the DB is good enough but there are some controller methods I want to use too. Although I could go without the latter
[05:06:15] Radar: tuckfrump: What controller methods?
[05:06:18] baweaver: ACTION scratches head
[05:06:26] Radar: tuckfrump: I really don't like talking in theoreticals :(
[05:06:42] theery: has joined #RubyOnRails
[05:07:42] tuckfrump: Radar: theoretical? I just need some control over the Rails App to create user with this shopping cart item, that order, etc so that I can test them
[05:08:11] Radar: tuckfrump: But why are your methods in the controller for that? Why aren't they in a model?
[05:08:20] Radar: tuckfrump: Show us some code and what you're trying to accomplish?
[05:09:04] tuckfrump: Radar: they it should be the model, yeah. Sorry I???m just translating some of the stuff the guy handling the Rails app???s telling me
[05:09:13] TomyLobo: has joined #RubyOnRails
[05:10:44] pawnbox: has joined #RubyOnRails
[05:10:45] Aeyrix: sounds like you need a consultant
[05:10:51] tuckfrump: :( we can???t afford one
[05:11:09] cih: has joined #RubyOnRails
[05:11:16] tuckfrump: any other suggestions?
[05:12:31] roxtrongo: has joined #RubyOnRails
[05:13:06] ChanServ: +o baweaver
[05:13:15] michaeldeol: has joined #RubyOnRails
[05:13:49] baweaver: factory girl
[05:14:01] baweaver: would ya look at that
[05:14:40] baweaver: now that's no fun at all
[05:14:54] workmad3_: has joined #RubyOnRails
[05:15:50] sarink: has joined #RubyOnRails
[05:16:28] Aeyrix: baweaver: wat
[05:18:06] ChanServ: -o baweaver
[05:19:02] rezzack: has joined #RubyOnRails
[05:22:41] tejasmanohar: has joined #RubyOnRails
[05:24:19] sanjayu: has joined #RubyOnRails
[05:28:29] jun_: has joined #RubyOnRails
[05:29:01] riotjones: has joined #RubyOnRails
[05:30:55] annlewis: has joined #RubyOnRails
[05:32:51] bklane: has joined #RubyOnRails
[05:33:46] ahmgeek: https://github.com/toy/image_optim/issues/36#issuecomment-34588533 regard this guys, where to put it ?
[05:33:58] ahmgeek: I tried the application.rb but rails nagged about it
[05:34:57] rvanlieshout: define nagged about it
[05:35:08] Aeyrix: application_controller?
[05:35:14] baweaver: def nagged_about_it "NAG!" end
[05:35:18] baweaver: rvanlieshout: ^
[05:35:57] bratsche: has joined #RubyOnRails
[05:37:24] ahmgeek: rvanlieshout: take it easy, I am trying to learn proper grammar :D
[05:38:17] rvanlieshout: shinnya: does it raise an error?
[05:40:43] tagrudev: has joined #RubyOnRails
[05:41:32] dhjondoh: has joined #RubyOnRails
[05:43:51] yardenbar: has joined #RubyOnRails
[05:44:22] herbst: has joined #RubyOnRails
[05:55:00] mices: is there a helper to convert a us state abbreviation to a string like CA to California
[05:57:26] rvanlieshout: mices: i wouldn't hope so
[05:57:31] rvanlieshout: mices: there surely is a gem for that
[05:57:33] rvanlieshout: or a locale file
[05:58:43] rakm: has joined #RubyOnRails
[06:00:17] dionysus69: has joined #RubyOnRails
[06:00:21] cih: has joined #RubyOnRails
[06:02:33] sininen_: has joined #RubyOnRails
[06:03:46] rubyonrails799: has joined #RubyOnRails
[06:04:13] arup_r: has joined #RubyOnRails
[06:04:55] cih: has joined #RubyOnRails
[06:05:23] lampshade: has joined #RubyOnRails
[06:07:16] absklb: has joined #RubyOnRails
[06:07:27] yfeldblum: has joined #RubyOnRails
[06:07:57] riotjones: has joined #RubyOnRails
[06:09:03] arup_r: absklb: morning
[06:09:42] krz: has joined #RubyOnRails
[06:10:54] eGGsha: has joined #RubyOnRails
[06:13:36] Lytol: has joined #RubyOnRails
[06:14:00] A124: has joined #RubyOnRails
[06:14:13] emilkarl: has joined #RubyOnRails
[06:15:40] arup_r: ACTION testing the output of request.format. This method seems very helpful
[06:15:42] herbst: has joined #RubyOnRails
[06:15:42] herbst: has joined #RubyOnRails
[06:17:08] arup_r: cool ... it works request.format.json? # gives boolean result.. pretty nice.
[06:17:10] doubl_m: has left #RubyOnRails: ()
[06:17:38] rvanlieshout: i hope you didn't add that # gives boolean result as a comment
[06:17:48] bbrowning_away: has joined #RubyOnRails
[06:18:47] abhishekvasisht: has joined #RubyOnRails
[06:18:54] arup_r: No I did not.. :)
[06:20:02] pydave6367: has joined #RubyOnRails
[06:21:28] rakm: has joined #RubyOnRails
[06:22:01] wroos: has joined #RubyOnRails
[06:22:39] ahmgeek: https://github.com/toy/image_optim/issues/108#issuecomment-144290189
[06:22:43] ahmgeek: sorry guys
[06:23:15] Grundell: has joined #RubyOnRails
[06:23:26] baweaver: remember we're not all guys here.
[06:24:25] jun_: has joined #RubyOnRails
[06:26:08] sandstrom: has joined #RubyOnRails
[06:26:17] Aeyrix: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[06:26:22] Aeyrix: wrong channel
[06:26:40] Aeyrix: I really need to work out why IRCCloud renders incorrectly on Firefox sometimes.
[06:27:18] dionysus69: I have looked at phussion passenger and it has modes with nginx and apache, but I dont get it, if I also use ngnix and apache, what does passenger do then? basically to make it simple, what webserver setup should I go for production web server?
[06:28:26] dionysus69: Aeyrix: use AndroIRC
[06:28:34] Aeyrix: dionysus69: Nah.
[06:28:39] Aeyrix: IRCCloud is one client for everywhere.
[06:28:41] Aeyrix: Desktop / phone.
[06:29:11] dionysus69: oh ok, I am using thunderbird for desktop irc and its great great :D
[06:29:40] Aeyrix: Everyone who IRCs regularly should look into something like IRCCloud tbh
[06:29:51] Aeyrix: The rendering problem is Firefox. Doesn't happen in Vivaldi.
[06:29:54] sevenseacat: I like my textual.
[06:30:00] sevenseacat: for the most part.
[06:31:13] shmoon_: has joined #RubyOnRails
[06:31:53] shmoon_: I did a Model.where(condition)
[06:32:11] annlewis: has joined #RubyOnRails
[06:32:22] shmoon_: seems like I can do r = Model.where(condition); r.some_method; if some_method is a class method in Model class. how does that work out ?
[06:32:44] shmoon_: because r.class would print ActiveRecord::Relation::ActiveRecord_Relation_Model
[06:32:55] shmoon_: or the other question would be, is this documented somewhere?
[06:33:03] shmoon_: found this code in an existing codebase
[06:33:30] Aeyrix: Yes, it'll be in the AR documentation as it's one of the foundational features of AR.
[06:33:50] absklb: Good Morning arup_r
[06:34:02] Aeyrix: ... sevenseacat, pls2sanity check
[06:34:05] ahmgeek: baweaver: nick names doesn?t say anything about genders :(
[06:34:19] Aeyrix: ActiveRecord_Relation_Model is more or less an array of "Model" right?
[06:34:42] sararegan: has joined #RubyOnRails
[06:34:44] Aeyrix: I can't check this because I don't have a ruby environment available right now.
[06:35:04] sevenseacat: its an ActiveRecord::Relation, which is kinda like an enumerable object of Model instances, yeah
[06:35:22] baweaver: it inherits the methods from that class
[06:35:27] violarium: has joined #RubyOnRails
[06:35:42] Aeyrix: So class methods would work but instance methods would not.
[06:35:47] baweaver: It does that because ActiveRecord is lazy
[06:35:50] Aeyrix: Turns out I misread the question because I'm an idiot.
[06:35:52] baweaver: hence scopes
[06:35:55] Aeyrix: d i s r e g a r d m e
[06:36:08] baweaver: I'll spot you that one and leave it alone Aeyrix ;)
[06:36:29] shmoon_: ok I'm confused
[06:36:35] shmoon_: what does being an array of "Model" mean ?
[06:36:45] baweaver: So shmoon_, you can get away with this: Model.where().where().where()
[06:37:26] shmoon_: ok makes sense now :P
[06:37:30] baweaver: as soon as something like #each or #to_a or another value method gets called on it, it evaluates all the SQL it was building in that chain
[06:37:39] baweaver: class methods can be used in that chain too
[06:37:48] shmoon_: got it, thanks! :-)
[06:37:52] baweaver: baweaver.com/blog/2015/05/04/sublime-scoping-with-rails/ - like that
[06:37:58] baweaver: </shameless-plug>
[06:38:13] sanjayu: has joined #RubyOnRails
[06:38:26] baweaver: ACTION mutters something about fixing a typo on there
[06:39:07] Aeyrix: B. A. Weaver.
[06:39:07] rhizome: fun with devise
[06:39:11] Aeyrix: B. Eaver.
[06:39:39] baweaver: Wood you care to finish that thought?
[06:40:07] Aeyrix: Dam, looks like the puns are starting :^)
[06:40:19] blackmesa: has joined #RubyOnRails
[06:40:26] dionysus69: has joined #RubyOnRails
[06:43:29] solars: has joined #RubyOnRails
[06:45:27] lampshades: has joined #RubyOnRails
[06:46:04] baweaver: maybe, if you hadn't caught me at the tail end of my day. Have to log out soon
[06:46:10] Aeyrix: getout.gif
[06:47:05] AzaToth: has joined #RubyOnRails
[06:47:09] absklb: hi, the Canvas LMS did not had app/assets/* so i added app/assets/javascripts/application.js and app/assets/javascripts/a.js and added require a to application.js now it still does not even try to find a.js? how can i know how Canvas team blocked all this so that I can unblock?
[06:48:16] CheckYourSix: has joined #RubyOnRails
[06:48:53] Cervajz: has joined #RubyOnRails
[06:49:49] trautwein: has joined #RubyOnRails
[06:50:55] Cervajz_: has joined #RubyOnRails
[06:53:03] gambl0re: has joined #RubyOnRails
[06:56:08] seank_: has joined #RubyOnRails
[06:56:11] pawnbox: has joined #RubyOnRails
[06:56:35] pawnbox: has joined #RubyOnRails
[06:58:54] arup_r: has joined #RubyOnRails
[06:59:03] aruntomar: has joined #RubyOnRails
[07:00:24] habitullence: has joined #RubyOnRails
[07:01:35] nfk|laptop: has joined #RubyOnRails
[07:01:47] dionysus69: has joined #RubyOnRails
[07:02:04] arup_r1: has joined #RubyOnRails
[07:02:46] abhishekvasisht: has joined #RubyOnRails
[07:04:11] FrankD: has joined #RubyOnRails
[07:04:54] linus2: has joined #RubyOnRails
[07:05:38] adlez: has joined #RubyOnRails
[07:05:48] piotrj: has joined #RubyOnRails
[07:10:26] _lazarevsky: has joined #RubyOnRails
[07:10:38] _lazarevsky: when doing ranges
[07:10:42] krz: has joined #RubyOnRails
[07:10:59] _lazarevsky: does it include the dates themselves or only the dates in between
[07:11:06] sevenseacat: easy to test and find out.
[07:11:15] _lazarevsky: well apparently it does not
[07:11:20] pawnbox: has joined #RubyOnRails
[07:11:21] _lazarevsky: where(start_date: start_date..end_date, end_date: start_date..end_date)
[07:11:30] trautwein: has joined #RubyOnRails
[07:11:32] sevenseacat: see what SQL it generates.
[07:11:35] _lazarevsky: I would like it to include records with those dates as well
[07:11:38] sevenseacat: that'll answer the question.
[07:12:07] jun_: has joined #RubyOnRails
[07:12:14] rhizome: you can use DateTime methods to be more inclusive. start_date.beginning_of_day, etc.
[07:13:53] _lazarevsky: ok so that translates to <= and >=
[07:14:16] rhizome: there ya go
[07:15:49] _lazarevsky: rhizome: beginning_of_day did it
[07:15:52] _lazarevsky: and end_of_day
[07:16:03] DoubleMalt: has joined #RubyOnRails
[07:16:05] _lazarevsky: I should really stop working with datetime
[07:16:25] sandstrom: has joined #RubyOnRails
[07:17:08] Cervajz: has joined #RubyOnRails
[07:18:56] SteenJobs: has joined #RubyOnRails
[07:20:29] atomical: has joined #RubyOnRails
[07:20:51] alex88: has joined #RubyOnRails
[07:21:06] _lazarevsky: rhizome: https://gist.github.com/anonymous/8225eff4314a8de0b9c6
[07:21:22] _lazarevsky: turns out I was wrong; your suggestion didn't solve it
[07:21:26] _lazarevsky: so check this
[07:21:32] _lazarevsky: imagine that the offset variable is 0
[07:21:58] _lazarevsky: I checked in the db and can confirm that there are records with start_date of 2015-09-28
[07:22:15] DoubleMalt: has joined #RubyOnRails
[07:22:21] _lazarevsky: unfortunately, these records are not returned to the front end
[07:22:26] _lazarevsky: I can't explain why..
[07:22:59] _lazarevsky: rhizome: SELECT "capacity_project_team_blocks".* FROM "capacity_project_team_blocks" WHERE "capacity_project_team_blocks"."capacity_project_id" = ? AND ("capacity_project_team_blocks"."start_date" BETWEEN '2015-09-28 00:00:00.000000' AND '2016-01-03 23:59:59.999999') AND ("capacity_project_team_blocks"."end_date" BETWEEN '2015-09-28 00:00:00.000000' AND '2016-01-03 23:59:59.999999') [["capacity_project_id", 12]
[07:23:08] _lazarevsky: here is the query that's generated
[07:23:38] sevenseacat: pet hate - when people say date and mean datetime
[07:24:05] arup_r1: _lazarevsky: that means query filter is wrong
[07:24:21] _lazarevsky: rhizome: I know it does, however the records for the starting_date (2015-09-28) are not returned :/
[07:24:42] _lazarevsky: #<CapacityProjectTeamBlock id: 345, start_date: "2015-09-28", end_date: "2015-10-04", capacity: 1, capacity_project_id: 11, created_at: "2015-09-30 07:16:09", updated_at: "2015-09-30 07:16:09">
[07:25:00] _lazarevsky: arup_r_: wadja mean.. I just checked and BETWEEN translates to <= and >=
[07:25:41] arup_r1: _lazarevsky: Try in rails console..
[07:25:46] rhizome: what is "12"?
[07:26:09] _lazarevsky: rhizome: where dp you see that?
[07:26:19] rhizome: the parameters to the query at the end
[07:26:30] _lazarevsky: oh that's the parent model's id
[07:26:51] rhizome: i only see one ? in the query
[07:26:58] _lazarevsky: i'm returning CapacityProject along with their children records (CapacityProjectTeamBlock)
[07:27:05] _lazarevsky: rhizome: I only posted one line of the query
[07:27:34] _lazarevsky: it's the same query for the other, the only difference being the capacity_project_Id
[07:27:38] rhizome: anyway, that's the way it works
[07:27:52] _lazarevsky: rhizome: so you can't see anything wrong with my code aye
[07:28:00] sevenseacat: you havent posted any code
[07:28:10] _lazarevsky: sevenseacat: https://gist.github.com/anonymous/8225eff4314a8de0b9c6
[07:28:29] sevenseacat: ACTION backs away slowly
[07:28:37] _lazarevsky: I did post it earlier :)
[07:30:07] sevenseacat: so are you actually working with dates or timestamps?
[07:30:13] sevenseacat: you've posted both
[07:30:36] _lazarevsky: start_date is of time date
[07:30:58] _lazarevsky: I wanna work just with dates
[07:31:05] _lazarevsky: beginning_of_day i added on rhizome's suggestion
[07:31:09] sevenseacat: then beginning of day and end of day are meaningless
[07:31:27] _lazarevsky: start_date is of type date*
[07:32:08] _lazarevsky: sevenseacat: I understand
[07:32:23] sevenseacat: so you posted a SQL query that said project_id = 12, but the record you wanted returned had project_id = 11
[07:33:06] annlewis: has joined #RubyOnRails
[07:33:26] _lazarevsky: there are 2 records
[07:33:30] _lazarevsky: with id 11 and 12
[07:33:32] _lazarevsky: both are returned..
[07:33:41] sevenseacat: that doesnt make sense.
[07:33:46] sevenseacat: and will not happen.
[07:34:05] _lazarevsky: so im returning 2 capacity project models along with the filtered capacity_project_team_block records
[07:34:20] sevenseacat: I think you need to simplify your problem to work out where its coming from
[07:34:27] sevenseacat: you have a mess of models and associations and a controller action from hell
[07:34:27] _lazarevsky: sevenseacat: ok
[07:34:37] sevenseacat: and you've just dumped it on us and said 'fix'
[07:34:40] _lazarevsky: haha controller action from hell
[07:35:08] _lazarevsky: ok.. I did try to solve it myself but couldn't figure out what the problem is
[07:35:12] _lazarevsky: I thought my mistake was something obvious
[07:35:29] moeabdol3: has joined #RubyOnRails
[07:35:29] sevenseacat: and how did you try and solve it
[07:35:35] artto: has joined #RubyOnRails
[07:35:57] sevenseacat: given you havent even properly demonstrated a problem
[07:37:11] sevenseacat: demonstrating a problem would be something like 'this line of code with these params generates this query, which returns these results, but actually i think this record should/shouldnt be included in the results'
[07:37:29] _lazarevsky: ok I found it!
[07:37:44] PlasmaStar: has joined #RubyOnRails
[07:37:47] _lazarevsky: oh wow.. mental note to self -> never mix dates and datetimes
[07:38:05] sevenseacat: that would be a good start.
[07:38:24] _lazarevsky: sevenseacat: params[:offset].to_i.weeks.from_now <- returns a bloody datetime
[07:38:33] sevenseacat: it sure does.
[07:39:43] _lazarevsky: so initially when the pages loads I say Date.current.beginning_of_week which returns a date and all is well
[07:39:50] _lazarevsky: then I change the offset to 1
[07:40:04] sevenseacat: if you say so.
[07:40:12] _lazarevsky: so I say params[:offset].to_i.weeks.from_now and use that as the starting_date which returns a datetime
[07:40:12] alex88_: has joined #RubyOnRails
[07:40:23] _lazarevsky: causing my query to not include the start_date
[07:40:45] Pumukel: has joined #RubyOnRails
[07:40:51] sevenseacat: I'm not even gonna
[07:41:17] rhizome: huh, i wonder what's up with that
[07:41:17] _lazarevsky: sevenseacat: what?
[07:41:38] _lazarevsky: params[:offset].to_i.weeks.from_now.to_date solved my problem
[07:42:28] rubyonrails578: has joined #RubyOnRails
[07:42:30] _lazarevsky: I'm glad I was able to contribute to the Knowledge Base in the ruby community
[07:42:32] _lazarevsky: you're welcome
[07:42:44] sevenseacat: nope, not gonna
[07:43:34] rezam90_: has joined #RubyOnRails
[07:48:22] cih: has joined #RubyOnRails
[07:49:29] futilegames: has joined #RubyOnRails
[07:49:34] mices: new_festival_path should translate to /festivals/new or festival/new ?
[07:50:22] sevenseacat: check the output of rake routes.
[07:51:56] Or1on: has joined #RubyOnRails
[07:52:08] drptbl: has joined #RubyOnRails
[07:54:52] RegulationD: has joined #RubyOnRails
[07:55:30] linus3: has joined #RubyOnRails
[07:56:58] seank_: has joined #RubyOnRails
[07:57:06] lipoqil: has joined #RubyOnRails
[07:57:13] Macaveli: has joined #RubyOnRails
[07:58:23] chrislotix: has joined #RubyOnRails
[07:58:25] Jon__: has joined #RubyOnRails
[07:59:45] alex88: has joined #RubyOnRails
[08:00:01] dawkirst: has joined #RubyOnRails
[08:00:20] dawkirst: Hi everyone (cross-ask from #rspec, but I think this is a better channel for the question). It's generally considered bad form to have more that one `expects` in an `it` block, right?
[08:00:30] atomical: has joined #RubyOnRails
[08:01:33] dhjondoh: if it suits your needs..
[08:01:39] violarium: dawkirst: I'm not sure about it. It depends on what are you checking, I think
[08:01:41] Lytol: has joined #RubyOnRails
[08:01:52] futilegames: has joined #RubyOnRails
[08:01:55] sevenseacat: one of those 'it depends'/style things
[08:02:21] violarium: dawkirst: if you want to check that, for example, page have proper content, it's fine to check content and title and so on in one block, I guess
[08:02:23] mikecmpbll: has joined #RubyOnRails
[08:02:55] dawkirst: Yeah, makes sense. Thanks!
[08:03:03] piotrj: has joined #RubyOnRails
[08:03:18] violarium: dawkirst: but if you want to check really not close things, it will be messy, like some kind of message and inserting into database
[08:03:55] aganov: has joined #RubyOnRails
[08:04:56] w0rd-driven: has joined #RubyOnRails
[08:05:36] drptbl: has joined #RubyOnRails
[08:06:16] charliesome: has joined #RubyOnRails
[08:07:35] rezam90: has joined #RubyOnRails
[08:08:06] aruntomar: has joined #RubyOnRails
[08:09:04] jsrn_: has joined #RubyOnRails
[08:09:14] rezam90: i have problems with render json to filter attributes
[08:09:20] rezam90: my code is:
[08:09:24] rezam90: render json: {success: 1, user: @user }, only: [:username, :full_name, :profile_picture]
[08:10:02] rezam90: but does not show anaything, just empty json
[08:10:39] rezam90: can anyone help?
[08:10:53] sevenseacat: is that code even being run?
[08:11:15] mhib: has joined #RubyOnRails
[08:12:56] rezam90: sevenseacat: yea, it works
[08:13:02] darutoko: has joined #RubyOnRails
[08:13:07] sevenseacat: apparently not if the output isnt what you want
[08:13:43] sevenseacat: can we see the full controller action with the logs of you calling it?
[08:14:17] rezam90: but it works: render json: @user, only: [:username, :profile_picture]
[08:14:35] rezam90: and it filters the @user object
[08:15:15] sevenseacat: I'll take that as a no
[08:15:16] finnnnnnnnnnn: has joined #RubyOnRails
[08:15:52] rezam90: { "username": "image", "profile_picture": "http://sampleimage.com" }
[08:16:25] universa1: rezam90: your two examples are different...
[08:16:36] sararegan: has joined #RubyOnRails
[08:17:35] Grundell: has joined #RubyOnRails
[08:17:35] mikecmpbll: i didn't know render passed the options through to as_json like that, but anyways it won't know how to do that when the user object is nested
[08:17:40] sbhatore: has joined #RubyOnRails
[08:17:59] arup_r1: rezam90: Do you like this way ? https://quickleft.com/blog/keeping-your-json-response-lean-in-rails/ or http://stackoverflow.com/a/612475/2767755
[08:18:03] arup_r1: see the appraoches
[08:18:39] arup_r1: I will go with the first approach
[08:20:22] arup_r1: rezam90: one more : http://jonathanjulian.com/2010/04/rails-to_json-or-as_json/
[08:21:07] Spami: has joined #RubyOnRails
[08:23:22] stardiviner: has joined #RubyOnRails
[08:25:45] lxsameer: has joined #RubyOnRails
[08:27:27] futilegames_: has joined #RubyOnRails
[08:27:30] charliesome: has joined #RubyOnRails
[08:27:49] burgestrand: has joined #RubyOnRails
[08:31:03] Peteykun: has joined #RubyOnRails
[08:31:38] Pupeno: has joined #RubyOnRails
[08:32:18] stannard_: has joined #RubyOnRails
[08:32:39] Pupeno: Is it possible to store schema_migrations in a different table?
[08:33:47] annlewis: has joined #RubyOnRails
[08:34:44] Pupeno: rvanlieshout: because this rails app uses another app's database and that name is taken.
[08:35:16] andywww: has joined #RubyOnRails
[08:37:01] rvanlieshout: https://github.com/rails/rails/blob/8587cf0d930832c362249ccec5fe896bd6563e2b/activerecord/lib/active_record/model_schema.rb#L43
[08:37:03] inoter: has joined #RubyOnRails
[08:37:42] maz-dev: has joined #RubyOnRails
[08:38:00] arBmind: has joined #RubyOnRails
[08:38:20] Pupeno: cool, thanks.
[08:38:49] krisquigley: has joined #RubyOnRails
[08:39:33] Cervajz_: has joined #RubyOnRails
[08:40:50] blackmesa: has joined #RubyOnRails
[08:42:34] stannard: has joined #RubyOnRails
[08:43:28] comrad: has joined #RubyOnRails
[08:44:15] gustav__: has joined #RubyOnRails
[08:44:58] davidhq: has joined #RubyOnRails
[08:46:16] mxrguspxrt: has joined #RubyOnRails
[08:48:52] tetraktys: has joined #RubyOnRails
[08:48:55] sbhatore: has joined #RubyOnRails
[08:49:40] Macaveli: has joined #RubyOnRails
[08:53:02] sanjayu: has joined #RubyOnRails
[08:53:03] blackmesa: has joined #RubyOnRails
[08:53:57] maz-dev: has joined #RubyOnRails
[08:54:12] EminenceHC: has joined #RubyOnRails
[08:57:47] seank_: has joined #RubyOnRails
[08:59:47] yaymukund: has joined #RubyOnRails
[09:01:33] JulienITARD: has joined #RubyOnRails
[09:02:00] piotrj: has joined #RubyOnRails
[09:05:29] sadaf2605: has joined #RubyOnRails
[09:06:44] jenrzzz: has joined #RubyOnRails
[09:08:38] htmldrum: has joined #RubyOnRails
[09:14:22] nfk: has joined #RubyOnRails
[09:17:37] stamina: has joined #RubyOnRails
[09:19:09] rezam90: has left #RubyOnRails: ()
[09:19:33] Macaveli: has joined #RubyOnRails
[09:19:55] rezam90: has joined #RubyOnRails
[09:20:18] beauby: has joined #RubyOnRails
[09:21:04] gustav__: has joined #RubyOnRails
[09:26:43] Cervajz: has joined #RubyOnRails
[09:27:40] mugurel: has joined #RubyOnRails
[09:29:04] Cervajz: has joined #RubyOnRails
[09:30:15] Cervajz__: has joined #RubyOnRails
[09:30:19] emilkarl: How can I nested a has one polymorphic model? I get an error saying the poly relationship is not set. Am I missng something? http://pastie.org/10451624
[09:32:20] nettoweb: has joined #RubyOnRails
[09:34:40] annlewis: has joined #RubyOnRails
[09:39:35] TvL2386: has joined #RubyOnRails
[09:40:38] arup_r: has joined #RubyOnRails
[09:42:58] voker57: has joined #RubyOnRails
[09:44:38] drptbl: has joined #RubyOnRails
[09:45:15] jenrzzz: has joined #RubyOnRails
[09:46:56] adre: has joined #RubyOnRails
[09:47:55] absklb: has joined #RubyOnRails
[09:48:09] absklb: why my rake cant build assets? https://gist.github.com/absklb/8d243651e4b759af0fc4 ubisg rails 3 ruby 2.1.6
[09:48:13] absklb: thhrough rvm
[09:49:46] Lytol: has joined #RubyOnRails
[09:52:19] pawnbox: has joined #RubyOnRails
[09:54:02] srinidhi: has joined #RubyOnRails
[09:54:54] EminenceHC: has joined #RubyOnRails
[09:56:08] Flyy7: has joined #RubyOnRails
[09:57:31] absklb: what does js_env key notices is already taken mean?
[09:58:04] krz: has joined #RubyOnRails
[09:58:06] marr: has joined #RubyOnRails
[09:58:33] seank_: has joined #RubyOnRails
[10:00:51] nfk|laptop: has joined #RubyOnRails
[10:01:26] Ergo: has joined #RubyOnRails
[10:03:26] tagrudev: has joined #RubyOnRails
[10:03:53] tvw: has joined #RubyOnRails
[10:04:56] abhishekvasisht: has joined #RubyOnRails
[10:06:10] absklb: after rake build assets, i get thhis error
[10:12:05] universa1: absklb: error trace, executed commands -> gist and then we might have some idea what the problem is, else you need to get lucky to find someone who had exactly this error and remembers it.
[10:15:07] freezevee: has joined #RubyOnRails
[10:16:08] Pupeno: has joined #RubyOnRails
[10:19:14] absklb: universa1: no commandns executed. only javascript inclued tag applicaition added to application.html.erb. last 500 lines of log/production.log https://gist.github.com/absklb/f19ba46756b3a1a15e89
[10:19:40] absklb: if i remove that javascript include that it works. if added it gives localhost 500 internal server error along with this info in log
[10:20:20] rickmasta: has joined #RubyOnRails
[10:23:29] arup_r: intersting error.. let me jump there..
[10:24:55] absklb: universa1: arup_r this Canvas did not had app/assets and did not included application.js. hence i manualy created app/assets/javascripts/applications.js and added vendor/asses/javascript/a.js and requi a in my application.js and then javascript inclued tag applicaiton in my application.html.erb and then this error!!
[10:26:17] absklb: arup_r: meanwhile how can i diretly add my .js bypassing all this rails thingy?
[10:26:32] mikecmpbll: absklb: can you be precise when talking about code that you've used
[10:26:36] diegobiavati: has joined #RubyOnRails
[10:26:40] arup_r: absklb: very easy if you are using erb
[10:26:45] mikecmpbll: you didn't put "javascript inclued tag applicaition" in your application.html.erb i assume
[10:26:51] mikecmpbll: because if so, then i know why it's erroring.
[10:27:02] rodfersou: has joined #RubyOnRails
[10:27:15] arup_r: absklb: Just put the code inside the view wrapping inside <script> tag :)
[10:27:24] arup_r: This is how you can by pass
[10:27:28] mikecmpbll: i suspect you put javascript_include_tag :application, which is why you're getting "No expansion found for :application"
[10:27:46] absklb: mikecmpbll: let us see what differenc a <%= and %> makes. So I added <%= javascript_include_tag :application %> to be precise.
[10:27:47] pawnbox: has joined #RubyOnRails
[10:27:50] mikecmpbll: which, if you'd told us was what you put in the first place someone would've been able to tell you what was wrong immediately.
[10:28:43] absklb: i dont know you write javascript include tag more than one way.
[10:29:00] mikecmpbll: absklb: you need to put <%= javascript_include_tag "application" %>
[10:29:07] mikecmpbll: in rails 3.2, anyway. which is what you're usin
[10:29:18] absklb: yeah rails 3
[10:29:40] mikecmpbll: rails 3.0 and 3.2 are not the same.
[10:29:45] pawnbox_: has joined #RubyOnRails
[10:29:47] absklb: technically.
[10:29:57] mikecmpbll: yes, and programming is technical.
[10:30:44] chandlerbing: has joined #RubyOnRails
[10:30:58] michael_mbp: has joined #RubyOnRails
[10:31:06] sevenseacat: theres a huge difference between 3.0 and 3.1 to do with assets
[10:31:12] sevenseacat: thats when the asset pipeline was introduced
[10:31:20] srinidhi: has joined #RubyOnRails
[10:32:05] arup_r: after that again they removed something.. I forgot the name..
[10:32:16] absklb: sevenseacat: mikecmpbll do you guuys tell lattitude tec while telling your adderss too? I wonder you might be
[10:32:27] dhjondoh: has joined #RubyOnRails
[10:32:30] absklb: how about exact precise position in galaxy?
[10:32:43] mikecmpbll: no, i give sufficient information required
[10:34:13] absklb: so in my rails 3.2 running on ubuntu 15.04 64 bit version, i have app/assets/javascripts/application.js and it says application.js not ofund 404
[10:34:36] absklb: "NetworkError: 404 Not Found - http://localhost:90/javascripts/application.js"
[10:34:45] mikecmpbll: have you precompiled your assets
[10:34:49] workmad3_: absklb: that's not the URL for it
[10:34:59] workmad3_: absklb: it'll be at `/assets/application.js`
[10:35:01] mostlybadfly: has joined #RubyOnRails
[10:35:02] absklb: workmad3_: tell that to rails and browser
[10:35:14] annlewis: has joined #RubyOnRails
[10:35:19] absklb: workmad3_: i have wrote NetworkError: 404 Not Found - http://localhost:90/javascripts/application.js"
[10:35:22] workmad3_: absklb: did you upgrade this app from rails 3.0 to 3.2?
[10:35:40] absklb: i mean, <%= javascript_include_tag "application" %> is what i wrote workmad3_
[10:35:42] subshad: has joined #RubyOnRails
[10:35:50] absklb: workmad3_: no. i did not do anything. its their app as it is.
[10:36:24] sevenseacat: who's "they"?
[10:36:25] workmad3_: absklb: right... it sounds like the asset pipeline has been disabled in it
[10:36:34] absklb: sevenseacat: original author?
[10:36:44] sevenseacat: ask them what they did to it?
[10:36:47] absklb: workmad3_: yes and I am trying to enable it
[10:36:48] mikecmpbll: is that the normal fallback url if a precompiled asset can't be found?
[10:36:57] workmad3_: absklb: right... so what config changes have you made?
[10:37:00] mikecmpbll: so probably just precompile
[10:37:04] sevenseacat: /stylesheets or /javascripts
[10:37:08] sevenseacat: instead of /assets
[10:37:17] workmad3_: mikecmpbll: no, it's the fallback for if the asset pipeline isn't enabled
[10:37:28] workmad3_: mikecmpbll: if an asset hasn't been precompiled, the 'fallback' is an error ;)
[10:37:45] mikecmpbll: in production
[10:37:50] sevenseacat: depends what env you're running in
[10:37:54] sevenseacat: in dev you'll get the incorrect urls
[10:38:12] workmad3_: sevenseacat: hmm... I thought in dev it would generate the 'correct' url, but it just wouldn't link to anything
[10:38:14] absklb: workmad3_: i added those 3 gems, rails asset precomile, created dir app/assets/javascripts and vendor/assets/javascripts. created application.js and wrote all those 4 require lines and then my own require a then add a.js to vendor assets javascripts
[10:38:17] workmad3_: at least in rails 3.2
[10:38:28] sararegan: has joined #RubyOnRails
[10:38:30] mikecmpbll: http://localhost:3000/javascripts/foo.js
[10:38:30] workmad3_: absklb: so you haven't touched any files in config?
[10:38:37] mikecmpbll: is what mine generated
[10:38:40] absklb: workmad3_: only Gemfile. nothing else.
[10:39:27] workmad3_: absklb: ok... so the asset pipeline is turned on in config... generate a fresh rails 3.2 app and look for differences in config/application.rb and config/environments/*, copying over lines that are related to assets
[10:39:42] mikecmpbll: or just precompile your assets. *will persist with this*
[10:39:50] absklb: workmad3_: ok will try
[10:39:51] mikecmpbll: if only for the lols
[10:39:56] absklb: also trying precompiling first
[10:40:11] workmad3_: mikecmpbll: that won't help much with the asset pipeline turned off :P
[10:40:29] mikecmpbll: i just realised what i said makes no sense actually
[10:40:36] mikecmpbll: absklb: are you in production
[10:40:39] ericjphillips: has joined #RubyOnRails
[10:40:40] absklb: mikecmpbll: yes.
[10:40:45] mikecmpbll: ok, then it makes sense still i think
[10:40:55] workmad3_: mikecmpbll: it still won't help with the asset pipeline turned off ;)
[10:41:01] mikecmpbll: but is it? :)
[10:41:04] Pupeno: Any ideas why active_admin is ignoring filter :id?
[10:41:10] piotrj: has joined #RubyOnRails
[10:41:27] workmad3_: mikecmpbll: he's getting `/javascripts/application.js` rather than an error or `/assets/application-blah.js` so yes, yes it is :P
[10:41:56] absklb: workmad3_: how to enable it then?
[10:41:57] sevenseacat: I wouldn't be so sure about that.
[10:42:06] sevenseacat: that its turned off, that is.
[10:42:11] mikecmpbll: me neither but i cba to load my app up in production
[10:42:21] mikecmpbll: so i'll concede defeat on the ground of laziness.
[10:42:27] FailBit: <%byte[]> rugby on rails
[10:42:46] sevenseacat: I'm also lazy, and eating dinner.
[10:42:48] workmad3_: absklb: ok, can you gist the files I mentioned earlier please :)
[10:43:21] jenrzzz: has joined #RubyOnRails
[10:43:32] absklb: workmad3_: instead of gist, let me directly give you their link. thats on github only
[10:43:42] cac: has joined #RubyOnRails
[10:43:42] workmad3_: fair enough
[10:43:45] sadaf2605: has joined #RubyOnRails
[10:43:59] absklb: also, i tried RAILS_ENV=production rake assets:precompile restart apache same 404 error.
[10:44:41] workmad3_: ACTION waits for link
[10:44:51] universa1: workmad3_: !g github canvas
[10:45:09] absklb: workmad3_: https://github.com/instructure/canvas-lms/blob/6061a744be115dd7e49ddb10fa61f70c62e4a706/config/application.rb and https://github.com/instructure/canvas-lms/blob/6061a744be115dd7e49ddb10fa61f70c62e4a706/config/environments/cache_store.rb and https://github.com/instructure/canvas-lms/blob/6061a744be115dd7e49ddb10fa61f70c62e4a706/config/environments/production.rb
[10:45:13] blackhuey: has joined #RubyOnRails
[10:45:51] bePolite: has joined #RubyOnRails
[10:46:12] sheepman: has joined #RubyOnRails
[10:46:12] mikecmpbll: love the comment.
[10:46:22] mikecmpbll: https://github.com/instructure/canvas-lms/blob/stable/config/application.rb#L16
[10:46:40] sevenseacat: ACTION concedes defeat
[10:46:56] absklb: so what shall I do? i need to add my own js file no?
[10:47:05] mikecmpbll: that's one hell of an application.rb
[10:47:57] absklb: ok so i think i need to disable again. but after disabling sprokcets etc etc how can I add my own js?
[10:48:15] universa1: absklb: they have a frontend app? there is some jsx code?
[10:48:32] absklb: universa1: yes they have front end app and they have their own js files.
[10:48:33] universa1: they are probably using gulp or alike for managing the js
[10:48:48] universa1: absklb: so why not add your js there?
[10:49:01] mikecmpbll: those those if CANVAS_RAILS3 are scattered everywhere in that app
[10:49:07] linus3: has joined #RubyOnRails
[10:49:08] sheepman: hi all, i'm writing a rails app is going to take bitcoin payments. After an order is placed I want to redirect the users to a "make payment" page then give the users 30 minutes to send payment. Once payment is received I want to automatically redirect them to another page. Presumably this is only possible using js and either a websocket or getting the browser to poll a url / api for it?
[10:49:16] absklb: universa1: let me try.
[10:49:27] absklb: thanks all.
[10:49:49] workmad3_: universa1: good point... if they're using their own JS buildchain for a front-end app, adding in sprockets is likely to screw things up badly :)
[10:50:11] universa1: workmad3_: ;)
[10:51:10] diegobiavati_: has joined #RubyOnRails
[10:54:57] chills42: has joined #RubyOnRails
[10:55:20] tetraktys: has joined #RubyOnRails
[10:58:20] Flying_Squirrel: has joined #RubyOnRails
[10:58:37] sheepman: has left #RubyOnRails: ()
[10:58:54] linus4: has joined #RubyOnRails
[10:59:18] seank_: has joined #RubyOnRails
[10:59:37] absklb: universa1: how can I add my own file without addding code to their files as its not clear if they have a single for which will load on all pages or not.
[11:00:10] universa1: absklb: i have no fucking clue. i haven't even seen their frontend app... i've never used jsx.
[11:00:22] seank_: has joined #RubyOnRails
[11:00:57] mugurel: i get this errors when i try to use database_cleaner with rspec and factory girl: uninitialized constant DatabaseCleaner (NameError). I used this tutorial http://devblog.avdi.org/2012/08/31/configuring-database_cleaner-with-rails-rspec-capybara-and-selenium/, and i use rails 3.2, ruby 1.9.3 and last versions for rspec and factory-girl
[11:02:26] absklb: how can I access REST API inside rails app instead of curl?
[11:02:46] wethu: has joined #RubyOnRails
[11:04:21] workmad3_: mugurel: that guide assumes you've already added the gem to your gemfile
[11:04:30] mugurel: yes, i did that
[11:05:41] sevenseacat: in which group?
[11:06:46] mugurel: only development, let me see if i add it in dev and test it will work
[11:07:02] waseem_: absklb: There are several solutions. https://www.ruby-toolbox.com/categories/http_clients
[11:07:31] Scripore: has joined #RubyOnRails
[11:08:08] mugurel: sevenseacat: thanks for the help, the group was the problem
[11:08:15] Pupeno: has joined #RubyOnRails
[11:09:59] dionysus69: has joined #RubyOnRails
[11:12:35] tsujp: has joined #RubyOnRails
[11:12:37] charliesome: has joined #RubyOnRails
[11:14:13] tsujp: Does anyone know how I can wrap suffix in the ordinalised date from this code
[11:14:22] tsujp: %p= entry.created_at.strftime( "#{entry.created_at.day.ordinalize} %B\, %Y" )
[11:14:31] tsujp: currently it outputs <p>30th September, 2015</p>
[11:14:43] tsujp: <p>30<span>th</span> September, 2015</p>
[11:14:56] tsujp: the th, rd, st, to be wrapped in a span which I can apply a class to
[11:15:34] blackmesa: has joined #RubyOnRails
[11:15:50] arup_r: has joined #RubyOnRails
[11:16:32] burgestrand: has joined #RubyOnRails
[11:17:39] krz: has joined #RubyOnRails
[11:18:08] jenrzzz: has joined #RubyOnRails
[11:21:12] jhass: tsujp: def ordinalize(number); "#{number}#{ordinal(number)}"; end that's its definition
[11:22:34] Balzrael: has joined #RubyOnRails
[11:24:57] Cervajz: has joined #RubyOnRails
[11:28:30] tsujp: im a bit of a newbie jhass, where would I put that?
[11:28:35] chrislotix: has joined #RubyOnRails
[11:29:15] jhass: tsujp: it's not meant as something you put somewhere
[11:29:20] dhjondoh: has joined #RubyOnRails
[11:29:37] jhass: understand the implementation of ordinalize and you'll understand how to solve your problem
[11:29:40] ldnunes: has joined #RubyOnRails
[11:30:43] syath: has joined #RubyOnRails
[11:31:11] arup_r1: has joined #RubyOnRails
[11:32:33] Macaveli: has joined #RubyOnRails
[11:34:31] beauby: has joined #RubyOnRails
[11:35:59] annlewis: has joined #RubyOnRails
[11:37:12] gustav__: has joined #RubyOnRails
[11:37:51] Lytol: has joined #RubyOnRails
[11:38:13] xcesariox: has joined #RubyOnRails
[11:39:34] charliesome: has joined #RubyOnRails
[11:40:05] jcromartie: has joined #RubyOnRails
[11:40:44] _el_fer_: has joined #RubyOnRails
[11:41:26] jenrzzz: has joined #RubyOnRails
[11:41:29] maz-dev: has joined #RubyOnRails
[11:44:49] TvL2386: has joined #RubyOnRails
[11:45:21] dionysus69: can anyone explain workings pf passenger for example nginx together? how is it better than standalone passenger?
[11:45:39] quantux_: has joined #RubyOnRails
[11:45:42] dhjondoh1: has joined #RubyOnRails
[11:47:40] johnflux: has joined #RubyOnRails
[11:48:19] sadaf2606: has joined #RubyOnRails
[11:48:43] _el_fer_: hi everybody
[11:51:33] blackmesa: has joined #RubyOnRails
[11:51:35] dhjondoh1: has joined #RubyOnRails
[11:52:03] allcentury: has joined #RubyOnRails
[11:53:32] artto: has joined #RubyOnRails
[11:53:33] arup_r1: _el_fer_: Hello!
[11:53:58] cac: has joined #RubyOnRails
[11:55:06] artto: has joined #RubyOnRails
[11:55:27] fcser_: has joined #RubyOnRails
[11:56:27] RegulationD: has joined #RubyOnRails
[11:56:53] linus4: has joined #RubyOnRails
[11:57:17] jcromartie: has joined #RubyOnRails
[11:59:26] maz-dev: has joined #RubyOnRails
[12:01:35] gustav__: has joined #RubyOnRails
[12:04:21] sararegan: has joined #RubyOnRails
[12:04:39] IceyEC: has joined #RubyOnRails
[12:07:43] gustav__: has joined #RubyOnRails
[12:09:53] Flyy7: has joined #RubyOnRails
[12:15:01] sbhatore: has joined #RubyOnRails
[12:17:19] Cervajz_: has joined #RubyOnRails
[12:19:07] avril14th: has joined #RubyOnRails
[12:19:15] avril14th: has left #RubyOnRails: ()
[12:20:32] Cervajz: has joined #RubyOnRails
[12:20:45] krisquigley: has joined #RubyOnRails
[12:20:56] atomical: has joined #RubyOnRails
[12:23:42] iszak: has joined #RubyOnRails
[12:24:04] ericjphillips: has joined #RubyOnRails
[12:24:36] Motoservo: has joined #RubyOnRails
[12:26:38] beauby: has joined #RubyOnRails
[12:28:47] towski_: has joined #RubyOnRails
[12:29:40] charliesome: has joined #RubyOnRails
[12:30:50] futilegames: has joined #RubyOnRails
[12:31:31] bonhoeffer: has joined #RubyOnRails
[12:32:12] alex88: has joined #RubyOnRails
[12:36:45] annlewis: has joined #RubyOnRails
[12:38:47] joshkovach: has joined #RubyOnRails
[12:39:39] sdwrage: has joined #RubyOnRails
[12:43:00] bonhoeffer: has joined #RubyOnRails
[12:43:58] burgestrand: has joined #RubyOnRails
[12:44:07] habitullence: has joined #RubyOnRails
[12:44:24] mices: rails is treating my new path as though "new" were a parameter
[12:44:31] jcromartie: has joined #RubyOnRails
[12:45:14] quazimodo: has joined #RubyOnRails
[12:46:01] umgrosscol: has joined #RubyOnRails
[12:46:15] krz: has joined #RubyOnRails
[12:46:22] universa1: mices: rails new path?!
[12:46:47] tbuehlmann: what universa1 is trying to say: wat
[12:47:04] universa1: tbuehlmann: ty for clarifying that ;)
[12:49:20] dideler: has joined #RubyOnRails
[12:49:38] dstarh: has joined #RubyOnRails
[12:50:07] tbuehlmann: got your back
[12:51:00] jojo__: has joined #RubyOnRails
[12:51:43] baegle: has joined #RubyOnRails
[12:52:25] arup_r1: jojo__: Jhi
[12:52:44] jojo__: welcome dude
[12:52:49] eGGsha: has joined #RubyOnRails
[12:53:58] sypheren: has joined #RubyOnRails
[12:54:25] bePolite: has joined #RubyOnRails
[12:55:16] gabeodess: has joined #RubyOnRails
[12:57:01] tsujp: has joined #RubyOnRails
[12:57:12] bamorim: has joined #RubyOnRails
[12:57:32] gabeodess: Is there a method that can be called on an object that will return the output of a block. Something similar to #tap, but can return the result of the block instead of the original object.
[12:57:45] arup_r1: gabeodess: .call() ?
[12:58:05] arup_r1: oops.. didn't get you
[12:58:09] arup_r1: show example
[12:58:40] arup_r1: gabeodess: block always returns its last statement
[12:59:11] elaptics: gabeodess: yield
[12:59:21] gabeodess: arup_r_: so I would want `???test???.some_method{|item| item.length }` to return 4.
[12:59:43] gabeodess: arup_r_: that???s an example for a String
[12:59:49] elaptics: gabeodess: you pass the block into your method and then yield to it in the methods code
[13:00:11] burgestrand: gabeodess: why don't you just call "test".length?
[13:00:22] burgestrand: (I'm assuming "item" here is the object?)
[13:00:24] gabeodess: Burgestrand: that was just an example.
[13:00:35] Cervajz: has joined #RubyOnRails
[13:00:37] burgestrand: gabeodess: My point being, why are you using a block at all?
[13:00:39] universa1: gabeodess: real example please.
[13:00:56] universa1: gabeodess: else we're talking in maybes, and ifs and solve a problem you don't really have.
[13:01:35] mices: universa1: i dunno what you mean, it only happens to one controller
[13:02:07] gabeodess: universa1: request.raw_post.split('&').detect{ |i| i =~ regex }.gsub(regex,??????).my_method{|item| JSON.load(item) }
[13:02:22] ramortegui: has joined #RubyOnRails
[13:02:25] bonhoeffer: has joined #RubyOnRails
[13:02:38] gabeodess: universa1: I suppose I could just wrap the whole thing in JSON.load, but I figured a method exists, it might be a little prettier.
[13:02:43] burgestrand: gabeodess: JSON.load(request.raw_post.split ???)
[13:02:53] universa1: gabeodess: replace my_method with map ?
[13:03:10] gabeodess: universa1: can I call #map on a string?
[13:03:23] universa1: gabeodess: you split -> array
[13:03:35] universa1: gabeodess: detect -> works on enumerable
[13:03:41] universa1: gabeodess: returns an array
[13:03:48] universa1: gabeodess: gsub does not work on an array
[13:03:49] burgestrand: detect returns a single item.
[13:03:51] burgestrand: You're thinking of collect.
[13:03:57] subshad: has joined #RubyOnRails
[13:03:59] burgestrand: detect is an alias of find.
[13:04:14] tetraktys: has joined #RubyOnRails
[13:04:15] universa1: Burgestrand: ohh might be, i always get confused by the many names for the different methods ;)
[13:04:17] fschuindt: has joined #RubyOnRails
[13:04:55] universa1: gabeodess: so ignore what i said, and just do what Burgestrand said.
[13:05:00] Jon__: has joined #RubyOnRails
[13:05:06] burgestrand: Anyway, it's a bit weird to want a method that does the same job as running the same code on the following line, but there's many weird things in this world!
[13:05:27] gabeodess: Burgestrand: I???m a wierd guy.
[13:05:37] burgestrand: Everybody are. :)
[13:06:25] gabeodess: Burgestrand: I figure ruby is all about beautifying your code, so I just figured it looked a little cleaner than passing a string of methods into another method.
[13:06:56] burgestrand: Yeah, I understand, trying to figure out an argument either for or against this mystery method.
[13:06:59] universa1: you've a regex in there, you lost anyways (chuckle) :p
[13:07:12] mices: universa1: i think i fixed it by placing my resources first in my routes.rb
[13:07:24] gabeodess: universa1: true??? I???m just trying to lose less :)
[13:07:36] burgestrand: This mystery method would essentially allow you to write any code by just chaining unrelated expressions together.
[13:07:49] universa1: gabeodess: raw_json = whatever.split...; json = JSON.load raw_json
[13:08:19] alex88: has joined #RubyOnRails
[13:08:27] blackmesa: has joined #RubyOnRails
[13:09:51] bmurt: has joined #RubyOnRails
[13:11:17] chills42: has joined #RubyOnRails
[13:11:59] _2easy: has joined #RubyOnRails
[13:12:40] burgestrand: Wonder what it'd be named.
[13:12:56] sankaber: has joined #RubyOnRails
[13:13:01] burgestrand: instance_exec :p
[13:13:07] ruurd: has joined #RubyOnRails
[13:17:54] elaptics: Burgestrand: eval
[13:18:09] jojo__: How to remove some text from a file using gsub
[13:18:12] sararegan: has joined #RubyOnRails
[13:18:13] burgestrand: If only eval could take a block!
[13:18:47] elaptics: jojo__: can you explain a bit more specifically what you're trying to do
[13:18:56] rvanlieshout: wut.. away for a while and people started using eval???
[13:19:11] rvanlieshout: eval should be removed from ruby
[13:19:31] Joufflu: has joined #RubyOnRails
[13:19:32] tbuehlmann: rvanlieshout, wait a few minutes, we're going to subclass Array and Hash
[13:23:52] iateadonut: has joined #RubyOnRails
[13:24:01] juanpaucar: has joined #RubyOnRails
[13:24:35] elaptics: I _really_ wish `eval` was renamed to `evil`
[13:25:04] beauby: has joined #RubyOnRails
[13:25:40] allcentury: has joined #RubyOnRails
[13:25:51] Criten_: has left #RubyOnRails: ()
[13:26:01] Lytol: has joined #RubyOnRails
[13:26:12] jkamenik: has joined #RubyOnRails
[13:26:42] WajidKagzi: has joined #RubyOnRails
[13:27:10] acti0nman: has joined #RubyOnRails
[13:33:04] tetraktys: has joined #RubyOnRails
[13:33:54] _el_fer_: has joined #RubyOnRails
[13:34:10] devdazed: has joined #RubyOnRails
[13:35:36] charliesome: has joined #RubyOnRails
[13:37:04] aaronr: has joined #RubyOnRails
[13:37:31] annlewis: has joined #RubyOnRails
[13:37:32] pawnbox: has joined #RubyOnRails
[13:38:13] n1lo: has joined #RubyOnRails
[13:39:38] cac: has joined #RubyOnRails
[13:42:14] jenrzzz: has joined #RubyOnRails
[13:42:26] piotrj: has joined #RubyOnRails
[13:42:59] Palsson: has joined #RubyOnRails
[13:43:02] victortyau: has joined #RubyOnRails
[13:43:40] OnkelTem: has joined #RubyOnRails
[13:43:42] Jon__: has joined #RubyOnRails
[13:45:18] goldbug: has joined #RubyOnRails
[13:45:22] OnkelTem: Hi all. I've got a website on RoR and since my RoR knowledge is about to 0, I don't know how to start it :) I tried doing: bin/rails server, it successfuly started some "Puma" and then when I visited localhost:3000 I just saw an error "We're sorry, but something went wrong."
[13:45:55] krz: has joined #RubyOnRails
[13:46:04] OnkelTem: At that, these is now anything useful in the logs, only a line: Started GET "/" for at 2015-09-30 16:40:24
[13:46:32] Flying_Squirrel: has joined #RubyOnRails
[13:46:37] rvanlieshout: how did you create that rails project OnkelTem?
[13:46:50] OnkelTem: rvanlieshout: fetched from github, that's how :)
[13:46:52] keernel: has joined #RubyOnRails
[13:47:00] rvanlieshout: an existing app?
[13:47:06] keernel: has left #RubyOnRails: ()
[13:47:15] OnkelTem: yeah, a private repo where I was invited to recently
[13:47:24] atomical_: has joined #RubyOnRails
[13:47:27] rvanlieshout: installed all required dependencies?
[13:47:30] burgestrand: OnkelTem: you see nothing else in the logs? Typically when an error is raised there's more information somewhere.
[13:47:31] goldbug: Hi folks, I'm trying to build a front-end data entry tool for a MySQL database I run. I'm really new to the concept of OOP, and I'm trying to wrap my head around how best to represent my data structure in an object-centric way. Anybody care to have their brain picked?
[13:47:37] ruurd: OnkelTem did you download and install a ruby environment? the correct one preferably?
[13:47:42] rvanlieshout: OnkelTem: what if you try to start a rails console?
[13:48:00] rvanlieshout: goldbug: table = object? :)
[13:48:08] rvanlieshout: table record = object instance
[13:49:11] mustmodify: has joined #RubyOnRails
[13:49:36] mustmodify: I always find it both sad AND hilarious when I see this in the logs: No route matches [GET] "/phpMyAdmin/scripts/setup.php"
[13:49:37] OnkelTem: ruurd: I thinkn yes. I had some experience with using tools written on ruby, particularly sass and the rest, so I sourced ~/.rvm/scripts/rvm and then ran './bin/setup' according to the projects Readme, which created database and installed all deps
[13:50:20] goldbug: rvanlieshout: That's how I've started out! But now trying to deal with the tricky issue of relationships.
[13:50:34] OnkelTem: rvanlieshout: honestly I have no idea what is that :)
[13:50:44] sininen__: has joined #RubyOnRails
[13:50:48] atomical: has joined #RubyOnRails
[13:50:51] ruurd: OnkelTem did you run bundler?
[13:50:56] rvanlieshout: goldbug: there is no tricky issue
[13:50:59] rvanlieshout: OnkelTem: run 'rails console'
[13:51:09] ruurd: run bundler
[13:51:22] goldbug: rvanlieshout: When I'm involved, there's *always* a tricky issue (;
[13:51:26] OnkelTem: rvanlieshout: ./bin/setup script mentioned in the readme did that: system "bundle check || bundle install"
[13:51:58] jas02: has joined #RubyOnRails
[13:52:10] OnkelTem: rvanlieshout: where `rails` should be normaly located?
[13:52:38] OnkelTem: ruurd: that message about bundler was for you, mistyped
[13:52:59] rvanlieshout: OnkelTem: bin/rails
[13:53:56] OnkelTem: rvanlieshout: yes, it is there! which I consider as good news
[13:54:17] rvanlieshout: so what if you run a bin/rails console
[13:54:17] atomical_: has joined #RubyOnRails
[13:54:27] xhoy: man that RVM docs need some updates :( spend and hour to find out how i can install al single user rvm instance! (since the user should not be root... there is a rvm autolibs read-fail !
[13:54:32] rvanlieshout: and aren't the other developrs there to help you create your dev environment?
[13:54:40] OnkelTem: rvanlieshout: running './bin/rails console' makes this: ./bin/rails:7: undefined method `require_relative' for main:Object (NoMethodError)
[13:54:48] habitullence: has joined #RubyOnRails
[13:54:52] rvanlieshout: OnkelTem: ruby -v
[13:56:01] OnkelTem: 1.8.7 granny
[13:56:43] mustmodify: has left #RubyOnRails: ()
[13:56:49] EminenceHC: has joined #RubyOnRails
[13:56:54] OnkelTem: what was requested for such an version? Is it in setups script?
[13:56:57] rvanlieshout: OnkelTem: and what does that rails app require?
[13:57:03] rvanlieshout: it all depends on the developers
[13:57:08] rvanlieshout: we include vagrant config for our projects
[13:57:19] goldbug: Here's what I'm currently trying to solve. In the database I have a table called psPersons which contains information about, in this case, classical composers and musicians. When the person is a composer, they have one or more periods assigned to them (refPeriods) - for instance, "Baroque" or "Classical" or "Romantic". So far in Rails, I've created a Person class, and a Period class. But
[13:57:19] goldbug: now I need to be able to assign one or more Periods to a Person. What's the best way of doing that?
[13:57:47] rvanlieshout: goldbug: in your person model: has_many :periods
[13:58:38] workmad3: it's probably a many-many relationship
[13:58:40] diegoviola: has joined #RubyOnRails
[13:58:56] masaru-: has joined #RubyOnRails
[13:59:01] rvanlieshout: euh. yeah. that
[13:59:06] goldbug: rvanlieshout: I have a "has_many :period_persons" and "has_many :periods, through: :period_persons"
[13:59:21] greengriminal: has joined #RubyOnRails
[13:59:38] goldbug: (There's obviously a period_persons class too.)
[13:59:40] workmad3: goldbug: you'll want a PeriodPerson model for that then, which would belong_to :period and belong_to :person
[13:59:55] goldbug: Yep, got that. This all kind of works.
[13:59:59] bamorim: has joined #RubyOnRails
[14:00:06] goldbug: I'm just wondering if this is really the best way to represent this?
[14:00:30] workmad3: goldbug: it's the canonical way to represent a many-many relationship in a relational db
[14:00:42] goldbug: (And also what I need to do to actually assign a period to a person and retrieve it again!)
[14:00:54] OnkelTem: rvanlieshout: how do I know what does it require?
[14:01:17] hydrozen: has joined #RubyOnRails
[14:01:20] rvanlieshout: OnkelTem: you could base it on the rails version, but the developers of the application should know what
[14:01:25] rvanlieshout: or just use the most recent one
[14:01:56] workmad3: OnkelTem: also, take a look in the Gemfile... that may have a ruby version specifier in it
[14:01:59] OnkelTem: rvanlieshout: where is ruby version specified? in which project file (usually)
[14:02:20] OnkelTem: workmad3: already checked that out, no ruby version. I'll paste it in a moment
[14:02:25] workmad3: OnkelTem: or if there's a .ruby-version file
[14:02:43] workmad3: OnkelTem: otherwise, you're down to looking @ the README or asking someone
[14:03:15] OnkelTem: https://gist.github.com/OnkelTem/bcb7fde81018badc4c3f
[14:03:19] goldbug: workmad3: Is the correct way to assign a Period: Person.periods << period ?
[14:04:38] rvanlieshout: OnkelTem: i would start with the newest
[14:04:48] rvanlieshout: and who gave you this project? and why isn't there any proper documentation?
[14:04:52] Or1on: has joined #RubyOnRails
[14:06:04] gustav__: has joined #RubyOnRails
[14:06:45] mehwork: How come rails new myapp says 'se `bundle show [gemname]` to see where a bundled gem is installed' but when i do it says 'Could not locate Gemfile or .bundle/ dir'?
[14:08:12] OnkelTem: rvanlieshout: Ok, my story. I got it from some company, its their own website. It's very simple, as a matter of fact - it is one page SPA, without ajax even. They want to be able to administer it (to change info) since atm they have no any control over it.
[14:08:12] workmad3: goldbug: I'd normally do `Person.person_periods.create(period: period)` but that's partly because I've had issues with rails managing the join table for me in past rails versions that are probably no longer issues
[14:08:16] rvanlieshout: mehwork: because you didn't run that command from a folder that contains a Gemfile
[14:08:46] Cervajz_: has joined #RubyOnRails
[14:09:32] OnkelTem: rvanlieshout: they asked me to add administration backend to it. I agreed to take a look, and now I'm looking :)
[14:10:30] rickmasta: has joined #RubyOnRails
[14:10:54] OnkelTem: rvanlieshout: and as I'm a Drupal websites developer, I can: 1) provide data over REST or 2) search-and-replace some static data which their website currently using.
[14:11:45] blackmesa: has joined #RubyOnRails
[14:12:44] OnkelTem: in the meantime, I just want to get it up and running locally :)
[14:13:10] rvanlieshout: install ruby 2.2 :)
[14:13:13] OnkelTem: their website: http://llpartners.ru
[14:13:14] HalcyonicStorm: has joined #RubyOnRails
[14:13:54] goldbug: workmad3: Okay I'll try to remember that if and when I get join table problems!
[14:15:17] goldbug: Another question: Some people in my database are composers, others are performers. Composers have periods. Performers have instruments, and belong to groups and all sorts of stuff like that. Should I be making subclasses of Person which extend it?
[14:15:50] rvanlieshout: or composer has_one :person
[14:16:20] goldbug: rvanlieshout: That's how it is in the database, but it's a little cumbersome.
[14:17:12] rvanlieshout: you could delegate all relative methods to the person object. so a composer.name would still work
[14:17:38] goldbug: Yes that's exactly what I was thinking, functionality-wise.
[14:17:43] goldbug: How's that work then?
[14:17:50] symbol: has joined #RubyOnRails
[14:18:17] PlasmaStar: has joined #RubyOnRails
[14:18:50] rvanlieshout: http://api.rubyonrails.org/classes/Module.html#method-i-delegate
[14:19:49] mcnesium: has joined #RubyOnRails
[14:21:02] wldcordeiro: has joined #RubyOnRails
[14:21:17] OnkelTem: rvanlieshout: how to install it? rvm install 2.2?
[14:21:34] rvanlieshout: if you're using rvm
[14:22:00] mcnesium: is it possible to compare enum values with >= ?
[14:22:00] OnkelTem: you know, all modern package managers - they are numerous!
[14:22:27] OnkelTem: yes, I can use rvm as it's installed :)
[14:22:58] OnkelTem: Also I have bundler, and I ran bundle
[14:23:19] rvanlieshout: you should run bundler using the right ruby version
[14:23:21] Meow-J: has joined #RubyOnRails
[14:23:21] goldbug: rvanlieshout: Interesting. Would it make more sense to do that or to use class inheritence, i.e. class Composer < Person?
[14:23:23] juanpaucar: has joined #RubyOnRails
[14:23:30] TvL2386: has joined #RubyOnRails
[14:23:36] rvanlieshout: goldbug: canot say that only using this information
[14:23:44] OnkelTem: I was mistaken btw, I have ruby of 1.9.3. Before I was running `ruby -v` in a new console which was not sourced with rvm/scripts/rvm
[14:23:49] rvanlieshout: it feels strange if you have 1 object using 2 tables
[14:24:49] rvanlieshout: anyway.. got to run
[14:24:52] rvanlieshout: back tomorrow
[14:24:53] OnkelTem: rvanlieshout: so what is the correct way to update ruby for a project? Shouldn't I specify a new version in a project's config file like Gemfile?
[14:25:09] OnkelTem: rvanlieshout: see you, thanks for the help!
[14:25:26] rvanlieshout: specify it in .ruby-version :)
[14:26:13] pontiki: has joined #RubyOnRails
[14:26:23] brunoalano: has joined #RubyOnRails
[14:26:23] wldcordeiro_: has joined #RubyOnRails
[14:26:51] brunoalano: I need to create a Admin panel for my application, it's better to use namespaces or a Rails Engine? (They will share the same models)
[14:27:23] mcnesium: with enum status: [ :guest, :promoter, :owner ] I have a validation function that does unless self.status > :guest raise error. when trying to create a db entry on the console using Evt.create( status: 1) I get comparison of String with :guest failed - how can I do this?
[14:28:55] smathy: has joined #RubyOnRails
[14:29:36] elaptics: brunoalano: probably depends on what the admin panel is supposed to do
[14:29:41] sarink: has joined #RubyOnRails
[14:29:59] brunoalano: elaptics: What you mean? This Admin panel will only used on that application
[14:30:01] elaptics: almost always I will build it myself rather than relying on some 3rd party gem like activeadmin
[14:30:13] brunoalano: elaptics: yes, i'll build by myself
[14:30:39] elaptics: brunoalano: what I mean is, what does an "Admin panel" even mean to your app. Is it just some CRUD thing or is there specific functions needed for certain user groups, etc
[14:31:49] brunoalano: elaptics: It's just a CRUD
[14:31:59] The_Phoenix: has joined #RubyOnRails
[14:32:59] elaptics: if it's just crud then you might get away with something like active admin (I personally don't touch that with a barge pole but not familiar with anything else)
[14:35:59] bklane: has joined #RubyOnRails
[14:36:37] sararegan: has joined #RubyOnRails
[14:38:18] annlewis: has joined #RubyOnRails
[14:39:26] FailBit: don't use activeadmin
[14:39:35] FailBit: 's not worth it
[14:41:44] Lytol: has joined #RubyOnRails
[14:41:54] twohlix: has joined #RubyOnRails
[14:42:33] sararegan: has joined #RubyOnRails
[14:43:11] TPBallbag: has joined #RubyOnRails
[14:43:35] tubbo: brunoalano: ^
[14:43:48] tubbo: active_admin also breaks down if/when you need to do fancy things with the form
[14:43:52] brunoalano: Thanks, I'll create by my own
[14:43:53] tubbo: or display metrics
[14:43:56] brunoalano: using namespaces
[14:44:12] tubbo: yeah that's what i do, i just have an admin namespace that has controllers for the models i want to affect
[14:44:30] ruurd: has joined #RubyOnRails
[14:44:31] lasker85: has joined #RubyOnRails
[14:44:35] FailBit: curl your toes repeatedly, during stimulation
[14:44:41] FailBit: uh, holy shit wrong chan
[14:45:29] tubbo: FailBit's favorite gems are `flog` and `flay`
[14:45:54] FailBit: my favorite gem is red and shiny and well polished
[14:47:23] dopamean_: has joined #RubyOnRails
[14:47:25] chills42: has joined #RubyOnRails
[14:47:51] defsdoor: has joined #RubyOnRails
[14:48:50] krisquigley: has joined #RubyOnRails
[14:50:13] bbrowning: has joined #RubyOnRails
[14:50:39] frmendes: has joined #RubyOnRails
[14:50:40] RegulationD: has joined #RubyOnRails
[14:54:13] linus4: has joined #RubyOnRails
[14:55:13] OnkelTem: How a ror project is launched on a production server?
[14:55:19] OnkelTem: using apache or what? normally
[14:55:41] blackmesa: has joined #RubyOnRails
[14:55:59] smathy: OnkelTem, yes, using apache or similar.
[14:57:35] arup_r: has joined #RubyOnRails
[14:58:47] OnkelTem: Currently when running a project locally if I change a tempalte and reload a page the chanages are applied
[14:59:08] OnkelTem: will this work in production ervironment?
[14:59:11] jgpawletko: has joined #RubyOnRails
[14:59:33] cornerma1: has joined #RubyOnRails
[14:59:40] mary5030: has joined #RubyOnRails
[15:00:15] smathy: OnkelTem, no, in production you need to restart the Rails app to reload code.
[15:00:52] smathy: OnkelTem, see the cache_classes config setting in your config/environments/*.rb files.
[15:02:28] OnkelTem: smathy: ok, I see
[15:03:14] OnkelTem: Well, let me again describe my case, but now I can be more specific (I have the site running!).
[15:03:46] annlewis: has joined #RubyOnRails
[15:03:51] OnkelTem: But first, I'd like to share my impressions. I like it! I like how the application is organized.
[15:03:56] OnkelTem: RoR is good, definitely
[15:04:27] OnkelTem: As far as I can see, it uses certain .slim templates which remind me .jade.
[15:04:34] sininen: has joined #RubyOnRails
[15:05:12] OnkelTem: So I have a set of templates which are used to build a page. Page is well structured and each of it has its own template file
[15:06:23] OnkelTem: But all the data is hardcoded in these templates. And that's what I have to change. I need to make this data dynamic. But I don't feel like I'm ready to do this on RoR, instead I'd like to run separate Drupal instance and just feed data from there
[15:07:23] FailBit: <OnkelTem> using apache or what? normally
[15:07:29] FailBit: I prefer nginx
[15:07:33] OnkelTem: What would you recommend to use? For example I can feed data in json. Will RoR take it? (sure it will, but is it optimal?) Or I'm better to feed complete .yml files and maybe RoR will be good with it
[15:09:42] arup_r: OnkelTem: Yes RoR takes it
[15:10:05] arup_r: you can dump the full JSON in a columns you know.. if you use postgresql
[15:10:43] iamdevnul: anyone here have much experience running a rails app through vagrant/virtualbox?
[15:10:44] arup_r: we can serialize too......
[15:11:19] OnkelTem: arup_r: yeah, postgresql is installed. It is in the porject's requirements. But frankly I don't see a value of it as they don't store any data in it :)
[15:11:21] blackmesa: has joined #RubyOnRails
[15:11:28] teaearlgraycold: So it seems the modules I'm importing in application.js (at least some of them) aren't loading until a page is refreshed after the initial load.
[15:11:34] teaearlgraycold: Like AJAX form validation
[15:11:55] OnkelTem: arup_r: they have no any model! This is very simple website. It doesn't use RoR's power really
[15:12:11] cajone: has left #RubyOnRails: ()
[15:12:28] teaearlgraycold: I saw on SO that a similar issue was caused by load order problems, but neither module specifies a load order, and moving them around had no effect
[15:12:38] arup_r: use sinatra then.. don't insult roR :)
[15:12:59] teaearlgraycold: Are there maybe some general rules to JS module load order in Rails?
[15:13:22] pawnbox: has joined #RubyOnRails
[15:13:42] smathy: OnkelTem, so just make the parts of it that you want dynamic PHP, you can host both Rails and PHP on the same httpd.
[15:13:49] OnkelTem: arup_r: lol. Just visited their website. Is it really that simple? Any why the hell they offend Frank? :)
[15:14:17] smathy: teaearlgraycold, "loading" is different from "running", sounds like they're not running.
[15:14:31] teaearlgraycold: How can I check if they're loading/running?
[15:14:49] arup_r: OnkelTem: I am joking man!
[15:15:09] arup_r: no issue.. make some flat tables .. by doing some analysis
[15:15:31] cajone: has joined #RubyOnRails
[15:15:47] smathy: teaearlgraycold, probably you're using turbolinks and you haven't adjusted any of your JS to use the turbolinks events (ie. you're still using the jquery ready() handler for running your JS), read: https://github.com/rails/turbolinks#events
[15:16:33] teaearlgraycold: smathy: Alright, it seems that none of the scripts are downloading on initial page retrieval. In the network analyzer I can see there's only a single request (for the HTML)
[15:16:41] teaearlgraycold: On a reload there's a ton of .js requests
[15:17:14] havenwood: has joined #RubyOnRails
[15:17:19] pjammer: has joined #RubyOnRails
[15:17:24] smathy: teaearlgraycold, right, all fits with my above hypothesis.
[15:17:28] matt_d_: has left #RubyOnRails: ()
[15:17:52] matt_d: has joined #RubyOnRails
[15:18:01] smathy: teaearlgraycold, just to confirm, once you reload the page, if you navigate away and back (using links on your site), same problem right?
[15:18:10] teaearlgraycold: I've written almost no JS myself, just using Gems
[15:18:37] teaearlgraycold: Should I remove turbolinks? Are the Gems just incompatible?
[15:18:39] i: has joined #RubyOnRails
[15:19:58] n008f4g_: has joined #RubyOnRails
[15:20:10] smathy: teaearlgraycold, if you're not running anything, then the best bet is to just use the turbolinks-jquery addition, as mentioned in the link I pointed you to above.
[15:20:33] GnuYawk: Rubocop is so annoying
[15:20:39] GnuYawk: why cant our code just stay messy! ugh
[15:21:03] smathy: teaearlgraycold, might be jquery-turbolinks - just search that page for "jquery"
[15:21:14] bklane: has joined #RubyOnRails
[15:21:39] delianides: has joined #RubyOnRails
[15:21:39] smathy: GnuYawk, or not messy actually, just not Rubocoppy
[15:22:20] TPBallbag: Haha, GnuYawk I recently discovered Rubocop and have been using it on a side project. One day, I decided it add it to my day-to-day project which I inherited from various other developers around a year ago. 11,000+ errors. #nope
[15:23:40] Maletor: has joined #RubyOnRails
[15:24:17] matt_d: has left #RubyOnRails: ()
[15:24:23] smathy: I reject the premise entirely that that sort of style consistency makes code any more manageable/readable/maintainable.
[15:24:25] Pupeno: has joined #RubyOnRails
[15:24:25] Pupeno: has joined #RubyOnRails
[15:24:28] matt_d: has joined #RubyOnRails
[15:25:14] smathy: AND it focuses people's attention on the wrong things.
[15:25:25] Pupeno: Is it possible to have a custom query for a has_many relationship?
[15:25:27] teaearlgraycold: smathy: it's not working for me. I'm loading it as specified in the docs.
[15:25:38] teaearlgraycold: It is a year old - but that shouldn't be an issue, right?
[15:25:52] rushed: has joined #RubyOnRails
[15:26:25] smathy: teaearlgraycold, not sure if you mean that gem or your code - if the gem, definitely not, people are using it all the time, if your code - I don't think so, no.
[15:26:43] sandstrom: has joined #RubyOnRails
[15:27:22] Pupeno: Something like table tools has many integrations but the relationship is with either tool_a_id or tool_b_id in integrations.
[15:27:26] towski_: has joined #RubyOnRails
[15:27:27] smathy: teaearlgraycold, you added the gem, did a bundle, added the line to application.js (in the right place) and restarted your app?
[15:27:51] jtb__: has joined #RubyOnRails
[15:28:04] teaearlgraycold: Yes. rails console shows jquery-turbolinks as loaded as well
[15:28:04] shmoon_: has joined #RubyOnRails
[15:28:42] smathy: Pupeno, not that, no. If you're doing that though, maybe you actually want a polymorphic association.
[15:29:05] smathy: teaearlgraycold, just kill your app again, and then run `spring stop` in your shell, and then start it back up.
[15:29:05] maz-dev: has joined #RubyOnRails
[15:29:52] Pupeno: smathy: no, this isn't a polymorphic association, there's no _type column.
[15:30:22] teaearlgraycold: smathy: that hasn't made any effect. Should turbolinks be after "//= require_tree ." as well? I've tried it as the last one and as before that one
[15:30:34] jschoolcraft: has joined #RubyOnRails
[15:30:39] Pupeno: It used to be possible in Rails 3.
[15:30:54] blackmesa: has joined #RubyOnRails
[15:30:59] moeabdol: has joined #RubyOnRails
[15:31:54] smathy: teaearlgraycold, huh? Dude, seriously, you gotta read READMEs more :)
[15:32:34] smathy: teaearlgraycold, your mission now is to find the README for the jquery-turbolinks gem and read it.
[15:32:50] EminenceHC: has joined #RubyOnRails
[15:34:39] ruurd: has joined #RubyOnRails
[15:34:45] disgrntld: has joined #RubyOnRails
[15:34:57] mustmodify: has joined #RubyOnRails
[15:35:15] mustmodify: under what conditions could " render :text => (@current_user.try(:email) || 'anonymous')" render "<html><head></head><body>anonymous</body></html>"
[15:35:19] mustmodify: I'm really baffled here.
[15:35:28] mustmodify: there is no associated view.
[15:35:44] rushed: mustmodify: why do you think it rendered that?
[15:36:24] mustmodify: I have a test that fails with: expected: "drwho@stuff.test" got: "..."
[15:36:25] teaearlgraycold: smathy: I did read it.
[15:36:28] mustmodify: where ... is the above
[15:37:05] goldbug: Dudes. I've got a model called Person. It contains attributes like first_name, middle_name, surname and so forth. That's all fine and well but some of the people in my database are Composers, and I'd like to be able to create them and retrieve their attributes much as with any Person, but also assign things to them like Compositions. Is this a case for a subclass (class Composer < Person)?
[15:37:15] blackmes1: has joined #RubyOnRails
[15:37:33] teaearlgraycold: goldbug: you can do that
[15:37:53] goldbug: teaearlgraycold: But should I? And where would that live - inside the person.rb model?
[15:37:58] mustmodify: goldbug: you *could* but my experience has been that creating a profile for different kinds of users has been better.
[15:38:07] teaearlgraycold: goldbug: that'd be a different model
[15:38:13] mustmodify: person.composer or person.composer_profile
[15:38:33] mustmodify: weird. adding layout: false got rid of the HTML tags...
[15:38:46] staticat_works: has joined #RubyOnRails
[15:38:48] teaearlgraycold: If I understand mustmodify, they're recommending you add a flag to person to show if they're a composer
[15:38:56] mustmodify: Running it without javascript did that.
[15:39:05] teaearlgraycold: Then you have a link between composers and a seperate model with their profile
[15:39:10] mustmodify: So maybe the JS bit i adding HTML tags?
[15:41:02] treehug88: has joined #RubyOnRails
[15:41:50] teaearlgraycold: I guess I'm not using turbolinks then
[15:41:53] diego3: has joined #RubyOnRails
[15:42:01] diego3: has joined #RubyOnRails
[15:42:20] teaearlgraycold: Documentation has failed me
[15:42:21] EminenceHC: has joined #RubyOnRails
[15:44:44] goldbug: teaearlgreycold and mustmodify: That's kind of what I have at the moment - an is_composer flag (so Tchaikovsky.is_composer = true). But in data terms there are quite a few differences between a composer and a regular person, even though they have things in common.
[15:45:09] smathy: teaearlgraycold, so why are you talking about trying it above and below the require_tree ?
[15:45:15] tubbo: any spring users know what this "client side hooks" thing they just added is?
[15:46:25] jkamenik: has joined #RubyOnRails
[15:46:29] teaearlgraycold: smathy: yes. I did notice on SO that someone mentioned with jquery-turbolinks you need your JS in the header
[15:46:31] Cervajz_: has joined #RubyOnRails
[15:46:37] teaearlgraycold: But I'm pretty sure a lot of my JS is in the body
[15:46:52] smathy: tubbo, Rails's spring?
[15:46:53] goldbug: Perhaps what I need is to create a subclass but keep composers in the same table (with the is_composer flag) as everyone else.
[15:47:07] tubbo: teaearlgraycold: you need your JS in the header if you're using turbolinks period, because it replaces the entire <body>
[15:47:20] smathy: teaearlgraycold, the README I've told you to find tells you PRECISELY where to add the require for the gem.
[15:47:22] teaearlgraycold: goldbug: no don't do that
[15:47:26] tubbo: smathy: yes
[15:47:38] smathy: teaearlgraycold, it has to be precisely between two lines in your manifest.
[15:47:52] blackmesa: has joined #RubyOnRails
[15:48:05] smathy: tubbo, maybe some sort of ability to cause a spring reload from the browser?
[15:48:16] teaearlgraycold: smathy: that's where it is, but it also specifies the location of turbolinks itself.
[15:48:19] smathy: ...for all those people allergic to the command line perhaps.
[15:48:38] smathy: teaearlgraycold, so why were you asking be about putting it before or after the require_tree line?
[15:48:45] goldbug: teaearlgraycold: No? How should I think about this then?
[15:48:46] smathy: teaearlgraycold, !gist your manifest
[15:48:47] helpa: teaearlgraycold: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[15:49:33] arup_r: has joined #RubyOnRails
[15:49:44] bricker: has joined #RubyOnRails
[15:49:49] teaearlgraycold: https://gist.github.com/anonymous/1bc26ce42365270e16a6\
[15:50:03] smathy: goldbug, I would create a new table with a `belongs_to :person` and then just delegate whatever methods you also want to call directly on Composer instances.
[15:50:29] tubbo: smathy: oh GOD i would love that
[15:50:39] tubbo: smathy: livereload + spring baby
[15:50:53] smathy: tubbo, I'm guessing though, but that's all I can imagine that would mean.
[15:50:58] arup_r: OnkelTem: Hi
[15:52:16] goldbug: smathy: Why delegation rather than using class inheritance? (This is all very new to me, sorry if this is obvious.)
[15:52:28] Mia: has joined #RubyOnRails
[15:52:28] Mia: has joined #RubyOnRails
[15:54:11] smathy: teaearlgraycold, ok good, only thing I'd recommend is leaving the turbolinks require up where it was immediately after the jquery_ujs, _might_ fix your issue.
[15:54:41] mustmodify: goldbug: FWIW, even though it makes a lot of sense to put a person_id on a composer, I generally put a composer_id on a user so I can more easily find users who are composers. Not that it's hard at all.
[15:54:55] yaw: has joined #RubyOnRails
[15:56:32] mustmodify: goldbug: use inheritance when you have a bit of functionality you want to use in many disperate classes. Not when you have one thing and another similar thing that are both principle objects. Because then they become beholden to eachother and that gets awkward. Especially if you spin up another kind of user. But if you were to spin up a ... uh ... listener profile, it's not awkward at all.
[15:56:37] smathy: goldbug, you could do it that way, but Rails models infer the table name from the class name, and I don't think you should use STI because of the additional things you want in Composer.
[15:56:40] mustmodify: (with delegation obv)
[15:57:06] Cervajz: has joined #RubyOnRails
[15:57:27] diegoviola: some company asked me to write some code with rails but they said my code is too simple, that I didn't use any patterns, etc, they asked me if I could use some patterns such as decorator or facades
[15:57:35] michaeldeol: has joined #RubyOnRails
[15:57:39] smathy: I would also disagree that the pkey should be on User, if you have other roles in your app eventually you don't want to have a different pkey on user for each one. Better for those other roles to point back at User.
[15:57:47] diegobiavati: has joined #RubyOnRails
[15:57:50] teaearlgraycold: smathy: thanks! That seems to have fixed one of my issues. For the other I'll try to get the one by of JS I wrote into the head
[15:57:54] diegoviola: but why should I? my code works
[15:58:17] yaw: diegoviola: did you ask them why they wanted you to use those patterns?
[15:58:35] mustmodify: smathy: makes sense. I still like my way, but I can totally agree with your logic.
[15:58:51] [Butch]: has joined #RubyOnRails
[15:58:54] smathy: teaearlgraycold, the main thing is that with turbolinks reloading the page in place, events won't be run in JS loaded into the page unless it's being triggered by (now) the ready() event.
[15:59:28] Fire-Dragon-DoL: has joined #RubyOnRails
[15:59:44] smathy: mustmodify, yes, both ways have pros and cons.
[16:00:00] teaearlgraycold: smathy: so I should have my JS use the new turbolinks-jQuery event?
[16:00:21] diego3: has joined #RubyOnRails
[16:00:34] smathy: diegoviola, if they really phrased it as you've presented it here then they're morons and you should just do whatever they want so they pay you.
[16:00:53] diego3: has joined #RubyOnRails
[16:01:01] Flying_Squirrel: has joined #RubyOnRails
[16:01:07] brunoalano_: has joined #RubyOnRails
[16:01:20] diego3: yaw: they said they just want to know if I know those patterns
[16:01:34] smathy: teaearlgraycold, yes, everything needs to run in a ready() block with turbolinks, the old habit of just having code inline in your <body> somewhere won't work with the ajax loading turbolinks uses.
[16:01:48] diegoviola: smathy: agreed
[16:02:35] smathy: diegoviola, if instead, they had explained that the code you wrote didn't conform to their existing architecture or best practices then you're at fault and should fix your stuff to fit in with their existing approach/codebase.
[16:02:37] diegoviola: well, I shouldn't have said "agreed", I don't like to go speaking shit of other people in their back, I'd rather tell you that you suck in front of you
[16:02:45] yaw: diegoviola: well, you don't have to use it in the application to show that you know it, right?
[16:02:46] dici: has joined #RubyOnRails
[16:03:17] FrankD: has joined #RubyOnRails
[16:03:30] blackmes1: has joined #RubyOnRails
[16:03:33] yaw: besides, they don't take business advice from you so why would they advise you on how to code?
[16:03:34] smathy: diegoviola, but for client work, if you're positioned well as an expert then you can advise them, but if not (which is my understanding from previous conversations with you) then just give them what they think they want.
[16:03:46] smathy: diegoviola, Rule #1 of client work: get paid.
[16:03:47] diegoviola: but it's frustrating, I agree
[16:04:03] goldbug: Thanks guys - must go now, but appreciate your help.
[16:04:08] goldbug: More tomorrow, doubtless (:
[16:04:09] smathy: goldbug, you're welcome.
[16:04:15] diego3: has joined #RubyOnRails
[16:04:19] diego3: has joined #RubyOnRails
[16:04:31] diegoviola: yaw: yes, but who knows what they really think
[16:05:00] smathy: diegoviola, the underlying problem here is the clients you take on, how they perceive you, and generally your messaging/marketing.
[16:05:30] pjammer: has joined #RubyOnRails
[16:05:59] diegoviola: I'm not a marketing person
[16:06:01] mwlang: has joined #RubyOnRails
[16:06:50] yaw: diegoviola: ideally you should have a talk with them. know why they're really bothered you're not using facade, etc patterns
[16:07:13] yaw: if they've been misinformed then educate them
[16:07:49] yaw: calm them down, basically :)
[16:08:58] diegoviola: my guess is some people are too much into design patterns
[16:09:25] diegoviola: but whatever, really, it's not my problem
[16:09:35] arBmind: has joined #RubyOnRails
[16:09:35] mwlang: I have nginx + passenger + rails app and was just looking in my nginx logs???I see several Error 500 responses, but when I look in the rails production.log, I can confirm the Rails app never got the request (or at least did not log anything for the requested path at the noted timestamps). Any idea how I can be getting 500 responses directly from nginx whereby the Rails app isn???t involved? The links are all valid and would???ve been
[16:09:36] mwlang: handled by controller actions (not static assets)
[16:11:26] tubbo: diegoviola: "some people" == "all programmers"
[16:11:28] ivanskie: has joined #RubyOnRails
[16:11:38] mustmodify: has left #RubyOnRails: ()
[16:11:57] diegoviola: tubbo: that's fine, I guess I'm the illiterate one then
[16:12:25] tubbo: diegoviola: no i mean, most programmers tend to think of design patterns as a silver bullet to solving a problem
[16:12:27] bricker: not me I had that shit
[16:12:30] tubbo: well maybe not most
[16:12:34] rushed: has joined #RubyOnRails
[16:12:44] bricker: if I can't copy and paste my Ruby code into a Python script, it's too fancy for me
[16:14:23] arup_r: ACTION watching tubbo, how cleverly he rewording his words to feel better others.. 
[16:14:39] arup_r: to make other feels better..**
[16:14:42] Trynemjoel: has joined #RubyOnRails
[16:14:49] bricker: tubbo is a diplomatic man
[16:15:16] smathy: So, if I have Bar belongs_to :foo; and Foo has_many :bars and I do: b = Bar.first; b.build_foo; then b.foo is that new foo, but b.foo.bars does not include b :(
[16:15:38] arup_r: I am lost in between foo and bar
[16:15:39] smathy: Lazy ass belongs_to
[16:16:31] bricker: smathy: are you asking a question? or just complaining? Would it help if you understood why that doesn't/can't work?
[16:16:37] smathy: Just complaining :)
[16:16:50] TPBallbag: smathy you need to implement the inverse_of argument
[16:16:57] bricker: nooooooooooo
[16:17:08] smathy: bricker, well it doesn't work when you have callbacks of some sort inside Foo that expect bars to have meaningful values.
[16:17:14] bklane: has joined #RubyOnRails
[16:17:19] smathy: TPBallbag, let me give that a try.
[16:18:20] smathy: TPBallbag, nope, didn't think so :)
[16:18:22] aruntomar: has joined #RubyOnRails
[16:18:24] erichu: has joined #RubyOnRails
[16:19:05] arup_r: ACTION never get how inverse_of works..
[16:19:34] smathy: arup_r, you use it if you have multiple associations on the other side.
[16:19:46] YankNYC: has joined #RubyOnRails
[16:19:47] TPBallbag: It should do, that's the purpose of the inverse_of arguments. Often used it to solve the same issue.
[16:20:02] bePolite: has joined #RubyOnRails
[16:20:24] TPBallbag: If not then try throwing a reload! in there
[16:20:53] smathy: arup_r, like Post belongs_to :author, class_name: "User"; belongs_to :moderator, class_name: "User" then in User you'd have has_many :posts, inverse_of: :author; has_many :moderated_posts, inverse_of: :moderator, class_name: "Post"
[16:21:10] smathy: TPBallbag, it's a build_foo - there's nothing to reload.
[16:21:32] brazenbraden: has joined #RubyOnRails
[16:21:41] TPBallbag: reload it in your callback where you need to read the association
[16:22:14] smathy: TPBallbag, records still aren't saved there.
[16:22:26] arup_r: smathy: I see ..
[16:22:31] TPBallbag: oh yeah, coz it's build :)
[16:22:46] smathy: TPBallbag, and for the record, populating the reciprocal in-memory association is not the purpose of inverse_of :)
[16:23:12] ivanskie: has joined #RubyOnRails
[16:23:22] FrankD: has joined #RubyOnRails
[16:23:23] arup_r: mean A will have associations with B having different names.. then inverse_of come into existence..
[16:23:38] ruurd: has joined #RubyOnRails
[16:23:39] eyck: has joined #RubyOnRails
[16:23:41] YankNYC: could someone help me figure out what method is missing from this problem to solve out of hartl's book? https://gist.github.com/genericlady/ed6a4cf1979b770836a2
[16:23:57] YankNYC: as soon as my sites are making $$$ i'll be sure to buy his book out of support
[16:24:05] smathy: This is just one of those things that only works one way, ie, if I did: f = Foo.first; f.bars.build; then f.bars.first.foo returns f
[16:24:16] tubbo: make it rain YankNYC
[16:24:20] Pupeno: has joined #RubyOnRails
[16:24:40] TPBallbag: StackOverflow disagrees http://stackoverflow.com/a/22238700/170078
[16:24:52] TPBallbag: And so do I :P
[16:26:08] kenpoint: has joined #RubyOnRails
[16:26:12] arup_r: smathy: thanks
[16:27:28] Lytol: has joined #RubyOnRails
[16:28:00] dionysus69: has joined #RubyOnRails
[16:28:25] podman: has joined #RubyOnRails
[16:28:25] YankNYC: haha yeah make it rain
[16:28:37] YankNYC: i told you i'm a unicorn.. unicorns can do that ya know
[16:28:56] YankNYC: but anyway save me the 40 bucks and help me with the method
[16:29:13] YankNYC: because without the member the assert returns true
[16:29:18] YankNYC: err method
[16:29:37] bricker: YankNYC: it seems like assigns(:user) is all you need
[16:29:51] YankNYC: the only value that is not the same is remember_digest. one has the hash the other has nil for remember_digest
[16:30:01] YankNYC: so maybe I need that method to be an assignment method
[16:30:26] YankNYC: but they pass anyway which is spooky. the hash codes must not change for remember_password
[16:30:41] YankNYC: i mean hash_id
[16:30:55] smathy: TPBallbag, that's ok, you can both be wrong together: https://gist.github.com/smathy/9e950624bc149aeec8e9
[16:31:02] smathy: arup_r, you're welcome.
[16:31:54] YankNYC: bricker: it can't be that simple otherwise he couldn't have assigns[:user].FILL_IN
[16:32:21] TPBallbag: smathy: You're using Rails 4.x which implements inverse_of by default.
[16:33:00] bricker: YankNYC: I have seen a lot of stuff in the hartl tutorials that don't make sense
[16:33:05] srinidhi: has joined #RubyOnRails
[16:33:06] bricker: I've never been through it myself
[16:33:24] beingjohnm: I think I'm not quite understanding the asset pipeline. I'm using a template that I bought. I've added the style.css to application.css so it loads fine. style.css contains some @import references to other css files and those don't seem to be precompiling. I tried renaming style.css to style.css.scss. I'm looking here for reference (http://sass-lang.com/documentation/file.SASS_REFERENCE.html#import).
[16:34:13] beingjohnm: I can put all css into the application.css if that is the only resolution. The template has about 25 sub css files that I would put in there.
[16:34:24] tubbo: beingjohnm: if you got a style.css file, that's *not* scss or sass, so it won't be preprocessed. it's probably using the CSS internal @import -> https://developer.mozilla.org/en-US/docs/Web/CSS/@import
[16:34:56] tubbo: beingjohnm: sass @import and css @import work differently, and the syntax is wildly different.
[16:35:02] YankNYC: the only thing i can think of doing is setting that remember_digest to nil to prevent unwanted side affects with the test failing later https://gist.github.com/genericlady/6ebe6c943c46d4a9842b
[16:35:08] smathy: TPBallbag, well, it auto-detects the inverse - yes. And yes, latest Rails is always what I'll assume we're talking about unless otherwise stated.
[16:35:09] beingjohnm: tubbu: it is using css internal @import
[16:35:25] YankNYC: bricker: take it from me, it's perfect
[16:35:27] beingjohnm: tubbo: does that work with rails?
[16:35:48] YankNYC: bricker: he did a great job with the tutorial and if someone says he doesn't make sense it's only their lack of experience and knowledge
[16:35:57] YankNYC: because i get it
[16:35:59] aruntomar: has joined #RubyOnRails
[16:36:05] tubbo: beingjohnm: it does, but your @imports are probably looking for files at absolute paths which rails may not be serving the files at. personally i think you should replace them with scss @imports, because they're easier to work with and not dependent on which browser you use.
[16:36:13] TPBallbag: smathy: so....inverse_of does solve your problem and was already implemented?
[16:36:27] tubbo: beingjohnm: so instead of @import url(/styles/my_style.css), you could @import 'styles/my_style'
[16:36:48] smathy: TPBallbag, no it doesn't solve it (because automatic inversing was already on). As I said, my issue is with the belongs_to side, not the has_many side.
[16:36:52] tubbo: beingjohnm: renaming all your .css files to .scss will allow you to use sass @imports and shouldn't require any change to your actual CSS code.
[16:37:36] erikruthven: has joined #RubyOnRails
[16:37:47] beingjohnm: tubbu: I'll try that. Thanks.
[16:38:34] erikruthven: has left #RubyOnRails: ()
[16:38:38] mices: in the event of a form submission error from the model 'validates' statements the browser reloads the same page, the form, with a flash notice on top telling in this case the fields that can't be left blank, however the form's unable and i have to click the back link to get back to the form, so what's the point of displaying the form if it's not gonna be usable
[16:38:45] smathy: TPBallbag, I've edited my gist to show the problem: https://gist.github.com/smathy/9e950624bc149aeec8e9 As you can see, the reciprocal association is not set, regardless of inverse_of being in automatic mode, or set explicitly.
[16:38:58] brazenbraden: so, im back with no new results. anyone have any ideas why im getting the error "/app/vendor/bundle/ruby/2.2.0/gems/mysql2-0.4.1/lib/mysql2.rb:31:in `require': libruby.so.2.2: cannot open shared object file: No such file or directory - /app/vendor/bundle/ruby/2.2.0/gems/mysql2-0.4.1/lib/mysql2/mysql2.so (LoadError)"? my gist: https://gist.github.com/brazenbraden/b4ef6839ac81fdd42a4a.i'm out of options.
[16:39:17] mices: i mean the forms not accessible it's frozen behind the flash notice
[16:39:33] workmad3: mices: sounds like you've got a styling issue
[16:40:12] mices: i did take out some nesting that was causing a problem some time ago i forget
[16:40:19] TPBallbag: smathy: Okay but why have you changed "p = t.projects.build" to "p = t.build_project"? If you leave it as it was then it works...because of inverse_of.
[16:40:51] smathy: TPBallbag, heh, you're really struggling with this :)
[16:42:17] pontiki: has joined #RubyOnRails
[16:42:43] smathy: TPBallbag, I actually changed p.tasks.build to t.project_build because I changed from building a task (in the has_many :tasks association on Project) to building a project (in the belong_to :project association on Task)
[16:42:45] siddart: has joined #RubyOnRails
[16:43:10] smathy: TPBallbag, as I said from the beginning the reflected association is set when you build from the has_many side, but not from the belongs_to side.
[16:43:22] slash_nick: Mr. TP... could you please clear something up... What's the TP stand for?
[16:43:23] smathy: (or from the has_one side for that batter)
[16:44:02] ruurd: smathy oh for frying out loud
[16:44:03] sbhatore: has joined #RubyOnRails
[16:44:07] rakm: has joined #RubyOnRails
[16:44:29] TPBallbag: smathy: I get you now. My bad.
[16:44:40] TPBallbag: Too many changes I missed!!
[16:44:41] tubbo: ruurd: smathy isn't always the smartest noodle in the bowl
[16:44:43] manfrin: has joined #RubyOnRails
[16:44:52] smathy: ruurd, it's too huch, I know.
[16:44:54] TPBallbag: slash_nick: TagPro
[16:45:14] TPBallbag: It's a crappy web game
[16:45:16] tubbo: TagProBallBag?
[16:45:34] smathy: ACTION was really hoping for "Toilet Paper"
[16:45:40] KamalKaur: has joined #RubyOnRails
[16:45:42] TPBallbag: Yeah, you roll around playing capture the flag as a ball
[16:45:46] TPBallbag: so...ballbag
[16:45:49] smathy: (and will continue to say that in his own head)
[16:45:50] KamalKaur: Hi, I have used protokoll gem for a customized ID in database. Which is set for a particular column. Is there a way to use similar thing in multi-user systems? THat the same customized auto-increment ID becomes particular to each user?
[16:46:04] slash_nick: TPBallbag: thank you :)
[16:46:26] tubbo: haha that's pretty funny
[16:46:34] ruurd: KamalKaur add a user_id foreign key
[16:46:49] symbole: has joined #RubyOnRails
[16:47:24] Flying_Squirrel: has joined #RubyOnRails
[16:47:31] drptbl: has joined #RubyOnRails
[16:47:46] KamalKaur: ruurd: Where? THe same column keeps incrementing for every added object and that way the Customized ID doesn't remain continuous for any user when many of them are working at the same time
[16:48:53] banjara: has joined #RubyOnRails
[16:49:23] apalmblad: has joined #RubyOnRails
[16:51:21] nickjj: are any of you guys interested in learning how to deploy a rails apps from end-to-end using docker? i'm releasing a new course on this topic soon, if you're interested: https://www.kickstarter.com/projects/nickjj/docker-for-devops-from-development-to-production
[16:52:38] banjara: has joined #RubyOnRails
[16:53:18] _SLM_: has joined #RubyOnRails
[16:53:18] BaNzounet: has joined #RubyOnRails
[16:54:43] ericjphillips: has joined #RubyOnRails
[16:55:24] krisquigley: has joined #RubyOnRails
[16:56:17] herbst: has joined #RubyOnRails
[16:56:43] ruurd: has joined #RubyOnRails
[16:58:32] ruurd: KamalKaur just use one column for user_id fkey and an autonumber for a second column
[16:58:58] ruurd: don't give meaning to a primary key.
[16:59:13] jenrzzz: has joined #RubyOnRails
[16:59:17] KamalKaur: ruurd: Can I have an example please? Will be easy for me to understand
[17:00:34] benlieb: has joined #RubyOnRails
[17:00:39] EminenceHC: has joined #RubyOnRails
[17:01:03] sbhatore: has joined #RubyOnRails
[17:01:21] juanpaucar: has joined #RubyOnRails
[17:01:27] piotrj: has joined #RubyOnRails
[17:01:46] juanpaucar: has joined #RubyOnRails
[17:04:26] mrchris: has joined #RubyOnRails
[17:05:19] Maletor: has joined #RubyOnRails
[17:05:33] BaNzounet: Hey, is it possible with dragonfly, to store multi image in an array(in postgress)? Or the only way to have an object with multiple images is to have another class Image?
[17:06:07] masaru-: has joined #RubyOnRails
[17:06:23] bklane: has joined #RubyOnRails
[17:06:25] mrchris: I seem to be having some issue with my Devise routes. I've customized them a bit and most of them work except for my "cancel" routes. It keeps redirecting me to the home page saying "you are already signed in." http://pastie.org/private/omxdqojrqnazkosmyv1jg
[17:06:53] mrchris: any ideas?
[17:08:37] Limix: has joined #RubyOnRails
[17:08:52] shmoon_: I've a question, `Model.all` executes SQL query and returns all the object, but I think `Model.all.class` although prints the class but doesn't execute the SQL query under the hood. How does Rails do that ?
[17:09:11] krisquigley: has joined #RubyOnRails
[17:09:17] mices: how do i say unless not in validates_presence_of
[17:10:29] mrchris: mices, if: -> {}
[17:11:39] mices: validates_presence_of :state, :if => "country==United States?"
[17:11:54] mices: see what i'm trying to say
[17:12:06] mices: if the country is usa then there has to be a state
[17:12:28] mices: but it doesn't seem to work
[17:15:26] pwnd_nsfw: shmoon_, 'Model.all.class' actually returns 'what'?
[17:16:00] arup_r: pwnd_nsfw: User.all.class
[17:16:00] arup_r: => User::ActiveRecord_Relation
[17:16:05] EminenceHC: has joined #RubyOnRails
[17:16:31] pwnd_nsfw: arup_r, it was a question for shmoon_ ;p
[17:16:56] arup_r: his question is interesting though
[17:16:57] pwnd_nsfw: Trying to demonstrate that no SQL would be executed because... well.... there's no SQL to execute
[17:17:41] _djbkd: has joined #RubyOnRails
[17:18:12] teaearlgraycold: smathy: got everything patched up now. Thanks for your help
[17:18:31] arup_r: `Model.all` gives array of models.. but `Model.all.class` says something else.. which is not convincing me
[17:18:38] arup_r: atleast me.. :/
[17:18:58] arup_r: I expected `Model.all.class` # Array
[17:19:01] apalmblad: has joined #RubyOnRails
[17:19:09] teaearlgraycold: arup_r: Model.all does not return an array
[17:19:16] teaearlgraycold: It returns a relation
[17:19:21] arup_r: I am seeing in Pry as array
[17:19:51] teaearlgraycold: For me Model.all shows #<ActiveRecord::Relation [#<Form id: 1, applicant: ... in rails console
[17:19:59] arup_r: The Pry did some shit
[17:20:02] teaearlgraycold: You can see the object is an ActiveRecord::Relation
[17:20:22] ruurd: has joined #RubyOnRails
[17:21:08] arup_r: teaearlgraycold: https://gist.github.com/aruprakshit/34aa0ebfa7e28e4e1985
[17:21:15] based_pdev: has joined #RubyOnRails
[17:21:51] teaearlgraycold: I'm new to all this - is pry something different from the normal rails console?
[17:21:59] benlieb: has joined #RubyOnRails
[17:22:08] arup_r: it changes the objects parent.. :)
[17:22:48] teaearlgraycold: It might just try to be smart and hide the ActiveRecord::Relation part cause it knows people think of Model.all as an array
[17:23:16] pwnd_nsfw: You can iterate over it anywho
[17:23:42] pjammer: has joined #RubyOnRails
[17:24:28] michaeldeol: has joined #RubyOnRails
[17:24:54] bricker: teaearlgraycold: pry is a ruby REPL, alternative to irb
[17:24:57] petricore: has joined #RubyOnRails
[17:25:33] lxsameer: has joined #RubyOnRails
[17:25:49] pwnd_nsfw: With much more sexy capabilities
[17:25:49] VeryBewitching: has joined #RubyOnRails
[17:25:57] pwnd_nsfw: But not sexy enough for me to make the switch
[17:26:47] bricker: pwnd_nsfw: the switch from IRB? you should absolutely do it, I felt the same way until I changed and now irb is so... basic.
[17:26:58] shmoon_: pwnd_nsfw: ActiveRecord::Relation::ActiveRecord_Relation_Model
[17:27:04] pwnd_nsfw: Sometimes basic is all I need
[17:27:27] shmoon_: but it doesn't execute the query, i want to understand how this magic is done
[17:28:07] mices: how do i say unless field == value in validates statement
[17:28:42] mices: do i have to say Class.field
[17:28:58] VeryBewitching: mices: validates :field, presence: true, unless: :some_method?
[17:29:25] pwnd_nsfw: shmoon_, that is interesting
[17:29:28] VeryBewitching: mices: Read through http://guides.rubyonrails.org/active_record_validations.html
[17:29:29] mices: i'm trying to say unless country=="United States"
[17:29:48] DoubleMalt: has joined #RubyOnRails
[17:29:48] mices: i can't find an example that matches closely enough there
[17:30:10] VeryBewitching: mices: You will have to think it through, the solutions for your application are available on the web.
[17:30:26] yaymukund: has joined #RubyOnRails
[17:30:44] corioliss: has joined #RubyOnRails
[17:31:03] VeryBewitching: mices: All you have to do is create a method in the model in_the_us?
[17:31:30] shmoon_: rails or node ? :P
[17:32:16] cnk: has joined #RubyOnRails
[17:34:17] pwnd_nsfw: shmoon_, you do have an interesting question. I can't seem to find anywhere about it
[17:34:37] shmoon_: I have a table called Booking with 200k rows
[17:34:41] shmoon_: Booking.all takes a long time
[17:34:49] shmoon_: but Booking.all.class prints the class info instantly
[17:34:55] shmoon_: still wondering why
[17:35:38] VeryBewitching: shmoon_: Read the source code for ActiveRecord::Base.all
[17:35:48] rushed: shmoon_: when you put something in irb it inspects the result
[17:35:54] s2013: has joined #RubyOnRails
[17:36:08] rushed: shmoon_: note "something" vs "something; false"
[17:36:57] rushed: shmoon_: try it in irb
[17:37:01] CheckYourSix: has joined #RubyOnRails
[17:37:31] shmoon_: ok you mean when I do Booking.all pry executes Booking.all.inspect?
[17:38:03] shmoon_: which leads to the execution, otherwise .all wouldn't execute
[17:38:31] rushed: shmoon_: all executes, it just returns an active relation :)
[17:38:32] VeryBewitching: .all has to execute in order for all.class to have a value.
[17:38:49] shmoon_: I mean query isn't executed
[17:39:31] bejar37: has joined #RubyOnRails
[17:39:41] Lytol: has joined #RubyOnRails
[17:39:47] shmoon_: ya it has to but the query isn't executing VeryBewitching
[17:39:59] VeryBewitching: No, it doesn't.
[17:40:08] VeryBewitching: You can see that in IRB
[17:40:18] shmoon_: Booking.all executes the query
[17:40:30] VeryBewitching: Yes, but Booking.all.class won't
[17:40:38] shmoon_: yes my question is why?
[17:40:52] VeryBewitching: As I said, read the source code.
[17:41:02] rushed: shmoon_: did you try it in irb? "Booking.all" vs "Booking.all; false" ?
[17:41:43] OnkelTem: Is it possible ot feed a slim template with data w/o using models or controllers?
[17:41:45] pwnd_nsfw: Doesn't execute query either
[17:41:49] pwnd_nsfw: Interesting
[17:41:59] SeanLazer: has joined #RubyOnRails
[17:42:00] shmoon_: yes rushed , doesn't execute the querhy
[17:42:15] shmoon_: so you're saying when I do just Booking.all, pry basically does Booking.all.inspect behind the scene?
[17:42:20] VeryBewitching: At least, it doesn't *report* that it has
[17:42:21] rushed: shmoon_: a) you type something in irb b) you hit enter c) the code is run d) irb gets the result e) irb inspects the result
[17:42:31] shmoon_: and Rails gets that request inside the inspect method and executes the query?
[17:42:48] rushed: shmoon_: you might be thinging that stuff that happens due to e) is happening in c) but it's not
[17:43:16] shmoon_: how is the inspection done ?
[17:43:26] shmoon_: like what method call
[17:44:19] tejasmanohar: has joined #RubyOnRails
[17:44:38] rushed: shmoon_: method calls that will result in the materialization of otherwise lazily executed active relation queries :)
[17:45:08] shmoon_: wish I could get to know the exact method call
[17:45:15] shmoon_: .inspect or something else
[17:45:17] pwnd_nsfw: I'm trying to zero in on it too
[17:45:26] Cervajz: has joined #RubyOnRails
[17:45:52] shmoon_: Booking.all.inspect; false does execute, so maybe its inspect
[17:45:53] mices: VeryBewitching: you were right, i found it
[17:48:03] mices: i defined a method? to use in the validates statement
[17:48:11] banjara: has joined #RubyOnRails
[17:48:54] ruurd: has joined #RubyOnRails
[17:49:12] CheckYourSix: has joined #RubyOnRails
[17:49:52] annlewis: has joined #RubyOnRails
[17:49:56] davidhq: has joined #RubyOnRails
[17:50:12] mices: my forms are stuck behind the notice
[17:51:35] mices: the only thing i have in css for notice is color
[17:52:29] yaw: has joined #RubyOnRails
[17:52:46] pwnd_nsfw: The Sun will blow up before mices provides code without someone having to ask him to do it
[17:54:01] mices: the notices are generated by the model validates statements so there's nothing to re-syntax?
[17:54:27] mices: i didn't write these notices
[17:54:42] mices: i mean alerts
[17:54:52] mices: or flash entries whatever
[17:55:08] VeryBewitching: mices: Though a lot of helpful information is provided here, it's not likely that anyone here will write your code for you. You are at some point going to have to go through the guides and learn this on your own.
[17:55:18] bePolite: has joined #RubyOnRails
[17:55:44] EminenceHC: has joined #RubyOnRails
[17:55:57] ruurd_: has joined #RubyOnRails
[17:56:49] pwnd_nsfw: shmoon_, http://devdocs.io/rails/activerecord/relation#method-i-load courtesy of smathy
[17:57:05] havenwood: has joined #RubyOnRails
[17:57:11] mices: at some point? where they been keepin you? this is the first time i saw you in here
[17:57:37] VeryBewitching: I've been in this channel for over a year.
[17:57:37] pwnd_nsfw: VeryBewitching is here a lot
[17:58:01] helpa: has joined #RubyOnRails
[17:58:09] pwnd_nsfw: oh hey helpa
[17:58:41] VeryBewitching: I used to be on here as Etriaph, but that's more of a nick I use gaming.
[17:59:14] benlieb: has joined #RubyOnRails
[17:59:31] pwnd_nsfw: He just didn't notice you because you weren't air planing a spoon of code into his mouth :p
[18:00:24] FailBit: *explosions*
[18:00:32] VeryBewitching: pwnd_nsfw: Now now, be nice. :D
[18:00:36] pwnd_nsfw: *michael bay*
[18:00:56] pwnd_nsfw: I apologize
[18:01:12] workmad3: VeryBewitching: helpa's auth list is done on nick
[18:01:22] mices: all i know is i can't get the theme song from bewitched out of my head now
[18:01:53] banjara: has joined #RubyOnRails
[18:02:09] ruurd: has joined #RubyOnRails
[18:02:22] smathy: That's *ALL* you know mices? Even I'm surprised at that.
[18:02:27] VeryBewitching: Wow, it's borked
[18:02:48] VeryBewitching: It can't be run by me
[18:03:11] VeryBewitching: That was the original nick I used
[18:03:13] yardenbar: has joined #RubyOnRails
[18:03:55] smathy: You're officially cut off!
[18:04:20] mugurel: I have a problem with eager_loading. I have User has many blogs, and Blog belongs to User. If i do Blog.eager_load(:users) i get Association named 'users' was not found; perhaps you misspelled it?
[18:04:36] smathy: That "at some point" should have happened about 390 days ago!
[18:04:40] lg782s: has joined #RubyOnRails
[18:04:41] arup_r: use :user
[18:04:58] arup_r: it should be assocation name
[18:05:04] arup_r: either way
[18:05:04] pwnd_nsfw: that's depressing
[18:05:56] mugurel: arup_r: thanks, so if i have has_many belongs to many i user the plural instead of singlar?
[18:06:08] aruntomar: has joined #RubyOnRails
[18:06:36] arup_r: did not get you
[18:06:49] OnkelTem: Imagine you have a remote REST server which feeds JSON objects. I need to take it and just use in .slim template. How would I do that?
[18:07:06] OnkelTem: take it - take a JSON object
[18:07:32] mugurel: on some relations it works if i do Post.eager_load(:thumbnails)
[18:07:33] OnkelTem: I need to request data from a remote server
[18:07:56] diegoviola: https://www.youtube.com/watch?v=iYWzMvlj2RQ
[18:09:00] smathy: OnkelTem, you write code to fetch the JSON and deserialize it into objects, and then you set those objects to instance vars in your controller, and then in the slim templates you use those instance vars to produce the HTML.
[18:09:55] FailBit: I just ate a grape and I
[18:09:56] OnkelTem: smathy: yep, that's what I was thinkig about. I'd like to learn some examples on this subject, if you can point me to the proper sources that would be great :)
[18:10:10] neanderslob: has joined #RubyOnRails
[18:10:40] EminenceHC: has joined #RubyOnRails
[18:10:47] OnkelTem: smathy: it sounds like a couple of lines, doesn't it? :)
[18:11:24] smathy: OnkelTem, if you want to do it in just a couple of lines, then you're going to need to REALLY know a lot.
[18:11:47] smathy: OnkelTem, if you want to just skim the surface of ruby and Rails, better to aim for several dozen lines.
[18:12:00] OnkelTem: smathy: not the case of course. Rather - I would hope on some snippet with a simialr task is solved
[18:12:33] XCMer: has joined #RubyOnRails
[18:12:53] ahmgeek: has joined #RubyOnRails
[18:12:55] XCMer: Any resource on making nested validations work with belongs_to (rails 4)?
[18:13:22] thejamespinto: has joined #RubyOnRails
[18:13:26] EminenceHC: has joined #RubyOnRails
[18:13:27] banjara: has joined #RubyOnRails
[18:13:53] Lytol: has joined #RubyOnRails
[18:14:17] banjara1: has joined #RubyOnRails
[18:14:22] sararegan: has joined #RubyOnRails
[18:14:24] mwlang: has joined #RubyOnRails
[18:14:25] ahmgeek: guys, I have a little bit weird question, I am new to rails, but I want to master ruby, I want to write a cool things to show of for Recurse Center as I want to apply there. what projects (small scale) and effective to work on.
[18:14:44] smathy: OnkelTem, it really depends a lot on what your existing knowledge is, I'm gathering not very extensive. For me, the answers here explain it very clearly: http://stackoverflow.com/q/748614/152786
[18:14:47] mwlang: Is it just me, or is forward progress on active_admin kinda slow?
[18:14:49] ahmgeek: and is there any books that aims for building things with ruby not teaching the lang itself
[18:15:08] smathy: OnkelTem, but if you're trying to find a chunk of code to just copy-paste and off you go, you're really gonna have a bad day.
[18:15:19] mwlang: (meaning long lags between resolving issues reported on github and churning out new updates)
[18:15:27] hydrozen: has joined #RubyOnRails
[18:15:34] smathy: OnkelTem, my real answer is, step 1: learn ruby: https://www.ruby-lang.org/en/documentation/
[18:15:50] mwlang: I even have one PR that???s been just sitting there for a few weeks now.
[18:15:57] jenrzzz: has joined #RubyOnRails
[18:16:03] piotrj: has joined #RubyOnRails
[18:16:16] smathy: OnkelTem, and if you're not prepared to do that, and you don't want to do what I suggested earlier (just run your PHP app on the same server as your Rails app and link to the content you already have on Drupal) then go hire a Rails developer.
[18:16:21] tubbo: mwlang: it's not just you. that's primarily why active_admin sucks, imho.
[18:16:39] smathy: A statement of fact (not an opinion at all) ^
[18:17:04] mwlang: Ah. So it???s not how AA was implemented that makes everybody say, ???AA sucks???
[18:17:13] mwlang: just that development cycles are slooooow.
[18:17:24] tubbo: mwlang: they're all connected.
[18:17:28] smathy: All of the above.
[18:17:32] tubbo: development cycles being slow means your software sucks
[18:17:47] yfeldblum: has joined #RubyOnRails
[18:17:53] FailBit: is there more to say?
[18:18:00] smathy: Too much invisible magic.
[18:18:06] tubbo: it's kinda like how Ohio always picks the president of the US
[18:18:22] mwlang: FailBit: well, it???s not the complete picture. I???ve worked with it on at least 10 different Rails projects.
[18:18:37] tubbo: it's not like "oh if ohio picks this guy he's GOING to win", it's more like "statistically speaking, ohio usually picks the winning candidate"
[18:18:44] OnkelTem: smathy: thank you! subscribe.
[18:18:45] mwlang: but the project I???m doing right now is first internationalized one
[18:18:51] mwlang: and it really sucks at I18n
[18:18:59] tubbo: so here, development cycles being slow is a major indicator that something is very wrong with it
[18:19:05] smathy: OnkelTem, you're welcome.
[18:21:04] mwlang: alright, well, thanks for confirming the slow development cycle???.now to figure out how to live with it ??? seriously considering just forking and start making some, ahem, rather drastic changes to it.
[18:21:32] mices: i've been looking closely at the nesting in my layout but that seems fine, maybe it's the google ad containing javascript in my layout
[18:22:02] mices: it's not flash notice, i mean error notices
[18:22:50] smathy: My mices:english babel fish seems to be broken.
[18:22:54] dans__: has joined #RubyOnRails
[18:23:35] tsujp: has joined #RubyOnRails
[18:24:43] n008f4g_: has joined #RubyOnRails
[18:25:12] Pupeno: has joined #RubyOnRails
[18:25:49] mxrguspxrt: has joined #RubyOnRails
[18:27:40] arup_r: has joined #RubyOnRails
[18:28:41] Lincee: has joined #RubyOnRails
[18:29:13] tubbo: http://nandovieira.com/dont-tell-me-what-to-do
[18:29:13] sininen: has joined #RubyOnRails
[18:29:19] tubbo: @everybody
[18:29:42] mices: never mind everything works
[18:30:02] mices: the problem was the way i was looking at my screen
[18:30:03] smathy: Phew, stand down everyone, mices problem is fixed.
[18:30:11] smathy: I can get back to work now.
[18:30:15] smathy: Thanks for the all clear.
[18:30:20] netzfisch: has joined #RubyOnRails
[18:30:34] Coldblackice: has joined #RubyOnRails
[18:30:43] mices: i'm loving rails
[18:30:44] tubbo: mices: gotta use your "good eye"
[18:31:28] smathy: "You don???t know if a self-taught developer can even understand the implications of what you???re advocating." - yeah, all you morons who taught yourselves! Oh, hang on a sec!
[18:31:41] based_pdev_: has joined #RubyOnRails
[18:31:48] mikecmpbll: has joined #RubyOnRails
[18:32:34] ellisTAA: has joined #RubyOnRails
[18:32:36] chino: how does rails handle loading controllers properly if 1 was to require another? like if it's sub classing another one?
[18:32:44] mices: i knew mvc was a much better approach than the way i was doing things but the rails generator brings way may than i bargained for/expected
[18:33:15] chino: i guess i have to put an explicit require statement at the top for the order to be gaurenteed?
[18:33:25] rakm: i'm having trouble using FileUtils.copy to copy the contents of "/srv/foo" to "/srv/bar". tried all of these so far: http://pastie.org/10452571
[18:34:35] tubbo: smathy: lol...but seriously, i'm really sick of these bloggers who literally all they say is shitting on other projects
[18:34:43] ellisTAA: has joined #RubyOnRails
[18:34:48] ellisTAA: has left #RubyOnRails: ()
[18:35:00] OnkelTem: smathy: what part of ruby application is better suit for such a communication like talking to a remote server via REST/http?
[18:35:05] smathy: tubbo, so, stop blogging? Stop advocating for what you think is the best?
[18:35:22] mices: i was too dumb to use layouts but in rails they're just inherent like so much other stuff
[18:35:37] smathy: tubbo, how about a little personal responsibility from the user? A little discerning judgement and active reading skills?
[18:35:43] tubbo: smathy: no..i thought you were kidding, you really didn't get the article at all. the point is, don't tell people how to act, lead by example and show other people how it helped you.
[18:36:02] OnkelTem: smathy: I'd like to trigger data requests on each page load (to not get a headache on cache invalidation - I'm better turn caching on at Drupal side)
[18:36:04] tubbo: smathy: has nothing to do with personal responsibility and everything to do with content filtering
[18:36:23] tubbo: i'm not interested in the next "$technology is a cancer" article or why @eevee doesn't think i should be using shit i like to u9se
[18:36:34] smathy: OnkelTem, ruby is a language, so I'll assuming you meant Rails - when you're ready to learn how Rails all fits together then go here: http://guides.rubyonrails.org/
[18:36:37] OnkelTem: smathy: I mean RoR
[18:36:39] tubbo: or how many curses i can count in a zed shaw flameagraph
[18:37:00] rakm: ahh FileUtils.cp_r('/srv/foo/.', '/srv/bar') workfed
[18:37:02] diegoviola: zed shaw was annoying
[18:37:12] tubbo: diegoviola: he's still alive ;)
[18:37:26] EminenceHC: has joined #RubyOnRails
[18:37:26] aruntomar_: has joined #RubyOnRails
[18:37:32] diegoviola: he went to write python and C because he was annoyed with some rubists
[18:37:33] ellisTAA: has joined #RubyOnRails
[18:37:38] lg782s_: has joined #RubyOnRails
[18:37:55] tubbo: but he's the kind of guy who can't even match the standards he attempts to set for everyone else.
[18:37:59] diegoviola: nothing against that or him though
[18:38:16] ellisTAA: can someone take a look at my models and tell me if i???m effing something up? https://gist.github.com/ellismarte/cd7a95842fa9752c4e23
[18:38:34] smathy: tubbo, I must already be unconsciously filtering whatever you're talking about, I never read something that I perceive as telling people how to act, or even telling people not to use something. The stuff I read talks about the pros/cons of different approaches and the common gotchas you encounter.
[18:38:37] centrx: has joined #RubyOnRails
[18:38:41] dramagods: has joined #RubyOnRails
[18:39:21] tubbo: diegoviola: he's annoyed by the same hipsters that annoy the rest of us
[18:39:26] hawson: has joined #RubyOnRails
[18:40:03] Denarii: EllisTAA: shouldn't sender and recipient be on the message, not the conversation?
[18:40:04] tubbo: in a way, i'm really glad ruby isn't the hot shit anymore because when it was, there were a lot of people who would try to use ruby, not really "get" what it's all about, and then write a few articles about how much it sucks because they couldn't program a directX video game with it or whatever
[18:40:09] Gustavo: has joined #RubyOnRails
[18:40:26] tubbo: and it made me realize that it's *way* easier to install octopress than it is to deploy a rails app, so a lot of people choose the former.
[18:40:27] ellisTAA: Denarii: you and i have a conversation and it has many messages .. that was my thought
[18:40:53] tubbo: EllisTAA: what if someone wants to add someone to the conversation?
[18:41:04] tubbo: like on facebook, how you can just add people to a chat and it becomes a group chat
[18:41:04] ellisTAA: tubbo: as of now they can???t
[18:41:05] Denarii: yeah, but the sender and recipient is a message level concern. I send and receive some messages, you send and receive some messages
[18:41:19] ellisTAA: i guess i could change it ???
[18:41:25] tubbo: EllisTAA: this isn't going to work https://gist.github.com/ellismarte/cd7a95842fa9752c4e23#file-user-rb-L4-L5
[18:41:39] ellisTAA: tubbo: why not
[18:41:40] tubbo: EllisTAA: you need to name each of those has_many's differently
[18:42:08] tubbo: EllisTAA: the way has_many works is by defining a method on your object, so it will redefine that method twice and the 1st call (:as => :sender) will not ever be accessible
[18:42:11] Denarii: with how it is now a conversation is always entirely one-sided: one person sending and the other receiving
[18:42:13] maz-dev: has joined #RubyOnRails
[18:42:16] juanpaucar: has joined #RubyOnRails
[18:42:40] ellisTAA: how would u design it?
[18:42:58] smathy: tubbo, you know, I'm not sure that article says what you read it as saying.
[18:43:34] smathy: "The problem is that developers that advocate a more complex architecture assume that everybody has the same deep knowledge about software design." - he's talking about the problem being developers *ADVOCATING* complex architectures.
[18:45:47] ellisTAA: tubbo: what about User has_many :conversations, :as => :sender || :as => :recipient, is something like that possible
[18:45:56] tubbo: EllisTAA: well i wouldn't typically use a conversation method, instead i'd just use Message and have a sender and receiver on that, then in User you can say has_many :sent_messages
[18:46:12] tubbo: you'd need to actually define the conversations method
[18:46:25] smathy: tubbo, I've just noticed that one of the links in his intro is to http://trailblazerb.org/, title: "abstract everything from the framework". "but you can???t just say what they should do" - Trailblazer never says that. "And without this context, developers may try to follow your advice and create software that is worst than before, because they just don???t know how to correct apply the patterns you???re promoting." - so fucking what?
[18:46:25] smathy: Someone gets out of their depth and that's the AUTHOR'S fault?
[18:46:54] ellisTAA: >< ahh ok thanks
[18:47:48] smathy: "And here lies the problem. When you???re advocating something, you???re more likely to hide the bad parts of the solution you???re advocating, leaving this exercise to the reader, that may or may not be able to balance these implications." - so? Some users can't evaluate things for themselves, so the problem is the advocate?
[18:48:25] atomical: has joined #RubyOnRails
[18:49:46] tubbo: the problem, no. the responsibility, maybe.
[18:49:53] tubbo: not that it should be that way or anything
[18:50:14] tubbo: just think people need to think a little more before writing a stupid blog post
[18:52:00] arooni: has joined #RubyOnRails
[18:52:47] smathy: Y'know, it's really easy to pick a few examples of architectural posts/sites with strong advocates and assert that they have hidden problems that will trip unwary people up. What would be harder would be to actually detail the problems he sees.
[18:53:02] smathy: tubbo, you think the http://trailblazerb.org/ page he linked to is a stupid blog post?
[18:54:10] tubbo: smathy: no, but i don't think it's a useful design pattern for most rails apps either. we believe it will help at my job because we are creating a platform in rails.
[18:54:25] smathy: Even the "Ditch Your ORM" post makes it pretty clear that he's advocating a complex higher order architecture. If some n00b could read through that, getting past concepts like immutability-oriented design, and still think this solution applied to them then, frankly, they deserve whatever chaos their copy-pasta causes in their app.
[18:54:26] tubbo: trailblazer should be the architecture behind Spree, not Shopify. see what i mean?
[18:54:53] tubbo: lol i agree smathy, anyone smart enough to cause that much damage does deserve it. but as the tech lead, do YOU deserve having to clean up after them? ;)
[18:55:02] smathy: There was a time when we derided the cargo cult, and now we're saying that the people who created the landing strip and distributed the food are in ANY WAY responsible?
[18:55:04] tubbo: i don't think you deserve that. you deserve better.
[18:55:24] tubbo: who's "we"? the cargo cult is alive and well
[18:55:26] smathy: Well, if I hired that moron then yes, I deserve it.
[18:55:31] tubbo: no matter how much we try to fight it
[18:56:08] smathy: Right, but the philosophy behind that is that the person at fault for taking something they don't understand and applying it to their codebase IS THE PERSON WHO DID THAT!
[18:56:23] smathy: The author of the blog post who advocated that is not IN ANY WAY responsible for those actions.
[18:56:47] Denarii: EllisTAA: https://gist.github.com/babelfish/7df7b3725af2e9262286
[18:57:01] smathy: Fuck that "Don't tell me what to do" concept, here's one "Don't copy shit you don't grok!"
[18:57:13] Avon: has joined #RubyOnRails
[18:57:53] tubbo: smathy: if i followed that logic, i'd still be doing php ;)
[18:58:01] tubbo: thanks asciicasts!
[18:58:26] FailBit: https://i.imgur.com/ZNBCPS5.jpg
[18:58:47] ellisTAA: Denarii: thanks i will check that out
[18:59:07] smathy: There are obviously different levels of understanding, but I guarantee you that if you had read the "Ditch your ORM" post when you were still a zygote you would NOT have copied that code/idea.
[18:59:18] MksN: has joined #RubyOnRails
[18:59:38] Cervajz: has joined #RubyOnRails
[19:00:16] ellisTAA: Denarii: why is ti called participations and not participants
[19:00:17] smathy: Nando seriously sounds like he copied something he didn't understand, and it caused him all sorts of hell, and so now he's bitching about the spilled milk.
[19:01:17] baweaver: has joined #RubyOnRails
[19:02:45] smathy: I'll add that his response to solnic in the comments is pathetic, it totally conflicts with the meat of his post: http://nandovieira.com/dont-tell-me-what-to-do#comment-2264140377
[19:02:49] Denarii: EllisTAA: because it's a bridge between the conversation and the user (the actual participant)
[19:03:59] havenn: has joined #RubyOnRails
[19:04:47] brazenbraden: in an attempt to see if it was a mysql problem, i switched over to posgres.. NOPE! "/pg-0.18.3/lib/pg.rb:4:in `require': libruby.so.2.2: cannot open shared object file: No such file or directory - /app/vendor/bundle/ruby/2.2.0/gems/pg-0.18.3/lib/pg_ext.so (LoadError)"
[19:05:23] piotrj: has joined #RubyOnRails
[19:05:28] iooner: has joined #RubyOnRails
[19:06:35] smathy: tubbo, even funnier when Nick calls him out, he does more backpedaling and tries to blame a talk in Rubyconf Brazil, and then the person who gave that talk calls him out too, and so he backpedals some more.
[19:06:45] tubbo: smathy: wat
[19:07:00] smathy: tubbo, in the comments.
[19:07:15] smathy: http://nandovieira.com/dont-tell-me-what-to-do#comment-2266409346
[19:07:42] tubbo: smathy: "There is no User but it???s very likely there is SignupUser. There is no Order but you definitely can deal with PlaceOrder. And when you see classes ending with Manager - just run." eww
[19:07:45] tubbo: fuck that shit
[19:08:04] Avon: has joined #RubyOnRails
[19:08:23] tubbo: that ROM thing is pretty neat though!
[19:08:31] DoubleMalt: has joined #RubyOnRails
[19:08:34] smathy: tubbo, not sure where that quote came from.
[19:08:38] yardenbar: has joined #RubyOnRails
[19:08:47] tubbo: oh sorry smathy, i read the "ditch your ORM" article
[19:09:12] ratmav: has joined #RubyOnRails
[19:09:28] tubbo: "class UserRelation < ROM::Relation[:sql]" EWWWW GET IT AWAY GET IT OFF MY SCREEN
[19:09:58] smathy: Oh right, I didn't read too far into it.
[19:09:59] krisquigley: has joined #RubyOnRails
[19:10:07] ratmav: hey guys, i'm new to load balancing
[19:10:18] ratmav: i have a rails app (nginx/puma)
[19:10:21] ratmav: two servers
[19:10:25] ratmav: behind an aws elb
[19:10:40] ratmav: logins don't work, i get a csrf error, but i can see the token in the logs
[19:10:57] ratmav: any ideas on what to check or where to look for more info?
[19:11:34] tubbo: ratmav: apps running on both machines need to have the same secret_key_base (which devise should then use as it secret_key by default)
[19:12:02] tubbo: ratmav: possible that the csrf token being generated for instance1 is incompatible with the token generated on instance2
[19:12:44] Gustavo: has joined #RubyOnRails
[19:13:20] ratmav: tubbo: aHa
[19:13:32] ratmav: i think i'm generating secret key base on each app restart
[19:13:39] ratmav: thanks tubbo
[19:13:42] ratmav: that's a good point
[19:13:50] ratmav: i'll try that out. i think it's going to fix the issue.
[19:14:13] tubbo: ratmav: you should never regenerate secret_key_base after it's already been generated, it invalidates a LOT of stuff
[19:14:23] ratmav: i hear you
[19:14:24] piotrj: has joined #RubyOnRails
[19:14:27] tubbo: ratmav: which is why it's so important not to leak that key
[19:14:47] ratmav: do you recommend putting it in the env?
[19:14:56] ratmav: that's probably a better place for it
[19:15:04] ratmav: as opposed to generating it
[19:16:08] smathy: tubbo, well, I agree with separating your business operations from your persistence classes, not sure about the ROM layout, seems to need some more DSL love.
[19:16:30] jenrzzz: has joined #RubyOnRails
[19:17:00] tubbo: smathy: just an interesting idea, and yeah i think it could use a few more DSLs
[19:17:18] tubbo: ratmav: yes, in fact that's what *rails* recommends if you noticed in your config/secrets.yml
[19:19:45] tubbo: smathy: yeah like i was playing around with trailblazer (still reading the book but i'm done playing with the code right now), and kinda got bored because it felt too heavy for what i was trying to do
[19:20:05] tubbo: that said, i still haven't really tried it out on what i *want* it to be on, and what i think it works best on, a series of gems that makes all of our consulting apps
[19:20:15] tubbo: because right now we are wasting a lot of time trying to figure out weirdo ruby loading issues
[19:24:06] cschneid_: has joined #RubyOnRails
[19:24:35] meoblast001: has joined #RubyOnRails
[19:24:58] mices: i had to manually add a "new" method to my routes to ensure that it came before my show
[19:25:27] mices: before i did that i kept moving resources up and down in routes.rb and getting different results
[19:25:35] tubbo: mices: be more vague plz
[19:25:48] pwnd_nsfw: tubbo, don't ask for the impossible
[19:25:52] mices: i have this route '/festivals/:state/'
[19:26:28] mices: but in this route '/festivals/new' , "new" got mistaken for a :state value
[19:26:38] mices: until i manually put the new route in myself
[19:26:51] tubbo: mices: oh yeah, that's definitely true. if you're making manual routes rather than leveraging rails' `resources` DSL, that is going to happen.
[19:26:52] mices: understand?
[19:27:33] tubbo: mices: resources :festivals will do that for you, but you have to pass the state as the ':id' param, because it will generate '/festivals/:id' as your route. that id param doesn't have any "rules" associated with it like your model does, wherein the id needs to be an auto-incrementing integer
[19:28:00] tubbo: mices: that's how gems like friendly_id work, they take params[:id] and search on whatever you give it as a slug to work, so '/festivals/coachella' means params[:id] == 'coachella'.
[19:28:03] Maletor: has joined #RubyOnRails
[19:28:28] tubbo: mices: so if you had Festival.where(state: params[:state]), you'd change that to Festival.where(state: params[:id])
[19:28:29] pwnd_nsfw: param: :festival
[19:28:40] Sigma00: has joined #RubyOnRails
[19:29:19] baweaver: has joined #RubyOnRails
[19:29:28] smathy: tubbo, feels lighter to me now than vanilla Rails.
[19:29:43] nertzy: has joined #RubyOnRails
[19:29:54] smathy: Each operation so self contained with such a 1:1 mapping to a business function. Only the properties I need, nothing I don't.
[19:30:03] tubbo: smathy: yeah, i don't know what you'd call what i make...it's not really "vanilla Rails" because it uses gems like responders, decent_exposure, draper, AMS, et. al. to extend the existing MVC thing
[19:30:24] `based_pdev`: has joined #RubyOnRails
[19:30:31] mices: tubbo: i'd change that or rails would change it for me behind the scenes?
[19:30:38] workmad3: has joined #RubyOnRails
[19:31:07] tubbo: Trailblazer is a more indirect approach though, that's what i don't like about it for regular rails apps...but for platforms where you already have a shitload of indirection, trailblazer is a great way to turn that mess into some kind of organized chaos :)
[19:31:21] tubbo: mices: no you'd need to change that in config/routes.rb
[19:31:25] siddart: has joined #RubyOnRails
[19:31:36] mices: there's no select in routes.rb
[19:31:53] loc22: has joined #RubyOnRails
[19:32:10] Flying_Squirrel: has joined #RubyOnRails
[19:32:34] mices: routes only takes paths and controller#action heh
[19:32:46] tubbo: mices: oh you're right, sorry i was confused. you need to change the custom routes you made into resource routes, but pwnd_nsfw just added something in that says you can change the dynamic part of the route to fill in a different param
[19:32:50] finnnnnnnnnnn: has joined #RubyOnRails
[19:32:52] smathy: I love this workflow: "Hmm, I need to show the admin the stats for the different graders. I know, I'll make an Admin::Grader::Stats operation." It reminds me of the good ol' days with Rails, before REST, when you'd just create a new action on a controller and fill it with code.
[19:33:33] tubbo: mices: so by default, it's :id...but pwnd_nsfw says you can pass `param: :festival` and change that, so you won't actually need to change controller code at all.
[19:33:45] finnnnnnnnnnn: hey all, anyone have any tips for getting a postgres db from heroku and conerting to sqllite3 locally?
[19:33:51] tubbo: mices: but you *do* need to change your routes.rb to use resources rather than get|post|put|delete
[19:34:04] tubbo: finnnnnnnnnnn: why can't you just run pg locally?
[19:34:36] mices: so then resources :festivals becomes what?
[19:34:57] tvw: has joined #RubyOnRails
[19:34:59] mices: not using pwnd_nsfw approach yet
[19:35:27] finnnnnnnnnnn: tubbo: could do that, reckon it???s easier?
[19:35:42] tubbo: finnnnnnnnnnn: seems easier to me
[19:35:50] finnnnnnnnnnn: cool, will try
[19:35:52] tubbo: mices: !gist your routes.rb, i'm tired of guessing with you.
[19:35:52] helpa: mices: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[19:36:12] smathy: finnnnnnnnnnn, problem with using sqlite3 locally is that for anything non-trivial you will eventually want something DB-specific.
[19:37:12] finnnnnnnnnnn: smathy: yeah, agree but sqllite is just so convienient
[19:37:27] arup_r: finnnnnnnnnnn: can you chomp out some `n`s ? :D
[19:37:33] mices: tubbo: https://gist.github.com/mices/e6126724a311cd178c9d
[19:37:43] pwnd_nsfw: tubbo, you would have to change controller code, but just because it's :festival instead of :id lol
[19:37:48] FrankD: hey, I just moved development systems from Ubuntu 13 to Fedora 22 and am having some issues
[19:37:56] petricore: has joined #RubyOnRails
[19:37:58] smathy: finnnnnnnnnnn, yep, so convenient that I often use it in production.
[19:38:00] FrankD: ie I get: Mysql2::Error: Unknown column 'projects.Owner' in 'where clause': SELECT COUNT(*) FROM `projects` WHERE `projects`.`Owner` = 1
[19:38:04] tubbo: mices: yeah just get rid of the `get` routes that are customizing festivals.
[19:38:10] FrankD: where it used to check projects.Owner_id, not projects.Owner
[19:38:21] pwnd_nsfw: what in the hell
[19:38:21] arup_r: FrankD: may be not all migrations ran
[19:38:25] pwnd_nsfw: is that routes.rb
[19:38:28] FrankD: arup_r, i copied the DB
[19:38:33] finnnnnnnnnnn: smathy: oh yeah, for real? maybe I shouldv???e gone that route. Heroku really want s postgres
[19:38:42] tubbo: mices: that is not the way you are supposed to do that. don't fight the framework.
[19:38:49] tubbo: mices: http://guides.rubyonrails.org/routing.html#adding-more-restful-actions
[19:38:56] FrankD: although i did get errors when copying the DB
[19:39:07] tubbo: mices: first of all, '/festivals/new' is *already* defined by resources :festivals
[19:39:27] tubbo: mices: this makes zero sense right here https://gist.github.com/mices/e6126724a311cd178c9d#file-routes-rb-L27-L47
[19:39:36] tubbo: mices: then why are you defining it twice?
[19:40:04] mices: to keep new from being taken for :state
[19:40:07] smathy: finnnnnnnnnnn, yeah, no local storage on heroku.
[19:40:23] mices: it's returning "festivals in new"
[19:40:27] mices: instead of the form
[19:40:48] pwnd_nsfw: why are those session routes defined 9999 times
[19:41:03] mices: the only duped route is new
[19:41:24] stesind: has joined #RubyOnRails
[19:42:06] yfeldblum: has joined #RubyOnRails
[19:43:11] netzfisch: has joined #RubyOnRails
[19:44:48] mices: tubbo: why doesn't that make sense, the admin index page for each model is different than the regular controller
[19:45:31] FrankD: arup_r, seems like an AR problem maybe? It's not appending "_id" to anything that was defined by t.references
[19:45:32] krisquigley: has joined #RubyOnRails
[19:46:00] s2013: has joined #RubyOnRails
[19:46:02] yaymukund: has joined #RubyOnRails
[19:46:54] baweaver: has joined #RubyOnRails
[19:48:18] sivinjski: has joined #RubyOnRails
[19:48:32] s2013: any of you use rails for mobile backend?
[19:49:00] smathy: FrankD, what's defined in the migration or db/schema.rb has nothing to do with whether _id is added or not.
[19:49:08] FrankD: smathy, I didn't think so
[19:49:08] smathy: (during queries at runtime)
[19:49:14] FrankD: what defines whether _id is added?
[19:49:17] smathy: FrankD, !gist your Project model.
[19:49:17] helpa: FrankD: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[19:49:25] smathy: FrankD, the belongs_to association.
[19:49:28] roxtrongo: has joined #RubyOnRails
[19:50:48] dopie: has joined #RubyOnRails
[19:50:50] FrankD: smathy, https://gist.github.com/fdimitri/8c856bd9b412d70d9a0a
[19:51:13] sexiboy: has joined #RubyOnRails
[19:51:22] piotrj: has joined #RubyOnRails
[19:51:30] FrankD: smathy, both servers are running rails 4.2.3
[19:51:48] kidoz: has joined #RubyOnRails
[19:53:20] Coldblackice: has joined #RubyOnRails
[19:54:04] smathy: FrankD, terrible style, but it should still work. Your query is something like: Project.where(Owner: 1).count ?
[19:54:28] blackmes1: has joined #RubyOnRails
[19:54:28] FrankD: well it DOES work on one server :p
[19:54:33] mices: tubbo: i don't understand why those routes don't make sense
[19:55:09] rickmasta: has joined #RubyOnRails
[19:55:46] FrankD: has_many :OwnedProjects, class_name: "Project", foreign_key: "Owner"
[19:56:00] FrankD: in models/user.rb ^
[19:56:22] FrankD: so i realize im explicitly calling the foreign_key Owner, but server #1 appends _id to it
[19:56:22] smathy: FrankD, heh, ok - well that foreign_key isn't right.
[19:56:30] FrankD: server #2 does not
[19:56:34] FrankD: is there a reason that would be? :p
[19:56:47] smathy: FrankD, you're not calling exactly the same thing in both places.
[19:57:10] smathy: FrankD, the foreign_key argument needs to be the entire field name.
[19:57:19] beingjohnm: I have a form with a field "transaction_date" and when submitting the form I can see that the value from the form is being submitted but when I see the sql insert statement does not include that parameter. I'm thinking it is failing silently due to the date format (09/30/2015)?
[19:57:24] FrankD: smathy, then why does it work on one server? both are using the same datbase backend
[19:57:47] FrankD: ie both are mysql2 adapter, i dumped the database on one and pulled it in on the other
[19:58:04] FrankD: both are rails 4.2.3
[19:58:12] smathy: FrankD, I don't know, and I have no interest in working out why broken code seems to be working.
[19:58:25] smathy: FrankD, the foreign_key argument needs to be the entire field name.
[19:58:31] FrankD: well if I change it to Owner_id, it breaks the other server :P
[19:58:57] rushed: FrankD: so maybe the schemas don't match? :(
[19:59:11] smathy: FrankD, to your gist add two more files showing the copy-pasted `rails console` session from both servers.
[19:59:48] EminenceHC: has joined #RubyOnRails
[20:00:12] Maletor: has joined #RubyOnRails
[20:00:34] FrankD: eh more concerned about it working on server 2, getting the hell off of cloud9 :P
[20:01:17] smathy: FrankD, good, so just fix the code and move on.
[20:03:25] loc22: has joined #RubyOnRails
[20:04:16] wldcordeiro_: has joined #RubyOnRails
[20:04:40] moeabdol: has joined #RubyOnRails
[20:05:40] mices: tubbo: i don't understand how i can remove all those custom routes here's what happens when i do
[20:05:54] tubbo: mices: the rails routing guide will give you a lot of information about this. you're basically re-writing the same code twice in the same file here.
[20:06:07] tubbo: mices: forget about the admin stuff, but still those are not valid routes
[20:06:08] mices: tubbo: Couldn't find Festival with 'id'=CA @festival = Festival.find(params[:id])
[20:06:10] Avon: has joined #RubyOnRails
[20:06:47] mices: yea this is what i'm focusing on, not the admin stuff
[20:08:06] mices: how's it gonna know it's looking for :state, not :id
[20:08:30] hydrozen: has joined #RubyOnRails
[20:09:47] otacon-: has joined #RubyOnRails
[20:10:35] Avon: has joined #RubyOnRails
[20:11:03] mices: i feel that adding the new action's a hack
[20:12:14] tubbo: mices: like pwnd_nsfw said earlier, if you pass `param: :state` to resources, it will override the param to fill in from the url
[20:12:19] pjammer: has joined #RubyOnRails
[20:12:48] mices: what about param :country ?
[20:12:50] tubbo: mices: it's less of a hack than what you have now, but i'd agree. friendly_id does what you want but you'd need to change a lot of stuff around
[20:12:57] tubbo: mices: what about it>
[20:13:08] cac: has joined #RubyOnRails
[20:13:19] tubbo: mices: also what are f_festivals and f_clubs?
[20:13:33] Dennis1: has joined #RubyOnRails
[20:13:48] mices: us clubs is just clubs
[20:14:01] mices: f_clubs is clubs outside the usa
[20:14:28] mices: so there's /clubs/:state and /clubs/:country
[20:14:45] Gustavo: has joined #RubyOnRails
[20:15:20] mices: in usa it's state->city->clubs elsewhere it's country->clubs
[20:15:26] rhizome: you're gonna have a bad time
[20:16:06] tubbo: mices: well now that you have that routing guide, you can ctrl+f it for a `collection do` block, which can define routes on the "collection"...so the rails way of doing this would be: https://gist.github.com/tubbo/b2ba3c7e03bb726f7927
[20:16:09] mices: they're just controller actions there's only one table
[20:16:10] tubbo: mices: but you have a biiiiiig problem
[20:16:16] tubbo: mices: not all countries have states, or even municipalities
[20:16:25] tubbo: some countries have more than 1 municipality like departamento or barrio
[20:17:09] tubbo: mices: sorry updated the gist to tell the route where to go
[20:17:15] mices: overseas i don't care where in the country it's just gonna list clubs in that country
[20:17:47] Obfuscate: mices: You also have a decision to make about Georgia.
[20:17:57] tubbo: mices: so let's say you returned all festivals/clubs in someone's home country. for russians, a person living in siberia could be receiving "local" results for clubs in moscow
[20:20:32] habitullence: has joined #RubyOnRails
[20:21:07] mices: i can't concern myself with global regions but cities i can
[20:21:09] tubbo: mices: it really kinda sounds like you want a route like this -> get '/festivals(/:country(/:state))' => 'festivals#index'
[20:21:18] tubbo: where both :country and :state are optional params
[20:21:31] tubbo: mices: yeah so you should totally just do that :D
[20:22:02] mices: yea i have to read what you told me and keep looking at the example you gave me
[20:22:19] moeabdol: has joined #RubyOnRails
[20:22:24] davidhq: has joined #RubyOnRails
[20:22:26] ownfocus: has joined #RubyOnRails
[20:22:30] mices: in the meanwhile my hack works i can leave the site up like this
[20:22:58] mices: im not gonna do any more development until i get this fully understood
[20:23:13] zendrix: has joined #RubyOnRails
[20:25:17] rhizome: :thumbsup:
[20:25:45] _djbkd: has joined #RubyOnRails
[20:25:57] nettoweb: has joined #RubyOnRails
[20:27:01] juanpaucar: has joined #RubyOnRails
[20:27:03] arooni: warning: noob question: i'm doing some long needed maintenance and i found out that my production.log file is 4GB. Is there really a need to keep the log file forever.... ? or can i just trim it somehow and move on?\\
[20:28:12] Avon: has joined #RubyOnRails
[20:28:24] mrmylanman: has joined #RubyOnRails
[20:28:32] waseem_: arooni: You can gzip it and upload to S3. You'll usually wont need it unless you want to process the logs for information extraction.
[20:28:47] waseem_: arooni: Also while you're at it, consider using logrotate to do it for you.
[20:30:01] baweaver: has joined #RubyOnRails
[20:30:12] drptbl_: has joined #RubyOnRails
[20:30:35] Palsson: has joined #RubyOnRails
[20:31:31] michael_mbp: has joined #RubyOnRails
[20:32:18] juanpauc_: has joined #RubyOnRails
[20:32:19] Papierkorb: if you upload it to some cloud service, at least encrypt it beforehand arooni.
[20:32:42] arooni: ok good calll
[20:33:08] beingjohnm: formatted_date = Date.strptime(@transaction.trans_date.to_s, '%m/%d/%Y').strftime("%Y-%m-%d") with trans_date being set as "09/30/2015" keeps giving an "invalid date" error for strptime. Any ideas?
[20:33:32] tubbo: arooni: fwiw, a 4gb file stored on S3 that's almost never actually downloaded won't cost you anything.
[20:33:39] smathy: arooni, more generally, you need log rotation on your server.
[20:33:55] arooni: yeah i'm gathering that
[20:34:06] tubbo: beingjohnm: why don't you just @transaction.trans_date.strftime('%Y-%m-%d')?
[20:34:12] arooni: i didnt really know about log rotate until this conversation so thanks for your help on that folks
[20:34:21] Papierkorb: isn't the Glacier option for that?
[20:34:40] FailBit: [4] pry(main)> Time.strptime('09/30/2015', '%m/%d/%Y')
[20:34:42] FailBit: => 2015-09-30 00:00:00 -0400
[20:34:46] Papierkorb: Though tbh this feels like I'm selling or at least endorsing amzn products. I'm not.
[20:34:48] tubbo: Papierkorb: yeah glacier makes sense if you're trying to store 400gb rather than 4gb
[20:35:00] _djbkd: has joined #RubyOnRails
[20:35:01] tubbo: but 4gb is nothing realistically
[20:35:13] beingjohnm: tubbo: when I do that I get undefined method strftime
[20:35:33] FailBit: what is trans_date?
[20:35:36] FailBit: is it a string?
[20:35:40] beingjohnm: tubbo: I think the error is somehow converting 09/30/2015 into a datetime object
[20:35:54] FailBit: also again, look at my pry output
[20:36:27] beingjohnm: I've been goggling and trying things for hours on this (and the base problem of the date not being saved in the database)
[20:36:30] tubbo: beingjohnm: it'
[20:36:37] tubbo: beingjohnm: that is false, because if it were strftime() would be a method :D
[20:36:55] tubbo: beingjohnm: is trans_date a string?
[20:37:08] beingjohnm: tubbo: yeah, that is the text_field from the form
[20:37:41] beingjohnm: tubbo: well, maybe not? If I don't add .to_s then it gives an error about assuming conversion to string
[20:38:22] beingjohnm: tubbo: I deinitely see this coming thorugh on the parameters of the post: "transaction"=>{"trans_date"=>"09/30/2015"
[20:38:24] tubbo: beingjohnm: you can find this out very easily by going into bin/rails console and doing Transaction.first.trans_date
[20:38:38] tubbo: beingjohnm: yeah, all http params must be strings...like they can't be Ruby date objects :)
[20:38:48] benlieb: has joined #RubyOnRails
[20:38:51] beingjohnm: tubbo: right!
[20:38:54] tubbo: so rails does the strftime/strptime conversion for you before INSERTing it into the db
[20:39:59] beingjohnm: tubbo: the problem is that it isn't being inserted (not being included in the insert query). Google is telling me that it is likely a formatting problem. So I'm trying to change the format to Y-m-d but that is failing with the invalid date error.
[20:41:59] tubbo: beingjohnm: !gist your controller and model code
[20:41:59] helpa: beingjohnm: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[20:42:08] masaru-: has left #RubyOnRails: ()
[20:42:11] Obfuscate: I would like to route a nested resource (currently 'tags/categories/:category_id/section/:id') as 'tags/:category_name/:section_name', where I have unique indexes for :category_name and [:category_id, :section_name], but where :section_name itself need not be unique. What's the best way to approach this?
[20:43:06] skullcrasher_: has joined #RubyOnRails
[20:43:51] beingjohnm: tubbo: https://gist.github.com/willjohnson/47dde9105db74722ad9d
[20:44:20] pjammer: has joined #RubyOnRails
[20:44:28] SteenJobs: has joined #RubyOnRails
[20:45:16] tubbo: beingjohnm: can you add the form erb (or haml) to that gist?
[20:45:27] tubbo: beingjohnm: i think the issue might be the way you're passing the data along
[20:45:40] rhizome: Obfuscate: you want slugs and to read the routing guide
[20:45:49] tubbo: if rails is actually expecting it to be '2015-09-30' rather than '09/30/2015', then you should do what rails wants you to do and your life will be easier
[20:46:48] ellisTAA: has joined #RubyOnRails
[20:46:52] amoeba: has joined #RubyOnRails
[20:47:07] skullcrasher_: has joined #RubyOnRails
[20:47:16] tubbo: beingjohnm: <%= f.text_field :trans_date, data:{provide: "datepicker"} %> ahhh that
[20:47:19] tubbo: is what's doing it
[20:47:22] jenrzzz: has joined #RubyOnRails
[20:47:27] tubbo: beingjohnm: can you configure your datepicker to send '%y-%m-%d'?
[20:47:35] tubbo: that is a LOT easier to handle
[20:47:41] beingjohnm: tubbo: seems like the database wants it to be like that. I just find it surprising that it wouldn't through an error and do the insert anyway without that field
[20:47:56] amoeba: If I have a user which triggers a delete request, and I want to have an intermediate step (form with password field and some notes), what is my best option. Should I just store request data in the form and on submit and validation redirect? Is there a more rails way?
[20:48:15] beingjohnm: tubbo: I had looked at that as a solution for a while and failed but will examine that again.
[20:48:18] Obfuscate: rhizome: Thanks. I'm reading the routing guide, although I'm confused about how rails handles the lookup in the above case. I'll look into slugs...
[20:48:35] tubbo: beingjohnm: there really isn't much type-checking done on the ORM level, at least most of the type-based errors i get come from my database :P
[20:48:53] madebymarkca: has joined #RubyOnRails
[20:49:18] beingjohnm: tubbo: this datepicker has been the bane of my existence today. And anything with javascript seems to be taking me ten times longer than it should. I appreciate all of your help today.
[20:49:56] bklane: has joined #RubyOnRails
[20:50:17] skullcrasher: has joined #RubyOnRails
[20:50:20] tubbo: beingjohnm: no problem, JS is almost never easy..
[20:50:49] thebatu1: has joined #RubyOnRails
[20:50:59] SteenJobs: beingjohnm: totes don???t know what the convo is, but there are some amazing jquery libs for date pickers
[20:51:01] SteenJobs: just saying
[20:51:23] thebatu1: hello all fine people
[20:51:53] beingjohnm: SteenJobs: yeah, the datepicker itself seems to look and act fine. It is that it seems to default to sending a date formatted in a way that rails won't save to the db.
[20:52:17] thebatu1: I am back to Rails after 3 months of DC
[20:52:21] SteenJobs: weird. throw a breakpoint and check what the format of the date is that???s being sent?
[20:52:47] sandstrom: has joined #RubyOnRails
[20:53:06] beingjohnm: SteenJobs: I've been over 150 tabs on this problem so far :(
[20:56:10] bklane: has joined #RubyOnRails
[20:56:22] banister: has joined #RubyOnRails
[20:57:09] yfeldblum: has joined #RubyOnRails
[20:57:19] workmad3: has joined #RubyOnRails
[20:57:27] kadoppe: has joined #RubyOnRails
[20:59:51] otacon-_: has joined #RubyOnRails
[21:00:01] Maletor: has joined #RubyOnRails
[21:00:05] epitron: has joined #RubyOnRails
[21:04:28] tubbo: beingjohnm: so what? there's probably a way to configure it
[21:04:37] bklane: has joined #RubyOnRails
[21:04:42] tubbo: beingjohnm: just because the datepicker comes with a default doesn't mean you HAVE to shoehorn it into your app :)
[21:05:41] beingjohnm: tubbo: yeah, seems I should use dateFormat: "yyyy-mm-dd" when the datepicker is called but that isn't working. Digging deeper now.
[21:06:09] nettoweb: has joined #RubyOnRails
[21:06:24] TomyLobo: has joined #RubyOnRails
[21:06:45] pjammer: has joined #RubyOnRails
[21:12:19] blackmes1: has joined #RubyOnRails
[21:14:00] mrmylanman: has joined #RubyOnRails
[21:14:07] yaw: has joined #RubyOnRails
[21:14:15] dikaio: has joined #RubyOnRails
[21:14:40] Scripore: has joined #RubyOnRails
[21:15:45] FrankD: so I'm writing a ruby program with AR, and establish_connection is giving me this: /home/carbide/.gem/ruby/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:177:in `rescue in spec': Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError)
[21:15:53] FrankD: mysql2 is loaded
[21:16:03] FrankD: any way around that?
[21:16:20] rhizome: are you requiring rubygems?
[21:16:35] bklane: has joined #RubyOnRails
[21:17:10] FrankD: rhizome, https://gist.github.com/fdimitri/f5232b06188cee042299
[21:17:16] FrankD: list of loded gems
[21:17:20] MksN: hi has someone experiences with prawnPdf and tables?
[21:17:31] centrx: someone...or anyone?
[21:17:50] FrankD: from `puts Gem.loaded_specs.values.map {|x| "#{x.name} #{x.version}"}
[21:18:14] SteenJobs: has joined #RubyOnRails
[21:20:34] tenderlove: has joined #RubyOnRails
[21:21:25] tenderlove: has joined #RubyOnRails
[21:23:28] rhizome: another day of fun with devise
[21:23:35] jenrzzz: has joined #RubyOnRails
[21:23:40] SteenJobs: rhizome: here???s a question for you
[21:23:56] chipotle: has joined #RubyOnRails
[21:24:07] SteenJobs: what???s the threshold for you personally when it comes to needing to hack devise to such an extent that it becomes worth it to just write your own auth?
[21:24:41] rhizome: pretty low
[21:25:06] beingjohnm: tubbo: AGGGHHHH...got it. Every question on Stack Overflow must have been referring to a different datepicker. Got the formatting handled there and had no problem saving to db now. So many hours wasted....
[21:25:43] mary5030: has joined #RubyOnRails
[21:26:22] tenderlo_: has joined #RubyOnRails
[21:27:54] workmad3: has joined #RubyOnRails
[21:29:03] moei: has joined #RubyOnRails
[21:29:14] rhizome: i have a devise user model and a cart that belongs_to it, and devise apparently wants a password for assigning the user to the cart, which doesn't (to me) modify the user model. is this a validates_associated or something?
[21:30:19] SteenJobs: rhizome: oh if this is about devise requiring a password to edit user info, hacking that is a pain in the butt.
[21:30:39] SteenJobs: just thinking about the last time i had to do that is stressing me out
[21:31:16] smathy: I've never actually deployed devise.
[21:31:36] smathy: I've started with it three times and ended up just ripping it's decaying corpse out of my code and using warden directly.
[21:31:41] rhizome: i'm not updating without password, there's tons of info on that. this is just assigning the user to the cart, which only changes cart's :customer_id
[21:31:50] yaymukund: has joined #RubyOnRails
[21:32:09] smathy: Also, hi there SteenJobs, ltns, hope you're well.
[21:32:23] habitullence: has joined #RubyOnRails
[21:33:25] justin2: has joined #RubyOnRails
[21:33:27] Ergo: has joined #RubyOnRails
[21:33:54] EminenceHC: has joined #RubyOnRails
[21:33:55] tenderlove: has joined #RubyOnRails
[21:34:26] diegoviola: has joined #RubyOnRails
[21:34:47] diegoviola: are facades the same as service objects pattern?
[21:35:23] SteenJobs: smathy: mahhh man
[21:36:01] baweaver: has joined #RubyOnRails
[21:36:19] Limix: has joined #RubyOnRails
[21:36:19] SteenJobs: smathy: yea i was always more willing to just hack the hell out of devise instead of risking doing some auth on my own and leaving any glaring security holes. but now i???d probs be more willing to follow your path.
[21:36:52] smathy: diegoviola, more like a decorator, but usually with a subset of the functionality of the wrapped object.
[21:37:50] tenderlove: has joined #RubyOnRails
[21:38:22] EminenceHC: has joined #RubyOnRails
[21:39:25] tubbo: diegoviola: "service objects" is definitely not a gang of 4 design pattern
[21:39:55] h7br1x: has joined #RubyOnRails
[21:41:20] epitron: has joined #RubyOnRails
[21:41:23] michaeldeol: has joined #RubyOnRails
[21:41:41] h7br1x: Hey guys, I'm trying to show only articles that are not marked as a draft in my index action. I tried this ' @articles = Article.where( draft: 'FALSE' ) ' but it's not working. Any suggestions?
[21:42:12] jobewan: has joined #RubyOnRails
[21:42:51] bricker: h7br1x: try `draft: false`
[21:44:02] michael_mbp: has joined #RubyOnRails
[21:44:41] diegoviola: https://github.com/diegoviola/movies/blob/master/app/views/movies/index.html.erb#L6-L13
[21:44:44] diegoviola: how do I improve that code?
[21:44:45] h7br1x: bricker: Thanks. That did it. How would I go about scheduling a post to go live at a certain time?
[21:44:53] diegoviola: not sure I like that if else block in the view
[21:45:22] bricker: h7br1x: set a "publish_at" timestamp, and modify your query to only retrieve posts with a past publish_at
[21:45:42] SegFaultAX: Is it possible to have a has_many :through without actually using through?
[21:45:52] bricker: h7br1x: alternatively you need to set the timestamp and run a periodic job to publish anything that should be published
[21:46:04] arooni: has joined #RubyOnRails
[21:46:17] h7br1x: bricker: Okay, I have published_at but could you give me an example of how that query wold look? Sorry still pretty green.
[21:46:45] bricker: h7br1x: Post.where("publish_at <= ?", Time.zone.now)
[21:47:37] cnk: I think h7br1x is going to eventually want a scope that combines pushed and not marked draft
[21:47:57] havenwood: has joined #RubyOnRails
[21:48:07] h7br1x: cnk: You're correct, that was going to be my next search. :P
[21:48:40] bricker: h7br1x: well you already know how to do them independently, just combine them
[21:48:45] diegoviola: should I use a decorator for this? any ideas?
[21:48:54] rickmasta: has joined #RubyOnRails
[21:48:55] cnk: I think modern rails won't let you create the scope without a lambda for the published date
[21:49:00] EminenceHC: has joined #RubyOnRails
[21:49:32] bricker: cnk: Rails 4+ deprecates scope without lambda, regardless of its content
[21:49:41] bricker: maybe removed it? 3.2 might have deprecated that
[21:49:46] cnk: I thought I had seen something like that
[21:49:48] bricker: diegoviola: is that code causing you problems?
[21:50:05] cnk: diegoviola: for something that straightforward, I think what you have is fine
[21:50:08] bricker: diegoviola: what problems do you think it will cause?
[21:51:07] diegoviola: bricker: the problem is my potential employer not liking it
[21:51:21] tenderlove: has joined #RubyOnRails
[21:51:28] bricker: diegoviola: if I was hiring I wouldn't think twice about that code, it's fine
[21:51:43] bricker: in fact I would be turned off if you tried to over-engineer a really simple if/else statement
[21:52:23] cnk: diegoviola: note it in your cover letter or a README - if this where complicated, I woudl do X but for a list lf links, simple is better
[21:52:39] bklane: has joined #RubyOnRails
[21:52:48] cnk: you want a list of talking points for discussing your code sample anyway, so add this to your list
[21:52:49] tvw: has joined #RubyOnRails
[21:52:54] cnk: but see what they want ot discuss
[21:52:55] EminenceHC: has joined #RubyOnRails
[21:53:22] diegoviola: I also prefer simplicity, but my potential employer asked me to over engineer this stupid app with decorator and facades, just to show them IKnowTheStuff(tm)
[21:53:52] diegoviola: and my controller is like what? 25 lines of code?
[21:53:54] gmci: has joined #RubyOnRails
[21:53:56] diegoviola: https://github.com/diegoviola/movies/blob/master/app/controllers/movies_controller.rb
[21:54:02] diegoviola: https://github.com/diegoviola/movies/blob/master/app/controllers/users_controller.rb
[21:54:06] diegoviola: Seriously...
[21:54:21] bricker: diegoviola: if he really wants you to over engineer, make a Navigation class which take in the current user and defines the navigation, a NavigationItem class which defines a nav item, and then loop over @navigation.items
[21:54:25] bricker: go all Java with it
[21:55:14] bklane: has joined #RubyOnRails
[21:55:50] Scripore: has joined #RubyOnRails
[21:56:23] atomical: has joined #RubyOnRails
[21:56:31] wethu: has joined #RubyOnRails
[21:56:46] diegoviola: bricker: I'd rather tell them that they are evil and that they need to repent to Matz over their stupid ways
[21:57:18] diegoviola: no that won't be a good idea
[21:59:11] frzn: has joined #RubyOnRails
[21:59:11] frzn: has joined #RubyOnRails
[21:59:20] diegoviola: seriously, I never programmed in Java
[22:00:59] tenderlove: has joined #RubyOnRails
[22:01:02] atomical_: has joined #RubyOnRails
[22:01:21] dopamean_: has joined #RubyOnRails
[22:01:40] rushed: diegoviola: you would prefer they wanted you to write something complicated enough to need a decorator & facades in order to justify it?
[22:01:53] diegoviola: I always think about this quote when people ask me to overengineer code:
[22:01:55] bricker: diegoviola: well if you want to see some over-engineered code, just look at any java program ever
[22:02:01] diegoviola: "Nobody should start to undertake a large project. You start with a small trivial project, and you should never expect it to get large. If you do, you'll just overdesign and generally think it is more important than it likely is at that stage. Or worse, you might be scared away by the sheer size of the work you envision. So start small, and think about the details. Don't think about some big picture and
[22:02:03] diegoviola: fancy design. If it doesn't solve some fairly immediate need, it's almost certainly over-designed. And don't expect people to jump in and help you. That's not how these things work. You need to get something half-way useful first, and then others will say "hey, that almost works for me", and they'll get involved in the project." -- Linus Torvalds
[22:02:04] rushed: diegoviola: it's not real code, it's an excercise
[22:02:35] h7br1x: bricker: can you help me combine those? I keep getting syntax errors.
[22:03:14] bricker: h7br1x: show me what you tried
[22:03:43] diegoviola: rushed: I don't know, they didn't took me seriously because I'm not using any design patterns
[22:04:05] frzn: has joined #RubyOnRails
[22:04:06] frzn: has joined #RubyOnRails
[22:04:08] diegoviola: rushed: they said "Go add facades and decorators to your project and then come back"
[22:04:33] h7br1x: @articles = Article.where("published_at <= ?", Time.zone.now AND (draft: flase))
[22:05:00] diegoviola: how do you define real project anyway?
[22:05:11] h7br1x: bricker: @articles = Article.where("published_at <= ?", Time.zone.now AND (draft: flase))
[22:05:13] diegoviola: or real code
[22:05:30] tubbo: diegoviola: ITS STILL REAL TO ME DAMMIT
[22:05:39] rushed: diegoviola: so? do it (or don't do it)... railing against an imaginary afront to the universe isn't going to get you anywhere :)
[22:05:53] dramagods: has joined #RubyOnRails
[22:06:18] kaduribeiro: has joined #RubyOnRails
[22:06:44] jenrzzz_: has joined #RubyOnRails
[22:06:50] bricker: h7br1x: you can chain your where()'s
[22:06:55] bricker: Article.where(...).where(...)
[22:07:21] hfp_work: has joined #RubyOnRails
[22:08:03] Miron_: has joined #RubyOnRails
[22:08:06] h7br1x: bricker: Thanks. That did it.
[22:08:09] volongato: has joined #RubyOnRails
[22:09:15] qejk: has joined #RubyOnRails
[22:09:52] hfp__work: has joined #RubyOnRails
[22:12:19] rhizome: you say, "what is this, java?"
[22:13:54] tvon: has joined #RubyOnRails
[22:14:08] blackmesa: has joined #RubyOnRails
[22:14:41] thejamespinto: has joined #RubyOnRails
[22:15:34] diegoviola: I failed every single time I had to write Java code
[22:16:19] pwnd_nsfw: Java makes shitting my own pants something I'm willing to do if it gets me out of using it.
[22:18:09] ericjphillips: has joined #RubyOnRails
[22:19:13] manfrin: has joined #RubyOnRails
[22:19:19] hfp_work: has joined #RubyOnRails
[22:19:22] rhizome: i took a class a year and a half ago. it was fine. i can see where they need a lot of that kind of thing over there.
[22:20:08] chipotle: has joined #RubyOnRails
[22:20:09] smathy: Java's ok, its frameworks are annoying, and its tooling is just clumsy.
[22:21:18] tenderlove: has joined #RubyOnRails
[22:21:50] pwnd_nsfw: I dislike the syntax a lot, now anyways
[22:22:17] pwnd_nsfw: I started out programming in Java
[22:22:21] mrchris: has joined #RubyOnRails
[22:22:22] SteenJobs_: has joined #RubyOnRails
[22:22:25] pwnd_nsfw: Was fun at the time, but I have a new bitch
[22:24:20] baweaver: has joined #RubyOnRails
[22:25:46] bklane: has joined #RubyOnRails
[22:26:47] bklane: has joined #RubyOnRails
[22:26:53] hfp_work: has joined #RubyOnRails
[22:27:09] charliesome: has joined #RubyOnRails
[22:27:27] rubyonrailed: has joined #RubyOnRails
[22:28:40] rubyonrailed: https://gist.github.com/anonymous/8ba06c611b7fa8d03edf I used to return keys using this code `SurveyType::QUESTIONS.invert[question_id]` But now `newdiap` contains an array of two id's. How can I still return newdiap if a array isn't being passed in?
[22:28:44] tubbo: java is great for teaching you how OOP works
[22:28:54] rubyonrailed: * ignore the magic numbers
[22:29:27] pwnd_nsfw: tubbo, definitely
[22:30:17] smathy: has joined #RubyOnRails
[22:30:52] diegoviola: tubbo: ruby isn't great for that?
[22:31:30] patrick99e99: has joined #RubyOnRails
[22:31:51] pwnd_nsfw: Java is much sexier
[22:31:54] pwnd_nsfw: for teaching oop
[22:32:12] shinnya: has joined #RubyOnRails
[22:32:16] pwnd_nsfw: how verbose the code is
[22:32:47] smathy: Not OOP necessarily, but types etc.
[22:33:07] Pupeno: has joined #RubyOnRails
[22:33:42] tubbo: diegoviola: hell no
[22:34:14] smathy: rubyonrailed, you want to return the value of newdiap as an array whether it's an array or a single value?
[22:34:27] diegoviola: tubbo: why not?
[22:34:57] smathy: Eiffel is great for teaching OO
[22:35:31] diegoviola: you don't want people to be exposed to the pain of Maven and XML, do you?
[22:35:41] tubbo: diegoviola: because ruby's syntax is a lot less cut-and-dry, a lot more ephemeral. i can alter the way ruby's syntax works.
[22:36:05] tubbo: i can't do that with java
[22:36:12] kgzm: has joined #RubyOnRails
[22:36:13] diegoviola: Python then?
[22:36:19] mary5030: has joined #RubyOnRails
[22:36:34] tubbo: diegoviola: every time you do `int i = 1`, you are absolutely always setting int i to 1. but if you do `i = 1` in ruby...well...you could be calling the '=' method on i couldn't you :)
[22:36:42] pydave6367: has joined #RubyOnRails
[22:36:44] epitron: has joined #RubyOnRails
[22:36:46] rubyonrailed: smathy: I wan't to be able to pass in a single id 440 or 5000 and return :newdiap. I don't want to pass in a array with both ids
[22:37:21] hfp_work: has joined #RubyOnRails
[22:37:33] smathy: tubbo, you *are always* calling the = method on i
[22:37:46] diegoviola: i = 1 in ruby is just like doing i.=(1)
[22:38:12] diegoviola: Ruby is fine for teaching OOP
[22:38:21] hfp__work: has joined #RubyOnRails
[22:38:28] smathy: Actually, = is a bad example. It's special.
[22:38:56] smathy: You can use i.foo =
[22:40:09] smathy: rubyonrailed, oh, sorry, I'm just seeing the `invert` in your question.
[22:41:08] paul0: has joined #RubyOnRails
[22:41:21] hfp_work|: has joined #RubyOnRails
[22:42:12] patrick99e99: does anyone here know if its possible to have a has_many :through with multiple foreign key/primary key mappings? In other words, say I have a File model, and a Folder model, and file has_many :folders :through => :folder_files...... And then say the folder_files table has folder_id, and folder_name... and I wanted to be able to link by either folder_id or folder_name... is there a way to make it so when I do file.folde
[22:42:36] manfrin: has joined #RubyOnRails
[22:42:39] smathy: rubyonrailed, you can't do that with a vanilla array, you'd need to make your own array class with == and eql? overridden.
[22:42:52] hfp_work: has joined #RubyOnRails
[22:44:06] smathy: patrick99e99, IRC servers impose a limit on message size, your previous was truncated at "when I do file.fold"
[22:44:12] rubyonrailed: smathy: Ok thanks
[22:44:16] atomical_: has joined #RubyOnRails
[22:44:23] patrick99e99: smathy: damn.. ok
[22:44:44] superlou: has joined #RubyOnRails
[22:45:30] Scriptonaut: has left #RubyOnRails: ()
[22:46:02] patrick99e99: is there a way to make it so when I do file.folders, it will look at both foreign keys? i.e. file.folders will do a query like: ... INNER JOIN "file_folders" ON "folders"."id" = "file_folders"."folder_id" OR "folders"."name" = "file_folders"."folder_name"
[22:46:44] patrick99e99: I can get one or the other...
[22:46:48] patrick99e99: but I cant get both...
[22:47:07] rhizome: one or the other what
[22:47:18] patrick99e99: its like Robert Deniro said in Casino "you can have the money or the hammer, but you can't have both"
[22:47:31] patrick99e99: rhizome: both folders who match the foreign_key of folder_id, and folder_name...
[22:48:00] rhizome: still don't understand
[22:48:12] patrick99e99: maybe my message wasnt clear because it got truncated.. let me try again with smaller sentences!
[22:48:34] patrick99e99: so I have a has_many through association.. File has many Folders... through FileFolders.
[22:48:37] Scriptonaut: has joined #RubyOnRails
[22:48:48] rushed: patrick99e99: why would you be joining on a string name when there is a key?
[22:48:50] patrick99e99: FileFolders has two foreign keys for Folder.. folder_id, and folder_name
[22:48:52] hfp_work: has joined #RubyOnRails
[22:49:19] patrick99e99: because im trying to migrate legacy data from another system where all i have is a string name..
[22:49:32] rushed: patrick99e99: then setup to assocations
[22:49:46] patrick99e99: I have been trying to do that, and I can only get one to work
[22:49:50] patrick99e99: that's my question..
[22:49:55] allcentury: has joined #RubyOnRails
[22:50:13] rushed: patrick99e99: no, your question was how do you consider both
[22:50:29] patrick99e99: In my FileFolders (join table), I did belongs_to :folder, :primary_key => 'name', :foreign_key => 'folder_name'
[22:50:36] patrick99e99: and that makes it work for the name key...
[22:50:47] rushed: patrick99e99: you need to just accept that you need two (ie file.folders and file.also_folders_because_legacy)
[22:51:26] rushed: patrick99e99: then you can add def all_the_folders; (folders + also_folders_because_legacy).uniq; end;
[22:51:40] patrick99e99: rushed: ok... so im unclear how to set that up.. you're saying in File, do: has_many :folders_because_of_legacy ... and has_many :folders ?
[22:51:41] rhizome: treat the names as slugs and either write or use something like friendly_id to provide fallback to integer ids
[22:51:54] rushed: patrick99e99: but seriously, migrate that to something more reasonable :)
[22:52:08] rushed: patrick99e99: two totally seperate has_many lines
[22:52:18] tenderlove: has joined #RubyOnRails
[22:52:26] shinnya: has joined #RubyOnRails
[22:52:31] patrick99e99: rushed: right.. ok i did that, but I am unclear how to specify the foreign/primary keys from the File has_many side.. it only seems to work on the belongs_to side
[22:52:44] charliesome: has joined #RubyOnRails
[22:52:46] rushed: patrick99e99: same thing
[22:52:55] patrick99e99: rushed: sorry? what? same thing what?
[22:53:17] rushed: patrick99e99: same thing on the other side, two relatinoships, one normal, one with the key overrides
[22:54:10] rushed: patrick99e99: if the name one is just for legacy and you wont be adding you might just do a class method with a OtherSide.where might be easier to look at :)
[22:54:21] rushed: patrick99e99: you would loose build, <<, etc, etc
[22:54:23] patrick99e99: ok let me see if I am understanding.. hold on let me try this
[22:55:42] mices: tubbo: the route you posted here https://gist.github.com/tubbo/b2ba3c7e03bb726f7927 will match what paths
[22:56:32] h7br1x: has joined #RubyOnRails
[23:00:07] patrick99e99: rushed: heres what I am doing, and I pasted in the error -> https://gist.github.com/patrick99e99/6602ec56176af13b7d73
[23:00:30] htmldrum: has joined #RubyOnRails
[23:00:38] stardiviner: has joined #RubyOnRails
[23:00:49] rushed: patrick99e99: that's not how through works
[23:00:56] patrick99e99: rushed: ok so i am not understanding
[23:01:06] patrick99e99: can you please explain?
[23:01:25] rushed: patrick99e99: through points to another association on the same option when your crossover table is a model
[23:01:59] patrick99e99: oh yeah i forgot in there.. i also have has_many :file_folders
[23:02:06] patrick99e99: which is what you mean... right?
[23:02:23] rushed: patrick99e99: wtf is this=> "belogns_to :file"
[23:02:36] rushed: patrick99e99: you haven't even run this code :P
[23:02:41] OnkelTem: has joined #RubyOnRails
[23:03:06] patrick99e99: rushed: hah. no i have.. im just using different simplified names of things in my example here
[23:03:18] rushed: patrick99e99: using fake values hurts everyone
[23:04:03] rushed: hurt might be a strong word :P
[23:04:07] rushed: but they don't help :)
[23:05:52] patrick99e99: rushed: ok... here is the real stuff --> https://gist.github.com/patrick99e99/6602ec56176af13b7d73
[23:06:48] patrick99e99: so the ExternalMigrationFolders has external_migration_id, folder_id, and folder_business_key
[23:06:50] jenrzzz: has joined #RubyOnRails
[23:06:57] jtb__: has joined #RubyOnRails
[23:06:59] patrick99e99: what am I doing wrong?
[23:07:24] smathy: OH, rushed for the rejection! http://assets.sbnation.com/assets/2368209/djblock.gif
[23:07:40] smathy: Take that you askers with non-real code!
[23:07:56] rushed: it's not like that~
[23:08:09] patrick99e99: smathy: it was just... simplified naming with a typo.
[23:08:48] ellisTAA: how do i change a form_for to use a put method?
[23:09:18] smathy: EllisTAA, seriously I think you could guess this one.
[23:09:24] ellisTAA: i mean method: :put
[23:09:37] smathy: Right, that's how.
[23:09:41] smathy: I knew you could guess it.
[23:09:58] ellisTAA: 276 days is so long :X
[23:10:28] smathy: It's too long to be asking, "How do I construct a hash with a key of :method and a value of :put?" - yes it is Sir ;)
[23:10:41] patrick99e99: rushed: so do you know what I am doing wrong?
[23:10:48] one_zero: has joined #RubyOnRails
[23:11:32] michael_mbp: has joined #RubyOnRails
[23:11:40] rushed: patrick99e99: external_migration_folders has a folder_id in it for a seperate folders table?
[23:11:58] tenderlove: has joined #RubyOnRails
[23:12:08] patrick99e99: folder has id (obviously) and business_key
[23:12:19] patrick99e99: tenderlove: omg!!! hows your cat?
[23:12:40] michael_mbp: ACTION is in such a pckle
[23:13:41] havenwood: pickles for cats, ship it!
[23:13:59] havenwood: michael_mbp: hi
[23:16:03] workmad3: has joined #RubyOnRails
[23:16:13] rhizome: here's a sequence of operations i don't understand:
[23:16:21] rhizome: (0.2ms) UPDATE `carts` SET `customer_id` = 14, `updated_at` = '2015-09-30 23:08:37' WHERE `carts`.`id` = 15
[23:16:24] rhizome: SQL (0.1ms) DELETE FROM `carts` WHERE `carts`.`id` = 15
[23:17:19] dramagods: has joined #RubyOnRails
[23:17:24] rhizome: maybe db cleanup. it's from a test
[23:17:38] yaymukund: has joined #RubyOnRails
[23:17:48] Ropeney: has joined #RubyOnRails
[23:19:03] funnel: has joined #RubyOnRails
[23:19:17] roxtrongo: has joined #RubyOnRails
[23:19:19] smathy: rhizome, yeah, smells like DatabaseCleaner
[23:19:26] smathy: ...set that bitch to transaction mode.
[23:20:19] ChadyG_: has joined #RubyOnRails
[23:20:22] yaw: has joined #RubyOnRails
[23:22:22] roxtrongo: has joined #RubyOnRails
[23:23:43] piotrj: has joined #RubyOnRails
[23:24:06] bklane: has joined #RubyOnRails
[23:24:45] robbyoconnor: has joined #RubyOnRails
[23:25:13] workmad3: has joined #RubyOnRails
[23:28:03] rushed: patrick99e99: I would probably start with something like https://gist.github.com/rushed/8f555dfe49545c0831fa (untested)
[23:28:58] tenderlove: has joined #RubyOnRails
[23:29:23] Lycanii: has joined #RubyOnRails
[23:31:08] bklane: has joined #RubyOnRails
[23:32:17] ellisTAA: anyone know why line 1 - <%= @user.id %> ??? is problematic? https://gist.github.com/ellismarte/a9689225672f355195cb#file-form-rb-L1
[23:35:29] bricker: EllisTAA: because you can't have ERB inside ERB
[23:40:21] tenderlove: has joined #RubyOnRails
[23:41:21] thejamespinto: bricker: well, you can, but you gotta run it twice
[23:41:37] bricker: thejamespinto: that's true
[23:43:42] lampshades: has joined #RubyOnRails
[23:44:03] quazimodo: has joined #RubyOnRails
[23:44:20] arooni: has joined #RubyOnRails
[23:47:08] mary5030: has joined #RubyOnRails
[23:48:31] FailBit: https://i.imgur.com/3Edce9N.png
[23:48:53] tenderlo_: has joined #RubyOnRails
[23:49:31] FailBit: >mongodb images $in is 20ms
[23:49:38] FailBit: fuck mongodb btw
[23:50:41] pwnd_nsfw: FailBit, I found the problem
[23:50:41] pwnd_nsfw: https://www.youtube.com/watch?v=bLHL75H_VEM&ab_channel=gigagigagilgamesh
[23:52:14] mary5030: has joined #RubyOnRails
[23:53:01] rhizome: i have a test that shows an object persisted, yet Model.all returns []
[23:53:18] adam12: default scope strikes again? :P
[23:53:26] FailBit: database_cleaner being screwy?
[23:54:32] pjammer: has joined #RubyOnRails
[23:55:31] smathy: thejamespinto, bricker, are you sure that's right? I didn't think you could nest ERB at all.
[23:55:43] rhizome: no default_scope, trying to be a little more explicit with DC and i'll see how that goes
[23:56:58] thejamespinto: smathy: we were just joking
[23:57:20] jtb__: has joined #RubyOnRails
[23:57:26] bricker: smathy: no I am not sure, I've never tried before
[23:57:46] smathy: Ah sorry.
[23:57:47] pwnd_nsfw: Why would you erb in erb anyways
[23:58:04] pwnd_nsfw: string interpolation yey
[23:58:42] smathy: pwnd_nsfw, maybe binding in different contexts - I couldn't think of a use case either though.
[23:59:17] smathy: I have just had nested ERB tags when producing templates and I knew I had some issues and had to escape the nested ones etc.
[23:59:49] GeissT: has joined #RubyOnRails