« Back to channel list

#RubyOnRails - 09 March 2016

« Back 1 day Forward 1 day »
[00:00:02] AgentSpyname: like they type it in
[00:00:18] weaksauce: AgentSpyname sanitize is better for that
[00:00:25] apple_: has joined #RubyOnRails
[00:01:01] weaksauce: https://github.com/rails/rails-html-sanitizer
[00:01:20] uxp: has joined #RubyOnRails
[00:01:57] Aherin: has joined #RubyOnRails
[00:02:43] weaksauce: AgentSpyname http://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize
[00:04:13] jjturner: has joined #RubyOnRails
[00:04:52] AgentSpyname: weaksauce: whats HTML_safe used for
[00:05:33] weaksauce: AgentSpyname your stuff that you trust so it doesn't go through any time expensive sanitization
[00:05:43] AgentSpyname: weaksauce: ok
[00:06:55] weaksauce: AgentSpyname the sanitize method will open up a bunch of analysis against all sorts of unicode attacks and things and be flexible so it can be specified what you want to leave in. that's costly. html_safe is basically a stamp of approval on the string saying I trust this
[00:07:44] Synthead: has joined #RubyOnRails
[00:08:31] robbyoconnor: has joined #RubyOnRails
[00:09:20] Ropeney: has joined #RubyOnRails
[00:10:30] agent008: has joined #RubyOnRails
[00:10:48] wldcordeiro: has joined #RubyOnRails
[00:12:53] alphaatom: has joined #RubyOnRails
[00:13:12] dstarh: has joined #RubyOnRails
[00:13:36] thomasfedb: has joined #RubyOnRails
[00:13:36] thomasfedb: has joined #RubyOnRails
[00:14:28] htmldrum_: has joined #RubyOnRails
[00:15:59] n1lo: has joined #RubyOnRails
[00:16:10] r0bby_: has joined #RubyOnRails
[00:16:18] nertzy: has joined #RubyOnRails
[00:16:21] guacamole: has joined #RubyOnRails
[00:16:52] delgiudices: has joined #RubyOnRails
[00:17:28] jjturner: newb testing registration
[00:17:38] jjturner: ahh success
[00:18:25] bonhoeffer: has joined #RubyOnRails
[00:20:33] nfk|laptop: should i bother with mongodb?
[00:22:12] jjturner: looking for help to diagnose a failed test
[00:24:05] jjturner: nfk|laptop have you run into limitations with a relational db?
[00:24:36] htmldrum: has joined #RubyOnRails
[00:26:46] jarinux: has joined #RubyOnRails
[00:28:40] nfk|laptop: jjturner, that's the thing, i just feel that the db itself promises to be so sweet with mongo that i can't really say no to it without some good reason like "development PITA"
[00:29:07] DLSteve: has joined #RubyOnRails
[00:29:20] nfk|laptop: looking at performance information i can expect they'll both be fine, I just dread coming up with a scheme for SQL
[00:29:45] nfk|laptop: anyway, the awful bit is churning stuff the hard way, not querying it
[00:30:21] nfk|laptop: there's something like few thousand records of various kinds but I need to do really exhausting calculations on them
[00:34:22] tris: has joined #RubyOnRails
[00:38:02] shanemcd: has joined #RubyOnRails
[00:39:23] statelesscode: has joined #RubyOnRails
[00:40:22] Contigi: has joined #RubyOnRails
[00:42:23] helpa: For maximum webscales, use MongoDB. Also see: !node.js
[00:42:26] helpa: For maximum webscales, check out node.js. Also see: !mongodb
[00:42:41] Radar: Nothing good comes of using Mongo
[00:42:48] Radar: if you want it for "Woo JSON store" then use PSQL
[00:43:21] alphaatom: has joined #RubyOnRails
[00:43:22] hnanon: has joined #RubyOnRails
[00:43:47] dalbuschat: has joined #RubyOnRails
[00:44:37] Sawbones: has joined #RubyOnRails
[00:49:05] bob14: has joined #RubyOnRails
[00:49:12] baweaver: has joined #RubyOnRails
[00:49:29] Ropeney: lies, mongodb is the answer to everything
[00:49:57] greenhat: apt-get install sqlserver
[00:50:48] tenderlove: has joined #RubyOnRails
[00:51:35] nfk|laptop: but that idea of documents is so compelling
[00:51:35] kies: has joined #RubyOnRails
[00:51:44] weaksauce: Radar sure something good come of using mongodb
[00:51:50] nfk|laptop: i could literally have like 2 collections and that would be it
[00:51:59] Radar: nfk|laptop: Do not fool yourself.
[00:52:01] nfk|laptop: and query times would probably be no worse if not better than with sql
[00:52:05] Radar: Mongo is a trap and you are about to fall into it.
[00:52:07] sleungcy: Hi, I have a question about this gist. How come the two outputs are different even though the if-condition never ran?
[00:52:09] sleungcy: https://gist.github.com/sleungcy/fc5ab5546bc60fd88c1d
[00:52:16] weaksauce: Radar ...you get to read in a year or two a blogpost about how they made a huge mistake using mongodb
[00:52:21] nfk|laptop: Radar, pitfal?
[00:52:25] weaksauce: postmortems are fun
[00:53:04] ivanskie_work: has joined #RubyOnRails
[00:53:59] nfk|laptop: ACTION yawns
[00:54:00] Ropeney: nfk|laptop, its awesome if you are trying to webscale and dealing with high traffic
[00:54:09] KensoDev: has joined #RubyOnRails
[00:54:21] nfk|laptop: unless someone decides to DDOS the system, unlikely
[00:54:34] nfk|laptop: at most it would see maybe few hundred users
[00:54:45] nfk|laptop: and even that for maybe few days a year
[00:56:34] Ropeney: https://www.youtube.com/watch?v=b2F-DItXtZs think sumarizes it nicely
[00:57:07] yuung: has joined #RubyOnRails
[00:57:47] gbgdev: has joined #RubyOnRails
[01:00:04] nfk|laptop: Ropeney, gosh, at least have mariadb in 2010, also that video is a bit annoying
[01:00:38] icharlie: has joined #RubyOnRails
[01:01:16] DoctorMonocular: has joined #RubyOnRails
[01:01:58] smathy: has joined #RubyOnRails
[01:02:45] stannard: has joined #RubyOnRails
[01:02:47] moeabdol4: has joined #RubyOnRails
[01:04:38] AgentSpyname: anyone know if there is a way to show the all routes that belong to the url
[01:04:44] AgentSpyname: so lets say i had /posts
[01:05:01] AgentSpyname: i would want it to say /posts/new, /posts/show etc
[01:05:16] Ropeney: AgentSpyname, `rake routes | grep /posts` ?
[01:05:26] AgentSpyname: on the webpage itself...
[01:05:28] AgentSpyname: not in the terminal
[01:07:14] IFrank00: has joined #RubyOnRails
[01:11:13] Ropeney: AgentSpyname, I don't know exactly, but i think `Rails.application.routes.named_routes.helpers.select {|h| url_for(h) =~ /\/posts/ }` might get you in the right direction
[01:11:24] craysiii: has joined #RubyOnRails
[01:13:01] montyboy: has joined #RubyOnRails
[01:14:52] smathy: sleungcy, in summary, because local variables and scope in Ruby is funky. See: https://gist.github.com/smathy/af02a49942c9b6bfef8f
[01:15:21] nfk|laptop: i really like this video: https://www.youtube.com/watch?v=oheekef7oJk
[01:18:17] Guest34101: has joined #RubyOnRails
[01:19:21] workmad3: has joined #RubyOnRails
[01:21:53] yuung: has joined #RubyOnRails
[01:21:57] CodaBrink: has joined #RubyOnRails
[01:24:17] Pazician: has joined #RubyOnRails
[01:25:51] Sawbones: has joined #RubyOnRails
[01:25:57] DLSteve: has joined #RubyOnRails
[01:26:30] sevenseacat: has joined #RubyOnRails
[01:28:33] ivanskie: has joined #RubyOnRails
[01:29:02] josephkokenge: has joined #RubyOnRails
[01:34:10] rafaelfranca: has joined #RubyOnRails
[01:37:23] IFrank00: has joined #RubyOnRails
[01:41:15] trosborn: has joined #RubyOnRails
[01:44:40] veloutin: has joined #RubyOnRails
[01:46:28] rattatmatt: has joined #RubyOnRails
[01:49:46] P4Titan: has joined #RubyOnRails
[01:50:10] Alejandro15: has joined #RubyOnRails
[01:50:16] P4Titan: Hello all. How do I register an initializer file, in particular, to have one file execute before another?
[01:50:53] Alejandro15: has left #RubyOnRails: ()
[01:51:21] jjturner: has joined #RubyOnRails
[01:52:38] sevenseacat: they execute in alphabetical order i believe
[01:53:06] P4Titan: Is there a good practice way to ensure one executes before another
[01:53:19] sevenseacat: the good practice would be to not make them rely on each other
[01:53:53] P4Titan: I have one file that loads env variables and other that uses them
[01:53:58] P4Titan: should I merge both files then?
[01:55:11] DmitryBochkarev: has joined #RubyOnRails
[01:55:54] sevenseacat: you dont need to load env variables - you always have access to them
[01:56:07] P4Titan: from a yml file?
[01:56:22] jjturner: has left #RubyOnRails: ()
[01:56:57] jjturner: has joined #RubyOnRails
[01:57:01] Devalo: has joined #RubyOnRails
[01:57:05] jjturner: has left #RubyOnRails: ()
[01:57:07] sevenseacat: oh yaml config, not actual env variables
[01:57:28] P4Titan: yep, sorry for not being that explicit
[01:58:26] sevenseacat: well, rename the files to make sure the one you want comes first, or remove the dependency between the two files
[02:01:25] electriv: has joined #RubyOnRails
[02:02:20] seaworthy: has joined #RubyOnRails
[02:03:49] moeabdol4: has joined #RubyOnRails
[02:04:52] delgiudices: has joined #RubyOnRails
[02:21:35] jayp: has joined #RubyOnRails
[02:26:50] Sawbones: has joined #RubyOnRails
[02:27:31] rickmasta: has joined #RubyOnRails
[02:29:59] tsujp: has joined #RubyOnRails
[02:34:10] delgiudices: What does the rails community use for testing
[02:34:13] delgiudices: Rspec or Minitest?
[02:34:19] mwlang: has joined #RubyOnRails
[02:34:21] peterppp: has joined #RubyOnRails
[02:34:22] sevenseacat: personal preference
[02:34:36] sevenseacat: I *think* Rspec is more common, but minitest is preferred by the rails core team
[02:35:09] delgiudices: Is there a good guide to testing rails with rspec?
[02:35:23] delgiudices: the default rails one uses minitest
[02:35:51] Guest34101: has joined #RubyOnRails
[02:35:56] helpa: Rails 4 Test Prescriptions - a great introduction to testing in Ruby and Rails, including both minitest and rspec. https://pragprog.com/book/nrtest2/rails-4-test-prescriptions
[02:36:06] sevenseacat: I reckon that's a really good book on testing.
[02:36:25] delgiudices: I was looking at something more lightweight
[02:36:34] delgiudices: That i could read to start testing in like 20-30 minuts?
[02:36:35] greenhat: Take a look at the spec DSL included with minitest. It is my personal preference.
[02:36:47] sevenseacat: the rspec docs?
[02:37:18] duderonomy: has joined #RubyOnRails
[02:37:56] greenhat: If nothing else the comments are worth reading for lulz https://github.com/seattlerb/minitest/blob/master/lib/minitest/spec.rb
[02:40:55] techsethi: has joined #RubyOnRails
[02:42:04] chagel: has joined #RubyOnRails
[02:43:57] Radar: [13:35:09] <delgiudices> Is there a good guide to testing rails with rspec?
[02:44:02] Radar: Rails 4 in Action is a good guide for that ;)
[02:44:13] sevenseacat: not sure I'd call snark in comments 'lulz'
[02:45:05] greenhat: Anyway, that's what I use.
[02:45:38] Rubie: has joined #RubyOnRails
[02:46:03] mwlang: what am I doing wrong? specs are passing, raising validation failure error, yet, on IRB console (and within the app), validation failures don’t happen: https://gist.github.com/mwlang/1de3d17c036a9d80f73e
[02:47:11] Chagel_: has joined #RubyOnRails
[02:47:36] mwlang: position groups can be hierachical and I’m trying to prevent A => B => A and even more contrived: A => B => C => A
[02:48:02] delgiudices: Radar btw why isn't there tests for the models in the r4ia_examples/ticketee
[02:49:47] jenrzzz: has joined #RubyOnRails
[02:50:41] k1t: has joined #RubyOnRails
[02:50:49] Radar: delgiudices: we don't need them :)
[02:50:57] Radar: The app is relatively simple
[02:51:08] delgiudices: I know but i was reading the testing rails app guide
[02:51:17] delgiudices: And it said that there should be a test for each model validation
[02:51:24] delgiudices: You don't agree with that?
[02:51:55] Radar: Yes, I do not agree with that. I think that's a too extreme version of testing.
[02:52:15] Ropeney: delgiudices, would you validate `validates_presence_of :name` ?
[02:52:44] Radar: I would test that the user sees that validation message that comes from that validation if they try to create a project with no name
[02:52:57] delgiudices: Ropeney https://github.com/thoughtbot/shoulda-matchers they created a project for that
[02:53:08] Radar: https://github.com/rubysherpas/r4ia_examples/blob/master/ticketee/spec/features/admin/creating_projects_spec.rb#L26-L31
[02:53:14] Radar: Which is what I do with ^ that test
[02:53:32] Ropeney: delgiudices, just feels that in rails validates_presence_of is speced, so no point specing it again
[02:54:04] delgiudices: Okay it actually makes sense not to test it
[02:54:04] mwlang: FWIW, I, too I only write tests for custom validations. If it’s standard Rails stuff, I count on it working as advertised.
[02:54:38] theblang: has joined #RubyOnRails
[02:54:45] Ropeney: Radar, does your feature specs take long running a whole suite on a large app? Or you just palm off to a CI?
[02:54:55] mwlang: my gist just happens to be one of those custom validations that ain’t working for me. :-p
[02:55:07] Radar: Ropeney: Too long on a developer's machine, so we palm it off into CI. 6 separate processes run all the tests in about 5 mins.
[02:55:35] Ropeney: so you do parallel_tests ?
[02:55:42] Radar: Ropeney: CI also has integration with GitHub so that we know if a branch is good to merge (build status == green) and also our deployment tooling. If master is not green then we do not deploy.
[02:55:44] mwlang: when it comes to custom validations, is it enough that you’re addeding to the self.errors? Or does the validation method have to actually return true or false?
[02:55:48] Radar: Yes, we use parallel_tests.
[02:55:51] alphaatom: has joined #RubyOnRails
[02:56:42] Ropeney: when i did parellel_tests && feature specs they seemed to fail on finding things on the page but not when didn't have parallel running; might of been something i did wrong though i guess.
[02:58:50] alphaatom: has joined #RubyOnRails
[02:59:46] Ropeney: Radar: Do you know of an open source project doing what you do with features that i could spin up and benchmark?
[03:00:05] Radar: Ropeney: https://github.com/solidusio/solidus
[03:00:27] Radar: Ropeney: how about the ecommerce framework I dev'd on for 2.5 years?
[03:00:44] Ropeney: Radar, that being the link above?
[03:01:01] Radar: Ropeney: Well, that was Spree but Solidus is a fork of Spree and the code quality is better in Solidus I reckon.
[03:01:11] Radar: I'm still the #1 committer :D https://github.com/solidusio/solidus/graphs/contributors
[03:01:36] Ropeney: Radar, theres a way to run all 4 spec sets?
[03:01:46] Radar: Ropeney: all contained in the readme
[03:01:46] Ropeney: i should read
[03:02:46] baweaver: has joined #RubyOnRails
[03:03:19] lemur: has joined #RubyOnRails
[03:04:24] moeabdol4: has joined #RubyOnRails
[03:07:04] mwlang: figured it out. I was walking the hierachy, but adding the validation issue to whatever node I happened to be at, which wasn’t necessarily the node I was attempting to save.
[03:07:54] uglybandersnatch: has joined #RubyOnRails
[03:09:47] voidDotClass: has joined #RubyOnRails
[03:11:19] RegulationD: has joined #RubyOnRails
[03:11:45] delgiudices: Is this a correct way of testing if a record was created ? https://gist.github.com/delgiudices/f5b774ad7d6b5c2af2de
[03:13:21] sevenseacat: i wouldn't rely on StoreRequest.last - I'd try to look up a StoreRequest by the name and make sure one gets returned
[03:13:27] baweaver: has joined #RubyOnRails
[03:13:36] r0bby_: has joined #RubyOnRails
[03:14:28] delgiudices: So something like StoreRequest.find_by!(name: 'Luis del Giudice')?
[03:18:10] SteenJobs: has joined #RubyOnRails
[03:18:33] sevenseacat: maybe not with a bang, as that will raise an exception if it fails
[03:20:08] Sawbones: has joined #RubyOnRails
[03:20:55] ivanskie: has joined #RubyOnRails
[03:21:50] DoctorMonocular: has joined #RubyOnRails
[03:23:33] duncannz: has joined #RubyOnRails
[03:24:32] Rodya_: has joined #RubyOnRails
[03:24:59] particles: has joined #RubyOnRails
[03:25:10] Pazician: has joined #RubyOnRails
[03:26:37] jenrzzz: has joined #RubyOnRails
[03:31:20] chagel: has joined #RubyOnRails
[03:33:33] dopie: has joined #RubyOnRails
[03:34:27] stardiviner: has joined #RubyOnRails
[03:36:59] rubyonrails753: has joined #RubyOnRails
[03:40:15] fedexo: has joined #RubyOnRails
[03:41:03] delgiudices: How about testing stuff like front end validations
[03:41:11] delgiudices: That has nothing to do with capistrano/rspec?
[03:41:29] sevenseacat: front end validations? like with javascript?
[03:41:47] delgiudices: sevenseacat *
[03:42:07] sevenseacat: I don't think I've ever implemented them
[03:42:11] B1n4r10: has joined #RubyOnRails
[03:42:13] delgiudices: sorry i didn't mean capistrano i meant capybara
[03:42:28] delgiudices: So i should not worry about testing that javascript is validating my forms?
[03:42:53] sevenseacat: thats up to you
[03:43:32] sevenseacat: if thats something super important to you that you want to continually check and ensure it works, then write tests for it
[03:43:54] moei: has joined #RubyOnRails
[03:44:28] sevenseacat: you may be able to do it with rspec/capybara/etc, or you may want to look at pure javascript tests in something like jasmine
[03:44:46] sevenseacat: testing heavy javascript with rspec gets really painful though
[03:45:20] delgiudices: I guess that's out of the scope of rails
[03:45:49] Bloomer: has joined #RubyOnRails
[03:47:00] pawnbox: has joined #RubyOnRails
[03:47:58] Radar: http://ryanbigg.com/2016/03/working-with-date-ranges-in-active-record/
[03:48:15] Radar: srsly people if you're not use by_star and you're trying to use date ranges in AR you're gonna have a bad time
[03:48:57] sevenseacat: who was complaining about a bug in that the other day because they didnt understand it
[03:50:47] sevenseacat: dunno, ah well
[03:51:03] crystal77: has joined #RubyOnRails
[03:55:27] evenix: has joined #RubyOnRails
[03:55:34] evenix: hi all I recently started experiencing a Authentication failure! invalid_credentials: OAuth2::Error with goolge oauth 2 out of no where
[03:57:30] evenix: sevenseacat: anything that I missed? announcement? release?
[03:57:48] evenix: google_oauth 2 api
[03:58:58] Devalo: has joined #RubyOnRails
[03:58:59] pawnbox: has joined #RubyOnRails
[04:00:20] sevenseacat: i dont think that would be related to your error, but then again you havent given us much to go on
[04:00:21] Eswar: has joined #RubyOnRails
[04:05:11] moeabdol4: has joined #RubyOnRails
[04:06:08] SteenJobs: evenix: hate to state the obvious, but did you try deleting cookies and local storage and then trying again?
[04:06:38] evenix: SteenJobs: stating the obvious is not always bad man :) good suggestion. I did delete the cache but not local storage and cookies
[04:07:09] SteenJobs: evenix: some less considerate people find it insulting, so figured better safe than sorry :)
[04:07:28] SteenJobs: i’ve hit errors like that many times because i changed something in the db and then forgot to clear local storage and cookies
[04:08:16] evenix: mmh seem that its not fixing my issue.. this is so strange
[04:08:50] SteenJobs: tough to say without the error message and the server output
[04:08:55] SteenJobs: what credentials are invalid?
[04:09:46] mary5030: has joined #RubyOnRails
[04:10:42] evenix: The only error message I get is Authentication failure! invalid_credentials: OAuth2::Error, and an encoded response.. i figured that it was gzip compressed so i uncompressed it and it just displayes my access_token info etc..
[04:11:52] Radar: Hard to debug without seeing it for yourselves.
[04:11:56] Radar: Ourselves*
[04:12:03] evenix: access_token, "token_type" : "Bearer", "expires_in" : 3596 and id_token
[04:12:09] evenix: this is what it returns
[04:12:12] Radar: Not useful for us.
[04:12:19] evenix: https://gist.github.com/richardsondx/351578258368862ae5c6
[04:13:21] evenix: everything was working with no problems.. i logout of my account today to test something and wasn't able to log back in.
[04:14:11] evenix: it redirect the response to omniauth_callbacks/failure
[04:14:35] SteenJobs: evenix: https://github.com/zquestz/omniauth-google-oauth2/issues/118#issuecomment-154505299
[04:14:55] SteenJobs: evenix: but before you do that, go to your gemfile and specify the most recent version of the gem, then run bundle install and make sure it updates
[04:15:15] evenix: yes i saw this guy.. already updated to the latest version
[04:15:46] evenix: omniauth (1.3.1)
[04:15:56] evenix: omniauth-google-oauth2 (0.3.1)
[04:16:54] evenix: this is so weird.. ive been working with teh API all week with no problem and now im not able to login lol.. (im building a chrome extension that uses gmail api extensively)
[04:17:20] braincrash: has joined #RubyOnRails
[04:17:57] evenix: I can make request in the backend with no problem and refresh my token but the google-oauth2 wont' work.. im goign to retry to make some request in the backend just to confirm
[04:19:30] SteenJobs: and that’s all you have from the server logs?
[04:20:46] evenix: yes the rest of the response is my access_token, token_type, bearer, expires_in, and id_token
[04:21:41] chagel: has joined #RubyOnRails
[04:22:39] techsethi: has joined #RubyOnRails
[04:23:38] SteenJobs: evenix: check your gemfile.lock and tell me what version of omniauth-oauth2 is listed
[04:24:20] IFrank00: has joined #RubyOnRails
[04:25:18] pawnbox: has joined #RubyOnRails
[04:25:45] evenix: omniauth-google-oauth2 (0.3.1), omniauth-oauth2 (1.4.0)
[04:25:58] evenix: omniauth (1.3.1), oauth2 (1.1.0)
[04:26:32] techsethi_: has joined #RubyOnRails
[04:26:46] SteenJobs: that’s the problem
[04:26:53] baweaver: has joined #RubyOnRails
[04:27:05] SteenJobs: add gem 'omniauth-oauth2', '~> 1.3.1' to your gemfile
[04:28:51] evenix: SteenJobs: ok had to run a bundle update omniauth-oauth2.. trying now
[04:29:06] mary5030_: has joined #RubyOnRails
[04:29:22] evenix: nope still failing
[04:31:33] SteenJobs: and gemfile.lock says it’s 1.3.1?
[04:31:42] chouhoul_: has joined #RubyOnRails
[04:32:01] evenix: omniauth-oauth2 (1.3.1) yes
[04:32:29] evenix: i'm going to open an issue. I'm on jruby 9.0.5.0 , rails 3.2.13
[04:33:06] evenix: I'm running out of ideas. I'm going to go through the issues again and google release notes
[04:33:41] evenix: i didnt change anything in devise and it randomly stopped working
[04:34:22] evenix: https://github.com/zquestz/omniauth-google-oauth2/issues/53 <- could be this
[04:35:54] thor_: has joined #RubyOnRails
[04:36:07] evenix: but i didn't change my application controller..
[04:36:31] SteenJobs: evenix: at this point i’d use a debugger and step through the oauth flow in your app so you can 1) inspect the present values and 2) see if it’s being triggered more than once
[04:36:45] hahuang61: has joined #RubyOnRails
[04:38:30] treaki_: has joined #RubyOnRails
[04:40:42] evenix: SteenJobs: what part of the oauth flow? in devise? I investigated the omaauth callback but it only goes to the failure part it never gets into the create during the callback
[04:41:17] SteenJobs: evenix: so wherever it does get up to, throw some breakpoints in there and you’ll see if it gets called twice
[04:41:38] SteenJobs: and in the callback, even in the failure bit, you’ll be able to examine whatever values are present, including the response from google
[04:42:06] pawnbox: has joined #RubyOnRails
[04:42:40] djbkd: has joined #RubyOnRails
[04:43:29] evenix: I analyzed the failure bit didnt get much.. just the one I shared. I'm wondering how I can get the details from the google side or somehow get more verbose
[04:43:35] evenix: in the failure callback
[04:48:14] pwnd_nsfw: has joined #RubyOnRails
[04:49:12] prgmmr: has joined #RubyOnRails
[04:49:51] SteenJobs: has joined #RubyOnRails
[04:51:25] SteenJobs: evenix: hey sorry, got disconnected.
[04:52:28] voker57: has joined #RubyOnRails
[04:52:28] voker57: has joined #RubyOnRails
[04:53:46] djbkd: has joined #RubyOnRails
[04:54:54] alphaatom: has joined #RubyOnRails
[04:56:53] theblang: has joined #RubyOnRails
[04:57:15] evenix: @SteenJobs no problem .. no luck
[04:57:31] dopie: has joined #RubyOnRails
[04:58:10] gremax: has joined #RubyOnRails
[04:58:13] evenix: im trying to use the console to manually try the same oauth login
[04:58:23] evenix: google api explorer
[04:58:41] evenix: i might get more verbose there
[04:58:59] evenix: lol i get a 200 OK
[04:59:03] evenix: with the same informations
[04:59:27] evenix: This is definitely coming from the app
[05:00:22] evenix: I find it weird that its returning me invalid credential error and then its also returnign me the credentials that actually work...
[05:01:28] krzkrzkrz: has joined #RubyOnRails
[05:02:01] zave: has joined #RubyOnRails
[05:03:59] mary5030: has joined #RubyOnRails
[05:05:58] moeabdol4: has joined #RubyOnRails
[05:06:40] baweaver: has joined #RubyOnRails
[05:06:59] SteenJobs: evenix: what happened with using a debugger
[05:07:13] SteenJobs: without being able to tinker with the code, it’s tough for me to troubleshoot
[05:07:57] evenix: where do you want me to add it? I've been putting it in the main call where I'm expecting the response. failure method and create method of the OmniauthCallbacksController
[05:08:23] evenix: only thing I can think of is that I upgraded my jruby version
[05:08:43] evenix: from 1.7.x to 9.. I'm wondering if that caused an issue with oauth2
[05:09:20] evenix: on https://github.com/intridea/oauth2 README: 'This library may inadvertently work (or seem to work) on other Ruby implementations, however support will only be provided for the versions listed above.'
[05:09:31] evenix: They mention jruby but don't specify which versions
[05:10:10] evenix: https://travis-ci.org/intridea/oauth2/jobs/111516225
[05:10:51] evenix: oauth2 seem to fail in 1.7.9
[05:10:51] SteenJobs: never dealt with jruby so don’t have much to offer there
[05:11:18] evenix: SteenJobs: jruby is a pain.. a big one lol. I hate it. literally.
[05:11:29] evenix: but it has concurency
[05:12:45] RegulationD: has joined #RubyOnRails
[05:12:55] matthias_: has joined #RubyOnRails
[05:13:15] sp1rs: has joined #RubyOnRails
[05:13:54] SteenJobs: just try and add breakpoints throughout the flow so you can pinpoint exactly when the error is coming up and so you can trace the code path as the code executes
[05:15:30] sp1rs: has joined #RubyOnRails
[05:17:06] chagel: has joined #RubyOnRails
[05:20:14] Synthead: has joined #RubyOnRails
[05:20:45] Synthbread: has joined #RubyOnRails
[05:20:54] evenix: ok debbuging ominauth gem now
[05:21:08] techsethi: has joined #RubyOnRails
[05:23:05] DoctorMonocular: has joined #RubyOnRails
[05:26:10] Pazician: has joined #RubyOnRails
[05:26:30] Rubie: has joined #RubyOnRails
[05:27:44] rvanlieshout: has joined #RubyOnRails
[05:28:50] sbhatore: has joined #RubyOnRails
[05:29:09] lxsameer: has joined #RubyOnRails
[05:29:16] sbhatore: Has anyone ever used CAS login in their application ??
[05:30:02] sbhatore: I'm getting error if I go by these instructions https://github.com/rubycas/rubycas-client
[05:30:38] sevenseacat: "I got an error", my favorite
[05:31:10] arup_r: has joined #RubyOnRails
[05:32:53] arup_r: has joined #RubyOnRails
[05:36:48] SteenJobs: that was kind of nostalgic
[05:37:14] rvanlieshout: good day here
[05:38:33] SteenJobs: sbhatore: what’s the error?
[05:38:55] sbhatore: SteenJobs: Just a minute
[05:39:01] darkxploit: has joined #RubyOnRails
[05:40:51] chagel: has joined #RubyOnRails
[05:41:33] siaW: has joined #RubyOnRails
[05:42:17] sbhatore: SteenJobs: undefined method `before' for CASClient::Frameworks::Rails::Filter:Class
[05:42:34] sbhatore: this is the exact error
[05:43:00] rvanlieshout: sbhatore: why would you expect 'before' to exist?
[05:43:20] hackeron: has joined #RubyOnRails
[05:43:58] sbhatore: I am going accordgin to this link: https://github.com/rubycas/rubycas-client
[05:44:11] SteenJobs: can you show us the line of code, or that area of code that’s causing the error
[05:44:59] arup_r: yeah, take a photo of your code and tweet us. :p
[05:45:23] rvanlieshout: sbhatore: !debug
[05:45:23] helpa: sbhatore: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[05:47:00] r0bby_: has joined #RubyOnRails
[05:50:08] arup_r: has joined #RubyOnRails
[05:50:14] DoctorMonocular: has joined #RubyOnRails
[05:52:05] marcdel: has joined #RubyOnRails
[05:52:07] jenrzzz: has joined #RubyOnRails
[05:57:05] marcdel: has joined #RubyOnRails
[05:57:07] sandstrom: has joined #RubyOnRails
[05:58:30] xcesariox: has joined #RubyOnRails
[06:00:03] bronson_: has joined #RubyOnRails
[06:00:18] Devalo: has joined #RubyOnRails
[06:00:25] htmldrum_: has joined #RubyOnRails
[06:02:26] boontdustie: has joined #RubyOnRails
[06:06:04] Abhijit: has joined #RubyOnRails
[06:06:23] Abhijit: is it good idea to allow dot in a humanized url ? or not a good idea?
[06:06:36] Abhijit: /users/a.b
[06:06:44] moeabdol4: has joined #RubyOnRails
[06:07:04] techsethi: has joined #RubyOnRails
[06:09:19] futilegames: has joined #RubyOnRails
[06:11:44] rvanlieshout: Abhijit: you might want to use to_param
[06:12:37] rvanlieshout: friendly_id is one iirc
[06:12:45] rvanlieshout: but to answer the question: i would try to prevent that
[06:13:01] Abhijit: i am using friedly_id
[06:13:12] rvanlieshout: and it included the dot?
[06:13:19] Abhijit: no. it gives error.
[06:13:31] Abhijit: i will have to do some configuration. i did not check exactly how though.
[06:14:07] Eswar: has joined #RubyOnRails
[06:15:02] Devalo: has joined #RubyOnRails
[06:15:25] enitiz: has joined #RubyOnRails
[06:18:00] futilegames: has joined #RubyOnRails
[06:19:11] arup_r: has joined #RubyOnRails
[06:22:54] roshanavand: has joined #RubyOnRails
[06:26:06] kdough: has joined #RubyOnRails
[06:26:25] sp1rs: has joined #RubyOnRails
[06:26:32] chipotle: has joined #RubyOnRails
[06:27:08] arup_r: has joined #RubyOnRails
[06:27:24] Abhijit: is there any other library other than friendly id which allows all dot integer special char by default?
[06:27:40] rvanlieshout: why do you prefer that dot? rails uses that to specify the format
[06:28:27] Abhijit: i told not to use it. but the boss want it.
[06:28:29] sandstrom: has joined #RubyOnRails
[06:29:28] rvanlieshout: then you'll need to parse the params[:format]
[06:29:45] rvanlieshout: or go to your boss with proper reasons why to not use that dot
[06:30:31] futilegames: has joined #RubyOnRails
[06:32:39] djbkd: has joined #RubyOnRails
[06:35:54] chagel: has joined #RubyOnRails
[06:43:41] djbkd: has joined #RubyOnRails
[06:44:01] htmldrum: has joined #RubyOnRails
[06:54:05] Megamos: has joined #RubyOnRails
[06:54:56] Macaveli: has joined #RubyOnRails
[06:55:02] arup_r1: has joined #RubyOnRails
[06:56:22] chagel: has joined #RubyOnRails
[06:59:02] solars: has joined #RubyOnRails
[06:59:41] hahuang61: has joined #RubyOnRails
[07:00:08] siaW: has joined #RubyOnRails
[07:06:02] dede: has joined #RubyOnRails
[07:07:43] trosborn: has joined #RubyOnRails
[07:08:36] jas02: has joined #RubyOnRails
[07:08:44] moeabdol4: has joined #RubyOnRails
[07:14:02] shivam_v: has joined #RubyOnRails
[07:14:17] sandstrom: has joined #RubyOnRails
[07:18:52] chagel: has joined #RubyOnRails
[07:20:23] Macaveli_: has joined #RubyOnRails
[07:21:22] yardenbar: has joined #RubyOnRails
[07:22:05] hashtd: has joined #RubyOnRails
[07:22:59] Macaveli_: Morning all :)
[07:23:31] rafaelfranca: has joined #RubyOnRails
[07:23:42] Pazician: has joined #RubyOnRails
[07:25:46] yxejamir: has joined #RubyOnRails
[07:26:41] hahuang61: has joined #RubyOnRails
[07:27:49] arup_r1: hi Macaveli_
[07:30:33] tetraktys: has joined #RubyOnRails
[07:31:35] mayonnaise: has joined #RubyOnRails
[07:32:54] aganov: has joined #RubyOnRails
[07:34:37] MEATCHICKEN: has joined #RubyOnRails
[07:35:18] MEATCHICKEN: I am unable to write this quer - Review.includes(:reviewer).where(reviewer: {})
[07:35:26] MEATCHICKEN: reviewer being polymorphic
[07:35:30] MEATCHICKEN: is this unsupported?
[07:36:59] rvanlieshout: to your last question
[07:37:13] konsolebox: has joined #RubyOnRails
[07:38:24] nerium: has joined #RubyOnRails
[07:38:37] MEATCHICKEN: rvanlieshout, any easy work arounds?
[07:38:52] rvanlieshout: there is no sane way in joining that
[07:40:56] marcdel: has joined #RubyOnRails
[07:41:06] rvanlieshout: unless you know what specific kind or reviewer you want to join
[07:41:13] r0bby_: has joined #RubyOnRails
[07:42:38] MEATCHICKEN: rvanlieshout, how would I do it in that case?
[07:42:52] rvanlieshout: what kind of reviewer are we talking about?
[07:43:05] MEATCHICKEN: multiple type of users
[07:43:10] MEATCHICKEN: just a regular User
[07:44:16] nerium: has joined #RubyOnRails
[07:44:29] rvanlieshout: Review.joins('INNER JOIN users ON users.id = reviews.reviewer_id AND reviews.reviewer_type = "User"')
[07:45:20] artto: has joined #RubyOnRails
[07:45:21] mayonnaise: has left #RubyOnRails: ()
[07:45:29] hinbody: has joined #RubyOnRails
[07:49:08] futilegames: has joined #RubyOnRails
[07:49:31] tsujp: has joined #RubyOnRails
[07:50:03] MEATCHICKEN: rvanlieshout, Will try that thanks
[07:52:44] aaronang: has joined #RubyOnRails
[07:54:41] tsujp: has joined #RubyOnRails
[07:54:43] Pazician: has joined #RubyOnRails
[07:56:46] darutoko: has joined #RubyOnRails
[07:56:57] Radar: Anyone got a newb-friendly JSON API guide for Rails that they can recommend?
[07:59:43] futilegames: has joined #RubyOnRails
[08:00:11] arBmind: has joined #RubyOnRails
[08:02:00] configged-: has joined #RubyOnRails
[08:02:00] configged: has joined #RubyOnRails
[08:02:07] baweaver: definitely not n00b friendly but I know of a few I'd have to find again.
[08:02:31] baweaver: most of the issue comes with token passing through devise for auth
[08:02:32] Palsson: has joined #RubyOnRails
[08:03:21] sandstrom: has joined #RubyOnRails
[08:03:48] aaronang: Radar, If you want to use Rails Edge, this might be a good read: http://edgeguides.rubyonrails.org/api_app.html
[08:06:25] y2mq37: has joined #RubyOnRails
[08:06:32] IFrank00: has joined #RubyOnRails
[08:09:27] moeabdol4: has joined #RubyOnRails
[08:10:53] Ropeney: has joined #RubyOnRails
[08:10:59] malcolmva: has joined #RubyOnRails
[08:12:28] tetraktys: has joined #RubyOnRails
[08:13:08] roshanavand: has joined #RubyOnRails
[08:15:58] ferr: has joined #RubyOnRails
[08:16:22] roshanavand: has joined #RubyOnRails
[08:18:32] SanguineAnomaly: has joined #RubyOnRails
[08:18:40] shtirlic: has joined #RubyOnRails
[08:21:28] yxejamir: has joined #RubyOnRails
[08:21:44] qejk: has joined #RubyOnRails
[08:22:31] trosborn: has joined #RubyOnRails
[08:24:38] ayoros: has joined #RubyOnRails
[08:24:57] trosborn: has joined #RubyOnRails
[08:26:32] sp1rs: has joined #RubyOnRails
[08:28:04] copperb0lt: has joined #RubyOnRails
[08:29:28] pawnbox: has joined #RubyOnRails
[08:31:28] tungd: has joined #RubyOnRails
[08:31:36] mark2: has joined #RubyOnRails
[08:31:55] blackhuey: has joined #RubyOnRails
[08:32:05] artto: has joined #RubyOnRails
[08:32:56] Palsson: has joined #RubyOnRails
[08:33:32] Ergo: has joined #RubyOnRails
[08:35:50] defsdoor: has joined #RubyOnRails
[08:36:50] SanguineAnomaly: has joined #RubyOnRails
[08:38:49] tetraktys: has joined #RubyOnRails
[08:41:39] Fly80: has joined #RubyOnRails
[08:43:27] SteenJobs: has joined #RubyOnRails
[08:44:30] bronson: has joined #RubyOnRails
[08:45:54] sp1rs: has joined #RubyOnRails
[08:47:06] Infinite_182: has joined #RubyOnRails
[08:50:25] shivam_v: has joined #RubyOnRails
[08:51:27] mbreedlove: has joined #RubyOnRails
[08:52:11] rrawlins: has joined #RubyOnRails
[08:53:31] srinidhi: has joined #RubyOnRails
[08:55:03] sp1rs: has joined #RubyOnRails
[08:59:43] uglybandersnatch: has joined #RubyOnRails
[08:59:56] toomus: has joined #RubyOnRails
[09:00:24] aaronang: toomus, hi :)
[09:00:59] toomus: I have problem with autoload order
[09:01:28] toomus: It looks like models are loaded before /lib folder
[09:01:39] srinidhi: has joined #RubyOnRails
[09:02:20] toomus: But in /lib I have some extensions that should be loaded first
[09:05:27] toomus: when I print ActiveSupport::Dependencies.autoload_paths it looks ok, /lib is before /models
[09:06:25] gbgdev: has joined #RubyOnRails
[09:06:26] toomus: but when I start app model is initialized first
[09:06:45] drptbl: has joined #RubyOnRails
[09:06:45] tsujp: has joined #RubyOnRails
[09:07:31] mdw: has joined #RubyOnRails
[09:08:12] Fly80: has left #RubyOnRails: ("Leaving")
[09:09:51] adre: has joined #RubyOnRails
[09:10:19] moeabdol4: has joined #RubyOnRails
[09:12:23] sandstrom: has joined #RubyOnRails
[09:14:17] RegulationD: has joined #RubyOnRails
[09:14:18] jsrn: has joined #RubyOnRails
[09:18:35] mr-spoon: has left #RubyOnRails: ("Gone.")
[09:19:56] PedramT: has joined #RubyOnRails
[09:21:25] finnnnnnnnnnn: has joined #RubyOnRails
[09:25:37] gbgdev: has joined #RubyOnRails
[09:30:57] techsethi: has joined #RubyOnRails
[09:32:17] chagel: has joined #RubyOnRails
[09:33:30] PedramT: has joined #RubyOnRails
[09:34:02] zave: has joined #RubyOnRails
[09:34:33] pawnbox: has joined #RubyOnRails
[09:34:35] sbhatore: has joined #RubyOnRails
[09:35:27] epochwolf: has joined #RubyOnRails
[09:36:57] Ergo: has joined #RubyOnRails
[09:37:45] jenrzzz: has joined #RubyOnRails
[09:38:00] sbhatore: has joined #RubyOnRails
[09:40:14] n008f4g_: has joined #RubyOnRails
[09:41:05] baweaver: has joined #RubyOnRails
[09:42:57] chagel: has joined #RubyOnRails
[09:44:27] Spami: has joined #RubyOnRails
[09:47:16] FooMunki: has joined #RubyOnRails
[09:48:14] apotry: has joined #RubyOnRails
[09:50:02] scope: has joined #RubyOnRails
[09:51:30] jenrzzz: has joined #RubyOnRails
[09:55:15] pawnbox: has joined #RubyOnRails
[09:57:49] DEA7TH: has joined #RubyOnRails
[09:58:46] marr: has joined #RubyOnRails
[09:59:01] quazimodo: has joined #RubyOnRails
[10:01:31] PedramT: has joined #RubyOnRails
[10:02:29] arup_r: has joined #RubyOnRails
[10:06:56] arup_r: If I write like - raise logger.inspect i am seeing error. But, when rendering in a browser, I see no <li> inside the <ul> .. I am thinking something wrong I code https://gist.github.com/aruprakshit/ecf2e23d63316fa6f9b7#file-_starloggers-html-slim-L1 .. not able to figure that out..
[10:07:22] arup_r: what's that little thing I am missing..?
[10:08:09] malcolmva: has joined #RubyOnRails
[10:08:56] workmad3: has joined #RubyOnRails
[10:11:17] moeabdol4: has joined #RubyOnRails
[10:13:42] trosborn: has joined #RubyOnRails
[10:20:05] chagel: has joined #RubyOnRails
[10:20:31] universa1: arup_r: = @recommended_loggers.inspect
[10:20:47] mfaeh: has joined #RubyOnRails
[10:21:47] pawnbox: has joined #RubyOnRails
[10:21:50] arup_r: Need to try that., But I made sure, the variable has data in it.. by raising as I said. But I will try and tell you what you said.
[10:22:46] arBmind: has joined #RubyOnRails
[10:23:39] ValMai: has joined #RubyOnRails
[10:24:07] gbgdev: has joined #RubyOnRails
[10:24:12] universa1: arup_r: no clue if that i of any importance with slim, but you have a double space after the "-" and your li i 3 spaces indented.
[10:25:28] arup_r: I had a single space.. it was not printing, so I was playing with it, so that it prints.. haha
[10:26:01] dgncn: has joined #RubyOnRails
[10:26:01] arup_r: the thing is. if have [1,2] instead of that ivar, it is printing..
[10:26:12] alexhartley: has joined #RubyOnRails
[10:26:27] drptbl: has joined #RubyOnRails
[10:27:06] universa1: arup_r: = render partial: "whatever", locals: {loggers: @recommended_loggers} if @recommended_loggers
[10:27:08] arup_r: it is not printing, when I have that var as you see. But inside the .each when I do - raise logger.inspect, it is throwing exception. Which is making sure, it is iterating.. so the question is why the data is not being printed.
[10:27:32] universa1: arup_r: and then your partial should just be: - loggers.each do |logger|; li salt
[10:27:48] arup_r: ok, .. hm
[10:28:25] arup_r: I am also thinking may be && this is worng. I will be back soon. let me try more
[10:28:59] universa1: arup_r: as a rule of thumb: partials should rarely work with instance variables, they should have their data as locals passed in.
[10:29:18] arup_r: oh, didn't know that.
[10:29:36] arup_r: where it is written..? any ref please
[10:29:52] arup_r: that can be a point..
[10:30:00] universa1: arup_r: no where. experience.
[10:30:09] universa1: arup_r: improves reuasibility.
[10:30:13] arup_r: that counts, though
[10:32:07] tbuehlmann: I agree. sometimes a partial is used for different controller actions or even controllers. when the partial relies on instance variables, each controller has to set it. so it's dangerous to change code in one controller and the partial, because it might effect other controllers
[10:32:54] universa1: isntance variables in a view are a bit like globals in a normal program ;)
[10:33:11] pawnbox: has joined #RubyOnRails
[10:34:23] tbuehlmann: I personally tend to use more and more controller helper methods in the view. they can be lazy and I don't have to care about them not being used anymore
[10:34:49] tbuehlmann: then it's rather a dead code problem than, maybe, a performance issue
[10:35:57] urkle: has joined #RubyOnRails
[10:35:58] tbuehlmann: I also wouldn't rely on an object's instance variables directly, methods are the way to go
[10:36:47] siaW: has joined #RubyOnRails
[10:37:13] pawnbox: has joined #RubyOnRails
[10:37:57] neanderslob_: hi everyone, I'm trying to add an attribute type (a string) to an object people that already exists and contains several attributes; how might I go about doing this?
[10:39:17] rodfersou: has joined #RubyOnRails
[10:39:34] pawnbox: has joined #RubyOnRails
[10:40:11] moeabdol4: has joined #RubyOnRails
[10:40:16] arup_r: tbuehlmann: so for instance variables you have inside controller actions, you will create a controller helper for each of them? Or what is the reasoning you give behind it ?
[10:40:18] universa1: neanderslob_: object as in an actual ruby object or do you mean you have a model.
[10:40:41] universa1: neanderslob_: with a database table?
[10:40:45] pawnbox: has joined #RubyOnRails
[10:40:49] arup_r: I am just trying to understand the design motivation that way.
[10:41:20] tbuehlmann: at least for the objects that have to be calculated somehow
[10:41:40] neanderslob_: universa1: you know, I'm not sophisticated enough to know the difference; this object would have come from a database table if that helps
[10:41:45] tbuehlmann: I write a method and make it accessible to the view via `helper_method :method_name`
[10:42:02] arup_r: yeah that I got it
[10:42:17] tungd: has joined #RubyOnRails
[10:42:18] tbuehlmann: that also frees me from a lot of before_actions
[10:42:30] arup_r: that's how we write controller helpers. Just trying to get why that way..
[10:42:41] tbuehlmann: often times these methods get merged in a decorator, but that doesn't always fits
[10:42:43] neanderslob_: universa1: but to be clear, I'm not trying to add this attribute to the database, just to the object that I pulled from the database
[10:42:46] Eswar: has joined #RubyOnRails
[10:43:01] neanderslob_: universa1: does that make sense?
[10:43:12] pawnbox: has joined #RubyOnRails
[10:44:16] arup_r: neanderslob_: if you do it often, and it is required.. you may create model helper attributes, like using attr_accessor.
[10:45:04] alexhartley: has joined #RubyOnRails
[10:45:06] arup_r: then, you can store the value there, and use it.
[10:45:22] neanderslob_: arup_r: oh yea, I suppose you're right
[10:45:58] neanderslob_: arup_r: I didn't draw the connection there; thanks
[10:46:37] hashtd: has joined #RubyOnRails
[10:47:46] czerasz: has joined #RubyOnRails
[10:48:52] pawnbox: has joined #RubyOnRails
[10:50:14] chagel: has joined #RubyOnRails
[10:52:24] alexhart_: has joined #RubyOnRails
[10:56:29] Jasaka: has joined #RubyOnRails
[10:58:00] trosborn: has joined #RubyOnRails
[10:59:34] alexhartley: has joined #RubyOnRails
[11:05:49] sandstrom: has joined #RubyOnRails
[11:07:50] sp1rs: has joined #RubyOnRails
[11:09:41] CustosLimen: has joined #RubyOnRails
[11:11:44] techsethi: has joined #RubyOnRails
[11:12:52] pawnbox: has joined #RubyOnRails
[11:15:01] RegulationD: has joined #RubyOnRails
[11:15:30] tsujp: has joined #RubyOnRails
[11:17:05] ayonkhan: has joined #RubyOnRails
[11:17:45] comm64x: has joined #RubyOnRails
[11:18:12] tungd: has joined #RubyOnRails
[11:18:24] drptbl: has joined #RubyOnRails
[11:18:29] shivam_v: has joined #RubyOnRails
[11:21:19] comm64x: I have a vanilla rails app which has a components directory as a sibling to the app directory and it contains a number of engines which I have mounted in my routes.rb file as subdomains...I'm able to visit the fake subdomain on localhost but it doesn't show the content for that engine, for example if I go to dashboard.site.dev it should say this is the dashboard but instead it gives me the same conten
[11:21:25] comm64x: t as if I visited site.dev. How can I make the contents of my engines show up properly
[11:22:30] bronson: has joined #RubyOnRails
[11:25:46] jottr: has joined #RubyOnRails
[11:25:48] trinaldi: has joined #RubyOnRails
[11:26:04] adlerdias: has joined #RubyOnRails
[11:26:19] ericpet: has joined #RubyOnRails
[11:28:53] snowy: has joined #RubyOnRails
[11:29:06] trosborn: has joined #RubyOnRails
[11:31:08] comm64x: has left #RubyOnRails: ()
[11:31:56] scope: has joined #RubyOnRails
[11:32:30] ldnunes: has joined #RubyOnRails
[11:32:42] alexhart_: has joined #RubyOnRails
[11:33:46] Fernando-Basso: has joined #RubyOnRails
[11:33:47] pawnbox: has joined #RubyOnRails
[11:33:52] ericpet: has joined #RubyOnRails
[11:36:56] PedramT: has joined #RubyOnRails
[11:37:19] silverdust: has joined #RubyOnRails
[11:37:51] configged: has joined #RubyOnRails
[11:38:01] configged-: has joined #RubyOnRails
[11:38:26] Ropeney: has joined #RubyOnRails
[11:38:56] silverdust: When I fetch url of a image that doesn't exists from console like this Advert.find(3).upload.image.url I get the missing url returned but on the web page it throws an error that undefined method image for nilClass
[11:39:02] alexhartley: has joined #RubyOnRails
[11:39:42] silverdust: I don't want to have to check with conditions all the time. I'll like if it just loads the default image without throwing error
[11:42:13] baweaver: has joined #RubyOnRails
[11:44:33] herpless: has joined #RubyOnRails
[11:46:33] k13nox: has joined #RubyOnRails
[11:47:46] k13nox: Hi, how to minify HTML email before send through 'mail()' ?
[11:49:02] htmldrum_: has joined #RubyOnRails
[11:50:35] hashtd: has left #RubyOnRails: ("Konversation terminated!")
[11:52:19] confact: How are companies that use Ruby handling code challenges. I tried to keep simple and collect everything in one class for simplicity but get turned down because of it without letting me explain.
[11:52:32] jottr: Hi all. The following query runs extremely slow: ` users = User.where.not('users.avatar' => nil).sample(30)`
[11:52:39] cym3try: has joined #RubyOnRails
[11:53:03] trosborn: has joined #RubyOnRails
[11:53:08] jottr: ^ Is there a means of improving the speed of such a query?
[11:53:24] confact: index on avatar?
[11:53:36] Macaveli: has joined #RubyOnRails
[11:53:53] tbuehlmann: adding a limit so you don't retrieve all users
[11:54:37] Palsson: has joined #RubyOnRails
[11:54:39] confact: oh yea. limit would be good too, good call tbuehlmann.
[11:54:41] Ergo^: has joined #RubyOnRails
[11:54:52] tbuehlmann: you want to order by random on the database, too
[11:55:01] jottr: confact: Ok So I would write a migration as such: `rails g migration AddIndexToavatar user_id:int:index` ?
[11:55:29] confact: jottr: try what tbuehlmann is saying first. that could fix most of the issue
[11:55:44] tbuehlmann: having an index on the field is a good idea, though (http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_index)
[11:55:48] confact: if you do sort by RAND() or something like that on the DB and limit that, it could work.
[11:56:51] jottr: confact: Would there be a more db agnostic way of implementing RAND()?
[11:57:02] alexhart_: has joined #RubyOnRails
[11:57:10] jottr: We are currently using mysql, and I would like to migrate to pg at some point
[11:57:15] jenrzzz: has joined #RubyOnRails
[11:57:46] Eswar: has joined #RubyOnRails
[11:58:13] confact: jottr: that is the problem with that
[11:58:42] confact: because mysql use RAND() and others RANDOM()
[11:59:28] jottr: yep. thats why I'm asking
[11:59:53] confact: jottr: i haven't find any good solution on just that, yet.
[12:00:13] pawnbox: has joined #RubyOnRails
[12:00:20] artto: has joined #RubyOnRails
[12:00:23] deur-: isn't order by RAND generally discouraged to use?
[12:00:56] jottr: https://stackoverflow.com/questions/5342270/rails-3-get-random-record
[12:01:01] tbuehlmann: last time I checked, ordering by RANDOM() needed a full table scan and that there are techniques to go around this
[12:01:22] jottr: For rails3 he proposes someting like this: `Thing.offset(rand(Thing.count)).first
[12:01:25] confact: deur-: raw RAND is discouraged yes. But it is workarounds for it.
[12:01:46] deur-: ah, gotcha
[12:02:20] confact: jottr: i just google little fast and found this, maybe soemthing? https://github.com/spilliton/randumb don't know how they do the actual RAND. check that up first.
[12:02:34] jottr: confact: ok thx
[12:03:23] confact: they might do the discouraged RAND so be sure of checking that.
[12:03:55] jottr: What about the solution proposed in the so question above?
[12:05:40] AimlessRAven: has joined #RubyOnRails
[12:05:54] AimlessRAven: hi everyone, i have = f.search_field :transaction_provider_id_eq, Transaction.accessible_by(current_ability).collect{|t| t.provider_id} that produce undefined method `merge' for #<Array:0x007fd9e24294b0>
[12:07:40] jottr: tbuehlmann: Also, I'm unsure on how to apply the link you proposed above. Is this a statement I should ad to my migration?
[12:07:49] ericpet: has joined #RubyOnRails
[12:08:06] tbuehlmann: right, that's a method you can use in your migration
[12:08:20] htmldrum: has joined #RubyOnRails
[12:09:18] Ergo: has joined #RubyOnRails
[12:09:31] dgncn: has joined #RubyOnRails
[12:10:27] jonee: has joined #RubyOnRails
[12:10:50] jottr: tbuehlmann: Ah ok. So I would have done like so: `rails g migration AddIndexToavatar user_id:int:index`, which would also add the add_column statement. Would there a better way to writing the generator, so I don't have to manually delete add_column afterwards?
[12:11:31] tbuehlmann: I don't understand. I thought you already had the column and just wanted an index?
[12:12:26] alexhart_: has joined #RubyOnRails
[12:12:37] sandstrom: has joined #RubyOnRails
[12:14:03] jottr: tbuehlmann: Well, I would like to write a migration with the rails generator, because it gives me the timestamp in the migration. But when I write it as in my example, it always add the `add_column` statement. Which I don't want.
[12:14:55] jottr: So my question was, if there is a better way of employing the generator, so that it only creates a migration with the `add_index` statement in it.
[12:15:10] tbuehlmann: there's no generator for only that I think
[12:15:16] tbuehlmann: if you just want and empty migration, try `$ bin/rails g migration <name>`
[12:15:28] jottr: tbuehlmann: ah. thx
[12:19:53] d0nn1e: has joined #RubyOnRails
[12:20:54] Tempesta: has joined #RubyOnRails
[12:23:15] Eswar: has joined #RubyOnRails
[12:23:47] pwnd_nsfw`: has joined #RubyOnRails
[12:23:48] techsethi: has joined #RubyOnRails
[12:24:03] Aherin_: has joined #RubyOnRails
[12:24:11] SeanLazer_: has joined #RubyOnRails
[12:24:53] alexhartley: has joined #RubyOnRails
[12:24:57] jottr_: has joined #RubyOnRails
[12:25:15] siaw_: has joined #RubyOnRails
[12:25:19] siaw_: has left #RubyOnRails: ()
[12:25:21] thomasfedb_: has joined #RubyOnRails
[12:25:24] bachmann: has joined #RubyOnRails
[12:25:58] daemonwrangler_: has joined #RubyOnRails
[12:25:58] robbkidd_: has joined #RubyOnRails
[12:26:02] hahuang65: has joined #RubyOnRails
[12:26:10] deded: has joined #RubyOnRails
[12:26:31] Depili_: has joined #RubyOnRails
[12:26:57] SloggerKhan1: has joined #RubyOnRails
[12:26:58] nibbo_: has joined #RubyOnRails
[12:27:11] Shidash: has joined #RubyOnRails
[12:28:01] mbreedlove: has joined #RubyOnRails
[12:28:11] noah256: has joined #RubyOnRails
[12:28:12] voobscout: has joined #RubyOnRails
[12:28:12] bphogan: has joined #RubyOnRails
[12:29:01] tubbo: has joined #RubyOnRails
[12:30:04] AntiSpamMeta: has joined #RubyOnRails
[12:31:25] finnnnnnnnnnn: has joined #RubyOnRails
[12:31:54] Seich: has joined #RubyOnRails
[12:32:15] Diabolik: has joined #RubyOnRails
[12:33:34] callumacrae: has joined #RubyOnRails
[12:34:03] AimlessRAven: has joined #RubyOnRails
[12:34:18] AimlessRAven: hi everyone i have = f.search_field :transaction_provider_id_eq, Transaction.accessible_by(current_ability).collect{|c| [c.provider_id]} and this produce me undefined method `merge' for #<Array:0x007fd9f73b9060>
[12:35:22] alexhart_: has joined #RubyOnRails
[12:35:23] mbreedlove: has joined #RubyOnRails
[12:35:25] Ropeney: has joined #RubyOnRails
[12:38:04] tbuehlmann: a search field basically is a text field, why do you provide an array argument?
[12:38:49] alexhartley: has joined #RubyOnRails
[12:39:06] barajasfab: has joined #RubyOnRails
[12:39:19] AimlessRAven: tbuehlmann: its be something like this = f.search_field :transaction_provider_id_eq
[12:39:42] tbuehlmann: I have no idea what you're trying to do
[12:40:12] rrawlins: has joined #RubyOnRails
[12:40:29] stardiviner: has joined #RubyOnRails
[12:41:05] AimlessRAven: i wanna find card by transaction.provvider_id
[12:42:43] Detch: has joined #RubyOnRails
[12:42:50] aaronang: has joined #RubyOnRails
[12:44:04] tbuehlmann: sorry, I can't help you
[12:44:37] mcr-credil: has joined #RubyOnRails
[12:44:47] quazimodo: has joined #RubyOnRails
[12:46:19] k13nox: has joined #RubyOnRails
[12:46:23] tungd: has joined #RubyOnRails
[12:46:56] artto: has joined #RubyOnRails
[12:47:56] flashpoint9: has joined #RubyOnRails
[12:48:04] k13nox: Hi, how to minify HTML email when send through 'mail()' ?
[12:48:44] ericpet: has joined #RubyOnRails
[12:49:33] chipotle: has joined #RubyOnRails
[12:49:59] moeabdol: has joined #RubyOnRails
[12:50:59] Trynemjoel: has joined #RubyOnRails
[12:52:00] pawnbox: has joined #RubyOnRails
[12:52:27] robbyoconnor: has joined #RubyOnRails
[12:52:31] scope: has joined #RubyOnRails
[12:53:09] ericpet: has joined #RubyOnRails
[12:58:49] ericpet: has joined #RubyOnRails
[13:00:03] jenrzzz: has joined #RubyOnRails
[13:00:46] LYC4Nbeat: has joined #RubyOnRails
[13:02:07] Ropeney: has joined #RubyOnRails
[13:05:40] rafaelfranca: has joined #RubyOnRails
[13:06:56] prgmmr: has joined #RubyOnRails
[13:10:00] sp1rs: has joined #RubyOnRails
[13:10:10] augcesar: has joined #RubyOnRails
[13:10:26] shanemcd: has joined #RubyOnRails
[13:10:36] ericpet: has joined #RubyOnRails
[13:13:21] stannard: has joined #RubyOnRails
[13:15:17] ericpet: has joined #RubyOnRails
[13:15:24] arup_r: I have 2 models, called Request and InquiryType. They have 1:1 assoc. Each request is created with any of InquiryType selected. I have index page, where I list all InquiyTypes. Now have delete option next to each of them. I want prevent user to delete any Inquiry types which are being used. I am thinking to hide delete icons for inquiry types which are being used. Is this a Good design or, I will keep delete icon with href set "#"?
[13:15:38] robbyoconnor: has joined #RubyOnRails
[13:15:56] RegulationD: has joined #RubyOnRails
[13:16:18] universa1: arup_r: first of all you should prevent the deletion in the model part!
[13:17:03] arup_r: hm, make sense. and in UI? should I hide the delete link to?
[13:17:16] arup_r: backend guard I understood.
[13:17:25] universa1: arup_r: yes. why show something that is not possible?!
[13:19:22] NurseChirssy: has joined #RubyOnRails
[13:22:43] mdw: has joined #RubyOnRails
[13:22:50] alexhart_: has joined #RubyOnRails
[13:23:32] bronson: has joined #RubyOnRails
[13:23:36] pawnbox: has joined #RubyOnRails
[13:25:28] alexhartley: has joined #RubyOnRails
[13:25:52] configged: has joined #RubyOnRails
[13:26:02] configged-: has joined #RubyOnRails
[13:26:06] drptbl: has joined #RubyOnRails
[13:27:33] sp1rs: has joined #RubyOnRails
[13:30:17] shanemcd: has joined #RubyOnRails
[13:30:22] chagel: has joined #RubyOnRails
[13:31:07] AzaToth: has joined #RubyOnRails
[13:31:10] mdw: has joined #RubyOnRails
[13:35:03] ferr: has joined #RubyOnRails
[13:35:47] alexhart_: has joined #RubyOnRails
[13:37:45] confact: How are companies that use Ruby handling code challenges? I tried to keep simple and collect everything in one class for simplicity but get turned down because of it without letting me explain.
[13:38:27] roshanavand: has joined #RubyOnRails
[13:41:08] jscheel: has joined #RubyOnRails
[13:41:58] dcope: has anyone in here purchased this? https://gumroad.com/l/backbone-js-on-rails i'm wondering if it's good / worth the $30
[13:42:56] aaronang: has joined #RubyOnRails
[13:43:12] baweaver: has joined #RubyOnRails
[13:44:24] rapha: has joined #RubyOnRails
[13:45:36] drptbl: has joined #RubyOnRails
[13:45:41] rapha: I need some help ... when I .save on my model, neither nothing I do within before_save or before_validation filters gets saved. Only when I trick around with using update_attributes there does anything happen at all. How do you even debug something like that?
[13:46:15] rvanlieshout: rapha: what are you doing in before_save or before_validation?
[13:46:38] rapha: rvanlieshout: for example "sort_value = main_translation.text.gsub(/(\(.*?\))( |)/, '').downcase"
[13:46:49] SeanLazer: has joined #RubyOnRails
[13:46:51] rvanlieshout: that's because sort_value is a local variable after that
[13:46:54] rvanlieshout: you want to use self.sort_value =
[13:46:56] universa1: rapha: gist actual code ;)
[13:47:12] rapha: universa1: that /was/ actual code ;)
[13:47:14] roshanavand: has joined #RubyOnRails
[13:47:20] yellow5: has joined #RubyOnRails
[13:47:37] universa1: rapha: yeah, but without context, it is usually very hard to have any clue what might go wrong.
[13:48:20] rapha: rvanlieshout: okay, still nothing. I'll gist as universa1 suggested.
[13:49:13] gbgdev: has joined #RubyOnRails
[13:49:52] unl0ckd: has joined #RubyOnRails
[13:50:48] rapha: universa1: rvanlieshout: https://gist.github.com/sixtyfive/3ebcc64201b0aed04ea3
[13:52:12] rvanlieshout: rapha: what happens and why is it wrong?
[13:53:12] rapha: rvanlieshout: the sort_value field remains blank when it should contain a non-blank value after .save'ing.
[13:53:45] stardiviner: has joined #RubyOnRails
[13:53:58] rvanlieshout: rapha: raise main_translation.text.inspect
[13:54:02] rvanlieshout: on the line above that self.sort_value =
[13:54:22] rapha: okay, second
[13:55:18] drbayer: has joined #RubyOnRails
[13:55:31] rapha: rvanlieshout: okay, for the Phrase I'm testing with, it gives "RuntimeError: "(die Jacke)""
[13:55:44] rapha: (Which is expected)
[13:55:57] rvanlieshout: and with the gsub?
[13:56:00] rvanlieshout: and other stuff
[13:57:47] rapha: rvanlieshout: "raise main_translation.text.gsub(/(\(.*?\))( |)/, '').downcase.inspect" indeed gives blank for reasons that are beyond me o_O
[13:58:01] rvanlieshout: what would you want "(die Jacke)"" to become?
[13:58:36] CodaBrink: has joined #RubyOnRails
[13:58:46] rapha: rvanlieshout: indeed, the computer just does what I tell it to. Wait a sec...
[13:59:06] robbyoconnor: has joined #RubyOnRails
[13:59:08] spion: is there a way to force a default (admin) user to be a part of structure.sql ? I want to take advantage of a database level non-null constraint for another table's owner_id field, with the default value being the id of the first (admin) user.
[13:59:28] spion: or perhaps I should scrap the db-level default value and do this in before_save
[13:59:31] rvanlieshout: spion: a structure.sql only contains the structure
[14:00:25] spion: rvanlieshout: so that means you cannot have a structure with foreign keys that have default values.
[14:01:14] ramortegui: has joined #RubyOnRails
[14:01:33] rvanlieshout: spion: values aren't part of structure
[14:01:39] DmitryBochkarev: has joined #RubyOnRails
[14:02:03] spion: rvanlieshout: default column values are
[14:02:13] rvanlieshout: default values are part of it indeed
[14:02:19] aegis3121: has joined #RubyOnRails
[14:04:10] AgentSpyname: has joined #RubyOnRails
[14:04:53] rapha: rvanlieshout: so the problem was in the data itself. Thank you so much for the trick with the `raise
[14:04:54] snowy: has joined #RubyOnRails
[14:05:00] rapha: though, that really helped!
[14:06:15] ericpet: has joined #RubyOnRails
[14:06:45] spion: rvanlieshout: therefore default values that reference foreign keys create a problem and shouldn't be used. (alternatively, rails should support seed data in structure.sql :)
[14:07:03] spion: thanks anyway, I'll just not have a default value there.
[14:08:05] rvanlieshout: i don't agree on seed data in structure.sql
[14:08:20] _bogus_: is it too bad to call a search from a view, like this <%= FormConteudo.find_by_string_id('desc_empresa') %> ?
[14:09:01] _bogus_: sorry, missed the field, <%= FormConteudo.find_by_string_id('desc_empresa').ajuda %>
[14:09:40] flashpoint9: has joined #RubyOnRails
[14:10:04] _bogus_: its working but im not sure if this is a good practice.. but I have this page and I'll need to get various rows from this FormConteudo model searching by it's string_id
[14:10:15] croberts: has joined #RubyOnRails
[14:11:30] spion: rvanlieshout: so then the proper way to add a migration for a not null foreign key field would be to add a field without the constraint, populate the existing data with a default value, then add the not null constraint
[14:14:37] _bogus_: maybe a helper ?
[14:16:14] rvanlieshout: make sure your migration fixes all invalid records first
[14:16:20] diegoviola: has joined #RubyOnRails
[14:17:32] CodaBrink: _bogus_ Typically you want to declare variables in the controller.
[14:17:58] ilhami: has joined #RubyOnRails
[14:18:06] CodaBrink: So, it's possible, but bad practice IMO
[14:19:24] _bogus_: codabrink, typically... but I need to check on many records of that model... actually I want the admin to edit many portions of some views, so I created a model where he can edit those portions, and each portion is a record identified by string_id, so inside the view I'll have many of those portions specified by this string_id
[14:21:30] sp1rs: has joined #RubyOnRails
[14:21:34] CodaBrink: Doing finds in the view isn't the end of the world
[14:21:58] sandstrom: has joined #RubyOnRails
[14:22:10] _bogus_: im thinking of a helper maybe, to be more tidy
[14:23:20] matthias_: has joined #RubyOnRails
[14:23:37] roshanavand: has joined #RubyOnRails
[14:24:25] ilhami: has left #RubyOnRails: ("Leaving")
[14:24:29] theblang: has joined #RubyOnRails
[14:24:52] jmignault: has joined #RubyOnRails
[14:25:52] aaronang: has joined #RubyOnRails
[14:27:54] rapha: rvanlieshout: is there a _filter in the model that fires after associations have been saved but before the self has been saved?
[14:29:14] akshat: has joined #RubyOnRails
[14:29:59] holyGlitch: has joined #RubyOnRails
[14:30:05] alexhartley: has joined #RubyOnRails
[14:31:23] rapha: rvanlieshout: sorry, they're not called filters, but callbacks.
[14:34:27] finnnnnnnnnnn: has joined #RubyOnRails
[14:38:07] tetraktys: has joined #RubyOnRails
[14:39:29] tetraktys: has joined #RubyOnRails
[14:40:40] stardiviner: has joined #RubyOnRails
[14:40:42] tetraktys: hi guys, how do i validate a habtm relation where A habtm B and only unique combinations of B to A are allowed?
[14:41:30] sankaber: has joined #RubyOnRails
[14:41:55] B1n4r10: has joined #RubyOnRails
[14:43:06] statelesscode: has joined #RubyOnRails
[14:43:25] apeiros: tetraktys: why'd you use habtm for that?
[14:43:44] tetraktys: why shouldn't i?
[14:43:56] apeiros: ah, a A may still belong to many B, just not twice to the same
[14:44:01] drbayer: has joined #RubyOnRails
[14:44:41] Scient: you do a has many through
[14:44:42] apeiros: unique constraint over two columns
[14:44:49] Scient: and validate the uniqueness in the join table model
[14:44:54] apeiros: on the habtm table
[14:44:59] Scient: or you do it on the habtm table, but it will not be enforced in rails then
[14:45:02] Scient: only on the db level
[14:45:47] arup_r: I still didn't get the question. :/
[14:46:52] tetraktys: https://gist.github.com/joostvanrijn/08e232e4abb953f82554
[14:47:02] shanemcd: has joined #RubyOnRails
[14:47:11] tetraktys: hopefully that clarifies it a bit
[14:47:59] arup_r: But, it is already in place **but each combination can only be used once**
[14:48:17] Scient: gave you an answer already
[14:48:21] arup_r: the join table has uniq entries of <a,b> always
[14:48:33] Scient: I would turn it into a HM:T with a uniqueness validation + a database constraint on the join table
[14:49:48] arup_r: tetraktys: Why do you think there will be duplicate entries..? If you use AR, there will never be duplicate entries in the join table.
[14:49:50] stannard: has joined #RubyOnRails
[14:49:51] delgiudices: has joined #RubyOnRails
[14:50:16] ericpet: has joined #RubyOnRails
[14:50:46] tetraktys: for instance: i create a case_item_set "foo", i can connect case_items "bar" and "baz"
[14:50:56] arup_r: Scient: what is wrong in HABTM, that you are telling to use HMT.. ? :)
[14:51:21] Scient: because having a join model allows you to add the uniqueness validation on the join table on the AR level
[14:51:46] tetraktys: now when i create a case_item "meh", i want validation to throw an error when i again want to connect "bar" and "baz"
[14:52:12] tetraktys: just "bar" is fine, so is just "baz", but the (already existing) combination should throw a validation error
[14:52:22] arup_r: why you need it? A connects with B using, <a_id, b_id> .. and there will be never a second value like same
[14:52:23] sankaber: has joined #RubyOnRails
[14:55:20] tetraktys: a <-> 1 and a <-> 2 should be possible
[14:55:40] tetraktys: b <-> 1 and b <-> 2 should error
[14:55:52] tetraktys: because 1 and 2 are already a combination for a
[14:56:28] tetraktys: i'm not trying to prevent a <-> 1 and a <-> 1, that's not the issue
[14:57:02] rvanlieshout: tetraktys: !fake
[14:57:02] helpa: tetraktys: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[14:57:10] rvanlieshout: what are you trying to do?
[14:57:14] arup_r: the join table will have a value of A and a value of B. Then what do yu mean? b <-> 1 and b <-> 2 should error
[14:57:22] apeiros: ACTION actually misunderstood the question then
[14:57:27] HalcyonicStorm: has joined #RubyOnRails
[14:58:40] apeiros: but that'd get me back to: why habtm? because now it does not seem possible that the "right" side can be connected to more than one thing on the "left" side, and then it'd just be a has_many+belongs_to
[15:00:15] arup_r: HABTM doesn't meet with the usecase OP is explaining
[15:01:10] jenrzzz: has joined #RubyOnRails
[15:01:20] tetraktys: updated the gist: https://gist.github.com/joostvanrijn/08e232e4abb953f82554
[15:01:43] tetraktys: i hope that shows it goes both ways
[15:01:55] n1lo: has joined #RubyOnRails
[15:03:52] _bogus_: https://gist.github.com/anonymous/ede779e61bd77a75822a please, i have set some default values for options (:tag => :p and :class => ''), but when I call this helper passing tag or class param alone, the other param became unavailable.. for ex, fc_legenda('something', {tag: :h1}) , the options inside the helper becomes {tag: h1}, with no :class ... what can I do here?
[15:04:00] rvanlieshout: tercenya_: switch to a has_many through and use a validation there
[15:04:17] arup_r: wrong nick, I guess,, :p
[15:04:24] tetraktys: i got it :)
[15:04:29] Spami: anyone has used the gem searchkick before? I'm trying to implement partial matching in the where condition
[15:04:41] rvanlieshout: tetraktys: Nederlands?
[15:04:43] tetraktys: i'll try it rvanlieshout
[15:07:06] rvanlieshout: new to this rails thing?
[15:07:20] FooMunki: has joined #RubyOnRails
[15:07:33] tetraktys: nope, just confused about this validation
[15:08:02] tetraktys: i was hoping there would be a magical validator for this use case, i'm not really looking to add yet another model
[15:08:19] axl_: has joined #RubyOnRails
[15:08:37] rvanlieshout: it's the fastest way to validate it, you could validate it using a custom validator that just queries that table
[15:08:53] tetraktys: that's actually the path i'm following now
[15:09:48] mag42c: has joined #RubyOnRails
[15:10:34] adavia: has joined #RubyOnRails
[15:11:25] mary5030: has joined #RubyOnRails
[15:12:07] nerium: has joined #RubyOnRails
[15:12:49] openstruct: has joined #RubyOnRails
[15:14:31] delgiudices: has joined #RubyOnRails
[15:15:05] baweaver: has joined #RubyOnRails
[15:16:08] Denarii: has joined #RubyOnRails
[15:18:19] _bogus_: https://gist.github.com/anonymous/ede779e61bd77a75822a please, i have set some default values for options (:tag => :p and :class => ''), but when I call this helper passing tag or class param alone, the other param became unavailable.. for ex, fc_legenda('something', {tag: :h1}) , the options inside the helper becomes {tag: h1}, with no :class ... what can I do here?
[15:19:18] roshanavand: has joined #RubyOnRails
[15:19:42] rafaelfranca: has joined #RubyOnRails
[15:19:43] jayp: has joined #RubyOnRails
[15:19:56] yekta: has joined #RubyOnRails
[15:20:26] adac: has joined #RubyOnRails
[15:21:47] yekta: Hello, I have a model that won't represent the value in the database and I'm absolutely confused, hoping someone can help. I have a Book model with Book.find(1).is_sellable which is `1` in the db, yet `Book.find(1).is_sellable` returns false. There's no custom attr_reader/writer. Moreover, if I print Book.find(1) it shows true in the output for is_sellable.
[15:22:07] shanemcd: has joined #RubyOnRails
[15:22:29] sandstrom: has joined #RubyOnRails
[15:22:44] sandstrom: has joined #RubyOnRails
[15:22:44] shinnya: has joined #RubyOnRails
[15:23:01] ruby-lang119: has joined #RubyOnRails
[15:23:10] mwlang: has joined #RubyOnRails
[15:24:03] ql6wlld: has joined #RubyOnRails
[15:24:06] yekta: https://dpaste.de/5WUg
[15:24:29] banister: has joined #RubyOnRails
[15:24:36] yekta: There’s no validation errors either. What on earth could be happening. I’m so confused.
[15:25:56] mwlang: A client just performed an enterprise vulnerability scan/review and I’ve been requested to make the website cookies HTTP Only. I thought Rails 4.1 cookies are httponly by default. Is this not the case?
[15:26:17] pawnbox: has joined #RubyOnRails
[15:29:02] someish: has joined #RubyOnRails
[15:29:36] aaronang: has joined #RubyOnRails
[15:30:12] shanemcd: has joined #RubyOnRails
[15:30:56] pawnbox: has joined #RubyOnRails
[15:31:32] NurseChirssy: has joined #RubyOnRails
[15:31:45] n008f4g_: has joined #RubyOnRails
[15:33:19] timmyBsd: has joined #RubyOnRails
[15:33:28] arup_r: has joined #RubyOnRails
[15:34:56] tetraktys: yekta, could you paste the relevant part of your schema?
[15:35:01] ayoros: has joined #RubyOnRails
[15:35:06] tetraktys: oh, he gave up already
[15:35:24] johnflux: has joined #RubyOnRails
[15:36:15] bronson: has joined #RubyOnRails
[15:38:56] fourq_: has left #RubyOnRails: ()
[15:43:19] zave: has joined #RubyOnRails
[15:44:42] neohunter: has joined #RubyOnRails
[15:45:24] treehug88: has joined #RubyOnRails
[15:45:29] kies: has joined #RubyOnRails
[15:46:19] flashpoint9: has joined #RubyOnRails
[15:48:21] ziyadb: has joined #RubyOnRails
[15:48:25] mary5030: has joined #RubyOnRails
[15:50:54] rrawlins: VCR users. I have some API requests which hit a different dynamic endpoint each time the test is run. i.e. http://api.wxample.com/12345.json - Anyone have experience of request matching using some form of REGEX so it uses the same recording each time?
[15:50:55] mary5030: has joined #RubyOnRails
[15:52:16] mary5030: has joined #RubyOnRails
[15:52:20] chouhoulis: has joined #RubyOnRails
[15:54:16] Devalo: has joined #RubyOnRails
[15:54:17] ivanskie_work: has joined #RubyOnRails
[15:55:25] shanemcd: has joined #RubyOnRails
[15:55:40] Rubie: has joined #RubyOnRails
[15:55:49] mwlang: rrawlins: sounds like possible overkill for test scenarios. I think I would take a “TimeCop” like approach instead and freeze the randomnized endpoint value…that is, each time the test suite runs, its going to hit the same endpoint that was recorded.
[15:56:09] alex88: has joined #RubyOnRails
[15:56:46] rrawlins: mwlang: interesting. That's not an approach I've thought about. I'll take a look and see how that might pan out
[15:58:49] mwlang: meh, finally found confirmation on the httponly question above: :httponly - Whether this cookie is accessible via scripting or only HTTP. Defaults to false.
[15:59:00] mwlang: from 4.2.6 api docs: http://api.rubyonrails.org/classes/ActionDispatch/Cookies.html
[15:59:33] Martyn: has joined #RubyOnRails
[16:02:13] jenrzzz: has joined #RubyOnRails
[16:03:37] chouhoulis: has joined #RubyOnRails
[16:04:05] GeorgesLeYeti: has joined #RubyOnRails
[16:04:47] arup_r: mwlang: hi.. how are you?
[16:05:08] mwlang: arup_r: a-ok. you?
[16:06:28] _bogus_: https://gist.github.com/anonymous/ede779e61bd77a75822a please, i have set some default values for options (:tag => :p and :class => ''), but when I call this helper passing tag or class param alone, the other param became unavailable.. for ex, fc_legenda('something', {tag: :h1}) , the options inside the helper becomes {tag: h1}, with no :class ... what can I do here?
[16:08:42] EdwardIII: as i've been unable to avoid doing html+css on this project, i started using bootstrap properly for layout
[16:08:50] EdwardIII: and i kind of feel like bootstrap = tables for layouts
[16:08:58] EdwardIII: it feels very similar heh
[16:09:59] zersiax: has joined #RubyOnRails
[16:10:03] chouhoulis: has joined #RubyOnRails
[16:10:12] universa1: _bogus_: you are overwriting the default value for options
[16:10:21] universa1: _bogus_: so it only becomes whatever you pass in.
[16:10:40] zersiax: quick question :) Is there a way to use bootstrap 2.3 with rails 4 without too much fuss?
[16:10:47] _bogus_: universa1, thats the intention but i would like to overwrite only the params Im passing
[16:10:49] universa1: _bogus_: options = {}; actual_options = {tag: :p, class: nil}.merge(options)
[16:10:58] universa1: _bogus_: you are only passing ONE param.
[16:11:08] universa1: _bogus_: one hash.
[16:11:40] arup_r: GeorgesLeYeti: Hello.. :)
[16:12:03] universa1: zersiax: define too much fuss? there should be some sass variant in some gem
[16:12:15] universa1: zersiax: bootstrap-sass or alike
[16:12:26] _bogus_: yes.. i understand you.. but what I would like is something like this: def method(options = {a: defaultA, b: defaultB}) and then when i call method(a: OtherA) to have the options hash = {a: otherA, b: defaultB}
[16:12:54] universa1: _bogus_: def foo(options = {}); actual_options = {tag: :p, class: nil}.merge(options)
[16:14:30] mwlang: So how can I actually tell (so I can write an rspec) that cookies are now httponly sitewide?
[16:14:34] roshanavand: has joined #RubyOnRails
[16:14:41] zersiax: i have a rails 3.2 app we plan to migrate to 4.2. However, a lot of the front-end code is using botstrap 2-classes. bootstrap-sass 2.3 that is. Therefore, we don't want to update that part in the initial migration. Is there a way to keep using the existing code?
[16:15:25] The_Phoenix: has joined #RubyOnRails
[16:15:28] universa1: zersiax: what would prevent you from keeping that code?
[16:16:43] aegis3121: has joined #RubyOnRails
[16:16:54] zersiax: i'm wondering if that particular version of bootstrap-sass still works with rails 4, or if it depends on things that were deprecated in rails 4. In that case, an upgrade to boostrap 3 would be performed which would break a lot of stuff
[16:17:23] universa1: zersiax: look at the gem, check it's dependencies?
[16:17:40] universa1: zersiax: if all else fails, extract the sass files from the gem and put them into vendor/...
[16:17:41] _bogus_: universa1, thanks !!
[16:17:55] zersiax: i checked the github pages but they all seem a little vague about it ...
[16:18:32] universa1: zersiax: the .gemspec file contains the information, or the rubygems.org page for the gem
[16:19:14] tjohnson: has joined #RubyOnRails
[16:19:36] uglybandersnatch: has joined #RubyOnRails
[16:22:38] gbgdev: has joined #RubyOnRails
[16:22:52] zersiax: i think it depends on railtys3.1 whereas rails 4 would use v4 of that gem. would that break, you reckon?
[16:25:12] Sephyros: has joined #RubyOnRails
[16:25:53] Sephyros: How i can negate a join?
[16:26:03] Sephyros: Person.joins(:credential).not.joins(:ocupation).count
[16:26:27] nfk: has joined #RubyOnRails
[16:27:18] arup_r: Sephyros: what is the plan?
[16:27:31] arup_r: we can then say some other tricks.
[16:28:16] shanemcd: has joined #RubyOnRails
[16:28:25] Sephyros: I have Person and Users and Tenants, Users are Person.joins(:credential) and Tenant are Person.joins(:ocupation)
[16:28:30] universa1: zersiax: 2.3.2.2 depends on sass ~> 3.2, this should allow any sass version < 4
[16:28:38] universa1: zersiax: so you should be fine.
[16:29:07] Sephyros: Every Tenant is an user, but not every User is a Tenant
[16:29:21] claytonzaugg: has joined #RubyOnRails
[16:30:10] Sephyros: and Everyone come from person
[16:30:17] Sephyros: i will gist the models
[16:30:50] arup_r: Sephyros: thanks. With that, also tell in plain english what to query for, not how to? :)
[16:31:05] arup_r: how to we will think.. :)
[16:32:24] RegulationD: has joined #RubyOnRails
[16:34:10] axl__: has joined #RubyOnRails
[16:35:09] sung: has joined #RubyOnRails
[16:37:56] Uranio: has joined #RubyOnRails
[16:38:21] sp1rs: has joined #RubyOnRails
[16:38:54] roshanavand: has joined #RubyOnRails
[16:39:30] GreatDanton: has joined #RubyOnRails
[16:39:44] marcdel: has joined #RubyOnRails
[16:40:27] slash_nick: With exceptions apps, does anyone know if they are required to manage closing database connections themselves?
[16:45:22] shanemcd: has joined #RubyOnRails
[16:47:14] roshanavand: has joined #RubyOnRails
[16:50:49] marcdel: has joined #RubyOnRails
[16:51:41] Rubie: has joined #RubyOnRails
[16:52:12] [Butch]: has joined #RubyOnRails
[16:53:36] matthias_: has joined #RubyOnRails
[16:54:43] slash_nick: (looks like they do)
[16:57:19] Quintasan: Does anyone use devise_token_auth with OmniAuth providers?
[16:57:32] Quintasan: I have several questions which I can't really find online
[16:57:39] DoctorMonocular: has joined #RubyOnRails
[16:58:02] rrawlins: has joined #RubyOnRails
[17:01:42] rakm: has joined #RubyOnRails
[17:03:45] jenrzzz: has joined #RubyOnRails
[17:07:22] DmitryBochkarev: has joined #RubyOnRails
[17:09:56] roshanavand: has joined #RubyOnRails
[17:10:09] DmitryBochkarev: has joined #RubyOnRails
[17:10:32] sandstrom: has joined #RubyOnRails
[17:11:41] aiRness: has joined #RubyOnRails
[17:11:44] aiRness: Hello. Is it possible to create an admin panel from the command line and how I can access it from the browser afterwards. Demise is installed and I've used the console but I can't use my admin user.
[17:12:55] baweaver: has joined #RubyOnRails
[17:13:01] pawnbox: has joined #RubyOnRails
[17:15:34] zersiax: has joined #RubyOnRails
[17:19:52] RegulationD: has joined #RubyOnRails
[17:20:12] enkristoffer: I'm getting a ActiveRecord::Fixture::FixtureError: table "reviews" has no column named "user". - The table has a user_id column and the fixture is referencing a User fixture the same way I usually do: https://gist.github.com/sachse/b32fb749d6a7233866ea - any ideas what the problem could be?
[17:20:18] arup_r: has joined #RubyOnRails
[17:20:18] enkristoffer: 5.0.0.beta3 by the way.
[17:20:35] htmldrum: has joined #RubyOnRails
[17:21:41] ppnlo: has joined #RubyOnRails
[17:22:24] leofrozenyogurt: has joined #RubyOnRails
[17:22:47] delgiudices: has joined #RubyOnRails
[17:23:00] B1n4r10: has joined #RubyOnRails
[17:23:18] manfrin: has joined #RubyOnRails
[17:23:37] Pulp: has joined #RubyOnRails
[17:26:31] drptbl: has joined #RubyOnRails
[17:28:54] shanemcd: has joined #RubyOnRails
[17:31:42] mary5030_: has joined #RubyOnRails
[17:31:46] baweaver: has joined #RubyOnRails
[17:35:37] Thav1: has joined #RubyOnRails
[17:35:38] flashpoint9: has joined #RubyOnRails
[17:36:31] nfk: what's the least invasive way to use Bootstrap with Rails, preferably also with Angular.js?
[17:36:43] nfk: i have found a tutorial but it's rather invasive
[17:37:07] rakm: has joined #RubyOnRails
[17:37:13] Thav1: has left #RubyOnRails: ()
[17:37:26] nfk: it's like ripping open the chest of Rails to do some surgery and I really don't think that having some CSS and JS should be taht evil
[17:37:31] Thav: has joined #RubyOnRails
[17:39:09] tubbo: nfk: what was so invasive about it? there's a gem that includes all the assets you need, then you just //= require and @import them.
[17:39:29] dopie: has joined #RubyOnRails
[17:39:51] nfk: tubbo, then perhaps that's a different tutorial, this one involves, ripping out turbolinks, changing stuff in the assets paths, etc
[17:40:17] Thav: I'm having a bizaare issue. I'm trying to render some html between <option> tags, but that html doesn't make it to the browser. In my erb file, I have something like this: <option value="<%= r.id %>"><%= r.name %><span style="float: right"><i class="fa fa-plus-square></i></span></option> However the span is excluded when I look at the source in the browser. what could cause this?
[17:40:19] leofrozenyogurt: has joined #RubyOnRails
[17:40:19] tubbo: nfk: oh yeah, well ripping out turbolinks is definitely something you probably want to do if you're using angular.
[17:40:20] arup_r: or through railsassets.org
[17:40:31] tubbo: nfk: but "ripping it out" just means removing the require statement and the line from Gemfile.
[17:40:56] nfk: tubbo, well, i'm tempted to do it for the sake of angular but really, having to also go around changing asset path, etc is fucking too much for angular
[17:41:11] adaedra: Thav: I don't think you're allowed to have things other than text in <option>s
[17:41:22] tubbo: nfk: what do you mean by "changing asset path"?
[17:41:26] leofrozenyogurt: I'm having an issue where loader.io is telling me my app dies at about 4k concurrent users on 10 Performance L dynos
[17:41:28] nfk: http://angular-rails.com/bootstrap.html
[17:41:30] nfk: tubbo, ^
[17:41:41] michaeldeol: has joined #RubyOnRails
[17:41:42] leofrozenyogurt: I'm also running a Puma server with web concurrency at 16
[17:41:43] adaedra: Thav: https://developer.mozilla.org/en/docs/Web/HTML/Element/Option – See: Allows only text.
[17:42:04] nfk: naturally i'd not be surprised that the author was either misinformed, pressing his agenda or that it's simply out of date though version numbers don't seem to be that much out of date
[17:42:04] leofrozenyogurt: I dont get why the app can't handle more it seems that under those specs it should handle at least 8k
[17:42:40] tubbo: nfk: oh yeah, that just means using bower instead of sprockets and rails-assets. i was thinking you could use a combo of https://github.com/hiravgandhi/angularjs-rails and https://github.com/twbs/bootstrap-sass.
[17:42:54] tubbo: they're just gems so you don't need to fuck with asset precompilation
[17:43:09] leofrozenyogurt: As well how could i cache a db call
[17:43:25] leofrozenyogurt: like so @brackets = Bracket.all.includes(:divisons)
[17:43:35] tubbo: nfk: the author most likely wrote that prior to the introduction of rails-assets.org, which generally has replaced most of the "asset bundlers" for Rails. it's much easier to manage all app-level dependencies in Gemfile than to manage multiple package management systems.
[17:43:44] tubbo: nfk: i hope one day we get an npm.rails-assets.org :)
[17:43:49] arup_r: adaedra: is correct http://stackoverflow.com/a/11890623/2767755 Thav
[17:44:23] holyGlitch: has left #RubyOnRails: ("Leaving")
[17:44:38] tubbo: leofrozenyogurt: typically query caching is handled for you in production. but the rails caching guide has more info on controlling the cache on a per-method level
[17:44:42] tubbo: leofrozenyogurt: !caching
[17:44:42] helpa: leofrozenyogurt: Caching with Rails Guide - http://guides.rubyonrails.org/caching_with_rails.html - by Aditya Chadha
[17:45:39] leofrozenyogurt: tubbo: yup iv read on that but it doesnt seem that memached is working in production or i am not setting the cache correctly on the contrroller action
[17:46:22] Coldblackice: has joined #RubyOnRails
[17:47:04] sneakerhax: has joined #RubyOnRails
[17:47:13] IFrank00: has joined #RubyOnRails
[17:48:04] marcdel: has joined #RubyOnRails
[17:50:29] ivanskie_work__: has joined #RubyOnRails
[17:50:30] jgpawletko: has joined #RubyOnRails
[17:50:47] nfk: tubbo, so i just remove turbolinks, add those two gems and that's it or there some more faffing about? i know some rails basics (well, rails 2/3 basics and enough to get started wth rails 4) and individually basics of bootstrap and angular but nothing on how they should be used together
[17:51:34] nfk: oh wait, i actually know a bit about using angular and bootstrap together but not how they tie in with rails
[17:51:47] DonOtreply: has joined #RubyOnRails
[17:51:56] adlerdias: has joined #RubyOnRails
[17:52:22] ivanskie_work: has joined #RubyOnRails
[17:53:47] finnnnnnnnnnn: has joined #RubyOnRails
[17:54:11] blackmesa: has joined #RubyOnRails
[17:54:18] finnnnnnnnnnn: ignoring the fact that CMSs are a bad idea. What’s the best CMS gem available for Rails right now?
[17:55:59] finnnnnnnnnnn: I'm scoping a small site build where the client will want to manage a small blog, FAQ questions/answers and some other bits of copy. I think something more than administrate/active admin/rails admin.
[17:56:00] bronson: has joined #RubyOnRails
[17:56:25] Sephyros: How i can get intermediate tables?
[17:58:18] ayoros: has joined #RubyOnRails
[17:59:27] disgrntld: has joined #RubyOnRails
[17:59:45] _bogus_: has joined #RubyOnRails
[18:01:52] maximski: has joined #RubyOnRails
[18:02:00] duaneb: has joined #RubyOnRails
[18:02:30] maximski: i have basically integrated this one in one of my models https://github.com/sferik/rails_admin/wiki/Has-many-:through-association#alternative
[18:03:16] drbayer: has joined #RubyOnRails
[18:03:36] maximski: the problem is that if i safe a new instance of the base model that has many other models, the other models will end up without a relation, because the main model id isn't set yet the moment this setter runs
[18:04:00] maximski: any thoughts on how to fix that?
[18:07:25] nfk: btw, is there any difference whether i start a clean project with --skip-turbolinks or remove it later?
[18:07:39] barajasfab: has joined #RubyOnRails
[18:07:57] marcdel: has joined #RubyOnRails
[18:09:01] EXCHGR: has joined #RubyOnRails
[18:09:20] ivanskie_work_: has joined #RubyOnRails
[18:10:01] nfk: what's the right place for bundle packages?
[18:10:33] nfk: right now they go where my local gems go but as i cleaned out turbolinks from my system i realised that it's probably bad idea to place them there
[18:10:46] nfk: since it just broke my demo version
[18:13:49] sleungcy: has joined #RubyOnRails
[18:14:23] workmad3: nfk: on your dev machine, or on a staging/demo/production server?
[18:14:39] nfk: dev machine
[18:14:42] nfk: two of them even
[18:15:11] nfk: for deployment i pray it will be IT dept's not my problem
[18:15:13] workmad3: nfk: for dev machines, I just install to my local gem repo and don't worry about uninstalling gems, just removing them from the Gemfile does it
[18:15:19] nfk: also known as someone else's problem
[18:17:28] flashpoint9: has joined #RubyOnRails
[18:18:11] anjen: has joined #RubyOnRails
[18:21:26] gbgdev: has joined #RubyOnRails
[18:23:14] nfk: isn't rails new supposed to run git init?
[18:24:00] nfk: or is lack of .git/ due to the project being in a parent directory that's already tracked by git?
[18:24:03] axl_: has joined #RubyOnRails
[18:26:28] nocontrol: has joined #RubyOnRails
[18:26:41] ziyadb: nfk: I guess you'll have to test and find out.
[18:27:04] ziyadb: entertain us with a rant on 'someone else's problems' during deployment.
[18:27:34] B1n4r10: has joined #RubyOnRails
[18:29:14] imerx: has joined #RubyOnRails
[18:29:22] krzkrzkrz: has joined #RubyOnRails
[18:33:59] adre: has joined #RubyOnRails
[18:34:28] bool_: has joined #RubyOnRails
[18:36:44] jenrzzz: has joined #RubyOnRails
[18:36:53] baweaver: has joined #RubyOnRails
[18:37:39] tubbo: nfk: what do you mean "what's the right place for bundle packages"?
[18:37:47] tubbo: oh never mind
[18:38:12] Thav: has left #RubyOnRails: ()
[18:38:38] tubbo: nfk: i keep my gems in ./vendor/bundle of my app directory at all times. makes it easy to blow away the whole dir as well as generate ctags for your app + gems
[18:39:21] nfk: another silly question but do i correctly suspect that if i'm using angular.js then i should not include bootstrap.js?
[18:40:29] nfk: tubbo, and add that directory to gitignore?
[18:40:50] djbkd: has joined #RubyOnRails
[18:41:28] aegis3121: has joined #RubyOnRails
[18:42:35] akshat: has joined #RubyOnRails
[18:44:28] tubbo: nfk: yeah you definitely don't want to track your gem bundle in git
[18:45:14] nfk: okay, this will be the stupidest question in the history of this channel
[18:45:54] Atrox: has joined #RubyOnRails
[18:46:08] nfk: i can make various egg dishes from japanese egg rolls to army field eggs sunny side up with tomatos and pasta dishes and i'm fairly proud of my tiramisus but um... how do i boil potatos?
[18:46:31] bool_: has joined #RubyOnRails
[18:46:52] k1t: has joined #RubyOnRails
[18:46:53] nfk: for now i put the water to boil but i'm utterly at loss for how long do i boil them, etc
[18:47:19] nocontrol: has joined #RubyOnRails
[18:47:49] nocontrol: guys is there any documentation about Rails' native testing engine ?
[18:47:53] mdw: has joined #RubyOnRails
[18:48:04] nocontrol: except this one page in Rails docs I haven't found anything else
[18:48:10] nocontrol: no books, no tutorials
[18:48:18] nfk: i'll link you with a course in a moment
[18:48:34] nfk: https://www.codeschool.com/courses/rails-testing-for-zombies
[18:48:39] choke: has joined #RubyOnRails
[18:48:41] chouhoulis: has joined #RubyOnRails
[18:48:42] nocontrol: I decided to leave RSpec and focus on Rails framework but I am starting to regret it
[18:48:58] nfk: if you're a new user, it might even be free for the first 30 days
[18:49:06] nocontrol: I know codeschool's lessons
[18:49:12] nocontrol: are they on minitest?
[18:49:22] nfk: It's Ruby::Test, iirc
[18:49:29] nocontrol: ok sounds good
[18:49:39] nfk: there's also Rspec but Rails uses Test Unit
[18:49:44] chouhoulis: has joined #RubyOnRails
[18:50:06] nfk: *also is a course for RSpec
[18:50:10] mostlybadfly: has joined #RubyOnRails
[18:50:10] Scient: id just keep on using rspec
[18:50:12] nocontrol: yeah I find Rspec easier tbh but I want to trust DHH and focus on Minitest
[18:50:38] nfk: anyway, if you ask about the native testing engine, that's the one
[18:50:56] Scient: "trust DHH"
[18:50:59] Scient: this isnt a cult
[18:51:07] chouhoul_: has joined #RubyOnRails
[18:51:10] Scient: use what you feel most comfortable with and that you like
[18:51:27] adaedra: "this isnt a cult"
[18:51:31] Scient: DHH isnt some sort of a programming god that you need to follow his path blindly
[18:51:38] adaedra: freedom of religion!
[18:51:49] Atrox: Hi guys, is it possible to authenticate only specific channels in actioncable? Like getting the channel name in the connect method to identify the channel and return? I did not find anything about that...
[18:52:11] blackmesa: has joined #RubyOnRails
[18:52:29] dopie: Anyone here use rails vim?
[18:52:40] delgiudices: has joined #RubyOnRails
[18:52:56] solars: has joined #RubyOnRails
[18:53:03] adac: has joined #RubyOnRails
[18:53:15] delgiudices: Let's say i use bootstrap and bootstrap 3 validator to handle my forms
[18:53:20] slash_nick: Atrox: i haven't used it yet... but i think you might be able to do something with a custom constraint in your routes
[18:53:31] delgiudices: What should i do so forms are easily rendered
[18:53:44] delgiudices: Without having to write bunch of code each time i'm writing the form
[18:54:05] Atrox: @slash_nick interesting idea... I will look into it. Thanks.
[18:54:28] slash_nick: Atrox: this really describes the approach i'm talking about: https://gist.github.com/rthbound/1b4a7073569f4b50e7bb
[18:55:34] moeabdol: has joined #RubyOnRails
[18:55:46] slash_nick: Atrox: hope it helps... could you let me know if that approach is at all applicable in action cable use cases?
[18:55:52] nocontrol: Scient: tbh If you don't trust he who created this, then who else ?
[18:55:54] slash_nick: if you try it :)
[18:56:12] slash_nick: nocontrol: "he who created this"
[18:56:34] slash_nick: nocontrol: "this" is created daily...over 3000 contributors now
[18:56:56] slash_nick: nocontrol: that said, i also prefer minitest :)
[18:58:08] fox_mulder_cp: wow, wow. somebody use actioncable from r5b3?
[18:58:32] nocontrol: fox_mulder_cp: me
[18:58:45] nocontrol: slash_nick: I am open to trust anyone with a good idea
[18:58:59] nocontrol: slash_nick: 50% say RSpec sucks, 50% say MiniTest sucks
[18:59:10] nocontrol: so I am sitting in the middle watching both
[18:59:15] chipotle: has joined #RubyOnRails
[18:59:26] nocontrol: I am thinking actually to use both of them and write tests twice
[18:59:44] arup_r1: has joined #RubyOnRails
[19:00:12] blackmesa: has joined #RubyOnRails
[19:00:19] fox_mulder_cp: nocontrol: i see a chat exmaple from main page video, but can''t thinking how to stay it workd
[19:00:37] nocontrol: i started with the same thing
[19:00:37] tubbo: nocontrol: you should trust yourself and use whatever makes you happier
[19:01:01] nocontrol: tubbo: I not that experienced and I see you can't change tools everyday
[19:01:21] fox_mulder_cp: and my rails teacher have a question - how make a horizontal zooming for nodes with action cab;e
[19:01:34] nocontrol: I did the wrong choice to start with Angular 1.x too and now that there are Angular 2 and React out I regret my choice
[19:01:36] nzst: has joined #RubyOnRails
[19:01:52] nzst: has left #RubyOnRails: ()
[19:01:56] yellow5: has joined #RubyOnRails
[19:02:23] Rinalds: has joined #RubyOnRails
[19:02:43] malcolmva: has joined #RubyOnRails
[19:03:23] FooMunki: has joined #RubyOnRails
[19:03:30] Atrox: @nocontrol Don't forget Vue.js ;)
[19:04:10] tubbo: nocontrol: that's true, but you could try each one and figure out which one you like using more
[19:04:29] RegulationD: has joined #RubyOnRails
[19:06:16] moeabdol1: has joined #RubyOnRails
[19:10:00] nocontrol: tubbo: the projects are going forward so I am like on a train
[19:10:21] arup_r1: my nick is broken, how??? :/
[19:10:22] nocontrol: tubbo: I got to trust someone and pick a choice because I don't have quite an experience in testing
[19:10:23] bronson: has joined #RubyOnRails
[19:10:34] tubbo: arup___: you have a tail
[19:10:44] flip_digits: has joined #RubyOnRails
[19:10:46] flip_digits: Is there a vim plugin that will allow me to jump between do end blocks in ruby code?
[19:10:56] baweaver: has joined #RubyOnRails
[19:12:35] tubbo: flip_digits: i feel like there's just an internal command to do that. #vim would have the answer.
[19:13:04] flip_digits: I asked in that chan thanks
[19:13:43] edwinvdgraaf: has joined #RubyOnRails
[19:13:59] lemur: has joined #RubyOnRails
[19:14:59] Cohedrin: has joined #RubyOnRails
[19:16:13] Cohedrin: has joined #RubyOnRails
[19:16:27] edwinvdgraaf: has joined #RubyOnRails
[19:18:36] aiRness: has left #RubyOnRails: ()
[19:19:03] djbkd: has joined #RubyOnRails
[19:21:09] Infinite_182: has joined #RubyOnRails
[19:21:21] djbkd: has joined #RubyOnRails
[19:21:22] malcolmva: has joined #RubyOnRails
[19:22:35] jxs_: has joined #RubyOnRails
[19:23:03] Rubie: has joined #RubyOnRails
[19:23:24] machuga: flip_digits did you get your answer? I remember it's a plugin to sync up with %'s standard block jumping
[19:24:13] choke: so, simple form gem issues... adding :class => 'mycustomclass' is never rendered to the page, whatever i put it's just thrown away.. any ideas on why?
[19:24:51] jorrin: has joined #RubyOnRails
[19:25:22] arup_r: choke: show the code
[19:25:34] arup_r: probably you are passing them wrong
[19:25:54] evenix: has joined #RubyOnRails
[19:26:46] Infinite_187: has joined #RubyOnRails
[19:27:22] choke: https://gist.github.com/ch0ke/7f0940f91ed44c26d8df is the input.. i've tried every conceivable way to pass it
[19:28:06] snowy: has joined #RubyOnRails
[19:28:47] michael_mbp: has joined #RubyOnRails
[19:30:18] arup_r: has joined #RubyOnRails
[19:30:56] arup_r: choke: you got answer? I was disconnected as usual
[19:31:58] Atrox: @slash_nick Got it... I searched at the wrong location. I can reject the connection at anytime in the channel itself ._.' It is so easy... Of course... It is rails
[19:32:50] kies: has joined #RubyOnRails
[19:33:40] zave: has joined #RubyOnRails
[19:33:44] crdpink: has joined #RubyOnRails
[19:33:52] mdw: has joined #RubyOnRails
[19:35:46] Jon30: has joined #RubyOnRails
[19:35:46] Jon30: has joined #RubyOnRails
[19:36:29] jenrzzz: has joined #RubyOnRails
[19:36:31] choke: arup_r i didn't see an answer no
[19:38:07] enkristoffer: I'm getting a 'ActiveRecord::Fixture::FixtureError: table "reviews" has no column named "user"' - The table has a user_id column and the fixture is referencing a User fixture the same way I usually do: https://gist.github.com/sachse/b32fb749d6a7233866ea - any ideas what the problem could be? Rails 5 beta3
[19:38:28] arup_r: choke: I added a comment
[19:38:57] choke: works like a charm arup_r thanks!
[19:40:26] futilegames: has joined #RubyOnRails
[19:41:55] zarubin: has joined #RubyOnRails
[19:42:19] flip_digits: machuga: no I haven't gotten an answer
[19:42:56] machuga: flip_digits matchit plugin *should* do it
[19:44:27] flip_digits: machuga: I have that installed and it's not working for me
[19:44:45] srinidhi: has joined #RubyOnRails
[19:45:11] Radar: GOOD MORING
[19:45:14] Radar: MORNING ALSO
[19:45:19] machuga: flip_digits do you have the ruby version?
[19:45:31] machuga: flip_digits http://vim.sourceforge.net/scripts/script.php?script_id=290
[19:45:53] aegis3121: has joined #RubyOnRails
[19:46:08] [Butch]_: has joined #RubyOnRails
[19:46:43] Pazician: has joined #RubyOnRails
[19:46:53] htmldrum: It's the morning oh god
[19:47:31] scope: has joined #RubyOnRails
[19:48:04] B1n4r10: has joined #RubyOnRails
[19:49:10] banister: has joined #RubyOnRails
[19:49:13] Atrox: has joined #RubyOnRails
[19:50:43] mdw: has joined #RubyOnRails
[19:51:05] Atrox: has joined #RubyOnRails
[19:52:04] sunya7a_: using ruby 3.02 and I'm trying to add a custom data attribute to an image_tag helper...Could someone tell me why I'm not getting what I expected: https://gist.github.com/anonymous/57a13133ef81634b4694
[19:52:10] tercenya: has joined #RubyOnRails
[19:52:16] sunya7a_: rails* 3.02
[19:53:21] sunya7a_: according to this the data attribute should be formatted the way I wanted http://stackoverflow.com/questions/20152927/how-to-add-jquery-data-attributes-in-rails-image-tag
[19:54:36] _bogus_: can I have some help to install rvm / ruby / rails / passenger in my server ? im getting real headaches with this :/
[19:57:51] yellow5: has joined #RubyOnRails
[19:58:11] Radar: _bogus_: http://ryanbigg.com/2015/07/deploying-a-rails-application-on-ubuntu-passenger-edition/
[19:58:23] sandstrom: has joined #RubyOnRails
[19:59:57] flip_digits: machuga: thanks
[20:01:40] gbgdev: has joined #RubyOnRails
[20:02:18] _bogus_: Radar, thanks.. any advises on rvm ? i cant install it system wide properly
[20:02:45] manfrin: has joined #RubyOnRails
[20:03:02] slash_nick: _bogus_: !rvm i'd imagine he'd say
[20:03:02] helpa: _bogus_: Remove RVM (with 'rvm implode --force') and use chruby + ruby-install. Ubuntu guide: http://bit.ly/1mvdEuH Mac guide: http://bit.ly/1QA85bc
[20:05:11] zarubin: has joined #RubyOnRails
[20:05:17] _bogus_: but i already have a ruby 1.8.7 installed which I cant modify (btw im not doing this on my machine but on a remote server which already contain things hosted and working)
[20:05:24] delgiudices: Let's say i have 2 user stores, 1: User can view products and 2: User can add products to cart
[20:05:37] delgiudices: Should i create 2 different rspec:feature for each of those?
[20:05:41] slash_nick: _bogus_: my guess is you don't want to use ruby 1.8.7
[20:05:42] delgiudices: Or should i put them on the same file
[20:05:55] _bogus_: slash_nick, yes, ruby 4.2 needs higher version
[20:06:34] slash_nick: rails 4.2 needs a higher version... _bogus_: that 1.8.7 is your system ruby, you don't want to use that.
[20:06:36] kies: has joined #RubyOnRails
[20:06:57] treehug88: has joined #RubyOnRails
[20:07:55] _bogus_: yes, is there any problems to install ruby-installer without uninstalling this 1.8.7 ?
[20:11:09] marcdel: has joined #RubyOnRails
[20:11:17] mdw7: has joined #RubyOnRails
[20:11:50] marcdel: has joined #RubyOnRails
[20:12:02] slash_nick: _bogus_: shouldn't be
[20:12:07] thezanke: has joined #RubyOnRails
[20:12:18] _bogus_: slash_nick, also, is this tutorial suitable for production server ?
[20:12:22] _bogus_: and the installation system wide ?
[20:13:52] slash_nick: comments indicate it's for setting up a dev environment
[20:14:32] slash_nick: _bogus_: i use rvm, personally
[20:15:18] moeabdol2: has joined #RubyOnRails
[20:16:28] DoctorMonocular: has joined #RubyOnRails
[20:17:26] sleungcy: has joined #RubyOnRails
[20:18:18] shanemcd: has joined #RubyOnRails
[20:20:18] shanemcd_: has joined #RubyOnRails
[20:20:27] shanemcd: has joined #RubyOnRails
[20:20:40] arup_r: has joined #RubyOnRails
[20:20:54] jjturner: has joined #RubyOnRails
[20:21:10] cnk: has joined #RubyOnRails
[20:21:24] uglybandersnatch: has joined #RubyOnRails
[20:23:35] IFrank00: has joined #RubyOnRails
[20:23:56] duaneb: has joined #RubyOnRails
[20:24:15] smathy: has joined #RubyOnRails
[20:24:34] boontdustie: has joined #RubyOnRails
[20:25:10] mwlang: I inherited a new Rails project where the prior developer created most tables without the usual primary key column (you know, the auto-incrementing :id column) and he rolled his own (why, oh why!?). What’s the rails migration command to add an :id column as primary key and make it auto-incrementing?
[20:26:03] mwlang: I’m halfway tempted to just rename these tables and recreate the Rails-way so ID is at top…but there’s a few million rows of data in some of these tables.
[20:26:16] smathy: Lots of people believe surrogate primary keys are the work of satan.
[20:26:29] tubbo: frankly i'd edit your db/schema.rb and the table directly :D
[20:26:33] baweaver: has joined #RubyOnRails
[20:26:35] tubbo: if i were you
[20:26:55] tubbo: p. sure rails doesn't include any sort of functionality for re-adding a primary key id column, unless `t.integer :id, primary_key: true` works :D
[20:26:57] arup_r: mwlang: https://thinkwhere.wordpress.com/2009/05/09/adding-a-primary-key-id-to-table-in-rails/ :)
[20:26:59] finnnnnnnnnnn: has joined #RubyOnRails
[20:27:00] smathy: mwlang, a few million rows shouldn't be too much of a problem to insert...select into new tables.
[20:27:38] mwlang: smathy: I think I’ll leave the religious zealots at home on this one. :-D
[20:29:28] mwlang: if I had to guess, I’d say the previous developer was obviously PHP or Perl, but he went WAY out of his way to *not* conform to Rails convention…overriding inflections, not doing the usual primary keys, heck, not even hooking up associations…he does “find_by_sql” for most of those…
[20:30:00] arup_r: mwlang: :D
[20:30:12] smathy: mwlang, remember his face, punch him in it when you can.
[20:30:16] arup_r: where were when he was playing with it? :)
[20:30:21] mwlang: you’d think it’s harder to buck convention and find all these obscure, alternative ways to implement in Rails than to just go with the flow.
[20:30:24] finnnnnnnnnnn_: has joined #RubyOnRails
[20:30:28] arup_r: where were you*
[20:30:39] arup_r: jjturner: pong
[20:31:05] mwlang: arup_r: thankfully a long ways away!
[20:31:13] sleungcy: has joined #RubyOnRails
[20:31:19] apotry: has joined #RubyOnRails
[20:31:39] prgmmr: has joined #RubyOnRails
[20:31:49] mwlang: now the project’s all mine! *muhahahah!* ;-)
[20:32:04] arup_r: happy to hear.. :)
[20:32:23] mwlang: arup_r: I might be crying next week.
[20:32:23] epochwolf: smathy: ALL HAIL SATAN.
[20:32:33] arup_r: ok, I thought you hired him, and was not looking at him what he was cooking.. haha
[20:32:48] arup_r: and were*
[20:33:07] smathy: epochwolf, ok then ;)
[20:33:08] arup_r: what/who is SATAN? ( The planet???)
[20:33:10] mwlang: oh, no, no, no….would’ve sent him out the door in a jiffy…if he ever would’ve even made it in.
[20:33:18] smathy: arup_r, Saturn?
[20:33:28] arup_r: yeah.. thanks smathy
[20:33:28] smathy: arup_r, satan is the devil.
[20:33:30] evenix: Any ideea on how I can fix this https://github.com/zquestz/omniauth-google-oauth2/issues/229
[20:33:39] mwlang: arup_r: Satan => Lucifer.
[20:33:42] evenix: whenever I get a response from google its gzip encrypted
[20:33:55] evenix: I'm wondering if there is a way to fix my encoding issue without alterning a gem or else.l
[20:34:21] quazimodo: has joined #RubyOnRails
[20:34:27] mcbobo_: has joined #RubyOnRails
[20:34:56] smathy: evenix, Accept header?
[20:34:56] siaW: has joined #RubyOnRails
[20:35:04] epochwolf: smathy: Seriously, unique artifical identifiers are awesome. For example, I am 268-24-5479. :)
[20:35:34] evenix: smathy: how would you do it? I just read something about config.middleware.use Rack::Deflater
[20:35:44] smathy: epochwolf, I can see both sides of the argument.
[20:36:20] smathy: evenix, no idea, I didn't look at your link :) Just saying that the Accept header is what will allow/prevent a site sending you gzipped responses.
[20:36:23] uglybandersnatch: has joined #RubyOnRails
[20:36:34] siaW: There’s something tricky that I don’t know how to overcome as a Rails newbie. I am using postgresql in all my rails app. When i create a toy app say Facebook and a table “user” and I try to create a NEW toy app called Twitter with table “user”, I get thrown with an error like “table user already exists”. How can i overcome such behaviou? Any advice?
[20:37:12] siaW: I don’t want to get into psql and mess with things around cause it’s 1. time consuming 2. i want to keep 2 tables called “user” for both of my toy apps Facebook and Twitter
[20:37:21] Radar: _bogus_: RVM is terrible. I advise using ruby-install for a very good reason in my guide.
[20:37:52] Radar: delgiudices: two different features. One story per feature.
[20:38:08] Cohedrin: siaw you're using the same database for both apps
[20:38:14] Radar: siaw: Use a different database for the other app.
[20:38:26] Cohedrin: you have to modify database.yml for the second app
[20:38:28] mwlang: RVM. is. terrible. ?!? Like, since when?
[20:38:38] arup_r: Radar: even if they pass through the same controller?
[20:38:38] delgiudices: Radar when do you decide if write the test in the feature or the controller
[20:38:41] siaW: Radar: no
[20:38:45] Radar: one at a time, please.
[20:38:56] Radar: mwlang: Since it fucked a production deploy for me that took me 4 hours to fix.
[20:39:02] Radar: mwlang: And since it did the same for plenty of other people.
[20:39:03] FernandoBasso: has joined #RubyOnRails
[20:39:04] siaW: Radar: my apps have 2 different tables
[20:39:06] jgpawletko: has joined #RubyOnRails
[20:39:16] Radar: siaw: Steps to reproduce the problem kthx
[20:39:32] delgiudices: Radar for example here you wrote this test in the controller, why not in spec/featuers? https://github.com/rubysherpas/r4ia_examples_old/blob/master/ticketee/spec/controllers/projects_controller_spec.rb#L26
[20:39:35] Radar: delgiudices: I start with the feature test first because it's the closest thing to clicking through a browser.
[20:39:40] smathy: rvm has been leaving a trail of destruction in its wake for years
[20:40:11] Radar: delgiudices: That one is kind of on the fence. You could test it either way.
[20:40:27] delgiudices: Oh ok i was just confused
[20:40:29] delgiudices: Thanks boss :)
[20:40:36] mwlang: Radar: ok, ya got my attention. What did rvm do? I’ve got at least 40 deployments on rvm across almost as many servers and don’t want to lose 4 hours on any one of those…
[20:40:57] bronson: has joined #RubyOnRails
[20:41:12] evenix: Loooks like i want the total inverse of Rack::Deflater
[20:41:16] evenix: I want no response to be gzip! lol
[20:41:18] cnk: mwlang: I have been using RVM for years and love it. I did try to move to rbenv a year or so ago, but gave up after an hour of nothing working. So, as always, YMMV
[20:41:20] Radar: mwlang: That's the thing: I don't know. It wouldn't install any gems because the $PATH was messed up and I don't remember doing anything to break it.
[20:41:33] Radar: mwlang: ruby-install is dead simple. You know what it does? It installs a Ruby. That's literally all it does.
[20:41:44] Radar: It's up to you to configure the $PATH so that you use the right ruby + gem
[20:41:54] smathy: RVM is unnecessarily complex, which is fine while it works but a nightmare when it doesn't.
[20:42:16] Radar: RVM tries to do way too much with things like gemsets. We don't need gemsets now that we have Bundler.
[20:42:17] mwlang: well, I do agree RVM is unnecessarily complex.
[20:42:23] siaW: has left #RubyOnRails: ()
[20:43:00] flashpoint9: has joined #RubyOnRails
[20:43:06] _bogus_: Radar, i see, but is it ok for a production server? is the installation system wide ?
[20:43:11] smathy: ...but even just the version switching that it does, it does in an unnecessarily complex way. That nothing else does things that way should be a warning bell for anyone considering it.
[20:43:16] _bogus_: to install this ruby-installer
[20:43:26] Radar: _bogus_: ruby-install is fine for a production server.
[20:43:27] _bogus_: i personally use rvm in my machine but its for local user only
[20:43:28] meoblast001: has joined #RubyOnRails
[20:43:36] mwlang: I guess its like cnk says, YMMV. I’ve had problems in the past, but almost always on my development machine where I run a gazillion Ruby versions
[20:43:45] mdw: has joined #RubyOnRails
[20:43:52] Radar: _bogus_: Yes, you install it system wide.
[20:43:58] mcbobo_: has joined #RubyOnRails
[20:44:08] delgiudices: Radar btw i had a question, you say, if you're with a client and he's telling you what he wants. you should be writing the specs immediately?
[20:44:35] Radar: delgiudices: I'd be hoping that you write the stories into something like Trello or at least GitHub so that you have a record of what the client wanted.
[20:44:42] Radar: delgiudices: Ideally it'd be the client who would be writing that stuff.
[20:44:57] delgiudices: So at what point do you convert them into rspec?
[20:45:20] _bogus_: Radar, another thing is I already installed passenger.. but the installer showed me 3 installations of apache (on /usr/bin/apache and /usr/local/bin/apache if im not wrong, and a third as backup).. i installed it on /usr/bin/apache just to discover the apache thats being used is the /usr/local/bin/apache one... but I think its not a problem right, as I've read it doesnt changes the apache installation, is that right ?
[20:45:20] tubbo: delgiudices: there's unfortunately no good answer :D
[20:45:28] smathy: ACTION never does
[20:45:35] Radar: _bogus_: Why do you have 3 installations of Apache?
[20:45:37] choke: Alright another issue that's/ frustrating. I have: https://gist.github.com/ch0ke/8f496e4f3a8353621a0e which fails as stated in the gist. removing all the constraints doesn't fix it either.. looks to me like it's just skipping the namespace.. any ideas
[20:45:38] smathy: ACTION mumbles "stupid rspec"
[20:45:41] Radar: _bogus_: That is your own problem.
[20:45:46] _bogus_: Radar, not sure, this is a host server
[20:45:52] delgiudices: tubbo i see..
[20:46:09] Radar: choke: It's a namespace. This line: https://gist.github.com/ch0ke/8f496e4f3a8353621a0e#file-projects_controller-rb-L14 should be redirect_to [:admin, @project]
[20:46:15] _bogus_: i asked them to upgrade the ruby but they said they wont because of incompability with cpanel, and gave me the root access to do what I want to do by my own risks
[20:46:20] Radar: choke: the path helper would be admin_project_path
[20:46:26] Radar: _bogus_: https://digitalocean.com
[20:46:26] tubbo: smathy: https://imgflip.com/i/10k28q
[20:46:31] Radar: _bogus_: $10 a month
[20:46:36] Radar: Get off that cpanel crap
[20:46:42] smathy: tubbo, heh :)
[20:46:49] arup_r: choke: use rake routes to see what are the helpers
[20:46:54] _bogus_: yes but this is the client's host... there's already things hosted and working there :/
[20:46:55] arup_r: don't guess them
[20:47:27] _bogus_: ill give a try on your tut
[20:48:21] mcbobo_: Had a question about Multiple Table Inheritance on Rails.
[20:48:25] choke: arup_r its admin_project_path as Radar suggests... Thanks again Radar for the killer help
[20:48:48] MEATCHICKEN: I have a survey that needs to be protected. Currently the workflow is that it is guarded by a query parameter token
[20:48:49] baweaver: has joined #RubyOnRails
[20:48:57] MEATCHICKEN: is there a better way to do this?
[20:49:20] epochwolf: meatchicken: if you don't have user accounts, tokens work.
[20:49:25] delgiudices: So overtime spec/features is supposed to get like 100+ files?
[20:49:33] MEATCHICKEN: epochwolf, if I did have user accounts?
[20:49:41] MEATCHICKEN: I can create some sort of model that determines who can take the survey?
[20:49:50] MEATCHICKEN: what if I want an easy-mode share link
[20:49:56] epochwolf: meatchicken: then use tokens.
[20:50:12] tubbo: delgiudices: what led you to that conclusion?
[20:50:23] MEATCHICKEN: epochwolf, Just as a query parameter? wouldn't that get saved in the browser history?
[20:50:31] delgiudices: Well i should write a spec for each feature
[20:50:37] delgiudices: And usually big projects have tons of features
[20:50:40] JonasOSDever: has joined #RubyOnRails
[20:50:48] epochwolf: meatchicken: yes. Unless it's a single use token.
[20:51:28] MEATCHICKEN: epochwolf, how can I implement that for tons of users? Generate one link for many users
[20:51:41] tubbo: delgiudices: oh yeah, i'm not sure why people use the term "feature spec"...but it basically just means a spec that's being run in the context of a browser, rather than directly. for example, controller specs just instantiate the controller class and run your action on them, it doesn't actually need to boot up an HTTP server.
[20:51:56] epochwolf: meatchicken: you can't, just make one token for everyone and hope no one steals or shares the link. A lot of sites do that.
[20:52:16] evenix: I'm looking for a way to automatically gzip responses.
[20:52:19] epochwolf: meatchicken: that's how shared private google docs work. :P
[20:52:23] MEATCHICKEN: epochwolf, fair enough - thanks !
[20:52:25] delgiudices: Well yeah i know that but
[20:52:25] Radar: delgiudices: The Rails app that I work on full time has 115 feature specs.
[20:52:34] drbayer: has joined #RubyOnRails
[20:52:34] Radar: delgiudices: Scientifically determined via find spec/features | wc -l
[20:52:50] delgiudices: Radar isn't that few features?
[20:52:52] nfk: tubbo, shouldn't having those @import "bootstrap" be enough in application.scss for the default index page to get bootstrap theming?
[20:52:59] Radar: delgiudices: It's enough features :)
[20:53:08] tubbo: nfk: not sure, how does bootstrap-sass tell you to import it?
[20:53:09] Radar: delgiudices: we've grouped them by their models (almost)
[20:53:20] Radar: delgiudices: So there's one like spec/features/admin/creating_adverts_spec.rb
[20:53:41] tubbo: i only have 47
[20:53:49] nfk: tubbo, i have hopefully killed off the default *= imports and added the required ones and restarted the server but i'm not seeing any difference
[20:53:56] _bogus_: Radar, i did the first lines on the tutorial, but its installing ruby on ~/src/ruby-2.3.0 ...
[20:54:24] tubbo: nfk: yeah you don't want to `*= require` anything in your SCSS, since sass importing works so well and allows you to share things like mixins and variables between files.
[20:54:26] Radar: _bogus_: I can't help you with that.
[20:54:29] mcbobo_: Anybody have any experience trying to do Multiple Table Inheritance?
[20:54:33] Radar: mcbobo_: !used
[20:54:33] helpa: mcbobo_: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[20:54:34] delgiudices: Radar oh i see
[20:54:40] uglybandersnatch: has joined #RubyOnRails
[20:55:27] tubbo: shared hosting is not compatible with ruby on rails generally
[20:56:00] moeabdol3: has joined #RubyOnRails
[20:56:05] Radar: There's also a very good reason I recommend digitalocean.
[20:56:13] Radar: cpanel driven hosting is generally quite hard to work with when setting up Rails.
[20:56:16] Radar: at least, ime
[20:56:36] bronson: cpanel is generally quite hard for anything.
[20:56:53] arBmind: has joined #RubyOnRails
[20:57:06] tubbo: bronson: except installing phpBB, that wasn't too hard ;)
[20:57:13] nfk: tubbo, so why am i not seeing any styling? how can i debug this?
[20:57:15] smathy: Where "quite" means "totally" and "hard" means "fucked"
[20:57:38] nfk: what i'm seeing is an inline style sheet
[20:57:45] nfk: could that be the reason?
[20:57:48] n008f4g_: has joined #RubyOnRails
[20:57:58] bronson: tubbo: just you wait... cpanel upgrades are brutal.
[20:58:04] Radar: nfk: sorry, missed the part where you gisted the code
[20:58:15] nfk: what code? it's the fucking default page
[20:58:22] nfk: i just think it shold get themed already
[20:58:31] tubbo: nfk: well the default page is blank, so maybe that's your problem
[20:58:39] nfk: and the only code i have added is what documentation said to add
[20:58:50] nfk: it says "welcome aboard"
[20:58:59] Radar: nfk: Screenshot then?
[20:59:03] nfk: tubbo, but shouldn't it be using application.css which is now application.scss?
[20:59:05] epochwolf: nfk: that's the public/index.html file.
[20:59:09] tubbo: nfk: so you got https://github.com/twbs/bootstrap-sass#a-ruby-on-rails all down then?
[20:59:13] tubbo: nfk: definitely.
[20:59:21] Radar: nfk: The welcome aboard page doesn't use application.css.scss.
[20:59:27] zarubin: has joined #RubyOnRails
[20:59:29] tubbo: haha i knew it! blank root orute
[20:59:32] nfk: Radar, it looks exactly like the page you get when you do rails new foo; cd foo; rails server and open localhost:3000
[20:59:45] Radar: nfk: Thanks for cooperating. I totally feel like helping.
[20:59:54] tubbo: that's a weird one, it gets rendered if you don't have `root to: 'some_controller#and_action'` defined in config/routes.rb
[21:00:00] nfk: tubbo, i think i completeted all steps except including the JS since i'm using angular instead
[21:00:16] nfk: besides the styling should work even without any js
[21:01:06] nfk: tubbo, i know about all that, i'm wondering why bootstrap styling is not being applied, isn't that page still using application.css?
[21:01:14] Radar: [07:59:20] <Radar> nfk: The welcome aboard page doesn't use application.css.scss.
[21:01:17] tubbo: dammit radar
[21:01:17] Radar: [07:59:05] <epochwolf> nfk: that's the public/index.html file.
[21:01:39] nfk: oh, sorry, missed that line
[21:01:42] Radar: nfk: Do not think that you can style the "Welcome Aboard" page.
[21:01:52] adac: has joined #RubyOnRails
[21:02:01] Radar: Generate your own controller, define a root route as tubbo just said, and then whammo you'll have styling applied to that page (if you did everything right)
[21:02:11] nfk: i just assumed that application.css would you know cover everything being served
[21:02:53] tubbo: nfk: yeah it throws that page up so you can make sure that ruby actually works when you browse to localhost:3000
[21:03:13] tubbo: nfk: application.css covers everything IN YOUR APPLICATION being served.
[21:03:14] nfk: btw, is it application.css.scss or application.scss? I remember seing the former often and even using that but the documentation uses the later
[21:03:22] tubbo: application.scss these days, used to be the former.
[21:03:37] Radar: bbl in 15-20 or so
[21:03:43] DoctorMonocular: has joined #RubyOnRails
[21:03:52] nfk: bbl, thanks for saying that line i missed
[21:04:16] nfk: and, finally, do i suspect correctly that if i'm using angular, i should not use bootstrap.js?
[21:04:41] htmldrum: has joined #RubyOnRails
[21:05:20] tubbo: nfk: i use neither bootstrap nor angular so i wouldn't know. pretty sure bootstrap.js is just a bunch of jQuery plugins though.
[21:05:25] Guest34101: has joined #RubyOnRails
[21:05:31] tubbo: if you use angular there's a chance jquery isn't even installed
[21:06:33] nfk: not only is angular designed to work with jquery, i don't think it even works without it
[21:06:45] tubbo: oh i thought it did, hmm
[21:06:46] nfk: just like bootstrap.js, i think
[21:06:54] tubbo: goes to show you just how much i know about the angular world lol
[21:07:02] nfk: the only question was about bootstrap.js and angular.js together which i suspect might actually clash
[21:07:16] tubbo: i can't imagine you'd need bootstrap.js unless you want fancy alerts or something
[21:07:20] tubbo: and modal jawns
[21:07:40] tubbo: but you'd probably want to implement them within angular's pervue.
[21:07:44] tubbo: perview* :D
[21:07:59] nfk: it's used for interactivity and i'm not quite sure if page resizing is pure-css or actually css with js
[21:08:12] nfk: since it uses different margins, etc depending on horizontal width
[21:08:15] mwlang: wait, angularjs doesn’t *require* jquery, but will use it if it’s present…
[21:08:18] mwlang: https://docs.angularjs.org/misc/faq
[21:08:29] smathy: Is this topic coming back around to being on-topic anytime soon?
[21:08:51] P4Titan: has joined #RubyOnRails
[21:09:00] nfk: how is making modern web applications with RoR not on topic?
[21:09:02] delgiudices: how abotu i have a story: adding item to cart and deleting item from cart which depends on the first one
[21:09:12] delgiudices: So i need to copy the add to cart store code and then place teh removing item from cart logic?
[21:09:16] delgiudices: Isn't that WET?
[21:09:23] openstruct: has joined #RubyOnRails
[21:10:26] P4Titan: Hello all. I need a reconmendation: I have an initializer that loads env variables from a yml file. I then have another initializer which, within, I use said env vars. Should I put both's contents into one file or is there some way to have this work flow separation while handling the dependency issue?
[21:11:06] smathy: delgiudices, so move the code that adds to the cart to a shared method.
[21:11:12] trosborn: has joined #RubyOnRails
[21:11:46] delgiudices: Isn't there something like rspec dependencies? smathy
[21:11:58] delgiudices: LIke this spec depends on this other spec
[21:12:03] IFrank00: has joined #RubyOnRails
[21:13:12] nfk: tubbo, mwlang, so it does technically not require jquery but only because it has its own cut-down version/fork inside it
[21:13:46] nfk: and if jquery is loaded before angular, then it uses the real jquery
[21:13:56] mwlang: nfk: that’s correct.
[21:14:15] nfk: so technically we were both correct
[21:14:51] enitiz: has joined #RubyOnRails
[21:15:14] qejk: has joined #RubyOnRails
[21:15:54] smathy: delgiudices, even if there was, you want to re-run all the tests themselves just to create the cart item?
[21:16:00] tubbo: delgiudices: no, that would be a bad practice. in fact, rspec has facilities to prevent two specs from running in succession twice.
[21:16:22] delgiudices: So how should i do it
[21:16:23] tubbo: each test should be isolated and idempotent, that's the only way to really get a guaranteed environment
[21:16:32] delgiudices: Because there are many steps to adding an item to the cart
[21:16:46] delgiudices: Like creating the records and clicking the buttons
[21:17:20] P4Titan: any suggestions?
[21:18:02] tubbo: delgiudices: what we do is have a 'factory method' called e.g. create_placed_order that creates an order in the DB and runs through service objects to do various calculations and things, to speed up test execution when we need to test for things that happen after an order is placed. but we do go through the motions on at least two of the tests to run through the entire checkout process.
[21:18:08] SteenJobs: has joined #RubyOnRails
[21:18:15] tubbo: P4Titan: yeah my suggestion is to actually ask a question :P
[21:18:43] P4Titan: I asked one above
[21:18:59] jenrzzz: has joined #RubyOnRails
[21:19:00] P4Titan: whether I should both both files' contents into one file
[21:19:05] smathy: delgiudices, for where it sounds like you are, just do it however you can, you'll get better later.
[21:19:18] P4Titan: tho I'd prefer to find a way to manage the interdependency w/ separated workflow
[21:19:18] someish: has joined #RubyOnRails
[21:19:26] delgiudices: thanks tubbo and smathy
[21:21:33] tubbo: P4Titan: oh there it is lol
[21:21:38] tubbo: sorry it was buried in my client
[21:21:47] mcbobo_: I'm extending the missing_method on some ActiveRecord models and I've come to a problem with a stackoverflow issue due to my inheritance. Any idea on how to debug this? It just seems to get to a stack overflow at the point of call .save
[21:21:56] tubbo: P4Titan: i'd just put them both into 1 file.
[21:22:07] tubbo: though i believe there _is_ a way to maintain initializer workflow
[21:22:28] djbkd: has joined #RubyOnRails
[21:22:28] tubbo: because config/initializers/*.rb are sorted alphanumerically, you can name each initializer with a number to ensure it's ordere din the right way
[21:22:35] tubbo: like 01_do_this_first.rb and 02_then_do_this.rb
[21:23:09] tubbo: mcbobo_: !gist those models.
[21:23:09] helpa: mcbobo_: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[21:23:27] marcdel: has joined #RubyOnRails
[21:23:34] baweaver: has joined #RubyOnRails
[21:23:36] IFrank00: has joined #RubyOnRails
[21:24:14] P4Titan: tubbo: Hmm, that's what I suppose
[21:24:28] P4Titan: ty, I'll figure out what works best
[21:24:34] Infinite_187: has joined #RubyOnRails
[21:24:35] P4Titan: probably going to unite the files
[21:26:38] Sceko: has joined #RubyOnRails
[21:27:58] baweaver: has joined #RubyOnRails
[21:28:15] roshanavand: has joined #RubyOnRails
[21:29:00] mcbobo_: Here's my attempt at doing MTI, getting a stackoverflow issue when trying to save a "Lender" but "Businesses" are fine https://gist.github.com/mcbobo/8883d67efb62074a35db
[21:29:14] Radar: mcbobo_: !gist-usage
[21:29:14] helpa: mcbobo_: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[21:30:24] siaW: has joined #RubyOnRails
[21:32:01] scope: has joined #RubyOnRails
[21:32:12] siaW: i’m playing with yet another toy app. this is what i want to do, after an email is created, there should be a flash message and then after some time a redirect, this is what i have so far https://gist.github.com/siaw23/b9d10011bd4af81f0e4d it’s not working
[21:32:33] tubbo: mcbobo_: instead of rescuing from NoMethodError, you might want to use `return super unless respond_to? method`, and then override `respond_to?` so that it will return true when you pass a method that is on the subclass.
[21:33:04] arBmind: has joined #RubyOnRails
[21:33:20] Radar: siaw: You probably want to use flash[:alert], given it's a redirect.
[21:33:51] siaW: but the redirect is to ANOTHER PAGE :D
[21:34:30] siaW: another domain to another site not related to the currect site
[21:35:04] arBmind: has joined #RubyOnRails
[21:35:46] siaW: is it possible?
[21:35:59] adaedra: siaw: you misunderstood how this works, apparently.
[21:36:29] siaW: adaedra: how?
[21:36:33] adaedra: The page won't get rendered at all until you hit the end of the controller, so your sleep is delaying /everything/
[21:36:51] siaW: ok. let’s forget about the sleep
[21:36:58] siaW: now i remove it
[21:37:06] adaedra: what you're trying to do is doable by embedding some javascript on your webpage or by the good ol' meta redirect
[21:37:34] siaW: so how do i display the flash image after saving?
[21:37:43] siaW: without a redirect?
[21:37:52] adaedra: yes, let something else do the redirect
[21:38:26] adaedra: you can't do something in the controller /after/ the page hit the browser
[21:38:55] claytonzaugg: has joined #RubyOnRails
[21:39:24] aaronang: has joined #RubyOnRails
[21:40:55] blackmesa: has joined #RubyOnRails
[21:41:22] siaW: i found a workaround ;)
[21:41:25] aaronang: Hi everybody, I was wondering what a developer can use to instrument the Rails framework. I am not talking about developing an app in Rails, but I am talking about improving the Rails framework. How would one instrument the code during development?
[21:41:29] yellow5: has joined #RubyOnRails
[21:43:19] finnnnnnnnnnn: has joined #RubyOnRails
[21:45:06] jottr: has joined #RubyOnRails
[21:47:56] Pazician: has joined #RubyOnRails
[21:48:16] Jasaka: has joined #RubyOnRails
[21:53:16] kknight: has joined #RubyOnRails
[21:55:15] DoctorMonocular: has joined #RubyOnRails
[21:55:32] B4daBing73: has joined #RubyOnRails
[21:55:32] B4daBing73: has joined #RubyOnRails
[21:58:37] ebbflowgo: has joined #RubyOnRails
[21:59:54] smathy: aaronang, what does "instrument" mean there?
[22:01:19] aaronang: smathy, logging information about execution and event, such that we are able to debug.
[22:01:40] aaronang: So basically for monitoring and debugging purposes
[22:02:02] djbkd: has joined #RubyOnRails
[22:03:16] smathy: aaronang, oh right, no idea. I'd just step through in a debugger.
[22:03:44] aaronang: smathy, I am pretty new to Ruby and Rails, could you explain what debugger you use?
[22:03:51] zave: has joined #RubyOnRails
[22:04:40] zave: has joined #RubyOnRails
[22:05:30] zave: has joined #RubyOnRails
[22:05:54] smathy: aaronang, byebug
[22:06:36] sleungcy: has joined #RubyOnRails
[22:07:04] SteenJobs: like, you know, in case you were wondering...
[22:07:12] yellow5: has joined #RubyOnRails
[22:08:06] aaronang: SteenJobs, smathy, Thanks :)
[22:09:00] aaronang: A bit stupid, but just found this: http://guides.rubyonrails.org/debugging_rails_applications.html
[22:09:43] _bogus_: has joined #RubyOnRails
[22:10:02] _bogus_: any tutorials on how to deploy an app manually?
[22:10:07] workmad3: has joined #RubyOnRails
[22:13:42] Devalo: has joined #RubyOnRails
[22:14:04] matthias_: has joined #RubyOnRails
[22:16:01] nfk: btw, what's the current recommendation for/against scaffolding? i remember it was not recommended in the past due to how it generates things that can later become a security issue or something
[22:17:35] mustmodify: has joined #RubyOnRails
[22:18:16] pawnbox: has joined #RubyOnRails
[22:18:51] SeanLazer: has joined #RubyOnRails
[22:18:57] workmad3: has joined #RubyOnRails
[22:18:58] kknight: _bogus_ michel hartl
[22:21:11] quazimodo: has joined #RubyOnRails
[22:21:22] enitiz: has joined #RubyOnRails
[22:24:05] bronson: nfk: it probably doesn't matter too much
[22:24:40] bronson: the issue is when people blindly generate a bunch of crap without understanding what it does, then being surprised when someone can drop every row in a table.
[22:25:41] banister: has joined #RubyOnRails
[22:26:08] bronson: scaffolding can be nice, especially if you have a very CRUDy app. Just make sure you look at every line as if you wrote it.
[22:26:36] nfk: i think i'll proceed with caution and not use scaffolding
[22:26:49] bronson: also it's infuriating to see scaffold-written migrations... 25 migrations to create 25 tables? really?
[22:26:50] nfk: especially since i still need to figure out how to tie angular with rails
[22:27:39] bronson: if you can use RESTful routes the rails side should be pretty easy.
[22:27:54] smathy: I've never heard anyone moan about a migration per table before bronson
[22:28:31] bronson: well, glad to be that person. :)
[22:29:29] SteenJobs: has joined #RubyOnRails
[22:29:57] tubbo: nfk: i use `rails generate resource` and that seems to be a good, minimal alternativ.e
[22:30:07] FaresKAlaboud: has joined #RubyOnRails
[22:30:15] smathy: nfk, I still generate scaffolding for all my apps, but I also understand what every line of generated code does.
[22:30:18] jottr: has joined #RubyOnRails
[22:31:28] bronson: agreed, rails generate resource is nice. especially in a rails-api app.
[22:31:47] nfk: can i have a varchar id? or were they strictly integers in sql?
[22:32:26] bronson: sql allows almost anything to be a primary key
[22:32:30] bronson: rails really likes integers.
[22:32:34] nfk: yeah but what about routes?
[22:32:37] bronson: in columns named 'id'
[22:32:42] nfk: i remember that it does do basic parsing, etc
[22:32:54] bronson: you can do it, but you need to worry about strange characters etc.
[22:33:11] nfk: like would lusers/accountingLuser1213 parse or fail?
[22:33:31] bronson: do you want that whole thing to be the id/ or just 1213?
[22:33:39] nfk: in practice it will be more like people/SD134
[22:33:41] bronson: using 1213-accountingLuser as an id is trivial
[22:33:50] nfk: bronson, i'd prefer the whole thing
[22:33:54] bronson: as long as you don't care about anything after the integer
[22:33:56] tubbo: nfk: it's much easier imho to use slugs and decouple the db id from the slug
[22:34:12] tubbo: lol lusers? haha
[22:34:13] nfk: since those id's are actually already in use and it sort of makes sense in the middle of the night at least to re-use them
[22:34:18] tubbo: luuuuu-huuuuu---zuuuhhh--herrrrr
[22:34:35] SteenJobs: tubbo: yes!!!!
[22:34:41] bronson: nfk: can anyone change their id to '../../../admin' ?
[22:34:47] mdw: has joined #RubyOnRails
[22:34:49] SteenJobs: tubbo: referring to your last message
[22:35:16] mustmodify: I need to include language in my URLs for this one very specific use-case. Based on my experience and not having heard anything in speculation about future tasks, I sincerely doubt we will support other languages in other areas of the app. I'm tempted to just throw the language in as an optional end to the URL... either like /confirmations/new.xml.fr or /confirmations/new-fr.xml or something like that. But I'm sure that's dumb... just don't know why
[22:35:19] mustmodify: Any thoughts?
[22:35:33] trosborn: has joined #RubyOnRails
[22:35:38] nfk: bronson, i'm not sure what would that do, for one any rails code i write will actually comapre your session username against what you asked and tell you phish off if they don't match
[22:35:52] nfk: and even if it didn't, i don't understand how that relative path would do anything dangerous
[22:36:07] bronson: right, I'm saying can the session username match that?
[22:36:09] nfk: unless of course you're admin or somesuch alrady
[22:36:12] nfk: *already
[22:36:35] bronson: it's just an indicator that you're going to have endless bugs and potential holes.
[22:36:46] baweaver: has joined #RubyOnRails
[22:37:03] nfk: herpes, so be it
[22:37:05] mustmodify: bronson: wow haven't been following your conversation but that's never a good thing to read. :P
[22:37:06] nfk: you win
[22:37:23] bronson: "I changed my username to 'a?k' and now your site is broken."
[22:37:45] nfk: it's not lusername, it's ID and it follows a rather set rules
[22:37:47] smathy: mustmodify, seems good to me.
[22:37:55] nfk: like FU16134
[22:38:10] enkristoffer: I'm getting a 'ActiveRecord::Fixture::FixtureError: table "reviews" has no column named "user"' - The table has a user_id column and the fixture is referencing a User fixture the same way I usually do: https://gist.github.com/sachse/b32fb749d6a7233866ea - any ideas what the problem is? Rails 5 beta3
[22:38:19] nfk: that's #134 of FU in 2016
[22:39:00] bronson: nfk: sure, you can do that without too much trouble.
[22:39:10] nfk: i don't like that too much bit
[22:39:11] bronson: but I agree with tubbo: if there's any doubt, use slugs.
[22:39:14] nfk: integers it is
[22:39:26] nfk: but on the other hand, i so don't want to do that
[22:39:31] nfk: oh wait, i don't actually have a choice
[22:39:37] nfk: how could i forget
[22:39:47] SteenJobs: has joined #RubyOnRails
[22:39:52] nfk: at the point some stuff could happen they do not yet have thos id's given out
[22:39:56] mustmodify: So no one objects to my URL scheme including language like /users/53.xml.fr ?
[22:40:02] nfk: how i hate engineering real life systems
[22:40:13] nfk: mustmodify, i do, it must be lusers
[22:40:21] bronson: mustmodify: why not 53.fr.xml?
[22:40:29] bronson: that way extension sensing will still work.
[22:40:32] mustmodify: bronson: either is fine with me.
[22:40:38] mustmodify: I guess that makes more sense.
[22:40:57] mustmodify: I just meant the concept of putting the language there
[22:41:07] bronson: and friggin IE10 is STILL requiring PDFs to end in '.pdf' otherwise they get occasionally displayed as garbage HTML.
[22:41:13] mustmodify: but good point, format should still be last.
[22:41:30] nfk: btw, do models have anything like email:email?
[22:41:35] wethu: has joined #RubyOnRails
[22:41:43] nfk: since manual email validation is an exercise in futility
[22:41:51] bronson: nfk: you mean instead of string: email ?
[22:42:01] jottr: has joined #RubyOnRails
[22:42:12] bronson: not really but that's coming in Rails 5... think it's called activerecord attributes api.
[22:42:15] ctrlrsf: has joined #RubyOnRails
[22:42:16] smathy: enkristoffer, looks like this: https://github.com/rails/rails/issues/22584#issuecomment-171224886
[22:42:29] smathy: enkristoffer, you might need to grab master (or go back to 4.2)
[22:43:04] bronson: nfk: but there are plenty of gems to help with email addresses in Rails 4.
[22:43:32] nfk: email validation has left me in such a despair i sometimes want to mail to admin@gov just to ask them how they feel to have such an email address
[22:43:47] nfk: at least i hope gov was a valid TLD
[22:45:18] nfk: btw, do those newfangled TLDs also have those admin addresses, like admin@xxx?
[22:45:45] bronson: Is there an up-to-date search gem?
[22:45:52] bronson: something like SearchLogic or ScopedSearch?
[22:45:54] nfk: probably one of the coolest email addresses if it does exist
[22:46:19] bronson: getting tired of writing all these scopes and managing params myself...
[22:46:34] smathy: bronson, people seem to like https://github.com/activerecord-hackery/ransack
[22:47:34] bronson: smathy: very interesting. it's a good sign that Radar is a maintainer.
[22:48:11] smathy: bronson, because then you can get real time help in here, ikr!
[22:49:54] HalcyonicStorm: bronson, smathy: that Radar fellow is such a square
[22:50:43] smathy: Such a card.
[22:52:41] pwnd_nsfw`: has left #RubyOnRails: ()
[22:52:51] pwnd_nsfw: has joined #RubyOnRails
[22:53:54] flashpoint9: has joined #RubyOnRails
[22:54:19] DoctorMonocular: has joined #RubyOnRails
[22:54:49] n008f4g_: has joined #RubyOnRails
[22:55:29] bronson: hm, ransack's urls are unpretty. ah well.
[22:57:18] nfk: if i want full-time:boolean should i use instead fulltime:boolean?
[22:57:24] shanemcd: has joined #RubyOnRails
[22:57:34] nfk: fulltime looks hard on the eyes but i'm afraid - might cause borks
[22:57:54] DoctorMonocular: has joined #RubyOnRails
[22:58:06] pawnbox: has joined #RubyOnRails
[22:59:35] flopsec: has joined #RubyOnRails
[22:59:36] someish_: has joined #RubyOnRails
[23:00:04] ebbflowgo: has joined #RubyOnRails
[23:00:29] Dreamer3: has joined #RubyOnRails
[23:00:32] nfk: alright, wtf,
[23:00:34] nfk: India: 60 hours
[23:00:35] nfk: Taiwan: 72+ hours
[23:00:46] nfk: that's full-time work week? my god
[23:00:54] kp666: has joined #RubyOnRails
[23:01:05] nfk: *workweek per wikipedia
[23:01:19] uglybandersnatch: has joined #RubyOnRails
[23:01:27] levifig: has joined #RubyOnRails
[23:01:30] roqo: has joined #RubyOnRails
[23:01:46] andatche: has joined #RubyOnRails
[23:02:41] manfrin_: has joined #RubyOnRails
[23:02:42] ebbflowgo: has joined #RubyOnRails
[23:03:07] johnflux: has joined #RubyOnRails
[23:03:50] Dreamer3_: has joined #RubyOnRails
[23:03:53] djbkd: has joined #RubyOnRails
[23:03:56] jenrzzz_: has joined #RubyOnRails
[23:04:38] djbkd: has joined #RubyOnRails
[23:04:50] arthropododo: has joined #RubyOnRails
[23:04:57] marcdel: has joined #RubyOnRails
[23:05:25] Cervajz: has joined #RubyOnRails
[23:06:29] uglybandersnatch: has joined #RubyOnRails
[23:07:06] baweaver: has joined #RubyOnRails
[23:07:08] Siyo: has joined #RubyOnRails
[23:07:08] Siyo: has joined #RubyOnRails
[23:08:01] dgncn: has joined #RubyOnRails
[23:08:11] Agent281: has joined #RubyOnRails
[23:09:07] Ericx2x: has joined #RubyOnRails
[23:09:33] darkxploit: has joined #RubyOnRails
[23:09:58] Ericx2x: What do most rails app do to work on multiple devices and screen sizes?
[23:10:11] Ericx2x: I heard there is some type of gem that handles it? I want to play around with that
[23:11:19] milesmatthias: has joined #RubyOnRails
[23:12:17] pwnd_nsfw: has joined #RubyOnRails
[23:12:38] flashpoint9: has joined #RubyOnRails
[23:14:45] mustmodify: has joined #RubyOnRails
[23:14:51] mary5030: has joined #RubyOnRails
[23:15:12] Devalo: has joined #RubyOnRails
[23:15:20] creature: has joined #RubyOnRails
[23:15:21] creature: has joined #RubyOnRails
[23:15:36] mustmodify: bronson: Depends on what kind of search you want.
[23:15:54] nfk: tubbo, i just got an error from firefox that /assets/students.self-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css?body=1 could not be loaded
[23:15:56] tetraktys: has joined #RubyOnRails
[23:16:01] mustmodify: For light weight searches I've built some pretty decent things with Valuable, though obviously it does a lot more than that.
[23:16:09] intrigueD: has joined #RubyOnRails
[23:16:20] pragmatism: has joined #RubyOnRails
[23:16:50] bronson: mustmodify: yep, I don't quite need ransack's flexibility.
[23:16:56] lemur: has joined #RubyOnRails
[23:17:06] bronson: ahaha, googling 'valuable gem'
[23:17:53] mustmodify: for serious searches I'm really liking elasticsearch-rails ... a lot of setup, and the elasticsearch syntax is at best inaccessible. But it's superfast.
[23:17:53] mustmodify: bronson: https://github.com/mustmodify/valuable
[23:17:53] mustmodify: because it has defaults and stuff, you can easily build queries with it.
[23:18:06] dalbuschat: has joined #RubyOnRails
[23:18:25] drbayer: has joined #RubyOnRails
[23:18:40] quazimodo: has joined #RubyOnRails
[23:18:46] nfk: i guess it has something to do with students.scss
[23:19:00] nfk: and bootstrap
[23:19:13] bronson: mustmodify: looks like it won't help with my urlparams -> scope either, but it looks way WAY better than hashie.
[23:19:42] mustmodify_: has joined #RubyOnRails
[23:21:08] JonasOSDever: has joined #RubyOnRails
[23:23:13] mcbobo_: Alright i'm out, pce
[23:23:21] kdough: has joined #RubyOnRails
[23:24:26] moses: has joined #RubyOnRails
[23:24:48] nfk: commenting out <%= stylesheet_link_tag 'application', media: 'all' %> seems to stop that error so it has something to do with that but what?
[23:24:58] Cervajz_: has joined #RubyOnRails
[23:25:20] moses: I am trying to take a template from the internet and implement it into a rails project, I copied over the html from the index page and all the js and images, but I dont know where to put the other 3 static pages
[23:25:36] moses: and css for that matter
[23:25:59] ebbflowgo: has joined #RubyOnRails
[23:26:38] Ericx2x: has joined #RubyOnRails
[23:27:16] Ericx2x: anyone have a personal server in their house that's just some laptop or something?
[23:27:29] Ericx2x: I'm thinking of hosting my rails site on a laptop I just leave on in my house.
[23:28:15] weaksauce: ericx2x heroku is free for basic stuff
[23:28:35] smathy: ericx2x, they use responsive CSS usually by using things like bootstrap or foundation.
[23:28:49] pawnbox: has joined #RubyOnRails
[23:29:16] Ericx2x: you can tie a domain name to heroku?
[23:29:25] Ericx2x: I generally find heroku to be weird.
[23:29:54] smathy: moses, app/assets/stylesheets for the CSS, public/ for any static pages.
[23:30:06] smathy: ericx2x, yes.
[23:30:14] weaksauce: ericx2x yeah you can. requires a little bit of dns setup
[23:30:19] milesmatthias: has joined #RubyOnRails
[23:30:20] nfk: tubbo, never mind, it turns out that *=require magic is so potent that even something like * // ###### require foo still parsed and executed
[23:30:33] weaksauce: last time i did it it was yeah
[23:30:47] kknight: has joined #RubyOnRails
[23:30:59] Ericx2x: so you host your personal blog on heroku and it's tied to your domain name?
[23:31:06] Ericx2x: and all you do is pay for the domain name?
[23:31:06] manfrin: has joined #RubyOnRails
[23:31:09] arthropododo: there are limits for small scale stuff, biggers plans are paid
[23:31:16] Ericx2x: how small scale?
[23:31:54] arthropododo: last I checked I think there was a database limit of 10k something
[23:31:59] nfk: ericx2x, i think you can also find alternatives tso that you don't have to pay for the domainname either
[23:32:10] nfk: yes, 10k limit for mysql, iirc
[23:32:14] nfk: not sure about sqlite
[23:32:20] nfk: or perhaps that was for sqlite
[23:32:21] Ericx2x: I mean, if I get a cheap laptop from craigslist for say $200
[23:32:29] Ericx2x: I can setup all I would want on it
[23:32:45] Ericx2x: Never have to pay any recurring fee besides electricity and parts that go bad
[23:32:56] nfk: ericx2x, you can easily server your website on a pi zero which costs like 5 pounds
[23:33:16] Ericx2x: I mean I may host other things
[23:33:23] Ericx2x: Like a minecraft server or something
[23:33:24] zave: has joined #RubyOnRails
[23:33:40] nfk: a current pi 3 probably can handle something like that
[23:33:48] mustmodify_: has joined #RubyOnRails
[23:33:55] nfk: 35 pounds
[23:34:23] Ericx2x: There are hardly any resources in a pi 3
[23:34:39] nfk: it should be like 100 more powerful than first generation pi, iirc
[23:34:45] Ericx2x: A 200 dollar laptop from 2010 would be ideal i think
[23:34:51] ensyde_: has joined #RubyOnRails
[23:34:52] Ericx2x: built in keyboard, monitor
[23:35:01] Ericx2x: silent, plenty of interchangable parts
[23:35:04] nfk: yeah, because you need those on a server
[23:35:17] nfk: pis do not even have a cooler
[23:36:18] weaksauce: i think heroku made the free plans pretty useful enough for most hobby things. once it gets to 10k rows you can upgrade or move it to digital ocean or something
[23:36:39] nfk: btw, what does that sleep for 6 hours for every 24 mean in practise?
[23:36:43] mustmodify___: has joined #RubyOnRails
[23:37:30] nfk: is that literally CPU time or do they count minutes or somesuch in which something was served and turn your instance off if it's been up for 18 hours straight?
[23:37:42] one_zero: has joined #RubyOnRails
[23:37:54] nfk: 18 hours of CPU time sounds insane amount of computation
[23:38:05] Ericx2x: oh wow lol
[23:38:06] nfk: *sounds like an
[23:38:16] snowy: has joined #RubyOnRails
[23:38:34] havenwood: nfk: Once you've been awake for 18 hours, no more until the 24-hour period is over. Awake doesn't mean CPU load, just not sleeping due to 30 minutes of inactivity.
[23:38:49] rapha: ACTION still can't believe that people in the US have to pay for bandwidth
[23:39:02] zave: has joined #RubyOnRails
[23:39:06] mwlang: ericx2x: I’ve run Rails on Pi. Slow to start up, but once running, performance wasn’t too shabby and that’s with MySQL also running on the Pi.
[23:39:06] nfk: where don't you pay for bandwidth
[23:39:20] havenwood: nfk: so if you ping the server once every half hour it'll shut off after 18hrs for six hours before resuming
[23:39:20] moses: ok so i successfully can load all the pages but now the theme is gone it looks terrible :/
[23:39:23] nfk: now, perhaps you meant they pay for data?
[23:39:30] mwlang: ericx2x: like 3 years ago…so was either 1st gen or 2nd gen Pi.
[23:39:31] SteenJobs: has joined #RubyOnRails
[23:39:34] moses: ty btw smathy
[23:39:39] zave: has joined #RubyOnRails
[23:39:47] nfk: havenwood, that sounds like awful design for a blog
[23:39:58] rapha: nfk: even the cheapest 5€-per-month vserver buys me unlimited bandwidth here in .de
[23:40:03] nfk: it's guaranteed that some atom feed will take it down
[23:40:08] havenwood: nfk: jekyll on github pages, done :P
[23:40:12] nfk: rapha, that's data not bandwidth
[23:40:19] rapha: nfk: sorry then, data
[23:40:33] nfk: e.g. your fiver can't even come close to my 100/20
[23:40:36] zave: has joined #RubyOnRails
[23:40:44] nfk: and that's paying for bandwidth
[23:40:58] rapha: nfk: what are the 100 and the 20?
[23:41:18] nfk: rapha, oh, i see, you meant virtual server data, not home ISP connections
[23:41:43] nfk: rapha, 100 Mbps downlink, 20 Mbps uplink but we were talking about different things
[23:41:53] Ericx2x: I personally don't think I would like a pi. I'd gladly pay an extra 150 dollars to have a built in monitor and keyboard.
[23:42:10] rapha: nfk: misunderstanding then, i was indeed referring to server data
[23:42:20] mwlang: ericx2x: or a mac mini. :-)
[23:42:46] Ericx2x: My current personal blog is strange: I checked my analaytics and I get approximately 500 users one month and less than 100 user other months
[23:42:57] Ericx2x: I'm not sure how resource intensive that means my server has to be
[23:43:00] havenwood: an intel edison makes a nice little server, if you don't mind yocto linux >.>
[23:43:10] nfk: ericx2x, a real server does not even have a keyboard or a display
[23:43:13] nfk: usually not
[23:43:24] moses: if my styling is broken what could be wrong with my ruby app?
[23:43:25] nfk: i often work over ssh
[23:43:48] nfk: also your laptop will be drawing 30-60 W easily
[23:43:48] JonasOSDever: has joined #RubyOnRails
[23:44:02] moses: as soon as I put my index.html page into the public folder it broke the styling
[23:44:10] nfk: while a Pi will be under 2 W without USB accesories
[23:44:26] Ericx2x: alright I didn't put that into consideration
[23:44:30] Ericx2x: I'll think about Pi
[23:44:48] Ericx2x: But what about heroku? Should I think of this as a viable option for my hosting?
[23:45:14] Ericx2x: I personally don't know if I should be worried about lack of control and hidden or potential fees.
[23:45:37] nfk: ericx2x, back in the day my Celeron 1800 MHz with 384 MB SD-SDRAM was serving around 2000 visitors per month all while I was using it as my only computer and torrent box
[23:45:53] nfk: and all that on something like 16/2 or maybe 20/4 connection
[23:45:58] nfk: wordpress, natch
[23:46:12] nfk: and apache 2.x, etc
[23:46:13] mwlang: ericx2x: $200 = roughly 10 months for Digital Ocean server for me. For me that means not worrying about static IP’s ($10/mo extra), power outages, kids mucking with things, electricity to run the equipment, or hardware failure.
[23:46:16] nfk: and mysql
[23:46:37] nfk: ericx2x, what hidden fees?
[23:46:57] nfk: also, as someone already said, you can use jekyll and host it on github
[23:47:13] nfk: it will literally work free of charge, just no comments, at least not backed by a DB
[23:47:44] Ericx2x: mwlang: yeah, but you don't get the sense of joy of having a physical server that you have complete control over. and over a 10 year period that would mean you paid 10x the price for the same service
[23:47:54] Ericx2x: I do't think hardware failure would be much of an issue
[23:48:04] nfk: you said spare parts yourself
[23:48:10] nfk: also a laptop is not designed for serving stuff
[23:48:12] mustmodify___: has left #RubyOnRails: ()
[23:48:14] nfk: it will fail eventually
[23:48:24] Ericx2x: nfk a laptop is convinient though
[23:48:24] nfk: anyway, i'm out
[23:48:25] mustmodify___: has joined #RubyOnRails
[23:48:30] Ericx2x: and it has a built in backup battery
[23:48:35] Ericx2x: for when power outages occur
[23:48:42] nfk: if you keep it plugged in all the time, it might not last
[23:48:51] nfk: especially if it's from 2010
[23:48:54] arthropododo: I was reading The RSpec Book and there is a chapter about simulating the browser using Webrat. But it seems that at some point Capybara started being used by a lot of people. Is there an obvious alternative to Capybara now
[23:49:24] havenwood: 2.5A@5V for a Pi or 100mA@3.3V for an Edison
[23:49:36] mustmodify___: Hey did I get banned? Or is my client acting up?
[23:49:47] havenwood: mustmodify___: You seem to not be banned. ;)
[23:49:57] nfk: the brick type battery is at least in the past always using li-ion cells and those are not very good at being under constant charging, in fact, you'll probably kill it totally in a year
[23:50:05] Ericx2x: alright I will probably end up getting a raspberry pi
[23:50:28] Ericx2x: Hopefully there is some good tutorial that can get me thinking of a backup battery and other setup items along the way
[23:50:41] mustmodify: Well I keep seeing "disconnected" and then when I am reconnected my nick has an extra _
[23:50:41] mustmodify: so I figured maybe my other nicks got banned and my client switched or ..
[23:50:57] nfk: a li-poly, especially the ones they currently put into smartphones are much better at charge/discharge but i don't know for how long a modern laptop battery will survive if left to charge forever
[23:51:33] nfk: ericx2x, i dunno about tutorial but i could probably solder a circuit from an off the shelf battery and a transistor or two with ease
[23:53:17] Ericx2x: nfk: I'm not very experienced in that department. How do you find a "off the shelf" battery that would work with the correct amp and voltage
[23:53:19] StevenXL: has joined #RubyOnRails
[23:53:21] nfk: actually, assuming a pi can be powered by some header (not sure from the top of my head as i never have needed it) you could put a modern off the shelf battery in paralel to power supply and if it dies, the battery will take over and when it comes online, get itself charged (the protective circuitry is nowadays inside the li-poly pack itself)
[23:53:25] Ericx2x: and wouldn't that battery be giving power all the time?
[23:53:39] StevenXL: Hi everyone. I am trying to persist some data to the database (postgres), and I keep getting a rollback. How can I figure out what the rollback is due to?
[23:53:57] nfk: ericx2x, look at spec but i epxect anything that does 5V will work, 3.xV might o might not work
[23:54:10] nfk: as for capacity, i don't think it matters
[23:54:29] Havoc][: has joined #RubyOnRails
[23:54:42] nfk: ericx2x, as long as psu is giving out more than battery, it would be charging
[23:55:05] nfk: actually, you might need to add in some resistor to avoid killing the power circuitry of the battery
[23:55:16] Ericx2x: Isn't that an issue to have the battery charge all the time? It would kill the battery the same way a 2010 laptop battery would be killed?
[23:55:20] nfk: so perhaps you would need something a bit more complicated than that but anyway, it's doable
[23:55:48] nfk: ericx2x, a modern battery has built-in control and will shut off when it's full
[23:55:55] nfk: of course that does not mean every one is like that
[23:56:13] nfk: but nowadays they just seem to come with such circuitry by default
[23:56:18] Ericx2x: I'm not very good with hardware and circuitry
[23:56:23] Ericx2x: I can barely solder stuff
[23:56:23] nfk: it also protects against explosive shortage, usually
[23:56:36] nfk: don't worry, i'm even worse at soldering
[23:56:47] nfk: and what's wrong with some downtime?
[23:56:53] Ropeney: has joined #RubyOnRails
[23:57:01] nfk: it's not like power is going out all the time
[23:57:25] nfk: ericx2x, just google for raspberry pi battery backup and see whatyou find
[23:57:26] differentreality: has joined #RubyOnRails
[23:57:50] JonasOSDever: has joined #RubyOnRails
[23:58:29] nfk: btw, the worst bit will be soldering wires to the battery itself, heat it for too long, and at best you might kill the circuitry, at worst, the cell itself might become upset
[23:59:02] pawnbox: has joined #RubyOnRails