« Back to channel list

#RubyOnRails - 13 January 2016

« Back 1 day Forward 1 day »
[00:00:05] chimche: has joined #RubyOnRails
[00:00:17] smathy: seaworthy, !gist your models please
[00:00:17] helpa: seaworthy: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[00:00:33] rhizome: Cohedrin: what are you trying to accomplish?
[00:00:54] Cohedrin: I'm trying to find all the servers without a bot assigned to them
[00:00:58] seaworthy: User with id key and Message with user_id key
[00:01:14] rhizome: Server.where.not(id: Bot.pluck(:server_id))
[00:01:29] rhizome: might need a uniq on that pluck
[00:01:51] lacrymology: I'm trying to set a date in an execute from an object received from the database
[00:01:55] lacrymology: I'm doing this
[00:02:00] Cohedrin: Yeah, I know I can do it like that, but it just seems like the includes statement should work
[00:02:17] Cohedrin: I'm just trying to understand why that wouldn't work, there are of course many ways to not use includes there and get what I want
[00:02:23] rhizome: probably a join that can do it
[00:02:38] j0llyr0tten: Cohedrin: what does includes do again?
[00:02:39] rhizome: includes is just going to suck them in if they exist
[00:02:47] lacrymology: "UPDATE events SET start_date='#{s['start_date']}' WHERE id in (#{event_ids.join(',')})", but that's failing
[00:02:48] Cohedrin: http://apidock.com/rails/ActiveRecord/QueryMethods/includes
[00:02:53] lacrymology: how should I be formatting that thing
[00:03:00] lacrymology: s['start_date'] is a Time object
[00:03:15] lethjakman: has joined #RubyOnRails
[00:03:39] mary5030: has joined #RubyOnRails
[00:03:46] Cohedrin: right so I guess a better way to phrase the question is, does includes require a relation to exsist for all models queried?
[00:03:48] rhizome: Cohedrin: http://stackoverflow.com/questions/24981000/performance-difference-between-not-exists-and-left-join-in-sql-server
[00:04:24] Cohedrin: hm interesting, thanks for the link
[00:04:27] Cohedrin: I didn't know that
[00:06:14] hannelita: has joined #RubyOnRails
[00:06:28] j0llyr0tten: lacrymology: is there some reason you're using SQL directly?
[00:08:50] lacrymology: j0llyr0tten: yes
[00:09:05] hahuang65: has joined #RubyOnRails
[00:09:31] lacrymology: in short, this is a migration, so I don't want to depend on AR fields that might disappear in the future
[00:12:38] _Tariq: has joined #RubyOnRails
[00:12:46] j0llyr0tten: lacrymology: i don't know, write it in AR, check what the log output says, then convert to SQL, bit of a lame answer but there you go
[00:13:32] ellisTAA: has joined #RubyOnRails
[00:13:33] sevenseacat: has joined #RubyOnRails
[00:14:38] bronson: lacrymology: when I'm faced with that, I tend to just put blank models in the migration.
[00:17:39] atomical_: has joined #RubyOnRails
[00:18:32] sfr^: has joined #RubyOnRails
[00:18:40] guacamole: has joined #RubyOnRails
[00:18:40] drale2k: has joined #RubyOnRails
[00:19:20] lalalaaa: has joined #RubyOnRails
[00:19:32] bronson: lacrymology: https://gist.github.com/bronson/6dd82e44797de069ae3d
[00:19:35] Deft: has joined #RubyOnRails
[00:21:07] zotherstupidguy: has joined #RubyOnRails
[00:21:27] zotherstupidguy: guys, which webserver is recommended for hug file uploads?
[00:22:07] sevenseacat: ACTION can't possibly know
[00:22:21] DEA7TH: has joined #RubyOnRails
[00:22:52] Cohedrin: probably puma or unicorn
[00:22:58] Cohedrin: they have threads/workers
[00:22:58] Radar: zotherstupidguy: Huge file uploads should be done in chunks.
[00:23:02] Cohedrin: so I guess that would be better?
[00:23:06] Radar: zotherstupidguy: http://fineuploader.com/
[00:23:34] DEA7TH: Is there a way to make let! before all, rather than before each? What is the point of it being before each anyway?
[00:23:52] Radar: DEA7TH: So you can setup a new instance for each test.
[00:24:00] Radar: DEA7TH: If you really want before all then use before(:all)
[00:24:10] sevenseacat: because tests should be isolated from each other.
[00:24:16] sevenseacat: sharing data between tests is a big no-no.
[00:24:40] DEA7TH: Radar: I find myself doing before(:all) { create examples } and then let(:customer) { Customer.find... (finds from the before(:all)) }
[00:24:42] Pazician: has joined #RubyOnRails
[00:24:45] DEA7TH: if that makes sense
[00:24:48] sevenseacat: I never use before :all.
[00:24:53] DEA7TH: the tests don't change the data
[00:25:01] sevenseacat: actually, I lie, I think I set up database cleaner before :all.
[00:25:12] sevenseacat: DEA7TH: that's not the point.
[00:25:13] pawnbox: has joined #RubyOnRails
[00:25:32] sfr^: has joined #RubyOnRails
[00:25:42] Radar: sevenseacat: all yours
[00:26:22] Cohedrin: DEA7TH: https://relishapp.com/rspec/rspec-rails/docs/transactions
[00:26:23] DEA7TH: Actual code I have: https://gist.github.com/VelizarHristov/03588b74fac88df4122c
[00:26:23] one_zero: has joined #RubyOnRails
[00:26:37] sevenseacat: you also increase your overhead and chance of bugs, because you have to manually clean up data created in each before :all block
[00:26:43] Cohedrin: the important bits being data created in before :each...
[00:26:50] Cohedrin: then everything after that
[00:27:06] Cohedrin: you're going to eventually hate yourself for doing that when it bites you in the ass, happens to just about everyone
[00:27:13] mrbubbles: has joined #RubyOnRails
[00:27:17] DEA7TH: oh well, guess I don't need before(:all)
[00:27:25] DEA7TH: I thought it's faster
[00:27:33] Cohedrin: it creates the object once
[00:27:35] Radar: You will have tests that modify objects.
[00:27:52] sevenseacat: to all the above.
[00:27:58] Radar: Then you'll be fucked when you have 10 tests and the third test modifies the object in a way that affects tests 4-10
[00:28:04] Cohedrin: its a good idea if you ahve a really expensive object that is made once and you are 100% sure you will never modify it
[00:28:11] Cohedrin: but you have to make sure you clean it up
[00:28:17] sevenseacat: or even better when your tests run in random order, and then you get random intermittent failures
[00:28:24] sevenseacat: they're awesome to debug
[00:28:28] rhizome: plus rails will be testing in random order soon
[00:28:50] Cohedrin: in short, you really shouldn't use it unless you're really sure you know what you're doing, and have a really good reason to
[00:28:50] sevenseacat: rhizome: great minds ;)
[00:29:09] DEA7TH: I used separate before(:each) for tests which modify data, but the other points make sense
[00:29:12] greenhat: Ryn each test in the scope of a transaction and the before(all) data should be clean for each test, right?
[00:29:16] cajone: has joined #RubyOnRails
[00:29:40] Cohedrin: you don't even need to specify before :each btw
[00:29:43] Cohedrin: you can just do before do
[00:29:44] rhizome: there's nothing protecting your immutable examples from being changed
[00:29:52] Cohedrin: the default is :each
[00:30:11] baweaver: has joined #RubyOnRails
[00:30:55] DEA7TH: and this way I can replace before(:all) with let! !
[00:31:07] thekkid: has joined #RubyOnRails
[00:31:39] rhizome: get the let out
[00:33:18] Radar: zotherstupidguy: Did you see what I said about uploads?
[00:33:43] jaymiejones86: has joined #RubyOnRails
[00:35:36] SteenJobs: has joined #RubyOnRails
[00:36:16] jaymiejones86: hey, anyone ran into the rails csrf meta tags not outputting in test env?
[00:36:36] zotherstupidguy: Radar thanks, my question is which webserver is suitable for file uploads. this article got me a bit confused https://www.nateberkopec.com/2015/07/29/scaling-ruby-apps-to-1000-rpm.html
[00:36:54] sevenseacat: (all of them)
[00:36:57] Radar: zotherstupidguy: I'm telling you that it won't matter if you chunk your uploads. Every upload will then be whatever your chunks are.
[00:37:19] zotherstupidguy: Radar is there a ruby library to do the chunks?
[00:37:21] Radar: zotherstupidguy: but sevenseacat is right. All webservers support file uploads.
[00:37:27] Radar: zotherstupidguy: No, you do it with FineUploader.
[00:37:40] Radar: Or some other inferior JS library that you'll spend 200hrs messing with.
[00:38:02] zotherstupidguy: Radar i am using the commandline gem to do the upload,
[00:38:20] Radar: zotherstupidguy: That would've been useful to know.
[00:38:30] Radar: glhf with that
[00:38:39] Radar: You're not going to show code probs so why even bother?
[00:39:18] kies^: has joined #RubyOnRails
[00:39:40] zotherstupidguy: Radar i show code allthe time!
[00:39:49] Radar: zotherstupidguy: Ok, show us your commandline code then.
[00:40:33] sfr^: has joined #RubyOnRails
[00:42:10] Rodya_: has joined #RubyOnRails
[00:42:36] northfurr: has joined #RubyOnRails
[00:44:33] sfr^: has joined #RubyOnRails
[00:44:59] guacamole: has joined #RubyOnRails
[00:48:28] Kallis: has joined #RubyOnRails
[00:48:29] Scripore: has joined #RubyOnRails
[00:48:34] sfr^: has joined #RubyOnRails
[00:50:39] zotherstupidguy: Radar https://github.com/gitlapse/gitlapse.rb thats the project i am working on.
[00:50:55] zotherstupidguy: nothing much there yet, but workin on it :)
[00:51:24] Radar: Thanks for showing it.
[00:51:30] Radar: Guessing gitlapse is your project too.
[00:51:32] guacamole: has joined #RubyOnRails
[00:51:41] Radar: I strongly advise uploading the files in chunks.
[00:51:59] Radar: Even with a Ruby client./
[00:52:27] hannelita: has joined #RubyOnRails
[00:52:31] zotherstupidguy: Radar yeah thanks :)
[00:52:36] sfr^: has joined #RubyOnRails
[00:52:38] jenrzzz: has joined #RubyOnRails
[00:54:35] sfr^: has joined #RubyOnRails
[00:54:45] rogue_koder: has joined #RubyOnRails
[00:56:11] pydave6367: has joined #RubyOnRails
[00:56:56] atomical: has joined #RubyOnRails
[00:57:27] DEA7TH: Rewrote all my before(:all)s to let! and there is no slowdown! neat
[00:58:20] TheDracle: has joined #RubyOnRails
[00:58:33] sfr^: has joined #RubyOnRails
[00:59:34] allcentury: has joined #RubyOnRails
[01:02:02] chimche: has joined #RubyOnRails
[01:05:33] Mirry: has joined #RubyOnRails
[01:07:00] drale2k: has joined #RubyOnRails
[01:08:08] arBmind1: has joined #RubyOnRails
[01:08:33] KnownSyntax: has joined #RubyOnRails
[01:08:35] KnownSyntax: has joined #RubyOnRails
[01:10:08] iateadonut: has joined #RubyOnRails
[01:10:36] sfr^: has joined #RubyOnRails
[01:11:13] drale2k: has joined #RubyOnRails
[01:11:50] johnflux: has joined #RubyOnRails
[01:13:16] northfurr: has joined #RubyOnRails
[01:13:30] drale2k: has joined #RubyOnRails
[01:13:52] sfr^: has joined #RubyOnRails
[01:14:22] jenrzzz: has joined #RubyOnRails
[01:20:22] barendt: has joined #RubyOnRails
[01:20:27] chipotle: has joined #RubyOnRails
[01:20:27] seaworthy: hi, how would i join these two sets, sort them by date desc, and then drop the ones that have repeating first element except the very first one https://bpaste.net/show/bd959830157f
[01:21:16] dstarh: has joined #RubyOnRails
[01:21:37] shpoont: has joined #RubyOnRails
[01:21:44] mices: i'm getting not included in list for a validation inclusion https://gist.github.com/mices/7c0008f82c1f9bf78c6f
[01:21:53] nerfando: has joined #RubyOnRails
[01:22:54] DLSteve: has joined #RubyOnRails
[01:24:00] rhizome: seaworthy: those dates suck for comparison, can you get them in iso8601? you might have to parse them in the sort if not
[01:24:39] sfr^: has joined #RubyOnRails
[01:25:30] seaworthy: yeh they are stored in db as iso8601
[01:25:52] matthewd: seaworthy: uniq(&:first) is probably going to play part
[01:26:03] rhizome: seaworthy: they don't look like it in the gist
[01:26:08] matthewd: Though I'm not sure what you mean by join
[01:26:12] rhizome: is this the result of a query?
[01:26:30] matthewd: If it's the result of a DB query, though, you may be better served by doing it back there, with a window function
[01:27:04] seaworthy: https://bpaste.net/show/7cdc4407cd67
[01:27:10] seaworthy: this is how they are generated
[01:27:56] seaworthy: grr when i print out they get converted
[01:28:33] rhizome: that's probably OK, they're date objects i'm guessing then
[01:28:57] seaworthy: by join i mean user_ids = sender_ids + received_ids
[01:29:50] sarink: has joined #RubyOnRails
[01:30:39] seaworthy: i think sort + uniq(&:first) might do it
[01:31:52] thekkid: has joined #RubyOnRails
[01:33:21] xnp70: has joined #RubyOnRails
[01:33:41] weaksauce: has joined #RubyOnRails
[01:37:10] ornerymoose: has joined #RubyOnRails
[01:38:23] jmfurlott: has joined #RubyOnRails
[01:42:24] janebootydoe: has joined #RubyOnRails
[01:43:21] Rodya_: has joined #RubyOnRails
[01:43:30] seaworthy: got it! thanks for help
[01:45:45] FailBit: "thing accomplished today: how to write gud virus"
[01:47:57] DLSteve: has joined #RubyOnRails
[01:50:32] sfr^: has joined #RubyOnRails
[01:50:52] markh: has joined #RubyOnRails
[01:53:42] lethjakman: has joined #RubyOnRails
[01:53:45] chimche: has joined #RubyOnRails
[01:58:26] Mirry: has joined #RubyOnRails
[01:58:30] baweaver: has joined #RubyOnRails
[01:59:02] sfr^: has joined #RubyOnRails
[02:00:54] neanderslob: has joined #RubyOnRails
[02:02:08] hannelita: has joined #RubyOnRails
[02:02:52] FailBit: >Sometimes the right answer to "how do I" is "don't".
[02:04:33] qejk: has joined #RubyOnRails
[02:04:51] sevenseacat: people here bitch when you say that though.
[02:07:15] Cohedrin: how do I change my controllers to be models
[02:07:27] allcentury: has joined #RubyOnRails
[02:07:33] FailBit: how do I sever my arm without it bleeding too much
[02:07:47] Cohedrin: you gotta cut out your heart first
[02:07:58] brendan-: has joined #RubyOnRails
[02:09:53] TheDracle: has joined #RubyOnRails
[02:09:57] hahuang65: has joined #RubyOnRails
[02:11:57] lethjakman: has joined #RubyOnRails
[02:12:24] mices: rhizome: i'm getting :gendre not included in list, is that gonna have to be permitted through the controller because it's a validations inclusion in the model for a select list in the form
[02:12:32] AntiSpamMeta: has joined #RubyOnRails
[02:13:11] mices: do validations inclusions in the model have to whitelisted differently
[02:14:24] mostlybadfly: has joined #RubyOnRails
[02:18:15] FailBit: what the f*ck are you talking about?
[02:18:39] FailBit: there is no such thing as validation other than in the models
[02:19:31] twi-lite: has joined #RubyOnRails
[02:20:23] twi-lite: has left #RubyOnRails: ()
[02:20:39] twi-lite: has joined #RubyOnRails
[02:22:12] twi-lite: has joined #RubyOnRails
[02:25:45] twi-lite: has joined #RubyOnRails
[02:25:50] Pazician: has joined #RubyOnRails
[02:28:21] chimche: has joined #RubyOnRails
[02:28:44] alex88: has joined #RubyOnRails
[02:29:05] six: has joined #RubyOnRails
[02:31:20] mices: i got it working by whitelisting through the controller, application_controller.rb since attribute_accessible is depracted this is the way and it seems theres no way around it
[02:31:52] robbyoconnor: has joined #RubyOnRails
[02:31:56] robbyoconnor: has joined #RubyOnRails
[02:32:37] thekkid: has joined #RubyOnRails
[02:33:01] KazW: has joined #RubyOnRails
[02:33:35] mices: having a validations inclusion in my model seems to make the situation so
[02:34:25] mices: if i didn't have the validations inclusion in my model i wouldn't have to whitelist anything on the controller level seemingly, but since i do i have to whitelist everything at the controller level
[02:35:51] Sawbones: has joined #RubyOnRails
[02:35:56] ferz_: has joined #RubyOnRails
[02:37:24] FailBit: attr_accessible is deprecated for a really good reason
[02:37:31] FailBit: ie it doesn't work
[02:37:46] FailBit: it works in principle but it's bad idiomatically
[02:37:50] ferz_: has joined #RubyOnRails
[02:38:13] tenderlove: has joined #RubyOnRails
[02:38:33] FailBit: that's why we now have ActionController's strong params for form data inclusion
[02:39:27] ferz_: has joined #RubyOnRails
[02:39:36] _Tariq: has joined #RubyOnRails
[02:39:50] FailBit: model validation is the same as it was before, and that's for verifying the integrity of the data; form inclusion (strong params) is just filtering the parameters passed down to the ones that are allowed to be posted
[02:44:43] Bloomer: has joined #RubyOnRails
[02:45:34] chimche: has joined #RubyOnRails
[02:47:51] nfk|laptop: has joined #RubyOnRails
[02:48:11] aloneintheworld: has joined #RubyOnRails
[02:49:53] pawnbox: has joined #RubyOnRails
[02:51:47] chimche1: has joined #RubyOnRails
[02:52:54] Ropeney: has joined #RubyOnRails
[02:54:36] fox_mulder_cp: has joined #RubyOnRails
[02:59:15] penguinpowernz: has joined #RubyOnRails
[02:59:25] sevenseacat: I can't type the word tooltip today. i keep typing tooptip.
[03:00:21] FailBit: use a dvorak keyboard for a month
[03:00:30] FailBit: this is how I teach people dvorak
[03:00:40] FailBit: 1. switch keyboard layout to dvorak
[03:00:48] FailBit: 2. sharpie in the entire keyboard
[03:00:55] FailBit: 3. wait a month
[03:02:04] krz: has joined #RubyOnRails
[03:02:38] lethjakman: has joined #RubyOnRails
[03:03:02] sevenseacat: I've only ever known one person to use dvorak. he loved it, but he couldn't pair with anyone or use their keyboards or get them to use his keyboard
[03:03:10] northfurr: has joined #RubyOnRails
[03:03:45] sevenseacat: I think undoing 25 years of muscle memory would not be fun
[03:05:55] bronson: has joined #RubyOnRails
[03:06:10] sevenseacat: also, i hate tooptips.
[03:06:15] FailBit: I imagine it like trying to play the piano with my hands behind my back
[03:06:41] dopie: has joined #RubyOnRails
[03:07:55] djbkd_: has joined #RubyOnRails
[03:09:16] sevenseacat: aaand tooptip got into the autocomplete somehow. sigh.
[03:10:22] mloveless: has joined #RubyOnRails
[03:11:06] seaworthy: how do i add a value to each array in an array of arrays?
[03:11:19] mloveless: has left #RubyOnRails: ()
[03:11:26] lethjakman: has joined #RubyOnRails
[03:12:12] eljimmy: has joined #RubyOnRails
[03:13:27] lacuna: has joined #RubyOnRails
[03:13:28] lacuna: has joined #RubyOnRails
[03:14:00] Sawbones: has joined #RubyOnRails
[03:16:23] TheDracle: has joined #RubyOnRails
[03:17:10] juddey: has joined #RubyOnRails
[03:19:26] mices: a form for a new message in mailboxer should be form_for(what?)
[03:19:46] northfurr: has joined #RubyOnRails
[03:19:58] pawnbox: has joined #RubyOnRails
[03:21:06] lethjakman: has joined #RubyOnRails
[03:23:53] jthomas_: has joined #RubyOnRails
[03:28:13] brycesenz: has joined #RubyOnRails
[03:28:15] nbdy: has joined #RubyOnRails
[03:33:10] dopie: has joined #RubyOnRails
[03:33:24] thekkid: has joined #RubyOnRails
[03:37:33] jthomas_: has joined #RubyOnRails
[03:38:30] dstarh: has joined #RubyOnRails
[03:40:50] northfurr: has joined #RubyOnRails
[03:43:19] Deft: has joined #RubyOnRails
[03:44:56] Rodya_: has joined #RubyOnRails
[03:45:14] felixdd: has joined #RubyOnRails
[03:46:03] sankaber: has joined #RubyOnRails
[03:46:12] konsolebox: has joined #RubyOnRails
[03:48:38] felixdd: How can I log something to the standard log at log/development.log or log/test.log
[03:49:10] felixdd: Do I have to add a logger in environment.rb?
[03:49:11] Illianthe: has joined #RubyOnRails
[03:49:24] kfrz: has joined #RubyOnRails
[03:51:47] swgillespie: has joined #RubyOnRails
[03:54:27] brycesenz: has joined #RubyOnRails
[03:54:36] Illianthe: has joined #RubyOnRails
[03:56:35] jthomas_: has joined #RubyOnRails
[03:56:42] rhizome: felixdd: logger.debug should be fine
[03:58:53] janebootydoe: has joined #RubyOnRails
[04:01:02] felixdd: rhizome: thx
[04:03:31] hannelita: has joined #RubyOnRails
[04:03:37] felixdd: rhizome: can't find logger variable. I'm using it in a class in /lib/
[04:04:04] rhizome: oh, that's different
[04:04:08] kies^: has joined #RubyOnRails
[04:06:44] lethjakman: has joined #RubyOnRails
[04:06:56] jthomas_: has joined #RubyOnRails
[04:07:02] dnewkerk: felixdd: Rails.logger.deug
[04:07:34] dnewkerk: sorry Rails.logger.debug
[04:08:05] bronson: has joined #RubyOnRails
[04:08:45] atomical: has joined #RubyOnRails
[04:09:30] felixdd: dnewkerk: That works but the log is still empty..
[04:09:56] felixdd: Whats the std loglevel?
[04:10:08] braincrash: has joined #RubyOnRails
[04:10:37] Guest: has joined #RubyOnRails
[04:10:39] hahuang65: has joined #RubyOnRails
[04:11:23] jthomas_: has joined #RubyOnRails
[04:11:30] choke: has joined #RubyOnRails
[04:11:39] northfurr: has joined #RubyOnRails
[04:11:49] dnewkerk: felixdd: http://guides.rubyonrails.org/debugging_rails_applications.html#log-levels
[04:15:45] choke: https://github.com/rails/rails/issues/10180#issuecomment-16270920 is this still valid for sub domains within rails? ie: domain.com routes to the default namespace and api.domain.com routes to the api namespace?
[04:18:21] speaking1ode: has joined #RubyOnRails
[04:19:01] jenrzzz: has joined #RubyOnRails
[04:19:27] kp666: has joined #RubyOnRails
[04:19:39] bronson: has joined #RubyOnRails
[04:19:58] lethjakman: has joined #RubyOnRails
[04:20:15] lacuna: has joined #RubyOnRails
[04:20:31] kp666: has joined #RubyOnRails
[04:20:40] tenderlove: has joined #RubyOnRails
[04:22:16] pawnbox: has joined #RubyOnRails
[04:22:21] djbkd: has joined #RubyOnRails
[04:23:16] tenderlove: has joined #RubyOnRails
[04:23:35] User458764: has joined #RubyOnRails
[04:24:37] bmalum: has joined #RubyOnRails
[04:26:58] lethjakman: has joined #RubyOnRails
[04:27:42] moei: has joined #RubyOnRails
[04:27:44] cornerma1: has joined #RubyOnRails
[04:30:42] diggitydane: has joined #RubyOnRails
[04:31:26] diggitydane: I desperately need to hire someone for one single postgres query. any recommendations my friends?
[04:32:02] djellemah_: has joined #RubyOnRails
[04:32:21] lethjakman: has joined #RubyOnRails
[04:32:42] djbkd: has joined #RubyOnRails
[04:35:36] thekkid: has joined #RubyOnRails
[04:35:41] Scripore: has joined #RubyOnRails
[04:37:00] djbkd_: has joined #RubyOnRails
[04:38:04] srinidhi: has joined #RubyOnRails
[04:39:01] _Tariq: has joined #RubyOnRails
[04:40:54] yfeldblum: has joined #RubyOnRails
[04:41:17] JohnT: has joined #RubyOnRails
[04:41:41] pawnbox: has joined #RubyOnRails
[04:42:45] kies: has joined #RubyOnRails
[04:44:38] alphaatom: has joined #RubyOnRails
[04:46:14] nbdy: has joined #RubyOnRails
[04:47:41] arup_r: has joined #RubyOnRails
[04:49:04] mary5030: has joined #RubyOnRails
[04:49:33] ornerymoose: has joined #RubyOnRails
[04:50:31] Illianthe: has joined #RubyOnRails
[04:55:18] sevenseacat: has joined #RubyOnRails
[04:55:48] Sawbones: has joined #RubyOnRails
[04:57:52] krz: has joined #RubyOnRails
[04:58:06] jthomas_: has joined #RubyOnRails
[05:02:36] kt2: has joined #RubyOnRails
[05:03:33] dopie: has joined #RubyOnRails
[05:04:24] hannelita: has joined #RubyOnRails
[05:07:13] dnewkerk: diggitydane: https://hackhands.com might be a good option
[05:07:46] sankaber: has joined #RubyOnRails
[05:08:55] guacamole: has joined #RubyOnRails
[05:09:24] pawnbox: has joined #RubyOnRails
[05:09:50] kies^: has joined #RubyOnRails
[05:10:09] mary5030_: has joined #RubyOnRails
[05:13:26] sevenseacat: has joined #RubyOnRails
[05:13:27] hahuang65: has joined #RubyOnRails
[05:15:19] Cohedrin: has joined #RubyOnRails
[05:17:27] kfrz: has joined #RubyOnRails
[05:17:41] mostlybadfly: has joined #RubyOnRails
[05:17:55] bmalum: has joined #RubyOnRails
[05:19:18] n00bDev: has joined #RubyOnRails
[05:21:05] dopie: has joined #RubyOnRails
[05:21:34] Cervajz: has joined #RubyOnRails
[05:23:13] atomical: has joined #RubyOnRails
[05:29:19] vamsi: has joined #RubyOnRails
[05:33:40] Deft: has joined #RubyOnRails
[05:35:01] JohnT: has joined #RubyOnRails
[05:36:19] thekkid: has joined #RubyOnRails
[05:39:04] krz: has joined #RubyOnRails
[05:40:08] User458764: has joined #RubyOnRails
[05:40:20] Rodya_: has joined #RubyOnRails
[05:42:02] jenrzzz: has joined #RubyOnRails
[05:42:45] diggitydane: dnewkerk, thanks I'll check them out
[05:46:47] rvanlieshout: has joined #RubyOnRails
[05:49:07] Cervajz: has joined #RubyOnRails
[05:55:44] claytonzaugg: has joined #RubyOnRails
[05:57:49] yfeldblum: has joined #RubyOnRails
[06:04:32] dionysus69: has joined #RubyOnRails
[06:05:25] markh: has joined #RubyOnRails
[06:05:28] hannelita: has joined #RubyOnRails
[06:06:56] C0r3: has joined #RubyOnRails
[06:08:02] C0r3: Hello everyone!
[06:08:27] hahuang61: has joined #RubyOnRails
[06:11:41] C0r3: I have two tables, `users` and `items` namely, where Item model belongs to User model (many-to-one). I also have another join table `wishlists` to hold `user_id` and `item_id` (many-to-many). I wanted to know, is it possible to define a 'has_many' declaration with different name, so that I can access the wishlists of a corresponding user as follows: @users.items_in_wishlist
[06:14:20] C0r3: I have two tables, `users` and `items` namely, where Item model belongs to User model (many-to-one). I also have another join table `wishlists` to hold `user_id` and `item_id` (many-to-many). I wanted to know, is it possible to define a 'has_many' declaration with different name, so that I can access the wishlists of a corresponding user as follows: @users.items_in_wishlist
[06:21:22] ur5us: has joined #RubyOnRails
[06:26:51] djbkd: has joined #RubyOnRails
[06:29:17] naftilos76: has joined #RubyOnRails
[06:30:01] rhizome: user has_many items, through: :wishlists
[06:30:21] rhizome: if items is like a catalog
[06:30:52] ascarter: has joined #RubyOnRails
[06:33:56] djbkd: has joined #RubyOnRails
[06:34:36] norc: has joined #RubyOnRails
[06:35:17] chouhoul_: has joined #RubyOnRails
[06:37:06] thekkid: has joined #RubyOnRails
[06:38:30] zpe: has joined #RubyOnRails
[06:40:07] aganov: has joined #RubyOnRails
[06:40:13] northfurr: has joined #RubyOnRails
[06:40:37] bronson: has joined #RubyOnRails
[06:41:19] Rodya_: has joined #RubyOnRails
[06:43:20] JohnT: has joined #RubyOnRails
[06:45:41] rogue_koder: has joined #RubyOnRails
[06:47:12] xapak: has joined #RubyOnRails
[06:49:13] xapak: Real quick question: in an ERB view, do you know why this is not showing the element count? <p><% @endpoints.length.to_s %></p>
[06:50:01] xapak: Oh, darn it.
[06:50:22] xapak: Come on! :(
[06:50:52] rhizome: you're welcome!
[06:51:01] xapak: has left #RubyOnRails: ()
[06:51:47] Rinalds: has joined #RubyOnRails
[06:54:41] ascarter: has joined #RubyOnRails
[06:55:06] a1ph4g33k: has joined #RubyOnRails
[06:55:24] arup_r: has joined #RubyOnRails
[06:55:38] kfrz: has joined #RubyOnRails
[06:56:07] rogriff: has joined #RubyOnRails
[06:59:12] shibabu: has joined #RubyOnRails
[07:00:45] akash_: has joined #RubyOnRails
[07:01:49] kerunaru: has joined #RubyOnRails
[07:02:04] lxsameer: has joined #RubyOnRails
[07:05:02] wldcordeiro: has joined #RubyOnRails
[07:07:31] hannelita: has joined #RubyOnRails
[07:10:29] yardenbar: has joined #RubyOnRails
[07:11:36] arup_r: has joined #RubyOnRails
[07:12:26] solars: has joined #RubyOnRails
[07:16:39] solars: has joined #RubyOnRails
[07:18:21] tagrudev: has joined #RubyOnRails
[07:18:39] sandstrom: has joined #RubyOnRails
[07:19:52] Pazician: has joined #RubyOnRails
[07:20:46] netzfisch: has joined #RubyOnRails
[07:20:51] MissionCritical: has joined #RubyOnRails
[07:21:19] lethjakman: has joined #RubyOnRails
[07:21:21] tjbiddle: has joined #RubyOnRails
[07:22:15] felixdd: rhizome: dnewkerk: I found the problem why nothing was going to the dev.log, the rails_12factor gem send everything to the server console
[07:23:02] tjbiddle: Hey all; interesting scenario I may need to cover due to China->AWS issues. I want my RoR app to have a database it always uses for reads - and then if there is an issue connecting to the database host it uses for writes; to delay those until the connection is good again. Has this been solved before?
[07:23:29] n00bDev: has joined #RubyOnRails
[07:23:50] AimlessRAven: has joined #RubyOnRails
[07:24:39] Cohedrin: tjbiddle I'm not 100% sure what you're asking, but I _think_ ocotopus is what you're looking for?
[07:24:44] tjbiddle: Maybe just rescue any can't connect exceptions and throw the info into a SideKiq job?
[07:24:44] Cohedrin: or you can use it for what you need
[07:24:46] tjbiddle: Cohedrin: Reading
[07:25:01] Cohedrin: https://github.com/tchandy/octopus
[07:26:09] tjbiddle: Cohedrin: Certainly looks promising! Wonder if combining that with a rescue on failed connects would work. Will make a note. Thanks!
[07:26:48] Cohedrin: I'm not sure what your problem is, you're trying to have a readonly db, which octopus will handle for you, but you also want to retry write requests?
[07:27:01] AimlessRAven: can anyone check my gist
[07:27:02] AimlessRAven: https://gist.github.com/anonymous/1fa4d8579879d709bd57
[07:27:19] ubiks: has joined #RubyOnRails
[07:29:11] sevenseacat: AimlessRaven: I think you need to get some Ruby books and practice your basic Ruby.
[07:29:51] JohnT: has joined #RubyOnRails
[07:30:09] tjbiddle: Cohedrin: So in a nut-shell; I'll have servers in the People's Republic of China - which is known to have intermittent connectivity to AWS (I'm using AWS's RDS for my database service). I'd like to setup a read-only database in the PRC that my servers that will pull from; and then write to the AWS host. But if the connectivity goes out (Because China is wonk), then I don't want those writes to be lost - so maybe when I go to save the record and I get
[07:30:09] tjbiddle: CantConnectException - Throw the write into a background process and wait until connectivity is restored
[07:30:31] AimlessRAven: sevenseacat: yea ill do it, but for now can you help me ?
[07:30:45] sevenseacat: AimlessRaven: I've helped you enough. you ask a dozen of these kinds of questions a day.
[07:30:47] tjbiddle: Also - unrelated: Is t.references :my_column, index: true, foreign_key: true the same as a normal `t.references` with a `add_foreign_key :table, :column` ?
[07:31:02] sevenseacat: tjbiddle: check the result in schema.rb.
[07:31:11] ubiks: has joined #RubyOnRails
[07:31:13] Cohedrin: is the app only used by the PRC?
[07:31:42] chipotle: has joined #RubyOnRails
[07:32:59] gNoobie__: has joined #RubyOnRails
[07:33:03] tibra: has joined #RubyOnRails
[07:33:04] tjbiddle: Cohedrin: No - Worldwide. We'll have client-side logic (mobile apps) that will test connectivity to our normal DNS entry; and if it doesn't work assume we're in the PRC and fall-back to those servers.
[07:33:04] DEA7TH: has joined #RubyOnRails
[07:33:39] tagrudev: has joined #RubyOnRails
[07:34:14] tagrudev: morning guys/girls
[07:35:02] Cohedrin: hmm, what might make the most sense is have a "shard" type setup in prc where it records everything from prc, then you can write it over later if the connectivity goes out
[07:35:09] tagrudev: is there a way that I can use rails-api in already created app ? specifying to load it's middleware for the desired namespace
[07:35:43] Cohedrin: as in, it always tries to write to both, but if it cant get the aws database, it only writes the the prc db, and then as you suggested you can have worker or somethign similar that diffs the databases?
[07:36:09] Cohedrin: not sure how well that would work for your specific app, if its critical it probably wont
[07:36:12] tjbiddle: sevenseacat: No change in the schema; both just have a t.integer :table_id - So I'm assuming the call for foreign keys is completely handled depending on which database adapter is used during the migration
[07:36:31] sevenseacat: you must be using sqlite
[07:36:43] sevenseacat: if you're not getting foreign keys at all
[07:36:49] tjbiddle: sevenseacat: In development - yes
[07:37:18] tjbiddle: I thought schema.rb was just based off of the migration - not where it was run. Alright, sec.
[07:37:40] sevenseacat: it is. you should have foreign key lines in there.
[07:37:53] thekkid: has joined #RubyOnRails
[07:38:07] tibra: has joined #RubyOnRails
[07:38:59] Deft: has joined #RubyOnRails
[07:39:07] tagrudev: https://github.com/rails-api/rails-api/issues/209
[07:42:20] Rodya_: has joined #RubyOnRails
[07:42:45] dtordable: has left #RubyOnRails: ()
[07:47:16] KazW: has joined #RubyOnRails
[07:50:28] ur5us: has joined #RubyOnRails
[07:51:39] tjbiddle: has joined #RubyOnRails
[07:51:48] lacuna: has joined #RubyOnRails
[07:52:34] defsdoor: has joined #RubyOnRails
[07:53:05] paulodiniz: has joined #RubyOnRails
[07:53:32] tjbiddle: sevenseacat: Hm - so checking my tables on MySQL - there are foreign keys in there; but still none in the schema.rb that was generated on the server. The foreigner gem (Which I'm not using) claims "...and correctly dumps foreign keys to schema.rb" - So I'm assuming Rails doesn't do this by default
[07:53:41] tetraktys: has joined #RubyOnRails
[07:53:57] tjbiddle: Anyhow - There are foreign key constraints, so I'll assume it's being done correctly regardless of which method I use that I mentioned above. Thanks!
[07:53:58] DirtyFInn: has joined #RubyOnRails
[07:54:06] sevenseacat: uh.... you're using an old version of rails, that requires foreigner for foreign keys?
[07:55:04] tjbiddle: sevenseacat: No - I'm saying I'm not using foreigner. I'm using 4.2.3 and using `foreign_key: true` in my migrations
[07:55:18] tjbiddle: Which is the correct way to do it, yes?
[07:55:19] sevenseacat: then why even mention foreigner?
[07:55:36] sevenseacat: Rails will list foreign keys in your schema file.
[07:55:41] tjbiddle: sevenseacat: Because I was saying that Rails doesn't seem to make any reference to foreign keys in the schema.rb
[07:55:45] tjbiddle: Even though they're on my database
[07:56:04] tjbiddle: And the foreign gem specifically boasts "Correctly adding it to schema.rb" so I'm assuming it's known that Rails isn't doing this
[07:56:13] tjbiddle: sevenseacat: I see no reference to them
[07:56:19] tjbiddle: I just checked
[07:57:12] sevenseacat: they'll be at the very bottom of your schema file.
[07:57:39] bronson: has joined #RubyOnRails
[07:58:17] tjbiddle: sevenseacat: Nothing at the bottom. No reference to `foreign`, `fk`, or `ref` anywhere in the schema either
[07:58:22] sevenseacat: gist your schema.rb?
[07:58:37] sevenseacat: and your migration that you have run?
[07:58:46] tjbiddle: Checked my current app directory, checked the shared directory (Using capistrano), checked the server that is being used to deploy capistrano
[07:58:52] darutoko: has joined #RubyOnRails
[07:59:52] riddled: has joined #RubyOnRails
[08:00:55] tjbiddle: sevenseacat: Sorry - not exposing that. Look, it's not there. It doesn't bother me whether it is or not - the foreign key is generated, I'm happy. I don't particularly care to prove the point either way - if you want me to check elsewhere so you can prove me wrong for your own sake, I'm happy to do so and uncover some knowledge in the process - but it's not in any of the obvious places. Is there some other string apart from the others that I should b
[08:00:57] tjbiddle: looking for?
[08:01:19] sevenseacat: k. you've done something wrong and/or silly then.
[08:01:58] sevenseacat: Rails will add your foreign keys to your schema.rb file.
[08:02:11] User458764: has joined #RubyOnRails
[08:02:33] lubekpl: has joined #RubyOnRails
[08:02:58] paulodiniz: has joined #RubyOnRails
[08:07:53] konsolebox: has joined #RubyOnRails
[08:08:15] hannelita: has joined #RubyOnRails
[08:08:55] guiNoobie: has joined #RubyOnRails
[08:09:20] roshanavand: has joined #RubyOnRails
[08:10:18] pawnbox: has joined #RubyOnRails
[08:12:17] tjbiddle: sevenseacat: Got it. When run in production it defaults to `config.active_record.dump_schema_after_migration = false` - The schema.rb was just never being updated from what I have in git.
[08:12:33] tjbiddle: And to answer to my original question: The method of assigning a foreign key doesn't change the end result.
[08:12:40] tjbiddle: Thanks for the direction
[08:13:12] l4u-: has joined #RubyOnRails
[08:13:32] cac: has joined #RubyOnRails
[08:13:39] sevenseacat: oh yeah, you said you were using sqlite in dev before you went off talking about mysql. right.
[08:13:50] sevenseacat: reason #1356242 why that is a bad idea.
[08:13:51] l4u-: when I test a nested resource, such as /blog/{blog_id}/posts, where should I put the tests?
[08:13:59] sevenseacat: depends on the type of test.
[08:14:09] tjbiddle: What exactly being a bad idea?
[08:14:11] tjbiddle: Using sqlite in dev?
[08:14:17] sevenseacat: using different dbmses in dev and production.
[08:14:45] tjbiddle: Noted; good point
[08:14:54] tjbiddle: I generally just use it for fast iteration/setup - but good point
[08:15:10] sevenseacat: how is it faster?
[08:15:46] sevenseacat: other than having to type a shorter rails new command
[08:15:48] tjbiddle: sevenseacat: Not monumentally; just faster on the initial "I just created my rails app and I don't want to fuck around with extra config since I'm lazy" aspect of it
[08:16:00] tjbiddle: Especially since I never use mysql on my mac
[08:16:16] tjbiddle: I'll set it up now though; and keep it in mind for later
[08:18:14] mark2: has joined #RubyOnRails
[08:18:36] Bloomer: has joined #RubyOnRails
[08:21:50] norc: Currently I use bash aliases to set up different RAILS_ENV and shorten bundle exec to just `be` - are there other ways?
[08:21:59] lethjakman: has joined #RubyOnRails
[08:22:00] sunya7a: has joined #RubyOnRails
[08:22:16] norc: (allowing me to do something like: demo be rails c)
[08:22:17] DEA7TH: has joined #RubyOnRails
[08:23:09] sevenseacat: I just have an alias for `be`
[08:23:10] tjbiddle: norc: Not sure on the answer to your question; but personally I'd recommend habit be to continue typing bundle exec - That way when you're debugging something later, possibly on a system with different rubies or rails - You know you're using the correct one.
[08:23:34] tjbiddle: Oh duh - totally didn't read that.
[08:23:45] tjbiddle: Thought you were trying to get rid of any prefix to it.
[08:23:56] mary5030: has joined #RubyOnRails
[08:25:15] antgel: has joined #RubyOnRails
[08:25:29] existensil: has joined #RubyOnRails
[08:25:53] Sawbones: has joined #RubyOnRails
[08:30:26] theod: has joined #RubyOnRails
[08:30:54] norc: Alright, Ill just stick with this then. :)
[08:34:04] tvw: has joined #RubyOnRails
[08:36:03] Cohedrin: tjbiddle did you figure out a working solution?
[08:36:13] Cohedrin: be interested to hear the final solution when you get one
[08:36:33] tjbiddle: Cohedrin: Just made a note of it for later; It's an issue I'll need to solve at some point - but not pressing
[08:36:43] tjbiddle: Debuting outside of PRC first as that's about 92% of our market
[08:36:48] Cohedrin: what are you guys doing right now?
[08:36:54] Cohedrin: just letting them get lost?
[08:36:55] tjbiddle: So that part of our architecture as been deprioritized
[08:37:29] tjbiddle: Yeah - essentially.
[08:38:02] tjbiddle: The numbers our PM sent me were based on some weird assumptions; but that's what I got out of it.
[08:38:03] Cohedrin: understandable
[08:38:15] Cohedrin: meh, you can only do so much
[08:38:38] thekkid: has joined #RubyOnRails
[08:38:45] tjbiddle: But I'm working on a complete re-write from the bottom-up; so hopefully should fix everything that we had. The original API was some half-baked codeignitor setup in PHP
[08:40:00] tjbiddle: I'll have to pop back in here when I cross that threshold though and let you know :)
[08:40:55] atomical: has joined #RubyOnRails
[08:41:38] pawnbox: has joined #RubyOnRails
[08:42:33] tvw: has joined #RubyOnRails
[08:43:04] Rodya_: has joined #RubyOnRails
[08:43:24] Cervajz: has joined #RubyOnRails
[08:45:37] artto: has joined #RubyOnRails
[08:47:16] riddled: has joined #RubyOnRails
[08:47:52] arup_r: has joined #RubyOnRails
[08:48:32] Ergo: has joined #RubyOnRails
[08:49:05] sandstrom: has joined #RubyOnRails
[08:50:20] nettoweb: has joined #RubyOnRails
[08:52:08] dionysus69: can anyone explain to me how pros and cons of using foundation gem? let's say I don't use the gem and set it up manually, where do I put downloaded files? into assets dir or vendor ?
[08:52:32] User458764: has joined #RubyOnRails
[08:53:01] neanderslob: hi all, I just added a controller that doesn't have a corresponding model and am getting the "uninitialized constant" error; from what I can tell this has something to do with cancancan's load_and_authorize_resource can anyone shine some light on why this happens?
[08:54:20] hannelita: has joined #RubyOnRails
[08:55:22] sevenseacat: dionysus69: either. probably vendor.
[08:55:33] sevenseacat: neanderslob: you'll have to be more specific about the actual error.
[08:55:59] greg: has joined #RubyOnRails
[08:56:49] dionysus69: ok thanks just checked if there was a convention x)
[08:56:56] greg: There was an error parsing `Gemfile`: wrong number of arguments (0 for 1+). Bundler cannot continue.
[08:57:02] greg: how to solve this
[08:57:17] bronson: greg, fix the error?
[08:57:19] helpa: greg: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[08:58:41] neanderslob: sevenseacat: gotcha, I actually think I just found my answer on github; apparently cancan makes certain assumptions about the naming of controllers and models and one needs to specify if one isn't following that convention
[08:58:44] neanderslob: thanks anyway
[08:59:08] sevenseacat: look what happens when you do 5 seconds of research :sparkles:
[09:01:36] lipoqil: has joined #RubyOnRails
[09:01:55] greg: helpa https://gist.github.com/aj07/03f38687c0271834036c
[09:02:40] sevenseacat: greg: yeah you kinda need to specify the name of a gem there.
[09:04:07] edwinvdgraaf: has joined #RubyOnRails
[09:04:16] greg: there on gem file i have done as per as given on https://github.com/twbs/bootstrap-sass
[09:04:25] greg: except rails version
[09:04:37] sevenseacat: greg: where does that gem say you should write the word "gem" with nothing after it?
[09:06:34] jsrn_: has joined #RubyOnRails
[09:06:56] pydave6367: has joined #RubyOnRails
[09:09:07] quazimodo: has joined #RubyOnRails
[09:11:25] juddey: has joined #RubyOnRails
[09:12:31] drptbl: has joined #RubyOnRails
[09:13:08] AimlessRAven: can someone help me with this method https://gist.github.com/anonymous/4b7eb0f1a8efaa7cde6a
[09:13:21] AimlessRAven: i wanna transform to hash, to get created_at and status
[09:14:59] AimlessRAven: for example if i make @order.test.each do |s| and type s.time this gibe me undefined method `time' for #<Hash:0x007f5570574050>
[09:15:33] sevenseacat: AimlessRaven: your questions have nothing to do with Rails.
[09:15:39] sevenseacat: please go read a Ruby book.
[09:17:03] bronson: AimlessRaven: didn't read the whole thing, does s['time'] work?
[09:17:14] rvanlieshout: and give it a proper name
[09:17:20] Bloomer: has joined #RubyOnRails
[09:17:33] sevenseacat: bronson: why offer an answer if youre not going to read the question?
[09:17:38] rvanlieshout: oh. it's the audits thing from yesterday
[09:17:39] bronson: heck, clean up the test routine. it's impenetrable.
[09:17:59] rvanlieshout: a ruby book + rails book would help here
[09:18:02] sevenseacat: rvanlieshout: the same audit discussion that has been going on for a loooooong time now
[09:18:07] sevenseacat: weeks at least
[09:18:07] rvanlieshout: there is really no need to convert it to a hash
[09:18:09] bronson: sevenseacat: I glanced at it and offered something to look at
[09:18:47] bronson: sevenseacat: you really expect me to analyze that code?
[09:19:08] sevenseacat: if you're going to try to help, yes.
[09:20:20] bronson: sevenseacat: what is your problem?
[09:20:25] Cohedrin: bronson its 5 lines
[09:20:33] sevenseacat: I don't have a problem
[09:20:58] sevenseacat: it's AimlessRaven who is having the problem.
[09:21:00] dEPy: has joined #RubyOnRails
[09:21:05] rvanlieshout: for weeks so it seems
[09:21:21] bronson: Cohedrin: line 3 is actually 4+ lines in disguise.
[09:21:24] rvanlieshout: investing a couple of weeks in ruby and rails would really help here
[09:21:42] Cohedrin: still sub 3 lines lol
[09:22:25] bronson: pshaw, easy to make that function a single line.
[09:22:48] sevenseacat: AimlessRaven: I recommend The Well-Grounded Rubyist for a good foundation on Ruby.
[09:24:04] AimlessRAven: bronson: yea this work, but in view give me like a array
[09:24:15] rvanlieshout: and don't forget about rails
[09:24:20] rvanlieshout: you shouldn't be working with plain arrays
[09:24:20] djbkd: has joined #RubyOnRails
[09:24:40] rvanlieshout: not when the origin is a normal plain old model instance
[09:24:52] AimlessRAven: not like a hash..
[09:25:07] sevenseacat: true, but we can save the Rails book recommendations until they learn some Ruby :)
[09:25:07] Cohedrin: aimless is this your first attempt at programming?
[09:25:09] pawnbox: has joined #RubyOnRails
[09:25:12] rvanlieshout: the approach is just wrong
[09:25:20] rvanlieshout: and fixin this will just result in another error where the approach is wrong
[09:25:28] Cohedrin: as in, is this rails app the first time you're trying to program seriously/
[09:25:43] Cohedrin: because if it is, you should play around a bit with code academy or something
[09:25:55] Cohedrin: you're going to keep running into problems like this if you don't
[09:26:00] paulodiniz: has joined #RubyOnRails
[09:26:00] Cohedrin: and when your app gets millions of users
[09:26:14] Cohedrin: you're going to have a bad time
[09:26:54] solars: has joined #RubyOnRails
[09:34:34] riddled: has joined #RubyOnRails
[09:37:28] bronson: anyone know of a good way to handle join tables in an api?
[09:37:38] tjbiddle: Anyone aware of if there's a way to set the permissions of the 'apps' directory in Capistrano? (eg: /home/deploy/apps/my_app_1)
[09:37:49] tjbiddle: Would prefer my application code not to be readable by all users
[09:38:00] bronson: property may have any number of contacts, contact may have any number of properties... how do I model this in the API?
[09:38:20] bronson: Exposing the join table seems a little gauche
[09:38:44] rvanlieshout: bronson: would it matter to the api users that it requires a join table?
[09:39:14] bronson: rvanlieshout: no, they don't care. I'd just like to make the api clean and simple.
[09:39:18] paulodiniz: has joined #RubyOnRails
[09:39:24] thekkid: has joined #RubyOnRails
[09:39:40] steharro: has joined #RubyOnRails
[09:39:56] rvanlieshout: bronson: then how is it related to the api?
[09:40:52] Papierkorb: bronson: can't you have something like recipes/:recipe_id/ingredients with Recipe <-> Ingredient ? 'same' for the other way around.
[09:40:53] guiNoobie: has left #RubyOnRails: ()
[09:41:12] ubiks: has joined #RubyOnRails
[09:41:37] ubiks: hi there; does anybody have a clue why avatars_for_rails can be brekaing my css? :/
[09:42:26] gNoobie__: has joined #RubyOnRails
[09:42:30] bronson: Papierkorb: yes, I think so... but that risks modifying the ingredient when I just wanted to add it to a recipe.
[09:42:32] greg: https://gist.github.com/aj07/e64a43506e11d31f8393
[09:42:44] paulodiniz: has joined #RubyOnRails
[09:42:46] greg: take a look at this bootstrap error
[09:43:08] sevenseacat: greg: yep, looked at it.
[09:43:08] greg: m doing as given on their git page still showing lotsa of error?
[09:43:10] Papierkorb: bronson: 'risks' ?
[09:43:17] sevenseacat: greg: are you doing as given?
[09:43:22] sevenseacat: greg: what are you doing?
[09:43:29] shibabu: has joined #RubyOnRails
[09:43:42] stamina: has joined #RubyOnRails
[09:43:50] d0nn1e: has joined #RubyOnRails
[09:43:51] Rodya_: has joined #RubyOnRails
[09:44:00] bronson: Papierkorb: it makes adding an ingredient to a recipe a two-step process: read the ingredient, then POST it nested in the recipe.
[09:44:12] xota: has joined #RubyOnRails
[09:44:16] xota: Hi! I am using https://github.com/stephskardal/rails_admin_import and I wanted to do an action just before the import, but not by record (they provide a hook for that), I want the action for the whole import. Basically I want to mark all the instances of a model as non-visible and just mark the ones imported as visible. Is that doable with this gem? Thanks!
[09:44:35] bronson: potentially with unintended modifications.
[09:44:57] bronson: Doesn't seem real simple but maybe that's as good as can be expected.
[09:46:11] Papierkorb: bronson: I'd probably have something like PATCH recipe/:id/ingredients with some JSON body like add and remove. You could, on the server, then even apply ACLs if you need that, or anything. I don't see how in that case an 'unintended' (???) modification (to what?) could be caused
[09:48:04] bronson: oh, you're thinking the json body would just be a command? PATCH recipe/:recipeid/ingredients/:ingrid with json { action: 'add' }
[09:48:09] bronson: or something like that?
[09:48:18] bronson: yeah, that seems OK.
[09:48:42] blackmesa: has joined #RubyOnRails
[09:48:49] Papierkorb: bronson: possibly, or even { "add": [ ... ], "remove": [ ... ] }
[09:48:52] bronson: seems kinda custom but it's better than posting the entire ingredient every time.
[09:49:08] rvanlieshout: it also matches PATCH better
[09:49:10] rvanlieshout: else it would be PUT
[09:49:27] Papierkorb: Ahhh you were thinking about 'concurrency' issues. Now I see
[09:50:30] bronson: right. or charset translation issues but I guess utf8 has made that mostly go away.
[09:53:45] nerfando: has joined #RubyOnRails
[09:54:18] srinidhi: has joined #RubyOnRails
[09:54:59] DoubleMalt: has joined #RubyOnRails
[09:59:36] udiudi: has joined #RubyOnRails
[09:59:42] zpe: has joined #RubyOnRails
[10:07:29] rodfersou: has joined #RubyOnRails
[10:09:55] CatMartyn: has joined #RubyOnRails
[10:10:43] lethjakman: has joined #RubyOnRails
[10:14:15] xota: has joined #RubyOnRails
[10:17:21] arup_r: has joined #RubyOnRails
[10:17:30] drptbl: has joined #RubyOnRails
[10:17:38] marr: has joined #RubyOnRails
[10:18:00] User458764: has joined #RubyOnRails
[10:19:02] Pazician: has joined #RubyOnRails
[10:20:56] pawnbox: has joined #RubyOnRails
[10:23:22] flat_white: has joined #RubyOnRails
[10:25:40] theod: has joined #RubyOnRails
[10:32:28] djbkd: has joined #RubyOnRails
[10:37:00] theod: has joined #RubyOnRails
[10:38:08] Jasaka|NA: has joined #RubyOnRails
[10:38:37] srinidhi: has joined #RubyOnRails
[10:40:10] thekkid: has joined #RubyOnRails
[10:40:34] Deft: has joined #RubyOnRails
[10:41:46] steharro: has joined #RubyOnRails
[10:43:28] robbyoconnor: has joined #RubyOnRails
[10:44:48] Rodya_: has joined #RubyOnRails
[10:46:24] arBmind: has joined #RubyOnRails
[10:48:12] PedramT: has joined #RubyOnRails
[10:50:45] AimlessRAven: has joined #RubyOnRails
[10:51:13] AimlessRAven: hi all, map iteration return my array.. what iteration i need to use to return me hash
[10:51:14] chrisarcand: has joined #RubyOnRails
[10:51:41] norc: !xy AImlessRaven
[10:53:20] norc: AImlessRaven: !xy
[10:53:27] norc: Maybe I am not allowed to do this :S
[10:53:37] norc: AImlessRaven: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[10:54:52] arBmind: has joined #RubyOnRails
[10:55:25] snowy: has joined #RubyOnRails
[11:00:00] akkmaxon: has joined #RubyOnRails
[11:03:19] artto: has joined #RubyOnRails
[11:05:23] avelldiroll: has joined #RubyOnRails
[11:06:24] AimlessRAven: norc ok audits.map(&:audited_changes).map { |i| i['status'].kind_of?(Array) ? i['status'].last : i['status'] }.compact this return me array
[11:06:27] flat_whi_: has joined #RubyOnRails
[11:06:30] AimlessRAven: how to refactory to return me hash
[11:07:05] norc: return {}
[11:07:32] aloneintheworld: has joined #RubyOnRails
[11:07:48] |RicharD|: has joined #RubyOnRails
[11:09:05] njero: has joined #RubyOnRails
[11:09:08] AimlessRAven: norc: undefined method `return' for ["pending", "awaiting_payment", "awaiting_fulfillment"]:Array
[11:09:25] PedramT: has joined #RubyOnRails
[11:10:07] norc: This is precisely why I ask people to learn Ruby before they start doing Rails projects..
[11:10:26] User458764: has joined #RubyOnRails
[11:10:29] lacuna: has joined #RubyOnRails
[11:10:33] Lewix: has joined #RubyOnRails
[11:10:52] xhoy: has joined #RubyOnRails
[11:11:02] AimlessRAven: ill learn ruby paralelicly
[11:12:17] |RicharD|: Guys I've a problem with ActiveModelSerializer, I'm trying to show the JSON of my Post that has many comments, and every comment belongs to a User
[11:12:36] iamayam: has joined #RubyOnRails
[11:12:37] |RicharD|: the problem is that in my json, it don't show the user of the comment
[11:12:46] |RicharD|: here a bit of code: https://gist.github.com/anonymous/f941bc43f477d6b9d9d7
[11:12:53] |RicharD|: what I'm doing wrong ?
[11:13:13] |RicharD|: (there is also the JSON and all ams)
[11:13:16] norc: |RicharD|: well, I can tell you what you did right: Presenting the problem properly. :-P
[11:13:28] |RicharD|: thank you :P
[11:14:09] tibra: ACTION suggests AImlessRaven to take a look at this beautiful gist
[11:14:37] norc: |RicharD|: That behavior is expected.
[11:14:55] |RicharD|: I guess for not show too many things nested ?
[11:15:33] norc: |RicharD|: The JSON adapter only operates on immediate attributes.
[11:15:53] |RicharD|: how could fix it ? I want avoid to do another ajax call for comments if possible :P
[11:15:59] norc: |RicharD|: https://github.com/rails-api/active_model_serializers/blob/master/lib/active_model/serializer/adapter/json.rb#L28
[11:16:01] arup_r: |RicharD|: can you show the controller action from where it is getting rendered
[11:16:03] norc: Reimplement this.
[11:16:41] |RicharD|: arup_r: what do you mean ?
[11:16:48] norc: |RicharD|: Or you could use jbuilder which is probably a bit better if you have the need to present specific views.
[11:17:12] arup_r: |RicharD|: nvm, ignore me :p
[11:17:37] |RicharD|: So I have 2 options: jbuilder and 2 ajax calls, correct ?
[11:18:04] norc: Those would be the 2 options that come to mind immediately.
[11:18:45] |RicharD|: ok thanks :)
[11:20:52] |RicharD|: I think I will do 2 ajax requests, because then I could implement a pagination for comments
[11:21:03] |RicharD|: so seems the cleanest solution
[11:21:09] norc: Indeed it does. :)
[11:21:26] pydave6367: has joined #RubyOnRails
[11:22:15] |RicharD|: Thanks again ;)
[11:28:13] theod: has joined #RubyOnRails
[11:28:48] gavit: this Tell and don't ask principle - I think I understand it, just dont know how to apply it. I keep getting stuck at a 'ask' :'(
[11:29:06] gavit: /end of rant
[11:30:08] PedramT: has joined #RubyOnRails
[11:31:29] yfeldblum: has joined #RubyOnRails
[11:32:32] tibra_: has joined #RubyOnRails
[11:33:33] zpe: has joined #RubyOnRails
[11:33:45] FailBit: we're here to help you design your code not write it
[11:37:43] lacrymology: has joined #RubyOnRails
[11:38:22] PedramT: has joined #RubyOnRails
[11:39:26] riddled: has joined #RubyOnRails
[11:39:50] AimlessRAven: https://gist.github.com/anonymous/2b0e2745db26d734b005 this is my method ..
[11:39:55] AimlessRAven: i wanna return me hash not array
[11:40:55] thekkid: has joined #RubyOnRails
[11:41:50] udiudi: Hi guys. Any recommendations regarding CSRF in Single Page Web apps? (w/backbone and jQuery ujs)
[11:43:04] xota: has joined #RubyOnRails
[11:43:37] tibra: has joined #RubyOnRails
[11:43:49] tibra: AImlessRaven: a method in ruby will always return the last instruction or something comes after a "return" keyword. so when you push something to an array that is what gets returned
[11:44:27] kp666: has joined #RubyOnRails
[11:44:40] PedramT: has joined #RubyOnRails
[11:45:33] Rodya_: has joined #RubyOnRails
[11:46:16] tibra: this is btw the reason to learn some ruby before solving problems with it
[11:46:41] theod: has joined #RubyOnRails
[11:46:58] AimlessRAven: tibra: yea ill learn ruby paralelicly but for now.. i have this task
[11:47:37] tibra: (hint: coding is even more fun when not running into a gazillion problems associated with ruby when doing rails)
[11:50:57] tetraktys: has joined #RubyOnRails
[11:51:42] shibabu: has joined #RubyOnRails
[11:51:51] artto: has joined #RubyOnRails
[11:57:05] Cervajz: has joined #RubyOnRails
[11:57:33] zotherstupidguy: has joined #RubyOnRails
[11:58:10] Cervajz: has joined #RubyOnRails
[11:59:38] lethjakman: has joined #RubyOnRails
[12:00:48] FooMunki: has joined #RubyOnRails
[12:02:17] sevenseacat: has joined #RubyOnRails
[12:02:18] djbkd: has joined #RubyOnRails
[12:03:47] chrisarcand: has joined #RubyOnRails
[12:03:56] pydave6367: has joined #RubyOnRails
[12:05:08] norc: has joined #RubyOnRails
[12:06:03] cgfbee: has joined #RubyOnRails
[12:06:28] edwinvdgraaf: has joined #RubyOnRails
[12:06:36] norc: Hi. When I include a simple "= console" to a view, my Rails application server renders the "We're sorry, but something went wrong page". However, my server log is showing this:
[12:06:37] norc: https://gist.github.com/anonymous/4dc31e661eef12af74d0
[12:07:31] norc: What is going on here?
[12:07:55] norc: My server is running in development mode even. This is giving me a real headache.
[12:08:10] FailBit: it might be raising
[12:08:19] FailBit: since views are usually compiled to an unlinked tempfile
[12:10:09] edwinvdgraaf: has joined #RubyOnRails
[12:10:27] norc: FailBit: Do you mean that console is raising an exception?
[12:10:54] FailBit: it might be yeah
[12:11:02] tagrudev: has joined #RubyOnRails
[12:13:11] norc: Mmm okay. A bit of testing shows that Rails is no longer giving me the normal debug view when an exception is shown in any case.
[12:14:52] RTG`: what does Rails.env output?
[12:15:23] kfrz: has joined #RubyOnRails
[12:15:31] norc: FailBit: Okay I nailed it down. The mere presence of the web-console gem is somehow causing all of this.
[12:17:20] norc: The 3.0.0 version at least.
[12:18:03] cgfbee: has joined #RubyOnRails
[12:19:10] norc: Ill just keep using better_errors - that at least just works.
[12:19:50] gavit: FailBit: nah, you're here for moral support :)
[12:20:46] AimlessRAven: has joined #RubyOnRails
[12:20:54] AimlessRAven: what is the short version of rails each ?
[12:21:00] gavit: https://gist.github.com/gavit/fa4050baf7615a45becc#file-salary_calculator-rb-L24 <- I have a feeling I have to write my code like this(I'll need to repeat this function for 'complete periods' and for the 'last period' and it seriously feels like ASK rather than TELL!
[12:21:26] gavit: AimlessRaven: my_collection.each do |element| ... end
[12:21:55] rvanlieshout: AimlessRaven: my_collection.each(&:foo)
[12:22:12] rvanlieshout: = .each{ |item| item.foo }
[12:22:29] FailBit: except faster
[12:22:40] rvanlieshout: is it really?
[12:22:46] rvanlieshout: it's shorter for sure
[12:22:48] FailBit: the second form is a call into rubyland for every block iteration
[12:22:48] c355E3B: has joined #RubyOnRails
[12:22:51] rvanlieshout: but i doubt it's any faster
[12:22:53] FailBit: the first form is a C-based proc
[12:23:05] rvanlieshout: which will still iterate over all and call it
[12:23:07] tibra: that is interesting
[12:23:13] gavit: ACTION thinks the speed difference is for asm coders.
[12:23:19] FailBit: true, it's not that much faster
[12:23:25] rvanlieshout: i doub't it's any
[12:23:32] FailBit: but it does avoid the overhead of calling into a proc
[12:23:44] FailBit: they carry around lots of baggage related to context
[12:24:24] rvanlieshout: and the fact that it uses to_proc doesn't matter i guess :P
[12:24:26] hannelita: has joined #RubyOnRails
[12:24:39] FailBit: that's the point, it doesn't
[12:24:41] FailBit: it converts it to C
[12:24:58] chrisarcand: has joined #RubyOnRails
[12:25:53] rvanlieshout: cause it's just Symbol#to_proc
[12:26:18] FailBit: https://github.com/ruby/ruby/blob/trunk/proc.c#L1079
[12:26:51] rvanlieshout: that converts that symbol into a proc
[12:26:55] daivyk: has joined #RubyOnRails
[12:26:57] rvanlieshout: then it iterates and calls the block each time
[12:27:06] rvanlieshout: quite similar to passing a block and calling that each time
[12:27:52] FailBit: https://github.com/ruby/ruby/blob/trunk/proc.c#L585
[12:29:32] rvanlieshout: what's with that function?
[12:30:46] FailBit: a cfunc_proc instructs the VM to execute the instructions at block.iseq
[12:31:22] FailBit: if you look at rb_sym_proc
[12:31:30] FailBit: rb_sym_to_proc
[12:31:36] FailBit: it calls that with the string value of the symbol
[12:33:21] rvanlieshout: yeah. so it creates a block
[12:33:39] rvanlieshout: but how is that so different from creating one yourself?
[12:33:42] FailBit: which is faster than VM interpretation of actual block code, yes
[12:34:16] rvanlieshout: ooh like that
[12:34:27] rvanlieshout: it uses compiled code to create a proc
[12:35:51] AzaToth: has joined #RubyOnRails
[12:35:57] circ-user-lD69d: has joined #RubyOnRails
[12:37:01] agoldboi: has joined #RubyOnRails
[12:37:14] bronson: has joined #RubyOnRails
[12:37:15] kies^: has joined #RubyOnRails
[12:38:27] mbreedlove: has joined #RubyOnRails
[12:38:55] udiudi: Hi guys. Any recommendations regarding CSRF in Single Page Web apps? (w/backbone and jQuery ujs) should it work out of the box? I'm getting a lot of "handle_unverified_request" events
[12:39:15] chipotle: has joined #RubyOnRails
[12:39:34] dionysus69: has joined #RubyOnRails
[12:40:36] steharro: has joined #RubyOnRails
[12:40:45] theod: has joined #RubyOnRails
[12:41:14] gbgdev: has joined #RubyOnRails
[12:41:19] roshanav_: has joined #RubyOnRails
[12:41:40] thekkid: has joined #RubyOnRails
[12:43:07] blackmesa: has joined #RubyOnRails
[12:43:18] pawnbox: has joined #RubyOnRails
[12:46:18] Rodya_: has joined #RubyOnRails
[12:49:00] pawnbox: has joined #RubyOnRails
[12:50:38] moei: has joined #RubyOnRails
[12:53:13] symbol: has joined #RubyOnRails
[12:55:16] AimlessRAven: has joined #RubyOnRails
[12:55:33] ornerymoose: has joined #RubyOnRails
[12:56:15] snowy: has joined #RubyOnRails
[12:56:18] AimlessRAven: how to create many hashesh with each on this method https://gist.github.com/anonymous/a4daac8852601b7ed4a4?
[12:56:21] AimlessRAven: how to create many hashesh with each on this method https://gist.github.com/anonymous/a4daac8852601b7ed4a4 ?
[12:58:40] FailBit: how many people can load this url?
[12:58:43] FailBit: https://derpicdn.net/assets/application-eb2f12c6337acfc9f188801264a7759b6083a6c5aa85b65a9e075b9c73ffac2f.js
[12:58:49] FailBit: we're getting a _lot_ of reports of 400 errors
[12:59:06] zetab: works fine
[13:00:17] lethjakman: has joined #RubyOnRails
[13:01:25] lubekpl: has joined #RubyOnRails
[13:02:45] allcentury: has joined #RubyOnRails
[13:03:19] pawnbox_: has joined #RubyOnRails
[13:05:22] rvanlieshout: http://downforeveryoneorjustme.com/https://derpicdn.net/assets/application-eb2f12c6337acfc9f188801264a7759b6083a6c5aa85b65a9e075b9c73ffac2f.js
[13:05:31] theod: has joined #RubyOnRails
[13:05:33] AimlessRAven: how to create many hashesh with each on this method https://gist.github.com/anonymous/a4daac8852601b7ed4a4
[13:07:13] arup_r: has joined #RubyOnRails
[13:08:12] dionysus69: there was someone here who planned to make a IAS or PAS for a special discounted price for this chat room, anyone knows how's that going through?
[13:10:34] rvanlieshout: AimlessRaven: just asking the question over and over again won't help
[13:10:40] rvanlieshout: it would surely not make you a better developer
[13:11:04] arup_r: has joined #RubyOnRails
[13:16:02] shibabu: has joined #RubyOnRails
[13:16:31] RTG`: norc: any particular reason to switch to web-console?
[13:16:52] PedramT: has joined #RubyOnRails
[13:20:34] flat_white: has joined #RubyOnRails
[13:22:05] ornerymoose: has joined #RubyOnRails
[13:23:04] norc: RTG`: I would like to be able to interactively inspect some bizarre behaviour.
[13:23:21] riddled: has joined #RubyOnRails
[13:23:22] chipotle: has joined #RubyOnRails
[13:23:55] zpe: has joined #RubyOnRails
[13:24:30] artto: has joined #RubyOnRails
[13:28:59] jyuan: has joined #RubyOnRails
[13:32:13] gavit: https://gist.github.com/gavit/fa4050baf7615a45becc#file-salary_calculator-rb-L24 <- I have a feeling I have to write my code like this(I'll need to repeat this function for 'complete periods' and for the 'last period. How can I DRY this?
[13:33:05] quazimodo: has joined #RubyOnRails
[13:33:57] tibra: gavit: This is no direct help to your problem, but I can highly recommend Martin Fowlers patterns on accounting system, helped me a lot over time: http://www.martinfowler.com/apsupp/accounting.pdf
[13:34:00] ornerymoose: has joined #RubyOnRails
[13:35:53] tibra: he basically talks about object separation vs. hardcoding. if you're designing anything with money/salary/accounts it is a thought-provoking read
[13:37:28] bronson: has joined #RubyOnRails
[13:38:25] chipotle: has joined #RubyOnRails
[13:39:08] roshanavand: has joined #RubyOnRails
[13:40:02] Guest11: has joined #RubyOnRails
[13:40:03] Guest11_: has joined #RubyOnRails
[13:41:00] Guest11: has joined #RubyOnRails
[13:42:25] thekkid: has joined #RubyOnRails
[13:44:39] Guest11: has joined #RubyOnRails
[13:47:18] Rodya_: has joined #RubyOnRails
[13:50:53] Snowy_: has joined #RubyOnRails
[13:52:06] roshanavand: has joined #RubyOnRails
[13:53:25] Bloomer: has joined #RubyOnRails
[13:56:21] lipoqil: has joined #RubyOnRails
[14:00:51] johnflux_: has joined #RubyOnRails
[14:00:52] johnflux_: has joined #RubyOnRails
[14:05:40] victortyau: has joined #RubyOnRails
[14:05:54] lethjakman: has joined #RubyOnRails
[14:07:07] ellisTAA: has joined #RubyOnRails
[14:07:09] udiudi: Any reason you can think of for session[:_csrf_token] being nil?
[14:08:36] roshanavand: has joined #RubyOnRails
[14:08:37] ellisTAA: i just got a review for my coding challenge ??? the guy said he recommends I focus my effortson proper object design, oo principles, and overall engineering best practices. i was wondering if somebody could give me specific feedback on my code? https://github.com/ellismarte/BetterDR
[14:10:39] Ergo^: has joined #RubyOnRails
[14:11:57] havenwood: ellistaa: .gitignore your .DS_Store and name all your Ruby files in snake_case.rb.
[14:12:35] blackmesa: has joined #RubyOnRails
[14:13:12] ellisTAA: havenwood: ok that makes sense
[14:13:12] norc: ellistaa: Also I found the usage of "prepend" as a local variable slightly offensive. :-)
[14:13:19] ellisTAA: norc: lol why
[14:13:28] havenwood: ellistaa: keyword!
[14:13:32] norc: havenwood: not keyword.
[14:13:34] norc: But method.
[14:13:46] ellisTAA: you mean its a verb and not a noun?
[14:14:01] norc: ellistaa: Usually its not a big deal, but this particular method is often used freestanding inside Modules.
[14:14:19] havenwood: ellistaa: Module#prepend
[14:14:24] ramortegui: has joined #RubyOnRails
[14:14:31] norc: &ri Module#prepend
[14:14:48] ellisTAA: so when i use prepend i should place it in a module or prepend is already a thing inside the module object?
[14:15:04] ellisTAA: oh its already a thing
[14:15:16] havenwood: ellistaa: yeah, just name it something else
[14:15:39] norc: ellistaa: Its just an optical thing. You should just avoid using things like "extend", "include" or "prepend" as lvars.
[14:17:51] aegis3121: has joined #RubyOnRails
[14:18:48] tvw: has joined #RubyOnRails
[14:20:19] ellisTAA: has joined #RubyOnRails
[14:20:50] workmad3: has joined #RubyOnRails
[14:21:33] norc: ellistaa: Furthermore, hardcoding API keys into source code is worst practice. Even more so if that code ends up on a public github repo. :-)
[14:21:55] paulodiniz: has joined #RubyOnRails
[14:22:22] ellisTAA: yeah i know but i figured its just a coding challenge ??? i guess that didn???t help me
[14:22:34] sdwrage: has joined #RubyOnRails
[14:22:59] ellisTAA: thanks for the feedback i appreciate it
[14:23:10] norc: ellistaa: These are just very simple basics. Reading a .gitignore'd yml file is straight forward. :-)
[14:23:12] bmalum: has joined #RubyOnRails
[14:24:02] ellisTAA: so when i put my key in a yml file and use .gitignore it doesn???t get uploaded to github?
[14:24:14] jas02: has joined #RubyOnRails
[14:24:34] norc: ellistaa: .gitgnore makes git ignore the file for any interaction (such as git add)
[14:24:46] norc: If it is not added, it cannot be commited. If its not commited, it cannot be pushed.
[14:24:55] sankaber: has joined #RubyOnRails
[14:25:09] ellisTAA: norc: so then anyone working on the repo has to add a yml file and api key to use it?
[14:25:18] udiudi: has joined #RubyOnRails
[14:25:22] udiudi: has left #RubyOnRails: ()
[14:25:27] udiudi: has joined #RubyOnRails
[14:25:31] norc: ellistaa: Yup. You could then add a key.yml.example that the person just needs to copy and modify.
[14:25:39] norc: ellistaa: Or you could use an environment variable
[14:25:47] mbreedlove: has joined #RubyOnRails
[14:26:17] norc: Passing as arguments is bad practice again, as these can usually be easily viewed in your process list.
[14:26:43] ellisTAA: the environment variable file would be hidden also right?
[14:27:08] norc: ellistaa: Or no file at all. You would require your user to invoke with API_KEY=abc ./command
[14:28:13] ellisTAA: norc: ok i guess i did fuck up on that part
[14:28:39] iateadonut: has joined #RubyOnRails
[14:28:49] artto: has joined #RubyOnRails
[14:28:50] norc: ellistaa: next up is potential infinite recursions going on.
[14:29:13] norc: ellistaa: https://github.com/ellismarte/BetterDR/blob/master/Model/knownConditions.rb#L24-L34 look at L24 and L34. Should be obvious.
[14:29:32] norc: So it is possible to crash the program by just recursing long enough until you exceed the stack limit.
[14:29:50] snowy: has joined #RubyOnRails
[14:30:07] ellisTAA: ah interesting
[14:30:20] ellisTAA: yeah i guess that???s not ideal
[14:30:38] norc: ellistaa: Next up: I would not expect an initializer of a model to present me with an interactive interface.
[14:30:43] norc: Separate these things.
[14:30:52] User458764: has joined #RubyOnRails
[14:31:05] _Tariq: has joined #RubyOnRails
[14:31:32] Ropeney: has joined #RubyOnRails
[14:31:53] norc: These should give you enough to start doing some refactoring for a bit. :)
[14:31:57] ellisTAA: ah ok yeah that makes sense also ???
[14:32:06] johnflux_: has joined #RubyOnRails
[14:32:07] johnflux_: has joined #RubyOnRails
[14:32:42] norc: ellistaa: In fact I would separate the interactive shell from the model entirely.
[14:32:43] ellisTAA: ive been reading about design patterns so i thought my design was ok. i???m kinda pissed i didn???t create a view for the interface ..
[14:32:57] norc: Model is about business logic.
[14:33:37] norc: ellistaa: Its okay. Reading does not give you experience, so no harm done. :)
[14:34:26] flat_white: has joined #RubyOnRails
[14:36:24] jgpawletko: has joined #RubyOnRails
[14:37:21] razorgfx: has joined #RubyOnRails
[14:38:08] ellisTAA: has joined #RubyOnRails
[14:38:55] roshanavand: has joined #RubyOnRails
[14:41:26] zpe: has joined #RubyOnRails
[14:42:42] symbol: has joined #RubyOnRails
[14:43:07] mordof_work: has joined #RubyOnRails
[14:43:13] thekkid: has joined #RubyOnRails
[14:44:22] lacuna: has joined #RubyOnRails
[14:44:59] joshkovach: has joined #RubyOnRails
[14:47:41] treehug88: has joined #RubyOnRails
[14:47:43] chouhoulis: has joined #RubyOnRails
[14:49:37] razorgfx: has joined #RubyOnRails
[14:50:13] B1n4r10: has joined #RubyOnRails
[14:52:47] arup_r: has joined #RubyOnRails
[14:53:03] msyvich: has joined #RubyOnRails
[14:53:08] msyvich: Is it necessary to install rails5 from source?
[14:53:17] havenwood: msyvich: gem install rails --pre
[14:53:46] msyvich: havenwood: lovely thanks
[14:55:20] jthomas_: has joined #RubyOnRails
[14:57:19] zpe: has joined #RubyOnRails
[14:59:11] paulodiniz: has joined #RubyOnRails
[15:00:10] ellisTAA: has joined #RubyOnRails
[15:00:26] The_Phoenix: has joined #RubyOnRails
[15:00:51] lacuna: has joined #RubyOnRails
[15:02:33] atomical_: has joined #RubyOnRails
[15:04:21] norc: /join #networking
[15:04:37] JakFrist: has joined #RubyOnRails
[15:04:55] msyvich: has joined #RubyOnRails
[15:05:07] Sylario: has joined #RubyOnRails
[15:05:40] paulodiniz: has joined #RubyOnRails
[15:06:32] Sylario: In an API giving access to a user, is there a convention on what kind of action should be used to find one user by email or any other unique attribute?
[15:06:53] _Tariq: has joined #RubyOnRails
[15:08:48] _Tariq: has joined #RubyOnRails
[15:09:06] gavit: in rails 4 when adding a module in /lib, where do I specify how to load this file?
[15:09:18] ornerymoose: has joined #RubyOnRails
[15:09:24] ellisTAA: has joined #RubyOnRails
[15:09:45] ddv: gavit: it isn't automatically loaded?
[15:10:13] ddv: gavit: what kind of module is this and what does it do?
[15:11:14] gavit: ddv: self made module, I want to include it in my class
[15:11:17] flashpoint9: has joined #RubyOnRails
[15:11:26] ddv: gavit: what does it do?
[15:11:39] gavit: ddv: it does calculations
[15:11:53] _Tariq: has joined #RubyOnRails
[15:11:59] ddv: gavit: why is this not in models?
[15:12:18] gavit: ddv: I'm moving it out because the model has too many functions
[15:14:33] dionysus69: has joined #RubyOnRails
[15:15:21] gavit: so much questions, still no answer. /sigh
[15:15:37] unreal: has joined #RubyOnRails
[15:16:31] msyvich: havenwood: for some reason rails -v still results in 4.2.5
[15:16:37] _Tariq: has joined #RubyOnRails
[15:16:55] msyvich: is there something special we have to do to switch the active rails version when installing --pre?
[15:17:25] renews: has joined #RubyOnRails
[15:17:57] chipotle: has joined #RubyOnRails
[15:18:02] dstarh: has joined #RubyOnRails
[15:18:36] arup_r: has joined #RubyOnRails
[15:18:57] shibabu: has joined #RubyOnRails
[15:19:52] gbgdev: has joined #RubyOnRails
[15:20:10] arup_r: gavit: it will be autloaded
[15:20:46] havenwood: msyvich: Try restarting your terminal.
[15:20:59] msyvich: yea this didn't work haven wood
[15:21:06] msyvich: i'm using rbenv too but everything looks right
[15:21:13] msyvich: havenwood*
[15:21:33] havenwood: msyvich: Already did a?: rbenv rehash
[15:21:50] havenwood: msyvich: Works on my machine! (chruby)
[15:21:53] msyvich: i'm gonna try uninstalling / reinstalling
[15:22:59] havenwood: msyvich: You might also try: rails _5.0.0.beta1_ -v
[15:23:05] arup_r: gavit: no it will not now.. You have to do it manually.. http://guides.rubyonrails.org/autoloading_and_reloading_constants.html#autoload-paths
[15:23:17] arup_r: it was, but now removed
[15:23:29] msyvich: havenwood: it's definitely on my machine
[15:23:46] msyvich: what's funny is how I've just uninstalled all versions of rails, then installed rails 5.0.0
[15:23:49] msyvich: then done rails -v
[15:23:55] msyvich: and it still says 4.2.5
[15:23:55] C0r3: has joined #RubyOnRails
[15:24:05] havenwood: msyvich: How about?: rails _5.0.0.beta1_ -v
[15:24:08] msyvich: it must be a mac / rbenv issue
[15:24:37] msyvich: ??? ~ rails _5.0.0.beta1_ -v
[15:24:37] msyvich: Rails 5.0.0.beta1
[15:24:48] eljimmy: has joined #RubyOnRails
[15:27:51] smathy: has joined #RubyOnRails
[15:29:47] yardenbar: has joined #RubyOnRails
[15:31:11] volume166: has joined #RubyOnRails
[15:31:32] msyvich: Yeah something about rbenv + gem install rails --pre is bonkers
[15:32:13] mrtomme: has joined #RubyOnRails
[15:34:23] ellisTAA: has joined #RubyOnRails
[15:35:52] pydave6367: has joined #RubyOnRails
[15:37:13] msyvich: havenwood: https://gist.github.com/freen/f799ea7a64b60bdeec17
[15:38:06] FooMunki: has joined #RubyOnRails
[15:40:03] brahman: has joined #RubyOnRails
[15:40:38] lxsameer: has joined #RubyOnRails
[15:40:38] lxsameer: has joined #RubyOnRails
[15:42:54] brahman: Hi, I am trying to use nested attributes to update a has_many association. When I specify an :id to my attributes hash, ActiveRecord can not find an instance with id = A and group_id = B. However if I do not specify the id in the hash it creates 2 new instances. Happy to pastebin some code if it helps...
[15:42:56] ellisTAA: has joined #RubyOnRails
[15:43:16] msyvich: has joined #RubyOnRails
[15:43:58] thekkid: has joined #RubyOnRails
[15:44:23] volume166: has joined #RubyOnRails
[15:44:32] smathy: brahman, !gist instead
[15:44:32] helpa: brahman: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[15:45:49] chadhs: has joined #RubyOnRails
[15:46:03] adavia: has joined #RubyOnRails
[15:46:17] ellisTAA: has joined #RubyOnRails
[15:47:17] ubiks: has joined #RubyOnRails
[15:47:50] ubiks: quick question: is omniauth secure when creating a new user with the basic parameters of the callback hash or should I implement something else?
[15:48:01] lacrymology: has joined #RubyOnRails
[15:50:40] brahman: smathy: https://gist.github.com/brahman81/72ebd59a6d2fe90dfdd4
[15:50:52] chouhoul_: has joined #RubyOnRails
[15:51:04] brahman: Let me know if you want to see anything else. I included the output from my rails console.
[15:51:16] volume166: has joined #RubyOnRails
[15:52:34] chouhoulis: has joined #RubyOnRails
[15:52:34] FailBit: ACTION punches a hole in his monitor
[15:52:59] Ergo: has joined #RubyOnRails
[15:53:45] volume166: has left #RubyOnRails: ()
[15:54:00] brahman: smathy: any ideas?
[15:54:18] tubbo: fists of furry
[15:58:07] TheDracle: has joined #RubyOnRails
[16:00:03] C0r3: has joined #RubyOnRails
[16:00:21] ellisTAA: has joined #RubyOnRails
[16:00:56] smathy: brahman, so you're trying to both create a new group AND attach an existing instance to that new group?
[16:01:03] gNoobie__: has joined #RubyOnRails
[16:01:30] smathy: brahman, use `instance_ids=` for that instead.
[16:01:54] pawnbox: has joined #RubyOnRails
[16:02:35] tagrudev: has joined #RubyOnRails
[16:02:46] pawnbox: has joined #RubyOnRails
[16:03:14] guiNoobie: has joined #RubyOnRails
[16:03:45] Firoot73: has joined #RubyOnRails
[16:05:42] brahman: Yes exactly.
[16:05:49] msyvich: havenwood: turns out the solution is to be explicit about the -v when gem install rails --pre
[16:05:57] msyvich: gem install rails -v 5.0.0.beta1 --pre
[16:06:05] brahman: giving your suggestion a go.
[16:07:03] gNoobie__: has joined #RubyOnRails
[16:07:06] montgomjean: has joined #RubyOnRails
[16:07:32] pydave6367: has joined #RubyOnRails
[16:07:43] gNoobie__: has joined #RubyOnRails
[16:08:25] brahman: smathy: that works but creates a new instance as the instance_id column already exists for my instance table. Should I not be using the id column from teh table instance?
[16:08:55] msyvich_: has joined #RubyOnRails
[16:09:37] hannelita: has joined #RubyOnRails
[16:11:06] theod: has joined #RubyOnRails
[16:11:32] C0r3: has joined #RubyOnRails
[16:12:15] B1n4r10: has joined #RubyOnRails
[16:12:29] legohead_: has joined #RubyOnRails
[16:12:30] brahman: smathy: on line 13 of file1, the ActiveRecord error suggests that it's trying to find an instance record with id = 12 and group_id already assigned. Is that normal?
[16:13:02] msyvich: has joined #RubyOnRails
[16:13:09] ldnunes: has joined #RubyOnRails
[16:13:51] smathy: brahman, what do you mean instance_id? Your instances table should have a group_id - not the other way around.
[16:15:20] brahman: yes it does have group_id, (although it has instance_Id also as I am tracking AWS instance id.)
[16:15:43] brahman: sorry maybe I got confused when you said try with `instance_ids=`
[16:16:31] chouhoul_: has joined #RubyOnRails
[16:17:04] bronson: has joined #RubyOnRails
[16:17:08] brahman: how should I try with instance_ids ?
[16:17:12] smathy: brahman, `instance_ids=` is a method added by `has_many :instances` - it's how you assign existing Instance records to a Group, ie. from the form will just come an array of ids.
[16:17:17] kfrz: has joined #RubyOnRails
[16:17:35] tonymilne: has joined #RubyOnRails
[16:17:57] C0r3: has joined #RubyOnRails
[16:18:17] akkmaxon: has joined #RubyOnRails
[16:18:32] brahman: ah so you mean not to use the nested attributes but update that instance_ids directly with a list of requested instance id's?
[16:18:57] bePolite: has joined #RubyOnRails
[16:18:57] bePolite: has joined #RubyOnRails
[16:19:00] Frem: has joined #RubyOnRails
[16:19:20] legohead_: has left #RubyOnRails: ()
[16:19:23] brahman: That was my fall back solution to itterate over each id in the controller but I stumbled on nested attributes and it seemed to fit the bill although I was unable to implement correctly.
[16:19:24] Ainieco: has joined #RubyOnRails
[16:19:31] ellisTAA: has joined #RubyOnRails
[16:20:03] cac: has joined #RubyOnRails
[16:21:13] Ainieco: does anyone use docker for development and production environments? i'm curios if you use 2 docker files one for prod and on for dev env or solve it via docker-comnpose overrides somehow
[16:21:54] twi-lite: has joined #RubyOnRails
[16:21:57] leksster: has joined #RubyOnRails
[16:23:49] mustmodify_: has joined #RubyOnRails
[16:24:07] Honeycomb: has joined #RubyOnRails
[16:24:13] Yomero2: has joined #RubyOnRails
[16:24:29] mustmodify_: I'm getting this bundler conflict for actionpack... but I don't see the conflict. Seems like 4.1 would work. Any ideas? https://gist.github.com/mustmodify/bdba5d2a54cd6becaf47
[16:24:42] mustmodify: stupid nickname conflict
[16:24:43] chouhoulis: has joined #RubyOnRails
[16:25:36] wldcordeiro: has joined #RubyOnRails
[16:28:06] tubbo: Ainieco: you don't change your container between development and production, that basically defeats the entire purpose of using Docker =P
[16:28:14] tubbo: mustmodify: /msg NickServ HELP GHOST
[16:28:33] tubbo: mustmodify: note, that has to do with your /nick problem, not your bundler problem haha
[16:28:37] Ergo^: has joined #RubyOnRails
[16:28:46] mustmodify: tubbo: got that, thanks. I'll check it out.
[16:28:51] tubbo: what caused the conflict in the first place?
[16:29:15] tubbo: like did you add a gem?
[16:29:26] mustmodify: tubbo: apparently just `bundle update rails` after I switched rails from 4.0.x to 4.1.0
[16:29:52] tubbo: maybe you need to bundle update haml-rails too? looks like it's looking for ~> 4.0.0
[16:30:25] arup_r: has joined #RubyOnRails
[16:30:35] aegis3121: has joined #RubyOnRails
[16:31:19] mustmodify: I guess I read ~> 4.0
[16:31:28] mustmodify: the spade will want 4.0.x not 4.x
[16:31:40] Ainieco: tubbo: do you mean i should precompile assets and manually restart application every time i change something?
[16:31:41] mustmodify: tobb: thanks, can't believe I missed that.
[16:31:59] seaworthy: has joined #RubyOnRails
[16:31:59] mustmodify: Ainieco: if you're in production, yes. :)
[16:32:18] Ainieco: mustmodify: no, i'm dev and i'd like to use docker for dev and prod
[16:32:38] iFrey: has joined #RubyOnRails
[16:32:55] tubbo: Ainieco: not sure if you can mount a directory to a docker container like you can with vagrant, but i'd imagine not. rails lets you develop locally, why not go with that?
[16:33:17] tubbo: Ainieco: i've found a great use for containers to be parity between staging and production.
[16:33:28] alex88: has joined #RubyOnRails
[16:33:49] tubbo: so i develop locally, build a docker container, push that to staging, do some QA on staging, then if it all looks good i just launch the image i built as a container on production and turn off the old app server container
[16:34:09] tubbo: but i don't think you need to cut a new container image for every revision you make as a developer, that might get really tedious...
[16:34:49] Ainieco: tubbo: because with docker you don't have to setup any dependencies locally manually which is cool for newcomers and you don't have to have vagrant
[16:35:37] shinnya: has joined #RubyOnRails
[16:35:48] walidvb: has joined #RubyOnRails
[16:36:28] walidvb: hello all! i'm trying to have a helper increment a counter everytime it is used. can i not put this in the helper class itself?
[16:36:32] disgrntld: has joined #RubyOnRails
[16:37:54] Ainieco: tubbo: but i guess you're right
[16:37:58] Ainieco: tubbo: thanks for input
[16:38:51] theod: has joined #RubyOnRails
[16:40:57] tubbo: Ainieco: well, docker-machine uses vbox, basically the same concept.
[16:41:14] C0r3: has joined #RubyOnRails
[16:41:15] tubbo: it's still running in a linux vm since there's no such thing as containers on os x or windows
[16:41:17] podman: has joined #RubyOnRails
[16:41:20] _Tariq: has joined #RubyOnRails
[16:41:37] tubbo: walidvb: first of all, helper methods don't exist in a "helper class". they exist in a "helper module".
[16:41:59] tubbo: walidvb: and since helpers don't save state, there's not really a way to do this without persisting *something* to the DB and reading from it.
[16:42:07] tubbo: s/helpers/modules
[16:42:15] walidvb: well, that would be for every render of the page
[16:43:09] User458764: has joined #RubyOnRails
[16:43:30] walidvb: so i'd need to store it from my controller in a before_filter. which i didn't want to do, because this has nothing to do with the controller.
[16:43:52] walidvb: basically, a helper renders a tag, and i want to change the class of this tag everytime the helper methd is called.
[16:43:58] tubbo: walidvb: eww :P
[16:45:28] KazW: has joined #RubyOnRails
[16:46:17] arup_r: I wish I can access the Devise current_user helper from worker and models :p My feature got stuck due to this. Still thinking..
[16:46:22] speaking1ode: has joined #RubyOnRails
[16:51:40] skyjumper: hey all - question about RSpec best practices
[16:52:01] mustmodify: skyjumper: use minitest.
[16:52:10] C0r3: has joined #RubyOnRails
[16:52:11] rakm: has joined #RubyOnRails
[16:52:29] mustmodify: half kidding
[16:52:37] skyjumper: I'm not seeing a whole lot of this in use - https://relishapp.com/rspec/rspec-expectations/docs/customized-message
[16:52:43] skyjumper: is it not recommended?
[16:53:08] nettoweb: guys, my class User has_one columnist and has_many Articles, how I can Show all articles from user that are columnist?
[16:54:04] atomical: has joined #RubyOnRails
[16:54:16] mustmodify: Are there articles that are not from columnists?
[16:54:23] smathy: mustmodify ftw :)
[16:54:49] smathy: skyjumper, generally it's not needed.
[16:55:18] smathy: skyjumper, failures return a decent message and line number of the failure, a precise description is often overkill.
[16:55:47] corioliss: has joined #RubyOnRails
[16:55:56] [Butch]: has joined #RubyOnRails
[16:56:01] walidvb: has joined #RubyOnRails
[16:56:21] walidvb: tubbo: sry, got disconnected.
[16:56:36] walidvb: is there any other way?
[16:56:43] Macaveli: has joined #RubyOnRails
[16:56:44] workmad3: has joined #RubyOnRails
[16:57:11] polishdub: has joined #RubyOnRails
[16:58:31] mices: i made my profiles model messageable and since profiles belongs_to user i'm trying to reference my conversations like this @converstions = current_user.profile.mailbox.conversations
[16:58:58] mices: but it's coming up blank, am i referencing the conversations ok?
[17:00:13] mustmodify: has left #RubyOnRails: ()
[17:00:23] atomical_: has joined #RubyOnRails
[17:00:46] lacuna: has joined #RubyOnRails
[17:01:38] KazW: has joined #RubyOnRails
[17:03:57] lacuna: has joined #RubyOnRails
[17:03:58] lacuna: has joined #RubyOnRails
[17:05:10] claytonzaugg: has joined #RubyOnRails
[17:05:55] mikecmpbll: has joined #RubyOnRails
[17:06:12] atomical: has joined #RubyOnRails
[17:08:17] symbol: has joined #RubyOnRails
[17:09:27] tubbo: walidvb: well you could have that helper method use another object (like a model) to figure out what the class name should be
[17:09:50] arup_r: nettoweb: Article.joins(user: : columnist) ?
[17:09:52] tubbo: walidvb: like the helper could return content_tag :some_element, 'with content', class: content_tag_class.class_name
[17:10:10] tubbo: walidvb: and then content_tag_class could be defined on the helper to return ContentTagClass.all.first or something
[17:10:19] tubbo: either that or use Redis to persist the count
[17:10:23] tubbo: but Rails isn't gonna do it reliably.
[17:10:42] KazW: has joined #RubyOnRails
[17:10:42] walidvb: hm. that's overly complicated for my use case. and i'd have a model existing only for views.
[17:10:45] tubbo: mices: yeah if mailbox has_many :conversations that's fine
[17:10:52] mices: where does mailboxer store message bodies, i only see id, subject, created_at, updated_at in mailboxer_conversations
[17:10:57] nettoweb: arup_r thanks, didnt know this
[17:10:58] walidvb: i literally only need to add a class every second call of the helper.
[17:11:10] tubbo: walidvb: that's not what you asked :)
[17:11:12] tubbo: walidvb: !xy
[17:11:12] helpa: walidvb: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[17:11:22] walidvb: fair enough
[17:11:31] tubbo: walidvb: check out the `cycle` helper in rails for what you want to do
[17:11:40] tubbo: basically you can alternate between two classes or whatever
[17:11:45] tubbo: like a striped table
[17:11:48] walidvb: i could increment the counter in my view and pass it to the helper method, too. but i'm using it in various places.
[17:11:49] tubbo: you can ALSO do that with CSS3
[17:11:54] alphaatom: has joined #RubyOnRails
[17:11:55] dionysus69: has joined #RubyOnRails
[17:12:03] walidvb: no, because my elements are not in the same parent
[17:12:04] blackmesa: has joined #RubyOnRails
[17:12:06] tubbo: walidvb: why do you need a counter?
[17:12:14] walidvb: but i'll check out cycle, sounds like exactly what i need.
[17:12:21] tubbo: walidvb: !gist your code if you need any more help
[17:12:21] helpa: walidvb: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[17:12:26] walidvb: ;) you now know my problem hehe
[17:12:27] tubbo: walidvb: bot access is whitelisted
[17:12:57] mices: tubbo: there's no mailbox model, mailboxer didn't create one
[17:13:29] tubbo: mices: hmm, so what does current_profile.profile.mailbox point to?
[17:13:43] mices: tubbo: i have no idea
[17:13:52] tubbo: mices: would be a lot cooler if you did
[17:13:53] greenhat: has joined #RubyOnRails
[17:14:07] tubbo: dazed and confused driven development :D
[17:14:28] tubbo: mices: i'd throw a debugger right before that line and run current_user.profile.mailbox to figure out what object that method returns
[17:14:43] tubbo: then, i'd look at the source code of whatever object that returns to see how conversations is defined
[17:14:51] tubbo: and make sure that whatever data i set it up with, was the correct data
[17:15:25] mices: tubbo: although mailboxer didn't create a mailbox model if you look at the mailboxer github page under How can I retrieve my conversations? it says to use `alfa.mailbox.conversations`
[17:16:05] tubbo: mices: maybe you don't have any conversations
[17:16:19] mices: where alfa is the name attribute of any messageable model
[17:16:54] mices: tubbo: i'm using profile.id instead of name
[17:17:04] tubbo: mices: i'm pretty sure you aren't meant to call mailbox.conversations on an attribute.
[17:17:24] tubbo: mices: an attribute like name would probably be a String, and mailbox definitely didn't monkey-patch String to add the mailbox method.
[17:18:10] mices: it requires all messageable models to have an email and name field
[17:18:21] zpe: has joined #RubyOnRails
[17:18:27] mices: i gave it the name field but not an opportunity to use it
[17:20:31] markh: has joined #RubyOnRails
[17:20:51] shibabu: has joined #RubyOnRails
[17:21:31] mordof_work: has joined #RubyOnRails
[17:23:17] JoshL: has joined #RubyOnRails
[17:23:44] tubbo: mices: that's cool but totally irrelevant to the conversation.
[17:23:46] bricker: has joined #RubyOnRails
[17:26:11] nettoweb: arup_r Im looking the docs but cant fnd an option to list all articles from users that arent columnists
[17:26:25] nettoweb: arup_r do you know how to achieve this?
[17:27:07] nozpheratu: has joined #RubyOnRails
[17:27:48] rodferso1: has joined #RubyOnRails
[17:29:15] northfurr: has joined #RubyOnRails
[17:30:28] cac: has joined #RubyOnRails
[17:30:49] kb3ien: has joined #RubyOnRails
[17:30:55] chrisarcand: has joined #RubyOnRails
[17:31:30] Z00t: has joined #RubyOnRails
[17:31:48] Sawbones: has joined #RubyOnRails
[17:32:27] mchu: has joined #RubyOnRails
[17:32:30] kb3ien: Moved a working install to a new hosts, new ruby 2.3 new rails 3.2; now I'm getting ActionController::RoutingError (No route matches [GET] "/assets/..." on many a GET request. I did `rake assets:precompile` what else might be needed?
[17:32:58] nerfando: has joined #RubyOnRails
[17:33:03] JakFrist: has joined #RubyOnRails
[17:33:55] tubbo: kb3ien: can you see the precompiled assets in ./public/assets?
[17:34:04] nerfando: has joined #RubyOnRails
[17:35:45] workmad3: kb3ien: are you running this in production environment?
[17:35:51] momomomomo: has joined #RubyOnRails
[17:35:52] tim_s007: has joined #RubyOnRails
[17:36:45] dopie: Has anyone used google drive with rails? or google cloud storage?
[17:37:02] kb3ien: I dont see them in public/
[17:39:32] safety_cut: has joined #RubyOnRails
[17:39:52] Deft: has joined #RubyOnRails
[17:41:02] kb3ien: RailEnv is set to production
[17:41:16] exhi: has joined #RubyOnRails
[17:41:42] tubbo: kb3ien: that's your problem
[17:41:48] bronson: has joined #RubyOnRails
[17:42:08] tubbo: kb3ien: at the very least when you run `rake assets:precompile` you should see stuff in public/assets
[17:43:03] helpa: dopie: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[17:43:05] kb3ien: I do see stuff, just not that stuff, might be an error unrelated to the problem at hand.... thanks.
[17:43:14] helpa: Incorrect.
[17:43:23] arthurix: has joined #RubyOnRails
[17:43:51] kb3ien: Perhaps someone removed the file from the project, but it's not needed, etc...
[17:43:52] exhi: is there a way to create different looking signup pages with Devise for Admin users and normal Users ? Since they're normally both under the registrations views..
[17:43:57] flashpoint9: has joined #RubyOnRails
[17:45:07] workmad3: kb3ien: also, if you're running in production, rails turns off serving static files from the rails server and expects you to set up nginx/apache/etc to serve static assets as they're much better at it than a ruby app server
[17:45:27] workmad3: kb3ien: so if you're running in production and just doing `rails s` to run the server, you'll probably be hitting that issue too
[17:45:38] kb3ien: The bigger mystery is when I load the page I see "Error compiling CSS asset" but whe 'viewsrc' is used. I get actual HTML that i'd expect.
[17:45:56] arthurix: has joined #RubyOnRails
[17:46:02] kb3ien: I'll take care of the static hosting, thanks for the advice...
[17:46:21] kb3ien: If nothing else the error logs will by 2% the size...
[17:46:57] dopie: Is it possible to use refile gem / fog for google drive?
[17:47:45] dopie: to upload files
[17:47:54] paulodiniz: has joined #RubyOnRails
[17:48:09] tubbo: dopie: you'd probably need a driver gem, not sure if one exists.
[17:48:17] tubbo: dopie: !rubytoolbox would be a great source for this
[17:48:17] helpa: dopie: http://www.rubytoolbox.com/
[17:48:29] tubbo: dopie: !xy also
[17:48:29] helpa: dopie: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[17:48:32] _Tariq: has joined #RubyOnRails
[17:49:13] rodfersou: has joined #RubyOnRails
[17:49:39] dopie: so im better off using refile
[17:49:48] kb3ien: perhaps if you look at the site, you'll get it, the uri is http://beta.library.bgc.bard.edu/ but the host is not the one in DNS
[17:50:11] kb3ien: the host is 2600:3c03::f03c:91ff:fef1:f3f7 or 45.79.175.153
[17:50:56] dopie: https://github.com/fog/fog-google/blob/master/README.md
[17:51:07] tubbo: kb3ien: view source on that page, you'll notice a lot of <script> tags pointing to each asset. that should not happen in production.
[17:51:18] tubbo: kb3ien: my guess is your server is not running in production.
[17:51:56] steharro: has joined #RubyOnRails
[17:54:56] kb3ien: How to confirm that ?
[17:55:08] ascarter: has joined #RubyOnRails
[17:56:53] nozpheratu: has joined #RubyOnRails
[17:57:15] momomomomo: has joined #RubyOnRails
[17:58:55] JohnT: has joined #RubyOnRails
[17:59:07] _Tariq: has joined #RubyOnRails
[17:59:49] kb3ien: the logs are full of "(development)" is that not an indicaton that we are not in production ?
[17:59:59] bronson: has joined #RubyOnRails
[18:00:11] rodfersou: has joined #RubyOnRails
[18:01:06] nozpheratu: has joined #RubyOnRails
[18:01:09] bronson: has joined #RubyOnRails
[18:01:35] sleungcy: has joined #RubyOnRails
[18:02:53] nfk|laptop: has joined #RubyOnRails
[18:02:53] tubbo: kb3ien: hehe that would be an indication that you are not running the rails app in production :)
[18:02:57] mices: where does mailboxer store messages, i don't have a messages table
[18:03:17] lacuna: has joined #RubyOnRails
[18:03:17] kb3ien: I thought so, probably for the best. given the error.
[18:03:58] guacamole: has joined #RubyOnRails
[18:04:40] tubbo: mices: reading the source of mailboxer/mailboxer on github will probably lead you to the right conclusion
[18:04:42] kb3ien: Where do I begin with the 'Error compiling CSS asset: Sass Syntax Error: Undefined variable: "$logo_image" ?
[18:05:35] kb3ien: It does reference a file, but the CSS issues are somewhat beyond my scope, and I'm not clear on what changed in ruby or rails to break them.
[18:06:09] roshanav_: has joined #RubyOnRails
[18:07:36] stesind: has joined #RubyOnRails
[18:08:59] pydave6367: has joined #RubyOnRails
[18:10:04] swgillespie: has joined #RubyOnRails
[18:10:10] deeprave: has joined #RubyOnRails
[18:10:19] machty: has joined #RubyOnRails
[18:10:32] jxf: has joined #RubyOnRails
[18:10:34] pyemkey: has joined #RubyOnRails
[18:11:12] gbgdev: has joined #RubyOnRails
[18:11:58] krainboltgreene: has joined #RubyOnRails
[18:12:00] B1n4r10: has joined #RubyOnRails
[18:12:22] tubbo: kb3ien: well even if things changed in ruby or rails, aren't you installing the same versions on the new host as you had on the old host?
[18:12:53] chipotle: has joined #RubyOnRails
[18:13:10] kb3ien: Its the same file as was on the old host.
[18:13:47] tubbo: kb3ien: yeah but what i mean is you aren't installing a new verson of ruby or rails here
[18:14:04] tubbo: so that's irrelevant
[18:14:23] mdel: has joined #RubyOnRails
[18:14:28] tubbo: my first guess is that you're calling a var that hasn't been defined yet, and/or you're using Sprockets require rather than Sass @import
[18:14:56] rajiv_: has joined #RubyOnRails
[18:15:55] ziyadb: has joined #RubyOnRails
[18:16:59] safety_cut: has joined #RubyOnRails
[18:17:08] jxs_: has joined #RubyOnRails
[18:17:15] Lloyd: has joined #RubyOnRails
[18:17:32] benlakey: has joined #RubyOnRails
[18:17:42] podman: has joined #RubyOnRails
[18:17:51] Obi_obi: has joined #RubyOnRails
[18:17:53] M-shine: has joined #RubyOnRails
[18:17:57] uranther: has joined #RubyOnRails
[18:17:58] Somnius: has joined #RubyOnRails
[18:18:00] shwoodard____: has joined #RubyOnRails
[18:18:09] tomaw_: has joined #RubyOnRails
[18:18:11] sdn90: has joined #RubyOnRails
[18:18:12] Frem: has joined #RubyOnRails
[18:18:24] amitchellbullard: has joined #RubyOnRails
[18:18:28] rajiv_: has left #RubyOnRails: ()
[18:18:36] lipoqil: has joined #RubyOnRails
[18:18:37] BBHoss: has joined #RubyOnRails
[18:18:41] golgaroth: has joined #RubyOnRails
[18:18:42] danlucraft: has joined #RubyOnRails
[18:18:44] czetter: has joined #RubyOnRails
[18:18:51] kumavis: has joined #RubyOnRails
[18:18:53] Hosh: has joined #RubyOnRails
[18:18:54] RubyNewbey____: has joined #RubyOnRails
[18:18:57] MiracleBlue__: has joined #RubyOnRails
[18:18:58] dotty: has joined #RubyOnRails
[18:18:59] ewilliam_: has joined #RubyOnRails
[18:19:05] ebryn: has joined #RubyOnRails
[18:19:13] c355E3B: has joined #RubyOnRails
[18:19:20] chancancode___: has joined #RubyOnRails
[18:19:24] lacuna: has joined #RubyOnRails
[18:19:25] lacuna: has joined #RubyOnRails
[18:19:26] dopie: has joined #RubyOnRails
[18:19:55] jord: has joined #RubyOnRails
[18:19:57] corioliss: has joined #RubyOnRails
[18:19:58] feignt: has joined #RubyOnRails
[18:20:36] aegis3121: has joined #RubyOnRails
[18:20:39] DukeDave: has joined #RubyOnRails
[18:20:53] upgrayeddd: has joined #RubyOnRails
[18:21:04] ELCALOR: has joined #RubyOnRails
[18:21:07] pfg: has joined #RubyOnRails
[18:21:09] justinweiss: has joined #RubyOnRails
[18:21:28] kb3ien: Not sure sonuds like the case. background:transparent asset_url($logo_image,image) no-repeat top left;
[18:21:59] jlyndon: has joined #RubyOnRails
[18:22:02] joaomdmoura__: has joined #RubyOnRails
[18:22:03] lxkm|work: has joined #RubyOnRails
[18:22:15] bronson: so respond_with was pulled into the responders gem... what's the right way to do this now?
[18:22:43] kapowaz__: has joined #RubyOnRails
[18:22:53] bronson: we don't go back to giant respond_to do |fmt|; format.html, format.xml, format.json etc; end do we?
[18:23:04] jlpeters: has joined #RubyOnRails
[18:23:07] alxndr: has joined #RubyOnRails
[18:23:08] matthewd: bronson: Use the responders gem?
[18:23:21] iamdevnul: has joined #RubyOnRails
[18:23:23] SuppliedRelic: has joined #RubyOnRails
[18:23:24] bronson: matthewd: well, it's a gem for a reason isn't it?
[18:23:35] bronson: figure if it were a good idea it would still be in core.
[18:23:55] spastorino: has joined #RubyOnRails
[18:24:34] guacamole: has joined #RubyOnRails
[18:24:56] lbotos_: has joined #RubyOnRails
[18:25:02] daxroc: has joined #RubyOnRails
[18:25:16] cac: has joined #RubyOnRails
[18:25:25] LordNelthon: has joined #RubyOnRails
[18:26:32] tejasmanohar: has joined #RubyOnRails
[18:26:32] atian: has joined #RubyOnRails
[18:26:33] barttenbrinke: has joined #RubyOnRails
[18:26:50] alethea: has joined #RubyOnRails
[18:27:06] ahills: has joined #RubyOnRails
[18:27:24] newton: has joined #RubyOnRails
[18:27:30] nomadicoder: has joined #RubyOnRails
[18:28:04] djbkd: has joined #RubyOnRails
[18:28:12] Hates_: has joined #RubyOnRails
[18:28:16] User458764: has joined #RubyOnRails
[18:29:29] CornishPasty: has joined #RubyOnRails
[18:29:50] Sylario: has joined #RubyOnRails
[18:30:08] jhill_: has joined #RubyOnRails
[18:30:12] gmci: has joined #RubyOnRails
[18:30:27] bronson: Maybe if you go with JBuilder or AMS, respond_with becomes superfluous?
[18:30:54] sublimate: has joined #RubyOnRails
[18:31:06] zrl: has joined #RubyOnRails
[18:31:09] slayerjain: has joined #RubyOnRails
[18:32:26] dmcc: has joined #RubyOnRails
[18:32:38] andrmrtmr: has joined #RubyOnRails
[18:32:41] norc: has joined #RubyOnRails
[18:33:36] acalewin: has joined #RubyOnRails
[18:34:47] mikecmpbll: has joined #RubyOnRails
[18:35:06] rodfersou: has joined #RubyOnRails
[18:35:42] Macaveli: has joined #RubyOnRails
[18:35:51] bronson: No, that appears incorrect... At least JBuilder still uses respond_to: https://github.com/rails/jbuilder/blob/master/lib/generators/rails/templates/controller.rb
[18:35:53] chrisarcand: bronson: You can read all about the reasoning and people's opinions on it here: https://github.com/rails/rails/pull/12136#issuecomment-50216483
[18:36:52] Guest4184____: has joined #RubyOnRails
[18:36:54] bronson: chrisarcand: thanks, I'll read through again.
[18:37:13] bronson: from what I remember, the opinions all make sense, but it's unclear what to do now...?
[18:37:15] momomomomo: has joined #RubyOnRails
[18:37:33] bronson: Or maybe it's clear, just use big repsond_to statements, and I'm selectively ignoring that. :)
[18:37:48] chrisarcand: bronson: FWIW I don't think you should be too worried about using the gem as 'doing it the wrong way'
[18:38:47] bronson: Really? Pulling page caching and other gems have been clear indications that they're now frowned upon.
[18:38:57] steffkes: has joined #RubyOnRails
[18:38:57] steffkes: has joined #RubyOnRails
[18:39:14] bronson: Seems like that's the reason here too, but I don't see much in the way of alternatives.
[18:39:46] bronson: caching at least was replaced with russian doll which is, agreed, much better!
[18:39:53] matthewd: bronson: https://github.com/rails/rails/pull/12136#issuecomment-50361922 seems quite clear
[18:39:56] peeja: has joined #RubyOnRails
[18:40:18] matthewd: > So [a big respond_to] strikes me as completely reasonable
[18:40:50] bronson: true. I guess sometimes I disagree with DHH.
[18:41:02] chrisarcand: This comment is also good: https://github.com/rails/rails/pull/12136#issuecomment-106371204
[18:41:11] bronson: devoting half of the lines in my controller to boilerplate doesn't seem so great to me... but I can get over it.
[18:41:12] matthewd: But responders isn't a "deprecated functionality extracted from rails" gem... it's an independent gem that already existed, and continues to exist
[18:41:30] matthewd: It just has responsibility for a little more of what it's providing, now
[18:42:17] bronson: @chrisarcand true, that is good.
[18:42:39] bronson: novohispano's point two posts below about using single-format controllers makes sense...
[18:43:20] bronson: matthewd: thanks for the reassurance.
[18:43:55] bronson: Guess I'll try single-format controllers and see how it goes. I'll fall back to responders if that fails.
[18:44:42] chrisarcand: bronson: And yet I also wouldn't like single-format controllers in my own app (assuming they are the same content, just different formats). I'd rather explicitly do as what Rails still supports with respond_to _or_ use the responders gem. See? Can't go wrong :D
[18:44:45] sandstrom: A question relating to logical operators and nesting (I'm designing an UI for it; http://i.imgur.com/bZP43np.png). If I force the outer 'conditional group' to always be && (AND), and the inner always || (OR), will that limit the type of expressions? (compared to allowing the choice of and/or in both nesting levels). My hunch is that it doesn't matter, i.e. you can express anything regardless, but I'm not 100% sure.
[18:45:10] matthewd: Also, once you've split your human- and API-facing controllers, (while I hesitate to put words in his mouth) I suspect David's opinion would be that exposing multiple API response formats is an anti-pattern
[18:45:22] JohnT: has joined #RubyOnRails
[18:45:27] lapide_viridi: has joined #RubyOnRails
[18:45:35] mchu: has joined #RubyOnRails
[18:45:38] yaymukund: has joined #RubyOnRails
[18:45:56] matthewd: (Like anything else, possibly something you're obliged to do for Reasons, but not necessarily a default design choice we want to encourage)
[18:46:03] yaymukund: has left #RubyOnRails: ()
[18:46:12] JakFrist: has joined #RubyOnRails
[18:46:21] bronson: In my case the html and api functionality is kinda different so splitting makes sense. Just extract the common stuff to concerns or ApplicationController.
[18:46:40] chrisarcand: Sounds solid to me
[18:46:41] akshat: has joined #RubyOnRails
[18:46:52] matthewd: sandstrom: It allows anything, but may make some expressions more awkward than they could otherwise be
[18:46:55] sandstrom: bronson you can roll a few custom methods in ApplicationController that does it for you (that's what I did)
[18:47:26] bronson: chrisarcand, matthewd: thanks. feeling reassured.
[18:47:55] sandstrom: matthewd thanks, how sure are you of this? is there a term for this, I'd like to read some example/proof of it :) (unless it's overly mathy)
[18:48:08] guacamole: has joined #RubyOnRails
[18:49:05] bronson: matthewd: not sure I agree that multiple response formats is an anti-pattern... Seems reasonable to provide some clients XML and some using JSON.
[18:49:06] nfk|laptop: has joined #RubyOnRails
[18:49:11] kb3ien: Giving up on it, seems to be a one-off bug. Other fish to fly...
[18:49:21] bronson: that said, I don't think I've ever written an app that requires that... so... maybe it is.
[18:49:44] matthewd: sandstrom: It's probably somewhere in https://en.wikipedia.org/wiki/Boolean_algebra :)
[18:49:45] tubbo: bronson: i'd rather support one API, not two.
[18:50:03] sandstrom: matthewd thanks :)
[18:50:09] bronson: tubbo: it's a single api that's format agnostic. in theory
[18:50:20] baweaver: has joined #RubyOnRails
[18:50:22] bronson: sandstrom: you're thinking about Demorgan's Rule maybe?
[18:50:37] tubbo: kb3ien: what's $logo_image defined as? are you SURE that `$logo_image: whatever` appears *before* that line is called?
[18:50:45] matthewd: bronson: At minimum, you're implementing two serialization formats
[18:50:48] tubbo: bronson: that's not reality, though.
[18:51:00] nettoweb: has joined #RubyOnRails
[18:51:05] craysiii: has joined #RubyOnRails
[18:51:09] bronson: right. the question is, how much do they differ?
[18:51:13] tubbo: it's just easier, and furthermore it doesn't matter for *most* people. there just aren't that many people using XML anymore.
[18:51:17] bronson: I don't know yet, I'll tell you after I've written this...
[18:51:23] matthewd: And, e.g., do you really have a client that *can't* talk (xml|json)?
[18:51:24] edwinvdgraaf: has joined #RubyOnRails
[18:51:36] bronson: Yea, count me among the people that will kick & fight before using XML again.
[18:51:43] craysiii: has joined #RubyOnRails
[18:51:49] swat535: has joined #RubyOnRails
[18:51:49] bronson: namespaces and xslt took years off my life...
[18:51:54] sandstrom: bronson probably :) Thanks for putting a name to it!
[18:52:05] tubbo: the only reason you'd need to use XML over JSON is if for some reason you're using a platform/language that has no JSON support whatsoever.
[18:52:13] tubbo: and i'm 99% sure that doesn't exist anymore
[18:52:48] pyemkey: has joined #RubyOnRails
[18:53:23] steharro: has joined #RubyOnRails
[18:53:29] bronson: agreed... for now. the industry will transition to another format in a few years and then we'll see!
[18:53:32] paulodin_: has joined #RubyOnRails
[18:56:13] guacamole: has joined #RubyOnRails
[18:56:32] pydave6367: has joined #RubyOnRails
[18:56:35] chrisarcand: has joined #RubyOnRails
[18:56:49] choke: has joined #RubyOnRails
[18:57:17] _Tariq: bronson: Can you explain why some people hate XML? Is it the fact you have to retype in tags?
[18:58:27] bronson: _Tariq: for me it was the tools that worked with it. awful error messages, namespaing breaks everything, and good luck getting xslt to do anything nontrivial.
[18:58:55] _Tariq: I only used XML back in, probably, 2008, and I never realized there were any tools
[18:58:56] bronson: also too many exploits. maybe the entity handling was too complex?
[18:59:25] _Tariq: But yeah, the reason I ask is that an open source project that I sometimes follow has decided to allow for modding by using XML
[18:59:26] bronson: For me, xml takes 3X the time as JSON to implement anything. Just fiddly.
[18:59:39] _Tariq: which was great and all...but er, not exactly modern.
[19:00:02] _Tariq: I'm wondering if there might have been a reason for this project (a game) to use XML instead of JSON
[19:01:06] bronson: guessing it's used by code that's worked for years and nobody's cared enough to change it
[19:01:20] _Tariq: Are there also any problems with JSON at the moment? (I'm worried the industry standard may change again)
[19:01:35] _Tariq: (So I want to get ahead of the curve)
[19:01:44] bronson: you say it's open source? you can mod it with diff/patch!
[19:01:56] _Tariq: Yeah, I could.
[19:02:06] _Tariq: But...that would require going back to that code again.
[19:02:19] bronson: a few small problems with json.
[19:02:37] bronson: the UTF incompatibility is probably the only real problem.
[19:03:04] bronson: everything else (stripping comments, lack of dates, screwing up escaping) is all misusing the format.
[19:03:37] _Tariq: Wait, stripping comments?
[19:03:45] Papierkorb: JSON has no comments
[19:03:49] _Tariq: Oh yeah, I remember YAML allows for comments while JSON doesn't.
[19:04:05] bronson: right, so different parsers do different things with comments
[19:04:31] Papierkorb: Has been a long time since I saw some JSON with comments, or even a parser which supports JSON comments
[19:04:40] Papierkorb: As they're illegal per the RFC
[19:04:42] _3dwardsharp: has joined #RubyOnRails
[19:04:43] bronson: Papierkorb: clearly you're not a sublime user :)
[19:05:25] paulodiniz: has joined #RubyOnRails
[19:05:25] flat_white: has joined #RubyOnRails
[19:06:25] lapide_viridi: has joined #RubyOnRails
[19:07:10] bronson: _Tariq: good description of JSON's encoding problem: https://en.wikipedia.org/wiki/JSON#Data_portability_issues
[19:07:18] rodferso1: has joined #RubyOnRails
[19:07:47] Malgorath: has joined #RubyOnRails
[19:08:30] Malgorath: I'm wanting to learn User authentication and controlled access. Do you guys suggest starting with something like Devise or more of a from scratch method?
[19:08:38] paulodiniz: has joined #RubyOnRails
[19:08:43] fox_mulder_cp: has joined #RubyOnRails
[19:08:47] bronson: If you have the time, start from scratch.
[19:09:01] bronson: then, when you get irritated with that, you'll really appreciate and understand devise.
[19:09:32] Malgorath: bronson, do you have any suggested urls to start learning from? I'm pretty new to rails
[19:10:07] tfitts: if you've already spent time doing it in other languages I'd just jump straight to devise as you'll already understand the problems and have the propert respect and appreciation for devise
[19:11:32] bronson: Malgorath: https://gist.github.com/thebucknerlife/10090014 looks good if you watch the linked railscast first.
[19:11:34] Malgorath: I understand how to do it with django and with certain php frameworks, I'm just not sure how it works with rails
[19:11:36] nerfando: has joined #RubyOnRails
[19:11:51] bronson: the railscast is getting pretty obsolete but the concepts are still the same.
[19:12:19] tubbo: Malgorath: if you want to learn user auth and controlled access, build it yourself. if you actually want to deploy user auth that's secure, use Devise.
[19:12:26] paulodiniz: has joined #RubyOnRails
[19:13:38] northfurr: has joined #RubyOnRails
[19:14:00] bronson: I've seen well-meaning people screw up devise. It's useful to know what it's is doing for you behind the scenes.
[19:14:48] lexileo: has joined #RubyOnRails
[19:15:02] baweaver: has joined #RubyOnRails
[19:15:06] bronson: (iow, I don't think you can deploy good user auth without learning it)
[19:15:23] northfurr: has joined #RubyOnRails
[19:15:42] roshanavand: has joined #RubyOnRails
[19:15:51] paulodiniz: has joined #RubyOnRails
[19:16:52] volume166: has joined #RubyOnRails
[19:17:25] stannard_: has joined #RubyOnRails
[19:18:03] tubbo: i guess so
[19:19:51] arBmind: has joined #RubyOnRails
[19:20:53] barendt: has joined #RubyOnRails
[19:21:32] eljimmy: has joined #RubyOnRails
[19:22:23] srinidhi: has joined #RubyOnRails
[19:22:30] Hans267: has joined #RubyOnRails
[19:22:36] bmalum: has joined #RubyOnRails
[19:23:57] shibabu: has joined #RubyOnRails
[19:24:25] Z00t: has joined #RubyOnRails
[19:24:58] stamina: has joined #RubyOnRails
[19:26:21] manfrin: has joined #RubyOnRails
[19:26:39] chrisarcand: has joined #RubyOnRails
[19:26:46] camilasan: has joined #RubyOnRails
[19:26:46] bePolite: has joined #RubyOnRails
[19:26:55] Aherin: has joined #RubyOnRails
[19:26:57] Pazician: has joined #RubyOnRails
[19:27:11] qejk: has joined #RubyOnRails
[19:27:25] rhizome: i don't agree. it's the basis of all shared libs
[19:28:23] srinidhi1: has joined #RubyOnRails
[19:28:35] baweaver: has joined #RubyOnRails
[19:32:19] arup_r: has joined #RubyOnRails
[19:33:16] kerunaru: has joined #RubyOnRails
[19:34:02] B1n4r10: has joined #RubyOnRails
[19:34:32] Sonicrida: has joined #RubyOnRails
[19:34:59] Sonicrida: has joined #RubyOnRails
[19:36:57] kb3ien: has joined #RubyOnRails
[19:37:39] arup_r: Sonicrida: hi
[19:38:03] Sonicrida: arup_r: or anybody else, could someone help me with a devise validation question?
[19:38:05] blackmesa: has joined #RubyOnRails
[19:38:14] arup_r: yes.. ask
[19:38:58] pyemkey: has joined #RubyOnRails
[19:39:23] DoubleMalt: has joined #RubyOnRails
[19:40:28] Sonicrida: Alright, so I have a user model validating for fields in my registration form. In my registration form, it renders one of two different forms depending on the path used to reach the form. Is it possible to validate only on a certain path? One form is just a minimal version of the other and it doesn't need validation for all of the fields of the oth
[19:40:56] Psyq: has joined #RubyOnRails
[19:40:58] steharro: has joined #RubyOnRails
[19:41:08] choke: has joined #RubyOnRails
[19:41:17] mchu: has joined #RubyOnRails
[19:41:34] roshanavand: has joined #RubyOnRails
[19:42:21] arup_r: Sonicrida: yes,use 2 different `context`s for 2 different forms http://api.rubyonrails.org/classes/ActiveModel/Validations.html#method-i-valid-3F
[19:43:34] Sonicrida: So I shouldn't have them on the same page arup_r?
[19:43:36] aegis3121: has joined #RubyOnRails
[19:43:50] momomomomo: has joined #RubyOnRails
[19:44:00] arup_r: but, may need to override devise registration controller create method or some thing like that.. But if it is your own controller and own code, it is definitely possible..
[19:44:03] paulodiniz: has joined #RubyOnRails
[19:44:34] arup_r: it is not about page.. it is while validating, or saving u need to tell Rails the context
[19:44:53] arup_r: check the example in the doc link I gave above
[19:45:00] meoblast001: has joined #RubyOnRails
[19:46:16] Sonicrida: Is the context the "on: :create" arup_r?
[19:46:17] dtordable: has joined #RubyOnRails
[19:46:55] arup_r: U can have your own custom context too.. which you need to pass inside the valid?(..)
[19:47:28] arup_r: `:create` and `:update` rails default, it use depending on the `.new_record?` returns value
[19:49:23] failproofshark: has joined #RubyOnRails
[19:50:53] Sonicrida: Is there a way to print out which fields fail validation to the console arup_r?
[19:51:46] ldnunes_: has joined #RubyOnRails
[19:51:49] arup_r: yes,, just call .save! and it will tell you. who are all those culprit
[19:51:58] mchu: hey! is anyone familiar with the ???serialized_accessor config???? I can???t find anything on it in google
[19:52:18] rhizome: never heard of it
[19:52:26] arup_r: Sonicrida: or do this way http://api.rubyonrails.org/classes/ActiveModel/Validations.html#method-i-errors
[19:52:35] pyemkey: has joined #RubyOnRails
[19:52:37] arup_r: to check what caused failure
[19:52:45] failproofshark: I'm having a little trouble finding this, but if I have a parameter hash similar to {foo => 1, bar => {bay => 2, baz =>3}} and call params.require(:bar).permit(:bay, :baz) how would I also include foo as a permitted parameter? Is it even possible if I call require followed by permit?
[19:53:58] atomical_: has joined #RubyOnRails
[19:54:28] arup_r: failproofshark: what is the root key of the hash ?
[19:54:36] Sonicrida: ok thanks arup_r
[19:56:05] failproofshark: arup_r: well in the example I gave, there really isnt a root, if I understand your question correctly
[19:56:25] edwinvdg_: has joined #RubyOnRails
[19:56:29] matthewd: mchu: Context?
[19:56:29] arup_r: failproofshark: when we have like {root: {foo => 1, bar => {bay => 2, baz =>3}} } as a prams hash, we can params.require(:root).permit(:foo, bar: [ :bay, :baz] )
[19:57:01] failproofshark: ah ok. so then in my case I just use .permit and omit the require?
[19:57:03] arup_r: failproofshark: ok.. then you can't include.. You have to do like params[:foo]
[19:57:53] matthewd: failproofshark: Yeah, you don't need the require; require is basically just [] + an error if it's not there
[19:58:28] wviana: has joined #RubyOnRails
[19:58:30] mchu: well the entire line of code is ???serialized_accessor :config, :scheduler_flex_night_start, :integer??? and it???s at the very end of the class. and i just have no idea what it does.
[19:59:15] wviana: Hi there, is possible to do something like this ? <div class="col-md-<%=columns%> form-group"> || columns is a var that is 3 or 4
[19:59:22] failproofshark: has left #RubyOnRails: ()
[20:00:11] arup_r: your code should work ? What do you mean by `||` ?
[20:00:59] wviana: arup_r: Is just to separe the code of my commentary explaining what's columns
[20:01:02] matthewd: mchu: And `serialized_accessor` is not defined in the application?
[20:01:03] arup_r: wviana: What is failing there >
[20:01:35] atomical: has joined #RubyOnRails
[20:01:40] arup_r: wviana: Ruby also has that `||` , so I was confused. Thanks for clrifying it
[20:01:49] mchu: actually both of these are in the class . include Core::SerializedColumns
[20:01:50] mchu: include Core::ArrayAccessor
[20:02:00] mchu: woops . sorry for the spacing
[20:02:04] wviana: arup_r: it's giving error in the last div close tag </div> syntax error, unexpected keyword_ensure, expecting keyword_end , syntax error, unexpected end-of-input, expecting keyword_end
[20:02:12] cnk: has joined #RubyOnRails
[20:02:13] momomomomo: has joined #RubyOnRails
[20:02:27] arup_r: ok show some more code..
[20:03:07] arup_r: the part u have shown is not the evil one :p
[20:03:15] wviana: arup_r: oh, forget it. I was doing something stupid.
[20:03:20] cac: has joined #RubyOnRails
[20:03:23] arup_r: yeah, like me :)
[20:03:30] wviana: arup_r: But thanks for helping me
[20:04:10] TheEyeOfTheTruth: has joined #RubyOnRails
[20:05:06] mordof_work: has joined #RubyOnRails
[20:05:22] paulodiniz: has joined #RubyOnRails
[20:07:07] TheEyeOfTheTruth: has left #RubyOnRails: ()
[20:07:53] FernandoBasso: has joined #RubyOnRails
[20:08:10] rogue_koder: has joined #RubyOnRails
[20:13:42] amortimer: has joined #RubyOnRails
[20:14:20] uris: has joined #RubyOnRails
[20:15:57] herpless: has joined #RubyOnRails
[20:18:48] kfrz: has joined #RubyOnRails
[20:19:01] stannard: has joined #RubyOnRails
[20:20:03] mordof_work: has joined #RubyOnRails
[20:21:03] sandstrom: has joined #RubyOnRails
[20:22:11] baweaver: has joined #RubyOnRails
[20:26:07] paulodiniz: has joined #RubyOnRails
[20:26:18] edwinvdgraaf: has joined #RubyOnRails
[20:26:58] Cervajz: has joined #RubyOnRails
[20:27:46] paulodiniz: has joined #RubyOnRails
[20:28:18] chridal: Alright. I have no where else to ask, since I don't know any international people.
[20:28:31] chridal: How would you guys feel about a social network named "Snikksnakk"
[20:29:51] tubbo: chridal: sounds like a company i was about to work for haha http://www.snipsnap.it/
[20:30:26] chridal: Hehe! What a coincidence :-D
[20:30:27] arup_r: coincidence!
[20:32:01] chridal: My partner is really set about the name, but I am very sceptical as to how it will be for people of other nationalities
[20:32:14] DoubleMalt: has joined #RubyOnRails
[20:32:20] Sonicrida: has joined #RubyOnRails
[20:32:34] Vinci_: has joined #RubyOnRails
[20:32:55] craysiii: im adverse to repetitious consonants but thats just me.
[20:33:05] paulodiniz: has joined #RubyOnRails
[20:33:17] dideler: has joined #RubyOnRails
[20:34:14] maxx88: chridal: i would agree with craysiii
[20:34:28] baweaver: has joined #RubyOnRails
[20:34:58] maxx88: chridal: seems like it means i want to sneak a snack
[20:35:40] maxx88: chridal: i guess if your target market is eating disorders
[20:36:04] atomical: has joined #RubyOnRails
[20:36:25] netzfisch: has joined #RubyOnRails
[20:36:43] Lewix: what's the best practice in regards to calling a class method before it's defined class Example < ActiveRecord::Base; call_method; def call_method; end
[20:36:59] Lewix: self.call_method*
[20:37:33] kadoppe: has joined #RubyOnRails
[20:37:37] Lewix: I don't want to write it after the method definition
[20:37:39] paulodiniz: has joined #RubyOnRails
[20:38:22] arup_r: Lewix: didn't get your issue
[20:38:26] Lewix: ACTION hasn't touched rails in months so he's a lil rusty
[20:38:31] Cohedrin: has joined #RubyOnRails
[20:38:51] pawnbox: has joined #RubyOnRails
[20:40:30] maxx88: has left #RubyOnRails: ()
[20:40:52] rodfersou: has joined #RubyOnRails
[20:41:06] wldcordeiro: has joined #RubyOnRails
[20:41:25] maxx88: has joined #RubyOnRails
[20:41:27] stamina: has joined #RubyOnRails
[20:41:43] Lewix: arup_r: put it simply, say you want to execute a private method right after the model load but you don't call it after the method is defined
[20:41:47] roshanavand: has joined #RubyOnRails
[20:41:49] arup_r: Lewix: Do you have several such ? then wrap them in a module and then extend the module inside the class at top then call
[20:42:18] arup_r: Lewix: let my try, and I think it works..no issue
[20:42:40] baweaver: has joined #RubyOnRails
[20:42:57] arup_r: >> class C; klass_method; def self.klass_method; p 12 ; end ; end
[20:44:11] blackmesa: has joined #RubyOnRails
[20:44:56] arup_r: Lewix: Above code not going to work,, because u expained before..
[20:46:00] Lewix: arup_r: I should probably use a callback for that, but it feels hacky
[20:49:49] arup_r: Lewix: No. U may use another method to call it.. need to know more about it
[20:51:43] ziyadb: has joined #RubyOnRails
[20:52:14] paulodiniz: has joined #RubyOnRails
[20:52:29] Z00t_: has joined #RubyOnRails
[20:54:00] snowy: has joined #RubyOnRails
[20:54:57] paulodiniz: has joined #RubyOnRails
[20:55:17] aegis3121: has joined #RubyOnRails
[20:55:42] guacamole: has joined #RubyOnRails
[20:56:43] roshanavand: has joined #RubyOnRails
[20:56:45] Raydiation: has joined #RubyOnRails
[20:57:05] Raydiation: hi, what would you return if a POST request creates an element that exists already?
[20:57:13] djbkd: has joined #RubyOnRails
[20:57:22] Raydiation: im returning a 409 atm and a JSON error message
[20:57:36] Raydiation: an api user asks me to return the full payload of the existing item
[20:58:01] snowy: has joined #RubyOnRails
[20:58:43] Raydiation: basically it should return the same as a GET request to the resource
[20:59:00] mary5030_: has joined #RubyOnRails
[20:59:11] kfrz: has joined #RubyOnRails
[20:59:12] bePolite: has joined #RubyOnRails
[20:59:32] guacamole: has joined #RubyOnRails
[20:59:50] mary5030_: has joined #RubyOnRails
[21:01:39] Radar: Raydiation: 422 Invalid Resource.
[21:02:34] mchu: has joined #RubyOnRails
[21:02:43] Raydiation: would you return the conflicting resource?
[21:02:49] Raydiation: in my case its a folder
[21:03:17] Raydiation: if the user tries to create a folder that exists already (e.g. id: 3), should it return the same as GET /folders/3?
[21:04:13] DEA7TH: has joined #RubyOnRails
[21:05:23] edwinvdgraaf: has joined #RubyOnRails
[21:07:49] tubbo: Raydiation: it depends on how your users are consuming the resource
[21:07:56] tubbo: Raydiation: do your users care if a folder exists there?
[21:08:12] Raydiation: tubbo: https://github.com/owncloud/news/issues/906
[21:09:24] tubbo: Raydiation: why are you asking a rails chatroom about a php project?
[21:09:49] tubbo: (just curious, not trying to demean your anything haha)
[21:09:59] eljimmy: has joined #RubyOnRails
[21:10:02] Scient: because why not
[21:10:37] gheegh: has joined #RubyOnRails
[21:10:44] choke: I would too, if i still wrote in dreaded php... mainly because i get more help here even on non-rails stuff than elsewhere ( and the people in #php, me included are just mean )
[21:11:16] pwnd_nsfw: has joined #RubyOnRails
[21:11:54] adaedra: I guess #php is still trying to figure the argument order of implode()
[21:12:11] tubbo: choke: yeah #php is a shitty channel
[21:12:27] tubbo: one big reason i don't work in PHP anymore is the people
[21:12:32] Raydiation: php is not a place where the REST is strong
[21:12:32] choke: well php is a shitty language..
[21:12:36] gbgdev: has joined #RubyOnRails
[21:13:11] tubbo: imho the language is way less shitty than the people writing the language
[21:13:23] choke: php can be quite strong in rest, i have a restful api in php that works quite well... or at least i had, it's re-written in ruby now
[21:13:43] choke: i can agree with that tubbo
[21:13:44] tubbo: the language itself still needs a lot of work, but there has been really good developments. unfortunately, PHP is still written by PHP developers
[21:13:49] tubbo: so they won't take advantage of all that
[21:13:56] tubbo: instead just preferring to encapsulate all the pages in a big switch statement
[21:14:29] choke: I think honestly for PHP to be viable again, they'd have to completely overhaul the OOP aspect of it -- the after-thought bolt-on just doesn't do it for me anymore
[21:15:50] tubbo: choke: or better yet, just rip it out completely.
[21:15:53] choke: though even if they did that, i don't think i'd go back to writing php unless i absolutely had to... i'm liking my ruby/rails ( less than a year knowing them )
[21:16:10] tubbo: php isn't good at object oriented programming, the sooner they realize and come to terms with that, the better.
[21:16:22] tubbo: fwiw PHP would make an incredible functional programming language
[21:16:39] w0rd-driven: has joined #RubyOnRails
[21:16:49] Raydiation: tubbo: actually it sucks for functional stuff
[21:17:45] Raydiation: as for the language in general: they decided to write it in PHP because of popularity and ease of server setup and because I wanted to work on that project, I've basically just used PHP
[21:18:10] Raydiation: basically pragmatic solution
[21:18:41] Raydiation: if i had the choice it would be something else ofc
[21:18:48] Raydiation: really anything except VB maybe
[21:20:01] tubbo: Raydiation: yeah at the time it probably made a lot more sense to write such an app in php rather than ruby or something. i worked on diaspora for a while and we had a lot of support-related issues regarding server setup.
[21:20:26] tubbo: if you want to compete with a service, the self-hosted solution *needs* to be just as easy to set up...so a 1-click install.
[21:20:58] tubbo: thankfully, heroku was around to sponsor us and we got into the first beta of the 1-click heroku installs
[21:21:02] tubbo: but you also need a heroku account now haha
[21:21:06] Raydiation: ive tried to do something like that for django once and it was very hard
[21:21:11] tubbo: so *i* personally think the solution is containers
[21:21:23] tubbo: maybe not docker, but some kind of repeatable image that one can just download and start
[21:21:51] Raydiation: which would also fix the whole php.ini crap and missing libs
[21:21:54] Raydiation: aka extensions
[21:22:46] Raydiation: on a sidenote theres a funny php setting that converts everything into multibyte compatible functions
[21:23:04] Raydiation: which breaks strlen() for everything else like http response size :D
[21:26:05] hannelita: has joined #RubyOnRails
[21:27:21] shibabu: has joined #RubyOnRails
[21:27:44] AntiSpamMeta: has joined #RubyOnRails
[21:29:15] dostoyevsky: has joined #RubyOnRails
[21:29:16] dopie: has joined #RubyOnRails
[21:29:39] baweaver: has joined #RubyOnRails
[21:29:49] dostoyevsky: Hey, can someone explain me what makes having many routes slow when starting an application?
[21:30:34] dostoyevsky: Is there some kind of o(N) overhead or more involved with adding another route?
[21:30:42] mordof_work: has joined #RubyOnRails
[21:30:49] MEATCHICKEN: has joined #RubyOnRails
[21:31:03] MEATCHICKEN: If I am making an ajax request to a controller to create a model
[21:31:09] MEATCHICKEN: do I need an authenticity token?
[21:31:23] MEATCHICKEN: I know form_for creates forms with authenticity tokens
[21:31:41] choke: well, it creates CSRF tokens
[21:32:06] tubbo: dostoyevsky: can you show me some evidence indicating that adding a large number of routes slows down app startup time?
[21:33:05] Scient: meatchicken: yes you do if its a POST
[21:33:18] Scient: meatchicken: rails ujs afaik supports that out of the box though
[21:33:22] Scient: or remote forms at least
[21:33:39] MEATCHICKEN: Scient: I am doing an ajax request without rails ujs
[21:33:53] pipework: Scient is the POSTer child of the intersection of science and ents worldwide.
[21:34:06] tvw: has joined #RubyOnRails
[21:34:09] Scient: meatchicken: then use the same mechanism as rails ujs
[21:34:30] Scient: https://gist.github.com/benschwarz/5333009 first google hit
[21:34:33] ur5us: has joined #RubyOnRails
[21:35:11] flashpoint9: has joined #RubyOnRails
[21:37:20] baweaver: has joined #RubyOnRails
[21:37:34] flashpoint9: has joined #RubyOnRails
[21:37:49] _Tariq: has joined #RubyOnRails
[21:37:59] yfeldblum: has joined #RubyOnRails
[21:40:07] zetab: has joined #RubyOnRails
[21:40:38] djbkd: has joined #RubyOnRails
[21:40:44] shibabu: has joined #RubyOnRails
[21:40:46] renanoronfle: has joined #RubyOnRails
[21:41:36] dostoyevsky: tubbo: Ok, I think I explained it wrong. Adding routes is not slow but set_routes_reloader is... but I am not sure what it does or why it might be slow
[21:42:04] dostoyevsky: someone also had this problem before: http://stackoverflow.com/questions/11037137/rails-3-set-routes-reloader-really-slow-why
[21:42:10] dostoyevsky: (doesn't explain the why, though)
[21:42:19] tubbo: dostoyevsky: did you see what the "fix" was there?
[21:42:29] dostoyevsky: tubbo: reducing number of routes
[21:42:32] tubbo: are you just doing `resources` blocks and not omitting routes you don't need?
[21:42:40] spoq: has joined #RubyOnRails
[21:43:50] nfk|laptop: has joined #RubyOnRails
[21:43:50] Palsson: has joined #RubyOnRails
[21:44:34] dostoyevsky: does routesreloader run everytime a new module is loaded on starting an application? Not sure why there is the need to reload when an application is starting
[21:44:42] havenwood: dostoyevsky: Here's a good talk that compares routing approaches of Rails, Sinatra and Roda: https://www.youtube.com/watch?v=PjnlsIJYkn0
[21:44:56] dostoyevsky: havenwood: thanks
[21:46:24] udiudi: has joined #RubyOnRails
[21:47:06] guacamole: has joined #RubyOnRails
[21:49:12] jgt: has joined #RubyOnRails
[21:51:00] tfitts: I'm trying to get codeship CI setup with my app. I have an old gem I'm using that isn't tested and it's preventing rake bundle exec from completing. I have a gist of the output here. https://gist.github.com/tfitts/0d8308e2e942029de08a would someone mind taking a look at it and see if they can tell me what I need to do to just get it to load?
[21:51:50] rhizome: tfitts: fix the gem
[21:52:09] atomical_: has joined #RubyOnRails
[21:52:25] tfitts: what do I have to do fix the gem?
[21:53:02] rhizome: i don't know whether gem-ness affects this, but I have to say it feels weird to see all those wildcards
[21:53:09] mchu: has joined #RubyOnRails
[21:53:23] rhizome: -I/home/rof/cache/bundler/ruby/2.1.0/gems/rspec-core-3.4.1/lib:/home/rof/cache/bundler/ruby/2.1.0/gems/rspec-support-3.4.1/lib /home/rof/cache/bundler/ruby/2.1.0/gems/rspec-core-3.4.1/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
[21:53:40] cac: has joined #RubyOnRails
[21:54:01] rhizome: i guess it's only half of that. start at the :
[21:54:19] rhizome: --pattern i see
[21:55:10] rhizome: try just requiring it in a blank class.rb, no rails
[21:55:21] rhizome: i guess you'd need rubygems too
[21:56:33] tfitts: if I require in irb it works, if I require in pry it fails
[21:56:38] edwinvdgraaf: has joined #RubyOnRails
[21:56:40] roshanavand: has joined #RubyOnRails
[21:57:05] tfitts: like just 2.2.1 :001 > require 'spree-api-client'
[21:57:24] tfitts: pry(main)> require 'spree-api-client'
[21:57:25] tfitts: LoadError: cannot load such file -- spree-api-client
[21:57:31] rhizome: something in core/{spec,config}?
[21:57:42] rhizome: look at the stack
[21:57:46] rhizome: follow those numbers
[21:58:06] rhizome: line 1 of item_spec looks good
[21:58:42] choke: has joined #RubyOnRails
[22:00:44] StaticVoid: has joined #RubyOnRails
[22:01:26] gbgdev: has joined #RubyOnRails
[22:01:27] dede: has joined #RubyOnRails
[22:01:35] bmalum: has joined #RubyOnRails
[22:01:49] blackmesa: has joined #RubyOnRails
[22:02:43] edwinvdgraaf: has joined #RubyOnRails
[22:02:49] hahuang65: has joined #RubyOnRails
[22:03:28] FooMunki: has joined #RubyOnRails
[22:03:31] hahuang65: has joined #RubyOnRails
[22:08:09] djbkd_: has joined #RubyOnRails
[22:09:58] hahuang65: has joined #RubyOnRails
[22:10:37] atomical: has joined #RubyOnRails
[22:10:45] pyemkey: has joined #RubyOnRails
[22:11:00] silverdust: Are ES6 features used within rails compiled to ES5 for production like babel?
[22:11:41] choke: has joined #RubyOnRails
[22:11:42] aegis3121: has joined #RubyOnRails
[22:13:29] capin: why would a profile image display in a navbar when viewing /users/edit but not display when loading TLD, ie. example.io? I phrase my question in more detail here, http://stackoverflow.com/questions/34777537
[22:14:11] hahuang65: has joined #RubyOnRails
[22:18:30] pawnbox: has joined #RubyOnRails
[22:19:01] edwinvdgraaf: has joined #RubyOnRails
[22:19:43] yk: has joined #RubyOnRails
[22:20:02] user083: How can i get the created_at from a relation?
[22:20:27] user083: I want to now when the relation was added and also the record it refers to
[22:20:42] rhizome: i don't think relations themselves have timestamps
[22:20:58] rhizome: do you mean association?
[22:20:59] Radar: not unless there's a join table
[22:21:11] atomical_: has joined #RubyOnRails
[22:21:12] user083: I have a table called view history with user_id, episode_id and created_at
[22:21:18] smathy: ...even then one side could have been added before the other.
[22:21:19] rhizome: "relation" i'm thinking of the query object
[22:21:26] user083: I want to know when the user viewed the episode
[22:21:54] rhizome: you call the attribute
[22:22:07] smathy: user083, each history record is created when a view happens?
[22:22:16] user083: smathy: yes
[22:22:47] smathy: user083, so just grab that record and as rhizome says, call its .created_at method.
[22:22:57] Palsson: has joined #RubyOnRails
[22:23:07] smathy: ACTION thinks he must me missing something here
[22:23:17] user083: I do not want to know when the episode was created, i want to know about the viewing time
[22:23:46] tfitts: user083: view_histories.created_at is when the view was created. i.e. when the video was watched
[22:24:09] user083: then how do i get infomation about the episode?
[22:24:15] user083: such as the title?
[22:24:24] mustmodify: has joined #RubyOnRails
[22:24:37] tfitts: view_history.episode.title
[22:25:07] smathy: view_histories.created_at will be a NoMethodError tfitts
[22:25:50] tfitts: smathy: right, he needs to actually select one from this collection
[22:25:59] tfitts: view_histories.last.created_at would work
[22:26:09] mustmodify: I have a screen where someone is paying for a subscription... subscriptions#new. They can pay by check or CC. Subscription#payment is polymorphic. But it turns out you can't pass in payment_type and payment_attributes, which I guess makes sense. So do I build the appropriate type of payment first and then set the attributes? Or do I create two controllers... CardPaymentsController and CheckPaymentsController ?
[22:26:21] user083: tfitts: I will try that
[22:26:43] roshanavand: has joined #RubyOnRails
[22:27:17] johnflux_: has joined #RubyOnRails
[22:27:29] dopie: has joined #RubyOnRails
[22:27:46] nerium: has joined #RubyOnRails
[22:28:01] slothbear: has joined #RubyOnRails
[22:30:19] batesism: has joined #RubyOnRails
[22:30:41] baweaver: has joined #RubyOnRails
[22:31:10] slothbear: I need to redisplay a Terms of Service when they've changed... but they're stored in a static template page... so I need to stow a Modification Date somewhere. Best idea so far: stick a constant in the static page controller.
[22:31:21] superlou: has joined #RubyOnRails
[22:31:56] slothbear: But that's separate from the Terms file... feels too far away. Any other ideas?
[22:32:15] bmalum: has joined #RubyOnRails
[22:32:31] Radar: Isn't the modification date static content itself?
[22:32:35] Radar: Store it on the page with the rest of the text?
[22:33:03] RahulT: has joined #RubyOnRails
[22:33:21] guacamole: has joined #RubyOnRails
[22:33:25] slothbear: radar: I got that almost implements (modification date of file) then realized it will change for other reasons. typo, formatting, etc.
[22:33:49] RahulT: has left #RubyOnRails: ()
[22:33:56] slothbear: oooh, on the page.... then read the template somehow
[22:34:00] Limix: has joined #RubyOnRails
[22:34:03] edwinvdgraaf: has joined #RubyOnRails
[22:34:12] slothbear: some kind of yaml front matter?
[22:34:29] RahulT: has joined #RubyOnRails
[22:34:40] slothbear: or.... first line is html comment with the date?
[22:35:26] markh: has joined #RubyOnRails
[22:36:43] slothbear: you can tell I work too much with yaml! first idea for every problem.
[22:36:56] pwnd_nsfw: If I'm trying to count page views, should I create a table to handle this? And add a new entry for every view?
[22:37:08] pwnd_nsfw: For some reason, that just seems silly to do, but there are things I want to do with the data
[22:37:56] pyemkey: has joined #RubyOnRails
[22:38:14] B1n4r10: has joined #RubyOnRails
[22:38:15] Cohedrin: pwnd_nsfw all you want do is count page views?
[22:38:18] Cohedrin: you don't want to track anything else
[22:38:35] pwnd_nsfw: Well, it'd be nice to know when the page views happen, to implement like a "Trending now" type of deal
[22:38:38] Cohedrin: https://ankane.github.io/ahoy/
[22:38:49] Cohedrin: sounds like it does what you want
[22:39:05] pwnd_nsfw: Why thank ya
[22:39:09] Cohedrin: works very well for tracking, we use it everywhere
[22:39:19] Cohedrin: just keep in mind it does produce a lot of data unless you configure it not to
[22:39:30] Cohedrin: it will expand your database quite a lot if you have lots of users
[22:39:46] pwnd_nsfw: I currently have "one" user :)
[22:39:59] pwnd_nsfw: But, if such an application were to lift off, well, I'd probably have the money to compensate
[22:40:03] pwnd_nsfw: Thanks for the suggestion
[22:40:34] pwnd_nsfw: Looks pretty useful
[22:40:49] eljimmy: has joined #RubyOnRails
[22:41:01] pyemkey_: has joined #RubyOnRails
[22:41:06] janebootydoe: has joined #RubyOnRails
[22:41:06] Cohedrin: its very good, small amount of setup to get a lot of data
[22:41:29] quazimodo: has joined #RubyOnRails
[22:41:34] tvw: has joined #RubyOnRails
[22:42:01] edwinvdgraaf: has joined #RubyOnRails
[22:44:24] user083: I still have a problem getting the relation timestamp
[22:44:30] user083: this is my relation
[22:44:31] user083: has_many :history, :through => :view_histories, :source => :episode
[22:44:53] AntiSpamMeta: has joined #RubyOnRails
[22:45:43] kerunaru: has joined #RubyOnRails
[22:45:46] user083: I tried "touch: true"
[22:46:14] smathy: user083, and what are you trying?
[22:46:21] slothbear: Sawright! Thanks for the help! The first line of my view now reads "<!-- modification_date: 2016-01-13 -->" which I can easily pick off. Unless there is an easier way, I'm implementing now. thanks again
[22:47:08] chipotle: has joined #RubyOnRails
[22:47:17] user083: smathy: I want to know when the user viewd the video
[22:47:47] user083: and what they viewed, more info than just the video id the view_history table provides
[22:47:59] _Tariq: has joined #RubyOnRails
[22:49:02] kuroro: has joined #RubyOnRails
[22:49:33] _Tariq_: has joined #RubyOnRails
[22:49:35] tfitts: user083: are you going to history or view_histories
[22:50:03] smathy: user083, yes, I meant what code are you trying, show how you're trying to get the date?
[22:50:19] user083: tfitts: I am trying to go to history, but i want only the created_at from view_historyies
[22:50:40] user083: <span><%= episode.created_at %></span>
[22:51:56] atomical: has joined #RubyOnRails
[22:51:58] pwnd_nsfw: I feel like I haven't gotten "param is missing or the value is empty" instead of going through validations before
[22:52:14] Radar: pwnd_nsfw: seems like strong parameters
[22:52:20] pwnd_nsfw: Precisely, but
[22:52:28] tfitts: you need to start from view_history to get the created_at. You're passing over the view_history info when using the has_many :through
[22:52:56] pwnd_nsfw: How am I supposed to submit an empty form without it reporting controller issue? :P
[22:53:20] antgel: has joined #RubyOnRails
[22:53:20] Radar: pwnd_nsfw: params[:post] ||= {}
[22:53:24] user083: tfitts: How can i not pass though the created_column on the view_history, but still get the episiode info?
[22:53:32] edwinvdgraaf: has joined #RubyOnRails
[22:53:38] Radar: pwnd_nsfw: why is the form empty? The parameters should be sent through as blank values.
[22:53:41] Radar: pwnd_nsfw: what is the log saying?
[22:53:46] tfitts: view_history has an episode relation
[22:53:58] pwnd_nsfw: Second, getting the gist together.
[22:54:01] Psyq: has joined #RubyOnRails
[22:54:07] tfitts: so view_history.created_at will give you when it was created and view_history.episode.title will give you the episode title.
[22:55:00] pyemkey: has joined #RubyOnRails
[22:55:17] roshanavand: has joined #RubyOnRails
[22:55:32] pwnd_nsfw: https://gist.github.com/SirUncleCid/75ee12a4a4f78adea801 Radar
[22:55:33] user083: tfitts: That fixed it, thanks.
[22:55:55] Radar: pwnd_nsfw: oh right, it's just a file upload. So yeah, do params[:picture] ||= {}
[22:56:03] Radar: pwnd_nsfw: at the top of your create action
[22:56:12] nfk|laptop: has joined #RubyOnRails
[22:56:14] northfurr: has joined #RubyOnRails
[22:56:27] edwinvdgraaf: has joined #RubyOnRails
[22:58:41] pawnbox: has joined #RubyOnRails
[22:58:50] theery: has joined #RubyOnRails
[22:59:08] pwnd_nsfw: Why thank ya Radar
[22:59:34] northfurr: has joined #RubyOnRails
[22:59:44] edwinvdgraaf: has joined #RubyOnRails
[22:59:53] wethu: has joined #RubyOnRails
[23:00:04] pwnd_nsfw: I don't remember running into that during R4IA
[23:01:32] dopie: has joined #RubyOnRails
[23:02:03] mary5030: has joined #RubyOnRails
[23:02:39] Dreeg: has joined #RubyOnRails
[23:02:47] baweaver: has joined #RubyOnRails
[23:03:45] safety_cut: has joined #RubyOnRails
[23:05:35] edwinvdgraaf: has joined #RubyOnRails
[23:05:43] Ropeney: has joined #RubyOnRails
[23:07:52] dopie: has joined #RubyOnRails
[23:08:57] benlieb: has joined #RubyOnRails
[23:09:10] mrgreenfur: has joined #RubyOnRails
[23:09:35] baweaver: has joined #RubyOnRails
[23:12:16] tfitts: I'm using searchkick which is a wrapper for elasticsearch. when testing do you normally install elasticsearch and start the server to test or is there a way to exclude searchkick and test that separately or would that make the tests somewhat worthless
[23:13:22] Radar: tfitts: yeah we have elasticsearch running in our tests.
[23:13:36] Radar: tfitts: It uses an index like <app_name>_<model>_<rails env>
[23:14:50] atomical_: has joined #RubyOnRails
[23:15:17] Seich: has joined #RubyOnRails
[23:15:28] chadwtaylor: has joined #RubyOnRails
[23:16:18] edwinvdgraaf: has joined #RubyOnRails
[23:17:10] edwinvdgraaf: has joined #RubyOnRails
[23:17:39] guacamole: has joined #RubyOnRails
[23:18:22] threeminutemonta: has joined #RubyOnRails
[23:19:16] pramsky: has joined #RubyOnRails
[23:19:56] Maletor: has joined #RubyOnRails
[23:22:08] wldcordeiro: has joined #RubyOnRails
[23:23:20] markh: has joined #RubyOnRails
[23:24:18] edwinvdgraaf: has joined #RubyOnRails
[23:26:20] momomomomo: has joined #RubyOnRails
[23:27:35] benlieb: I would like to duplicate a carrierwave file attribute, which is using S3 as a remote store from one db record to another. Basically this works: a.upadate(source: b.source) and b.source is coppied onto S3, but I???m concerned about large files. It is hard to tell how this is done. Is it done by bring the first remote file down to the server and then put back up? Is it a background process? Is there a way that carrierwave (via fog) tels S3 to copy a f
[23:27:35] benlieb: without downloading it?
[23:27:37] benlieb: Asking here because I???ve spent a lot of time trying to figure this out.
[23:28:39] DEA7TH_: has joined #RubyOnRails
[23:28:46] Pazician: has joined #RubyOnRails
[23:31:49] robbyoconnor: has joined #RubyOnRails
[23:31:56] robbyoconnor: has joined #RubyOnRails
[23:32:00] Hans267: Are you there radar?
[23:32:48] Radar: benlieb: don't you mean b.update(source: a.source)? Since you're copying from A -> B?
[23:32:51] Radar: Hans267: What's up?
[23:33:18] Hans267: Forever and ever, eh? I???m trying to use ransack to do some more complicated searching through multiple models and associations
[23:33:30] benlieb: Radar: the order wasn???t meant to be specific.
[23:33:42] paulodiniz: has joined #RubyOnRails
[23:33:45] Hans267: and a gist https://gist.github.com/janikhans/b228e3ff1b0fed10a597
[23:34:02] benlieb: I just wondered if anyone had insight to the internals of CW before I try to read the source
[23:34:11] Radar: Hans267: I don't work with Ransack for free any more.
[23:34:23] Radar: Hans267: http://ryanbigg.com/2015/11/open-source-work/
[23:34:29] iFrey: has joined #RubyOnRails
[23:35:30] Radar: I am also a strong proponent for people moving away from Ransack which is just a very hacky layer on top of AR's already complex querying, and encouraging people to use Elasticsearch instead.
[23:36:06] Hans267: radar: I see. I???ll look into Elasticsearch some more then.
[23:37:50] Axsuul: has joined #RubyOnRails
[23:38:08] pipework: Mmm elasticsearch.
[23:38:14] pipework: pouchdb and couchdb are sweet too.
[23:38:31] pyemkey: has joined #RubyOnRails
[23:38:53] atian: has joined #RubyOnRails
[23:38:58] dionysus69: has joined #RubyOnRails
[23:40:14] snowy: has joined #RubyOnRails
[23:45:00] tfitts: elasticsearch!
[23:45:14] northfurr: has joined #RubyOnRails
[23:45:26] tfitts: installing it as we speak on my test machine
[23:47:10] astrofog: has joined #RubyOnRails
[23:48:17] atomical: has joined #RubyOnRails
[23:48:31] pipework: tfitts: !good
[23:48:31] helpa: tfitts: good is good
[23:49:39] dopie: https://gist.github.com/staycreativedesign/200b0cb704a0e672fbed
[23:49:48] dopie: why is my macro not working?!
[23:50:30] B1n4r10: has joined #RubyOnRails
[23:50:44] bahar: has joined #RubyOnRails
[23:50:45] bahar: has joined #RubyOnRails
[23:51:09] EXCHGR: has joined #RubyOnRails
[23:55:25] northfurr: anyone know how to pass the current iteration in an each block to a partial? I???ve tried with the following code and can???t get it to work correctly. The article that gets passed to the view in this case is always the first article in @articles, as opposed to whichever one is iterated. https://gist.github.com/anonymous/2c81496dcb9c78ce84b5
[23:56:51] johnflux_: has joined #RubyOnRails
[23:56:52] johnflux_: has joined #RubyOnRails
[23:57:36] pyemkey: has joined #RubyOnRails
[23:59:46] atomical_: has joined #RubyOnRails