« Back to channel list

#RubyOnRails - 22 March 2016

« Back 1 day Forward 1 day »
[00:01:45] siaW: i have a migration that looks like this https://gist.github.com/siaw23/af615aee14a253ce9cd6#file-latest_migration-rb
[00:01:54] siaW: i’m using postgres
[00:02:03] siaW: my latest migration can’t run
[00:02:17] smoitra: has joined #RubyOnRails
[00:02:22] siaW: because then i get this error like ActiveRecord::StatementInvalid: PG::DuplicateColumn: ERROR: column "name" of relation "accounts" already exists
[00:02:23] siaW: : ALTER TABLE "accounts" ADD "name" character varying
[00:02:31] siaW: how can i fix it
[00:02:45] Radar: Remove the line in your migration which adds the name colkumn again
[00:03:06] siaW: what do you mean please?
[00:03:14] Radar: You have a line in a migration
[00:03:28] Radar: which is adding a name column to the accounts table... but the accounts table already has the name column
[00:03:31] Radar: so when the migration tries to add it again... it fails
[00:03:38] Radar: Remove the line which is adding the name column.
[00:04:10] rubyonrailed: has joined #RubyOnRails
[00:05:06] siaW: thanks Radar :)
[00:06:39] JoshGlzBrk: has joined #RubyOnRails
[00:06:58] bronson: Why does image-url('image.png') work, but image-path('image.png') doesn't?
[00:07:02] bronson: is this a weirdness with using less?
[00:07:18] bronson: or can't stylesheets use relative paths?
[00:07:19] Radar: bronson: what do each of those generate in the output?
[00:07:46] bronson: Radar, image-url works great and produces an url. image-path produces broken css.
[00:08:22] Radar: bronson: You're explaining what they produce, but I think it would be more helpful if you showed me what they produce.
[00:08:41] bronson: Radar: true. let me break it and copy the output...
[00:08:55] kies: has joined #RubyOnRails
[00:09:27] trosborn: has joined #RubyOnRails
[00:12:23] joshhbk: has joined #RubyOnRails
[00:16:05] siaW: has joined #RubyOnRails
[00:18:11] baweaver: has joined #RubyOnRails
[00:20:37] bronson: Radar: image-url('image.png') gives "url(/assets/image-1d...70.png)", which works.
[00:20:55] Radar: bronson: right, so I think that's being generated from the less-rails asset pipeline helpers
[00:21:05] Radar: image-path isn't processed I think
[00:21:15] bronson: Agreed, that's what I'm guessing too. A lessism.
[00:21:25] bronson: Good to know that this should work with sass.
[00:22:54] Radar: http://guides.rubyonrails.org/asset_pipeline.html#css-and-sass
[00:23:06] Radar: It looks like image-path should work too, but maybe less doesn't support that? I am not sure on that point.
[00:23:39] bronson: but -path doesn't enclose the result in url(...)
[00:23:55] Radar: I don't know why it's not doing that.
[00:24:08] bronson: Looks like it's by design, according to the guide.
[00:24:32] bronson: Which is a shame since I think css requires url(...), even if it's enclosing a path...?
[00:24:46] bronson: I need to read up on that, I'm well outside my expertise zone.
[00:25:00] kdough: has joined #RubyOnRails
[00:25:05] codepete: has joined #RubyOnRails
[00:25:51] th0m_: has joined #RubyOnRails
[00:26:39] clorisu: has joined #RubyOnRails
[00:26:58] delgiudices: has joined #RubyOnRails
[00:28:17] Radar: bronson: probably good rule of thumb here is to use image-url consistently.
[00:28:37] dalbusch1t: has joined #RubyOnRails
[00:28:39] rickmasta: has joined #RubyOnRails
[00:28:59] baweaver: has joined #RubyOnRails
[00:31:07] smathy: bronson, yes, standard CSS needs the url()
[00:31:10] delgiudices: has joined #RubyOnRails
[00:31:19] smathy: bronson, that's why there's the -url helpers.
[00:31:38] smathy: bronson, different to the _path vs _url routes helper conventions.
[00:33:09] bronson: smathy: makes sense. I'm converting code from using /public/images to /app/assets/images... Old code uses url(/images/path) a lot.
[00:33:17] hiljusti: has joined #RubyOnRails
[00:33:29] Devalo: has joined #RubyOnRails
[00:33:30] bronson: it's mildly annoying I can't use a helper to produce the same output but I'll get over it. :)
[00:33:54] bronson: url(image-path(image.png)) doesn't work either, alas.
[00:35:28] uglybandersnatch: has joined #RubyOnRails
[00:36:00] smathy: bronson, assuming you don't mean that it doesn't work without the quotes, really?
[00:36:58] smathy: bronson, both image-url("image.png") and url(image-path("image.png")) should produce the same thing.
[00:37:27] sypheren: has joined #RubyOnRails
[00:37:30] smathy: Ie. url(/assets/image-FINGERPRINT.png)
[00:38:11] LateralOctober: has joined #RubyOnRails
[00:39:46] i: has joined #RubyOnRails
[00:42:06] mrgreenfur_: has joined #RubyOnRails
[00:42:26] y2mq37: has joined #RubyOnRails
[00:42:26] bronson: aw, smathy just left.
[00:42:44] bronson: this doesn't work for me: url(image-path('grabbing-cursor.png'))
[00:42:56] bronson: which, it sounds like, should work. so maybe THAT is the lessism.
[00:43:17] stannard: has joined #RubyOnRails
[00:44:25] bronson: the error is: expected ')' got '('
[00:44:42] Arcaire: On that line?
[00:44:45] Arcaire: Or elsewhere?
[00:45:51] bronson: Arcaire, on this line: stylesheet_link_tag "application", media: "all"
[00:46:00] bronson: which is where my less errors normally show up.
[00:46:26] Arcaire: Paste full error please.
[00:46:48] Arcaire: I can't really work with that. I have no idea what your stylesheet looks like other than the single line you're having an issue with.
[00:47:34] lessless: has joined #RubyOnRails
[00:47:58] htmldrum_: has joined #RubyOnRails
[00:47:59] htmldrum: has joined #RubyOnRails
[00:48:47] bronson: Arcaire: https://gist.github.com/bronson/abb1fd819d2b3741708b
[00:49:28] ur5us: has joined #RubyOnRails
[00:49:38] pwnd_nsfw: Error reporting for sass/less is so shit
[00:49:55] ur5us: has joined #RubyOnRails
[00:49:57] pwnd_nsfw: Unless I'm blind
[00:50:02] pwnd_nsfw: but.. like, it doesn't really help
[00:50:10] pwnd_nsfw: you'd be better off just blindly looking for the error
[00:50:20] Arcaire: Apparently quotes are required for url() in preprocessed.
[00:50:23] Arcaire: url("memes');
[00:50:28] Arcaire: er, s/'/"/
[00:50:28] mostlybadfly: has joined #RubyOnRails
[00:50:35] bronson: trying that
[00:51:18] pwnd_nsfw: url('good-meme')
[00:51:37] sevenseacat: has joined #RubyOnRails
[00:56:31] siaW: this should be simple. i’m using Devise. i generated a model with devise called User. User has many accounts. now i created a controller that finds/creates/updates an account with serveral details. how do i set the current users account to the newly created account? this is what i’m trying to do on LINE 4 https://gist.github.com/siaw23/0f38e71e603e63a3a2b6
[00:56:32] SteenJobs: has joined #RubyOnRails
[00:57:04] Arcaire: > User has many accounts
[00:57:05] siaW: i need to somehow make a referece to currect_user in the TwitterAccountsController but not sure how to do it
[00:57:55] havenwood: Tabs fixed: https://gist.github.com/siaw23/0f38e71e603e63a3a2b6?ts=2
[00:58:05] havenwood: Handy trick that, ts=2
[00:58:08] Arcaire: What changed?
[00:58:28] AgentSpyname: has joined #RubyOnRails
[00:58:46] codepete: has joined #RubyOnRails
[00:58:47] bronson: Arcaire: that just returned literal: url("image-path('grabbing-cursor.png')")
[00:58:50] bronson: which is pretty funny.
[00:58:50] Arcaire: http://imgur.com/IseTo6q
[00:59:00] pwnd_nsfw: bronson, dawwwww
[00:59:01] Arcaire: bronson: What is image-path? I've never heard of it before.
[00:59:08] Arcaire: Is that a function within LESS?
[00:59:27] pwnd_nsfw: asset helpers
[00:59:30] bronson: Arcaire: should be like image-url but only puts a path: http://guides.rubyonrails.org/asset_pipeline.html#css-and-sass
[00:59:51] pwnd_nsfw: css-and-sass
[00:59:55] pwnd_nsfw: sass != less amirite?
[00:59:56] bool_: has joined #RubyOnRails
[00:59:57] pwnd_nsfw: I never use less
[01:00:00] AgentSpyname: hi guys, i was just putting in some routes but for some reason, no matter what i type in for the param, it will go to the right record
[01:00:06] AgentSpyname: like /education/math and /cows/math do the same thing
[01:00:09] havenwood: That link ^ works for others, yeah? Two-space tabs?
[01:00:10] Arcaire: Are you using sass-rails, bronson?
[01:00:13] Arcaire: If not, it won't work for you.
[01:00:13] trosborn: has joined #RubyOnRails
[01:00:41] pwnd_nsfw: AgentSpyname, need to see the relevant code m8
[01:00:42] Arcaire: AgentSpyname: Neat.
[01:00:53] Arcaire: That is probably less than 1% of what we need to even have any hope of diagnosing your issue.
[01:01:01] Arcaire: "Hi Doctor, I'm not feeling 100%."
[01:01:04] bronson: Arcaire: less-rails, which I would expect to work similarly. It's close.
[01:01:04] Arcaire: "... Okay?"
[01:01:08] Arcaire: bronson: It is not.
[01:01:24] bronson: well, image-url works.
[01:01:29] Arcaire: bronson: Welcome to why I no longer work in a field even close to front-end development.
[01:01:44] Pazician: has joined #RubyOnRails
[01:01:47] pwnd_nsfw: front end is quite annoying
[01:01:50] yatish27: has joined #RubyOnRails
[01:02:00] bronson: eh, the asset pipeline ruins everybody's life. :)
[01:02:02] pwnd_nsfw: especially when you're working with a designer who is brilliant, but knows jack shit about rails
[01:02:10] AgentSpyname: https://gist.github.com/AgentSpyname/33233951a2c9d99cd8ac
[01:02:36] pwnd_nsfw: you have no routes to match what you're trying to do
[01:02:38] Arcaire: bronson: What're you doing in the CSS again, sorry?
[01:02:46] Arcaire: My scrollback is pissy at the moment because I have about a thousand channels.
[01:02:50] Arcaire: Just the relevant line is fine.
[01:02:53] pwnd_nsfw: What's your input, your output, and your expected output AgentSpyname ?
[01:02:55] Arcaire: I think I see your problem kinda.
[01:03:20] pwnd_nsfw: url(image-path('grabbing-cursor.png'))
[01:03:22] pwnd_nsfw: no quotes iirc
[01:03:24] Arcaire: image-url("rails.png") /* Becomes: url(/assets/rails.png) */
[01:03:28] Arcaire: source: https://github.com/metaskills/less-rails
[01:03:33] Arcaire: so you don't need url()
[01:03:36] pwnd_nsfw: or correct method would work
[01:03:37] AgentSpyname: pwnd_nsfw: When I go to /education/math I want it to display the records for that page
[01:03:37] Arcaire: just image-url("memes.png") is fine
[01:03:56] AgentSpyname: when i go to /randomurl/math i still get the records for that page even though that shouldnt happen
[01:04:10] pwnd_nsfw: AgentSpyname, how do you get records for that page if that isn't valid?
[01:04:14] bronson: Arcaire, yep image-url works. Except I'd like to output just the path so it matches the code that was there previously.
[01:04:19] bronson: But it looks like that's not so easy.
[01:04:21] pwnd_nsfw: first off... your routes don't work for what you're doing like I said
[01:04:22] bronson: No big deal.
[01:04:32] Arcaire: bronson: Yeah there's little to no functionality for that specific use-case, unfortunately.
[01:04:38] Arcaire: You'd be better off moving completely to the above.
[01:04:41] Arcaire: It'll be easier in the future.
[01:04:44] Arcaire: pwnd_nsfw: Yeah they do.
[01:04:52] bronson: Arcaire: agreed, doing that now.
[01:04:57] Arcaire: main_topic => education; second_topic => math
[01:04:57] bronson: It's a strange limitation though.
[01:05:14] pwnd_nsfw: Arcaire, the first one is commented out anyways
[01:05:25] Arcaire: pwnd_nsfw:
[01:05:25] Arcaire: resources :main_topics , :path => '' do
[01:05:26] Arcaire: no it isn't
[01:05:41] pwnd_nsfw: I asked for whole routes file, and ignored top line
[01:05:47] Arcaire: Yeah that's not the whole routes file.
[01:05:55] Arcaire: I'm sure in about 45 minutes or so we'll work out that someone needs to do this:
[01:06:03] Arcaire: come on helpa
[01:06:10] Arcaire: *sigh* radar pls
[01:06:12] Radar: Arcaire: Wrong name
[01:06:19] Arcaire: looks like i don't have the correct PRIVILEGE
[01:06:24] Arcaire: [[ triggering intensifies ]]
[01:06:33] helpa: NO FAKE CODE. If you're under an NDA, we cannot help you with your problem. Go hire a consultant.
[01:06:34] Arcaire: is what I wanted.
[01:06:54] Arcaire: Turns out my privilege level is adequate, after checking it.
[01:07:29] Radar: You had to look deeper into your heart.
[01:07:34] _Tariq: has joined #RubyOnRails
[01:08:29] htmldrum: has joined #RubyOnRails
[01:08:30] htmldrum_: has joined #RubyOnRails
[01:08:38] arBmind: has joined #RubyOnRails
[01:09:27] draig: has joined #RubyOnRails
[01:12:55] Darmani: has joined #RubyOnRails
[01:14:41] Darmani: Radar: Breh?
[01:14:51] Radar: Darmani: Did you learn everything from my book yet?\
[01:15:03] Darmani: Radar: I've been reading it.
[01:15:19] Darmani: I do have a specific question for you though.
[01:15:29] Radar: I like specific questions \o/
[01:15:54] Darmani: I'm having a bit of trouble using nested resources. For example like a comment section underneath an article.
[01:16:18] Darmani: The controller setup is throwing me off. I'm not sure how to initialize it properly.
[01:16:39] DikshitNijjer: has joined #RubyOnRails
[01:17:03] Radar: Do you have some code I can look at?
[01:17:26] DikshitNijjer: what is the main difference between ruby on rails and mean javascript?
[01:17:32] ChanServ: +q *!*@gateway/web/cgi-irc/kiwiirc.com/ip.
[01:17:37] Radar: DikshitNijjer: Hi again.
[01:18:18] Darmani: I have my setup on c9 cloud IDE... I haven't uploaded it to Github or anything ._.
[01:18:23] Radar: Seems the trolls have figured out how to work nickserv.
[01:18:35] Darmani: I know I should but I haven't read your book on version control >.<
[01:18:53] Radar: Ok, please upload the code to GitHub and then I can take a look.
[01:19:10] Darmani: Can you link that book to learn Github again?
[01:19:20] Radar: What OS are you on?
[01:19:33] Darmani: Ubuntu, latest version.
[01:19:38] Radar: ok, start here: https://guides.github.com/activities/hello-world/
[01:19:55] Radar: That'll at least enable you to create a repo and get familar with some git concepts.
[01:20:07] Radar: You could even just create a repo then follow the instructions on the page after that
[01:20:10] Radar: i'm about to head to lunch
[01:20:23] Darmani: Alright, I'll hit you up later then.
[01:20:29] stannard: has joined #RubyOnRails
[01:21:47] bricker: has joined #RubyOnRails
[01:23:07] uglybandersnatch: has joined #RubyOnRails
[01:24:36] LateralOctober: has joined #RubyOnRails
[01:24:50] Bil1: has joined #RubyOnRails
[01:26:09] silentpost: has joined #RubyOnRails
[01:29:03] htmldrum: has joined #RubyOnRails
[01:29:05] htmldrum_: has joined #RubyOnRails
[01:30:38] Bil1: has joined #RubyOnRails
[01:31:42] Bil1: has joined #RubyOnRails
[01:33:27] Bil11: has joined #RubyOnRails
[01:34:51] vircung__: has joined #RubyOnRails
[01:36:26] Bil11: Hello everyone. I have a problem that I am sure some of you will find very simple. I have a model called Assignment. It was associated to the User model via a belongs_to. User has_man :assignments. Basically, when an assignment is created, I want to say the issuer was user number blah. I changed the models to try to reflect that but I can't get it to work and be required.
[01:36:31] _Tariq: has joined #RubyOnRails
[01:37:05] halfamind: has joined #RubyOnRails
[01:38:33] Bil11: class Assignment ... belongs_to :issuer, :class_name => 'User', :foreign_key => 'user_id', required: true ... end class User ... has_man :assignments ... end. I need it so that a = Assignment.new; a.valid? = false. a.issuer_id = 10000 (bad id); a.valid? = false. and a.issuer_id = 1 (real user id); a.valid? = true.
[01:39:12] Bil11: So far I haven't been able to make this happen. I've been messing with :foreign_key and :primary_key options but they don't make much sense. Found a guide that looked promising (http://www.spacevatican.org/2008/5/6/creating-multiple-associations-with-the-same-table/) but it isn't working the same way for me for some reason.
[01:39:13] LateralOctober: has joined #RubyOnRails
[01:40:42] siaW: if anyone can help: http://stackoverflow.com/questions/36144793/devise-omniauth-twitter-twitter-gem-updating-attributes
[01:42:53] vircung__: has left #RubyOnRails: ()
[01:45:17] vircung__: has joined #RubyOnRails
[01:46:32] baweaver: has joined #RubyOnRails
[01:46:46] sypheren: has joined #RubyOnRails
[01:47:23] trosborn: Bil11: you need to put your code in a gist copy pasting into chat is totally unreadable
[01:49:31] htmldrum_: has joined #RubyOnRails
[01:49:32] htmldrum: has joined #RubyOnRails
[01:49:53] ensyde_: has joined #RubyOnRails
[01:53:58] Bil11: @trosborn Thanks, i was reading through the rules when I noticed that :-P. Here ya go https://gist.github.com/matthttam/c636055f50eeb1aac860
[01:54:23] ensyde_: has joined #RubyOnRails
[01:56:13] KnownSyntax: has joined #RubyOnRails
[01:58:58] das3in: has joined #RubyOnRails
[01:59:24] Kallis: has joined #RubyOnRails
[01:59:35] Bil11: I am just so confused right now. I get how has_man :assignments and belongs_to :user works perfectly as long as there is a user_id field for assignments. But simply changing the user_id field to issuer_id seemed simple enough. But I can't get it to work the same way with this :-(
[01:59:53] Radar: Darmani: Hi.
[01:59:57] Radar: Bil11: What happens?
[02:00:08] Radar: Darmani: Did you manage to get the repo on GitHub yet?
[02:00:18] Bil11: Hi Radar. I made a Gist here with a little more explaination. https://gist.github.com/matthttam/c636055f50eeb1aac860
[02:00:44] Bil11: But basically I need it to verify that the issuer_id located in my Assignments model is a valid User
[02:01:01] Radar: Bil11: Can you include the schema for the assignments and users table too please?
[02:01:10] Bil11: Oh of course, yes.
[02:01:45] delgiudices: has joined #RubyOnRails
[02:02:27] trosborn: a = Assignment.new(check_out: Time.now, a.issuer_id = 1) seems wierd to me. like i’ve never see anyone pass an instance into its own new method
[02:02:51] Bil11: I updated with excerts from the schema file.
[02:02:52] das3in: How can I query computed values in AR? If I have a score instance method on User. I want "User.where(score: 10)"
[02:02:55] trosborn: if I understand that code correctly.
[02:03:23] Bil11: oh, that is a typo trosborn
[02:04:07] Bil11: That should be all hashes... sorry.
[02:04:33] trosborn: okay… you should probably just copy and paste to ensure we are all working with the same code
[02:04:37] Bil11: @das3in what do you mean by computed values? What exactly are you trying to query?
[02:04:53] Bil11: @trasborn OK, i'll type out in terminal and past it
[02:05:47] Radar: Bil11: Shouldn't this https://gist.github.com/matthttam/c636055f50eeb1aac860#file-assignment-rb-L12 be using issuer_id?
[02:06:37] Bil11: Should it? I keep reading myself in circles on this topic. I'll give it a try
[02:06:41] stannard: has joined #RubyOnRails
[02:06:53] Radar: Well, the field in the assignment table isn't user_id.
[02:07:02] Radar: There is no user_id field. So I'm guessing it's called issuer_id.
[02:07:14] Radar: foreign key opt is "what key in this model's table stores the ID for this association?"
[02:07:16] das3in: https://gist.github.com/das3in/2b6b45ac902bafd3bedf
[02:07:27] Radar: And you could probably even get rid of the foreign_key, since the association is called "issuer". Rails will know.
[02:07:41] delgiudices: Radar can you adopt me
[02:07:45] Radar: das3in: You can't do that. Store score in the database.
[02:09:42] rubyonrailed: has joined #RubyOnRails
[02:09:58] Bil11: @Radar about to test that change. Does the User has_many look right?
[02:10:05] kahn_dumb: has joined #RubyOnRails
[02:10:11] sevenseacat: test it and see :)
[02:10:52] das3in: Radar: so if I wanted to do this https://gist.github.com/das3in/2b6b45ac902bafd3bedf and be able to get Team.where(motivation: 7), I'd need to create a after_update on Team and resave the value in the DB
[02:11:28] Bil11: DEAR GOD that was it.... THank you so much. I really have been poking at this for a few hours. I get so confused on these relationship deals. I'm more of a create the tables myself kind of person... trying to learn ActiveRecord and rails.
[02:11:31] _Sypheren: has joined #RubyOnRails
[02:12:31] xploshioon: has joined #RubyOnRails
[02:14:34] Cohedrin: is it possible to preload an assoication that can't be defined in a has_many or has_one relation?
[02:14:41] Radar: Bil11: foreign key should also be issuer_id
[02:14:55] Radar: Bil11: Because you're saying in that instance "this is the column which represents this current model's ID in the foreign table"
[02:14:59] Radar: Bil11: https://gist.github.com/matthttam/c636055f50eeb1aac860#file-user-rb-L5
[02:15:15] Radar: Bil11: !associations should cover this stuff already
[02:15:15] helpa: Bil11: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[02:15:16] Cohedrin: in my case, using an sql statement with an or clause is much faster than combining two relations together, but I need to be able to preload them
[02:15:20] Radar: das3in: Yes you would.
[02:15:37] cabinB: I have a form partial I'm rendering in a view. It needs to have form_for because of some fields on it. What is the proper syntax for passing a form_for object to a partial? I tried <%= render 'layouts/leftcol_map', :locals => {:f => f } %> ... but ...
[02:15:49] cabinB: I get the following error: undefined local variable or method `f'
[02:15:50] _Tariq: has joined #RubyOnRails
[02:16:04] Radar: cabinB: <%= render 'layouts/leftcol_map', f: f
[02:16:19] Radar: cabinB: You would only use :locals if you were doing render :partial => "file", :locals => ...
[02:16:36] htmldrum_: has joined #RubyOnRails
[02:16:36] htmldrum: has joined #RubyOnRails
[02:16:40] das3in: Radar: I thought about that but then I'd enter an update loop. After motivation gets saved, it'll trigger the after_save filter. Not sure how to do it just once
[02:17:14] sevenseacat: calculate and populate it before_save ?
[02:17:16] RegulationD: has joined #RubyOnRails
[02:17:16] Radar: das3in: You can call update_column to skip the callback.
[02:17:21] Radar: Or sevenseacat's advice too.
[02:17:22] cabinB: I'll try what you suggest Radar. But I don't think I understand the second comment. Do you mean I use :locals only when using fat arrow syntax instead of colon?
[02:17:35] Radar: cabinB: I mean use :locals only when using :partial as well.
[02:17:53] Radar: cabinB: Otherwise the local that gets passed is called locals, and it's a hash which contains ... well, you can guess
[02:18:42] cabinB: radar: I see. out of curiosity, why would I use :partial when I don't need to (for example: render 'layouts\leftcol' works just fine)
[02:18:45] siaw_: has joined #RubyOnRails
[02:18:56] baweaver: has joined #RubyOnRails
[02:18:57] Radar: cabinB: because you're an old school rails developer
[02:19:04] Radar: render :partial used to be the only way
[02:19:05] mwlang: geez. I thought I’d check to see if acts_as_paraonoid was still around (last used it way, way back in the day)….there’s a gazillion reimplementations of this thing — mostly Rails 3ish.
[02:19:23] cabinB: radar: and that, I'm clearly not :-)
[02:19:25] Radar: mwlang: everyone knows that https://github.com/rubysherpas/paranoia is know the best.
[02:19:32] sevenseacat: they do act slightly differently (render "foo" vs render partial: "foo") but for the life of me don't ask me how, just use one way and stick with it
[02:19:38] sevenseacat: probably scoping
[02:19:47] cabinB: radar: just syntax that'll be deprecated then, right?
[02:19:50] mwlang: bingo! got exactly the answer I was hoping for. :-D
[02:19:59] mwlang: (a strong recommendation!)
[02:20:14] sevenseacat: mwlang: well, he wrote it.
[02:20:26] _Tariq: has joined #RubyOnRails
[02:20:31] Bil11: @Radar Changing the foreign key under the User model to "issuer_id" worked. It is strange it still worked when set to user_id...
[02:20:32] mwlang: sevenseacat: common theme in this channel.
[02:20:34] cabinB: radar: that worked just great. thanks!
[02:20:51] Cohedrin: is there any way I can turn this into an has_many association? https://gist.github.com/Cohedrin/5d8cdff446622701e690
[02:21:02] Cohedrin: having a hell of a time getting it to properly go into an assoication
[02:22:12] Radar: Cohedrin: I don't think you can. Could probably define it as a method in your class called, I assume, messages.
[02:22:14] lessless: has joined #RubyOnRails
[02:22:39] Cohedrin: Radar: That's what I'm doing currently, but I need to preload it with the model
[02:22:44] sevenseacat: yeah that kind of stuff is tricky
[02:23:14] Cohedrin: I'm using activemodelserializers to render this association, so if its not preloaded it's gonna spam the database
[02:23:15] Radar: https://gist.github.com/radar/83e25058c2b7d610422d
[02:23:16] Radar: Cohedrin: ^
[02:23:32] IrishGringo: has joined #RubyOnRails
[02:23:56] delgiudices: How do you permit params for nested attributes?
[02:24:01] Cohedrin: Radar: Yeah, that's almost excatly what I have now, can't figure out how to preload that though :(
[02:24:18] Radar: delgiudices: same way you permit regular attributes.
[02:24:59] delgiudices: But what if the nested object has an attribute with the same name as the main object
[02:25:28] Vircung: has joined #RubyOnRails
[02:25:31] sevenseacat: http://guides.rubyonrails.org/action_controller_overview.html#strong-parameters
[02:25:37] sevenseacat: see nested parameters
[02:25:37] delgiudices: params.require(:business).permit(:name, :nested_name)?
[02:26:44] delgiudices: Ok so is <tablename>_attributes
[02:27:43] Darmani: Radar: Hey man, sorry I went to get some dinner.
[02:28:59] Radar: Darmani: no worries :)
[02:29:20] stannard: has joined #RubyOnRails
[02:29:28] Darmani: That tutorial was super helpful by the way. Now I just need to figure out how to upload my shit to Github.
[02:29:40] das3in: Radar sevenseacat so I decided to try it your way kinda. I want to update the Team's motivation when a new Membership is created. But I can't access 'team' correctly. error in gist https://gist.github.com/das3in/2b6b45ac902bafd3bedf
[02:29:43] Radar: Darmani: Create the repo then on that page it should contain steps on how to upload it.
[02:30:10] Radar: das3in: Move it into a method and call it there. after_save :update_team_motivation.
[02:30:14] sevenseacat: das3in: after_save takes either a proc to run, or the symbol of a method to call.
[02:38:19] Darmani: Radar: The steps would be different for uploading to Github if the project was on a Cloud IDE wouldn't it?
[02:38:30] Radar: Darmani: Yes. You would need to download it to your local machine.
[02:38:56] Darmani: I can't upload it straight from the bash terminal on the IDE?
[02:43:05] Radar: shrug. I have no idea how cloud9 works
[02:43:39] sevenseacat: makes me sad that lots of places like railsgirls and railstutorial are now pushing cloud9
[02:44:07] Radar: Low barrier to get setup.
[02:45:27] sevenseacat: this is true, but it's just delaying the normal barrier
[02:45:40] sevenseacat: you'll still have to set up a dev environment anyway
[02:45:57] _Tariq: has joined #RubyOnRails
[02:46:50] delgiudices: Can accepts_nested_attributes be used for creation?
[02:47:20] delgiudices: I'm getting an error Model expected, got actioncontroller::parameters
[02:47:30] chagel: has joined #RubyOnRails
[02:48:09] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[02:49:36] ensyde_: has joined #RubyOnRails
[02:50:07] delgiudices: sevenseacat https://gist.github.com/delgiudices/b6461726ca7fbd17909e
[02:50:22] sevenseacat: there's no error there
[02:50:40] delgiudices: You want the stack trace?
[02:50:47] Radar: delgiudices: stacktrace and the form too pllease.
[02:51:04] sevenseacat: but nested attributes would typically be <model>_attributes, as you said before, but isnt what your code says
[02:51:38] Radar: which makes me think that the form is wrong
[02:51:47] Radar: Or I guess the model could be wrong
[02:51:55] Radar: Will see the form first, then the model.
[02:52:16] Radar: If it's not the form, then it'll be because the anaf line is missing from the model
[02:52:27] quazimodo: has joined #RubyOnRails
[02:52:51] delgiudices: Ok just updated https://gist.github.com/delgiudices/b6461726ca7fbd17909e
[02:52:57] Radar: delgiudices: FTR: that error happens when you try to pass a Hash to a setter for an association. So spec= is the setter, and you're not passing it a Spec, but a params hash for a Spec. it's getting grumpy for that reason
[02:53:03] Radar: delgiudices: sorry, anaf line was spoilers.
[02:53:23] sevenseacat: https://gist.github.com/delgiudices/b6461726ca7fbd17909e#file-gistfile1-txt-L90 this is ick
[02:53:23] Radar: delgiudices: https://gist.github.com/delgiudices/b6461726ca7fbd17909e#file-gistfile1-txt-L90 convert this to f.simple_fields_for :spec and try again please.
[02:53:40] Radar: sevenseacat: I think it _might_ work, but I am never sure. I always use symbols.
[02:54:00] Radar: delgiudices: If that doesn't work, then we can get to the spoilers part.
[02:54:05] Radar: delgiudices: !gist-usage before we get there though
[02:54:05] helpa: delgiudices: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[02:54:53] delgiudices: Yeah still the same
[02:55:13] Radar: Right. Tidy up the formatting in your Gist, add the model, and then I'll point to where it's wrong.
[02:55:20] bronson: has joined #RubyOnRails
[02:55:21] delgiudices: Alright thanks sec
[02:56:26] Radar: Or sevenseacat will if I'm distracted.
[02:56:54] _Sypheren: has joined #RubyOnRails
[02:57:04] uglybandersnatch: has joined #RubyOnRails
[02:57:07] delgiudices: https://gist.github.com/delgiudices/b6cddb56a81c213b92f7
[02:57:10] dandaman: has joined #RubyOnRails
[02:57:10] delgiudices: Is this better?
[02:57:17] chagel: has joined #RubyOnRails
[02:57:26] Radar: You gist like the best.
[02:57:47] Radar: Hm, model is fine too. What do the logs/development.log say?
[02:57:56] Radar: https://gist.github.com/delgiudices/b6cddb56a81c213b92f7#file-business-rb-L10 This is the line in the model I was looking for.
[02:58:03] Radar: Or more exactly, expecting not to be there
[02:58:49] Bil11: @Radar I've almost got my test suite green now! Just curious though. I'm reading through the Active Record Join docs. I have a query that runs that joins all these tables together. Because I changed the associated foreign key to issuer_id I can't simply do Assignment.joins(:user). Is the only way to do this typing out Assignment.joins("INNER JOIN User ON User.user_id = Assignment.issuer_id")?
[02:58:57] chipotle: has joined #RubyOnRails
[02:59:07] Radar: Bil11: is the association called user or is it called issuer?
[02:59:08] delgiudices: I just added the logs to the gist
[02:59:32] Bil11: @Radar Oh... I can do .joins(:issuer)?!
[02:59:38] Radar: Bil11: !try
[02:59:38] helpa: Bil11: Why don't you try it and find out for yourself?
[03:00:06] Radar: delgiudices: logs seem wrong. Did you just resubmit the form, or are you reloading it and fillng it back in each time?
[03:00:24] delgiudices: Oh wow i was just reloading my bad
[03:00:28] delgiudices: How did you find out though?
[03:00:39] Radar: Your spec parameter should be spec_attributes.
[03:00:45] Radar: Everything else checked out, so I made an assumption.
[03:01:02] delgiudices: So when i do simple_fields_for :spec
[03:01:03] Bil11: @Radar Thanks. I am honestly getting confused. I'm sure i'll eventually get my head around this. I can straight write SQL like a mad man but this is throwing me for a loop for some reason. Thanks for the help again. You are amazing!
[03:01:10] delgiudices: the name is spec_params?
[03:01:28] Inside: has joined #RubyOnRails
[03:01:28] Inside: has joined #RubyOnRails
[03:02:24] dcunit3d: has joined #RubyOnRails
[03:02:25] delgiudices: Ok so no error now
[03:02:35] delgiudices: But the nested object was not created
[03:02:43] delgiudices: I guess i think to change the permit
[03:02:48] Radar: delgiudices: attributes should be coming through as spec_attributes.
[03:02:51] delgiudices: to spec_attributes
[03:03:14] Pazician: has joined #RubyOnRails
[03:04:53] dandaman: has joined #RubyOnRails
[03:06:51] delgiudices: Thank you both working now :)
[03:06:53] juhoh: has joined #RubyOnRails
[03:07:38] djbkd: has joined #RubyOnRails
[03:07:50] _Tariq: has joined #RubyOnRails
[03:08:21] dandaman: has joined #RubyOnRails
[03:13:51] uglybandersnatch: has joined #RubyOnRails
[03:16:46] brycesenz: has joined #RubyOnRails
[03:18:46] chagel: has joined #RubyOnRails
[03:20:45] PaperAnchor: has joined #RubyOnRails
[03:21:20] dandaman: has joined #RubyOnRails
[03:22:08] PaperAnchor: I am here with a desperate attempt to get some help from someone
[03:23:52] duncannz: has joined #RubyOnRails
[03:24:00] Radar: PaperAnchor: !rules that's how to get help
[03:24:00] helpa: PaperAnchor: https://gist.github.com/996779
[03:26:13] greenride: has joined #RubyOnRails
[03:27:06] yfeldblum: has joined #RubyOnRails
[03:27:46] qejk: has joined #RubyOnRails
[03:29:04] zzach: has joined #RubyOnRails
[03:30:03] rubyonrailed: has joined #RubyOnRails
[03:30:27] chagel: has joined #RubyOnRails
[03:30:35] greenride: I'm using the carrierwave gem and have an Uploader mounted on a column. For every upload, Carrierwave always writes 'file.jpeg' to the database. And, the url for all rows points to the last upload. What should carrierwave write in each row?
[03:31:08] sevenseacat: the filename of the uploaded file
[03:31:09] Radar: greenride: !rule0
[03:31:09] helpa: greenride: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[03:32:26] theblang: has joined #RubyOnRails
[03:34:43] tw1sted: has joined #RubyOnRails
[03:41:00] ensyde_: has joined #RubyOnRails
[03:41:22] djbkd: has joined #RubyOnRails
[03:42:11] chagel: has joined #RubyOnRails
[03:42:34] greenride: https://gist.github.com/anonymous/cc00c851ae2e33e8e536
[03:42:41] mwlang: hate it when I answer my own stack overflow questions 5 minutes after posting it…. *sigh*
[03:43:01] Radar: greenride: so what is the problem
[03:43:55] greenride: Radar: The spec works and single file upload works. However, all subsequent collections point to the same image, and the value in the mounted column is always 'file.jpeg'.
[03:44:49] PaperAnchor: https://gist.github.com/PaperAnchor/fffc07f14932d8fdb591
[03:47:05] Radar: greenride: I don't understand how that's possiblwe.
[03:47:52] sevenseacat: show us the logs of this happening
[03:48:09] Radar: PaperAnchor: Thanks for following the rules. Great writeup! This code: where: { category_id: params[:category_id] } Should this perhaps be params[:search][:category_id]
[03:48:11] sevenseacat: show us file.jpeg being inserted, when thats not what the params were
[03:49:06] konsolebox: has joined #RubyOnRails
[03:49:18] sevenseacat: also, https://github.com/lebedev-yury/carrierwave-base64/blob/master/lib/carrierwave/base64/base64_string_io.rb#L21
[03:49:24] sevenseacat: seems thats how the gem works,
[03:50:44] sevenseacat: which makes sense, as a base64-encoded string doesnt have a filename in it.
[03:54:23] boontdustie: has joined #RubyOnRails
[03:56:18] greenride: sevenseacat: Thanks. Do you know how filenames are translated into urls when using fog?
[03:56:43] greenride: Is the url completely determined by the filename?
[03:56:46] _Sypheren_: has joined #RubyOnRails
[03:56:53] sevenseacat: please show us evidence of your problem.
[03:56:59] kahn_dumb: has joined #RubyOnRails
[03:57:11] Radar: PaperAnchor: !rule12
[03:57:11] helpa: PaperAnchor: Do not PM members of the channel without first asking if that is OK.
[03:57:21] _Tariq: has joined #RubyOnRails
[03:59:50] PaperAnchor: Thank you for responding Radar. The category search is still not showing any results, and the business name search is giving me an error of "no implicit conversion of Symbol into Integer"
[04:00:01] Radar: PaperAnchor: what is the stacktrace for that?
[04:03:59] chagel: has joined #RubyOnRails
[04:04:55] griffindy: has joined #RubyOnRails
[04:08:44] PaperAnchor: app/controllers/businesses_controller.rb:7:in `[]' app/controllers/businesses_controller.rb:7:in `search'
[04:08:50] ericmeds: has joined #RubyOnRails
[04:09:09] baweaver: has joined #RubyOnRails
[04:11:19] uglybandersnatch: has joined #RubyOnRails
[04:11:43] chipotle: has joined #RubyOnRails
[04:14:37] braincrash: has joined #RubyOnRails
[04:16:28] dopie: has joined #RubyOnRails
[04:16:47] pawnbox: has joined #RubyOnRails
[04:18:54] chagel: has joined #RubyOnRails
[04:19:48] Radar: PaperAnchor: So params[:category] might be nil there. You should check for that before trying to reference it.
[04:20:07] startupality: has joined #RubyOnRails
[04:20:36] SteenJobs: has joined #RubyOnRails
[04:23:33] dandaman: has joined #RubyOnRails
[04:23:59] ensyde_: has joined #RubyOnRails
[04:24:22] treaki__: has joined #RubyOnRails
[04:24:57] DoctorMonocular: has joined #RubyOnRails
[04:25:44] startupality: has joined #RubyOnRails
[04:30:48] rubyonrailed: has joined #RubyOnRails
[04:31:10] yfeldblum: has joined #RubyOnRails
[04:32:31] yfeldblum: has joined #RubyOnRails
[04:34:22] krzkrz: has joined #RubyOnRails
[04:34:50] Devalo: has joined #RubyOnRails
[04:39:33] startupality: has joined #RubyOnRails
[04:42:17] johnflux: has joined #RubyOnRails
[04:42:21] startupality: has joined #RubyOnRails
[04:43:53] xilus: has joined #RubyOnRails
[04:43:56] kdough: has joined #RubyOnRails
[04:45:18] xilus: has left #RubyOnRails: ()
[04:45:51] xilus: has joined #RubyOnRails
[04:52:37] xilus: has joined #RubyOnRails
[04:54:05] chagel: has joined #RubyOnRails
[04:54:29] arup_r: has joined #RubyOnRails
[04:55:20] rubyonrailed: has joined #RubyOnRails
[04:59:17] merida: has joined #RubyOnRails
[04:59:18] merida_: has joined #RubyOnRails
[05:02:37] pawnbox_: has joined #RubyOnRails
[05:03:46] bePolite: has joined #RubyOnRails
[05:09:50] ensyde__: has joined #RubyOnRails
[05:18:53] RegulationD: has joined #RubyOnRails
[05:20:37] mwlang: hmmm…I’m gathering there’s no sane way to do OR conditionals: scope :officers, -> { active.includes(:agency_user_assignments).where(agency_user_assignments: {officer_role: true, supervising_officer_role: true}) }
[05:20:55] sevenseacat: not until rails 5.
[05:20:59] mwlang: trying to filter where officer_role or supervising_role is true.
[05:21:25] mwlang: hmmm….possible to backport with monkey patch?
[05:21:45] sevenseacat: i wouldnt think so, it's been an involved process, but I don't know the details of it.
[05:22:01] sevenseacat: write an SQL snippet
[05:22:56] DragonPunch: has joined #RubyOnRails
[05:23:16] mwlang: I’m doing that wrong, too: scope :officers, -> { active.includes(:agency_user_assignments).where('agency_user_assignments.officer_role = 1 or agency_user_assignments.supervising_officer_role = 1') } => Mysql2::Error: Unknown column 'agency_user_assignments.officer_role' in 'where clause': SELECT `users`.* FROM `users` WHERE (agency_user_assignments.officer_role = 1 or agency_user_assignments.supervising_officer_role = 1)
[05:23:25] mwlang: its like it completely ignores the includes.
[05:23:47] sevenseacat: i think you want a join, not an includes.
[05:23:49] mwlang: oh, nevermind…changing includes to joins solves it.
[05:24:55] krzkrz: has joined #RubyOnRails
[05:29:23] chagel: has joined #RubyOnRails
[05:31:31] timdotrb: has joined #RubyOnRails
[05:32:03] Ropeney: rails 5 has an OR way to do that sevenseacat?
[05:32:38] sevenseacat: https://github.com/rails/rails/pull/16052
[05:32:46] startupality: has joined #RubyOnRails
[05:33:21] sevenseacat: I think its changed a bit since then but that was the original PR
[05:33:56] sp1rs: has joined #RubyOnRails
[05:34:14] arup_r: I read some where DHH may remove `.or`. But forgot the link I read it.
[05:34:49] Ropeney: I think it's rather handy
[05:35:08] sevenseacat: arup_r: I think that would be unlikely.
[05:35:15] yatish27: has joined #RubyOnRails
[05:35:16] sevenseacat: its something people have been crying out for for years.
[05:35:23] tildes: has joined #RubyOnRails
[05:38:16] sneakerhax: has joined #RubyOnRails
[05:40:02] djbkd: has joined #RubyOnRails
[05:47:41] bronson: has joined #RubyOnRails
[05:50:38] htmldrum: has joined #RubyOnRails
[05:50:43] imuglyandimproud: has joined #RubyOnRails
[05:50:59] imuglyandimproud: in the case of local engines, is there a more appropriate way to add engines to vendor/ folder than sym linking?
[05:51:23] htmldrum_: has joined #RubyOnRails
[05:51:38] dextertzu: has joined #RubyOnRails
[05:56:28] djbkd: has joined #RubyOnRails
[05:56:53] srinidhi: has joined #RubyOnRails
[05:56:55] Devalo: has joined #RubyOnRails
[05:57:03] Radar: imuglyandimproud: why are you symlinking?
[05:57:12] Radar: imuglyandimproud: http://ryanbigg.com/2013/08/bundler-local-paths/
[06:02:53] yatish27_: has joined #RubyOnRails
[06:04:34] halfamind: has joined #RubyOnRails
[06:07:58] sp1rs: has joined #RubyOnRails
[06:09:36] xilus: has joined #RubyOnRails
[06:10:12] johnflux: has joined #RubyOnRails
[06:10:54] ur5us: has joined #RubyOnRails
[06:11:20] bePolite: has joined #RubyOnRails
[06:12:19] jenrzzz: has joined #RubyOnRails
[06:16:29] sp1rs: has joined #RubyOnRails
[06:21:25] mwlang: you know…I don’t know why the Rails team had to invent the all new Arel library instead of just taking the rock-solid Sequel gem and building on top of that.
[06:21:36] scope: has joined #RubyOnRails
[06:21:47] scope: hello everyone
[06:22:13] scope: got more of an opinionated question whats best bootstrap or bootstrap-sass
[06:22:15] sevenseacat: scope: afternoon
[06:22:24] mwlang: boostrap-sass
[06:22:29] sevenseacat: sass is the default now, isnt it?
[06:22:36] mbreedlove: has joined #RubyOnRails
[06:22:41] scope: and why sorry hahaha
[06:22:52] scope: I'm still new and trying to learn as much as i can
[06:22:59] sevenseacat: i've always used bootstrap-sass because i <3 sass. if you like less, you would probably want to use that version instead
[06:23:09] scope: looking at all the documentations its a little overwhelming
[06:23:34] scope: and then how would i choose the versions etc
[06:23:54] mwlang: easier to totally adapt at the core level…can override all the sass-variables ahead of @import ‘bootstrap’ so you can set all your grid settings, colors, and so on.
[06:24:02] sevenseacat: well the versions of the bootstrap-sass gem match the version of bootstrap it's for
[06:24:17] scope: how do you know what version of bootstrap its for
[06:24:50] mwlang: scope: I’d just go for bootstrap 3.x series as 4 is still premature.
[06:25:05] Chagel_: has joined #RubyOnRails
[06:25:08] sevenseacat: the version number of the gem.
[06:25:19] mwlang: if you’re doing a new Rails 4 project and include the boostrap-sass gem, you’ll get ver 3.
[06:25:25] sevenseacat: eg. the latest version of the gem is 3.3.6
[06:25:32] sevenseacat: https://rubygems.org/gems/bootstrap-sass
[06:25:36] scope: so i have to have both bootstrap and bootstrap sass gem
[06:26:11] scope: ok and last question
[06:26:18] scope: sorry I'm a pain i know
[06:26:24] sevenseacat: nah you're fine :)
[06:26:38] scope: i tried to use date picker but i get so many errors its crazy
[06:26:42] scope: what gem would i use
[06:26:58] scope: i noticed there is an actually bootstrap datetimepicker
[06:27:06] davee_: has joined #RubyOnRails
[06:27:11] pawnbox: has joined #RubyOnRails
[06:27:41] sevenseacat: i usually use the pikaday library for datepickers
[06:27:46] sp1rs: has joined #RubyOnRails
[06:27:57] sevenseacat: but there's so many of them out there and most of them work more or less
[06:28:34] techsethi: has joined #RubyOnRails
[06:28:56] scope: damn it i thought that was the last question i forgot
[06:29:12] scope: say i install bootstrap date picker but then realise i want pickadauy instead
[06:29:30] scope: if i just delete from gem file and the bundle install will that remove the gems i removed
[06:29:46] sevenseacat: remove from your project, but not uninstall them from your computer
[06:30:10] mwlang: scope: perhaps this one: https://rubygems.org/gems/bootstrap-datepicker-rails/versions/1.5.0
[06:30:52] DragonPunch: has joined #RubyOnRails
[06:31:26] scope: runtime and development dependances are normally auto installed correct and to check i goto gemlock and check to see if its there if not add the gem to gem file
[06:31:37] mbreedlove: has joined #RubyOnRails
[06:32:45] sevenseacat: sorry, I'm not following
[06:33:00] djbkd: has joined #RubyOnRails
[06:33:04] sevenseacat: nothing is 'auto-installed' - if you want to use a gem in your project, you add it to your Gemfile then bundle install
[06:33:27] scope: i mean when you first create an app
[06:33:36] scope: a lot of dependencies are installed
[06:33:47] sevenseacat: right, they're all dependencies of the gems in your Gemfile
[06:34:15] sevenseacat: when you create an app, you get a default Gemfile with a bunch of gems in it already
[06:34:40] scope: so bootstrap-datepciker needs railties bundler json pry rake
[06:34:54] scope: to check i have those dependencies i look in hemlock
[06:35:03] scope: if not there i goto gem file and add them
[06:35:15] sevenseacat: they will install when you install the bootstrap-datepicker gem
[06:36:08] scope: ok let me have a bash at that see if i can actually do something hahaha.
[06:39:11] aganov: has joined #RubyOnRails
[06:42:52] kahn_dumb: has joined #RubyOnRails
[06:44:03] sp1rs: has joined #RubyOnRails
[06:44:43] scope: sometimes being a hacker is a curse
[06:44:51] scope: i want to know every little detail
[06:45:01] scope: how things work why they work
[06:45:12] scope: what i can do to push it beyond its capabilities
[06:45:20] scope: making me over think a lot of the time
[06:45:37] netzfisch: has joined #RubyOnRails
[06:48:11] rvanlieshout: has joined #RubyOnRails
[06:48:18] TheNet: has joined #RubyOnRails
[06:52:10] netzfisch: has joined #RubyOnRails
[06:52:12] Disavowed: has joined #RubyOnRails
[06:54:27] arup_r: has joined #RubyOnRails
[06:58:53] chagel: has joined #RubyOnRails
[07:01:49] htmldrum_: has joined #RubyOnRails
[07:01:49] htmldrum: has joined #RubyOnRails
[07:02:43] mr-spoon: has joined #RubyOnRails
[07:03:20] bronson: has joined #RubyOnRails
[07:04:28] Pazician: has joined #RubyOnRails
[07:04:59] jenrzzz: has joined #RubyOnRails
[07:10:56] bePolite: has joined #RubyOnRails
[07:12:44] chagel: has joined #RubyOnRails
[07:13:23] scepticulous: has joined #RubyOnRails
[07:17:02] acosonic: has joined #RubyOnRails
[07:17:19] acosonic: hi all, is there something like codeception done for ruby on rails?
[07:17:44] chagel: has joined #RubyOnRails
[07:17:54] sevenseacat: codeception appears to be 'write tests via BDD' so the answer is yes, rspec
[07:17:55] Pazician: has joined #RubyOnRails
[07:19:00] acosonic: sevenseacat: yes, but it integrates selenium
[07:19:15] sevenseacat: that sounds like a downside
[07:19:18] sevenseacat: selenium is a pain in the ass
[07:19:59] sevenseacat: rspec has feature testing built in, which may be what you're after
[07:20:03] RegulationD: has joined #RubyOnRails
[07:20:25] acosonic: I will, but I want to explore more… Capybara ok? worth spending time on?
[07:20:52] sevenseacat: capybara is an invaluable tool.
[07:21:23] pawnbox: has joined #RubyOnRails
[07:21:26] Cork: if one have distance = 7.days, how can one get 7 back out of distance?
[07:21:57] sevenseacat: well 7.days is just a number
[07:22:00] Cork: no that gives you a date object
[07:22:17] Cork: its an ActiveSupport::Distance
[07:22:22] Cork: *Duration
[07:23:05] sevenseacat: under the hood it's a number though - see 7.days.value
[07:23:23] Cork: ya, it stores it in seconds i think
[07:23:24] sevenseacat: which is number of seconds
[07:23:36] Cork: an option is 7.days / 1.day i guess...
[07:23:46] rvanlieshout: why would you want to get that number back?
[07:23:55] rvanlieshout: why don't you have it anymore? :)
[07:24:04] mark3: has joined #RubyOnRails
[07:24:33] Cork: rvanlieshout: exactly
[07:25:06] Cork: the function takes a duration and i need to out put "blap blap <time in days ago>"
[07:25:26] sevenseacat: right, now we get to the reasoning
[07:25:27] Cork: preferably time in "style used", but days is ok
[07:25:33] sevenseacat: so you want distance_of_time_in_words or something similar
[07:25:49] Cork: ya, except i need a number not a string
[07:26:11] sevenseacat: what? can you give us an example of what you're actually trying to do?
[07:26:20] Cork: but ya distance_of_time_in_words is the lead i need
[07:26:47] Cork: sevenseacat: the problem with distance_of_time_in_words is that it needs i18n
[07:26:51] Cork: something i don't have in this project
[07:27:16] sevenseacat: no it doesnt need it, and yes you do have it
[07:28:01] Cork: sevenseacat: https://github.com/rails/rails/blob/97f2c4129ae23ee074986a588628acc689a86462/actionview/lib/action_view/helpers/date_helper.rb#L71 no it requires it, and no this isn't a full rails instance project
[07:28:18] comrad: has joined #RubyOnRails
[07:28:24] uglybandersnatch: has joined #RubyOnRails
[07:29:15] jenrzzz: has joined #RubyOnRails
[07:29:46] tvw: has joined #RubyOnRails
[07:31:02] agit0: has joined #RubyOnRails
[07:32:28] rvanlieshout: then include it
[07:33:22] chagel: has joined #RubyOnRails
[07:34:13] baweaver: has joined #RubyOnRails
[07:34:47] startupality: has joined #RubyOnRails
[07:35:45] rogue_koder: has joined #RubyOnRails
[07:36:20] lele: has joined #RubyOnRails
[07:37:22] MrDoctor: has joined #RubyOnRails
[07:41:30] scope: the render partial code <%= render :partial 'shared/navabr' %>
[07:41:32] AimlessRAven: has joined #RubyOnRails
[07:41:59] scope: or <%= render partial: 'shared/navbar' %>
[07:42:23] pawnbox: has joined #RubyOnRails
[07:42:35] scope: it was the latter
[07:43:20] sevenseacat: the former is a syntax error
[07:43:51] chagel: has joined #RubyOnRails
[07:44:43] scope: the first yes
[07:44:49] scope: the second was fine
[07:47:59] Devalo: has joined #RubyOnRails
[07:50:55] alfie_max15: has joined #RubyOnRails
[07:51:09] alfie_max15: got a quick question
[07:51:19] sevenseacat: i hope the guys here can answer you.
[07:51:45] alfie_max15: can i access a js file in vendor/javascript/ via url in production?
[07:52:03] alfie_max15: i can in dev, and it works
[07:53:08] rvanlieshout: alfie_max15: read about the asset pipeline
[07:54:48] darutoko: has joined #RubyOnRails
[07:54:49] alfie_max15: i'm doing that right now, and i have some understanding about it
[07:55:07] alfie_max15: is it because the assets are precompled that i can't access them?
[07:55:27] rvanlieshout: well.. you have to precompile them AND use a proper way in accessing them
[07:55:48] chagel: has joined #RubyOnRails
[07:55:51] defsdoor: has joined #RubyOnRails
[07:56:49] johnflux: has joined #RubyOnRails
[07:56:49] johnflux: has joined #RubyOnRails
[07:56:59] njero: has joined #RubyOnRails
[07:57:11] alfie_max15: i'm trying to add this js in my app, but it's not loaded in the app as such, i then use the js path and include them in separate pages, it's like a widget
[07:57:32] alfie_max15: rvanlieshout, could there be a better way of doing this?
[07:57:51] rvanlieshout: you might want to start with showing what you've done so far
[07:57:57] alfie_max15: doing this in this way so that the path would be under my app domain
[07:58:11] rvanlieshout: and it's best to always include that js
[07:58:13] rvanlieshout: in application.js
[07:58:50] Devalo: has joined #RubyOnRails
[07:58:51] alfie_max15: another approach that comes into my mind would be to keep it in s3 and use that url
[07:59:14] rvanlieshout: i've really got no clue about what you're trying to do
[08:00:22] ur5us: has joined #RubyOnRails
[08:00:50] Inside: has joined #RubyOnRails
[08:01:01] alfie_max15: i've got a file vendor/javascripts/widget.js
[08:01:52] alfie_max15: and would like to load it in my different web pages, using the script tag like : <script src="myapp.herokuapp.com/assets/widget.js"></script>
[08:02:28] alfie_max15: reading about asset pipeline tells me that as all the assets are precompiled, i would not be able to do so in production
[08:03:05] alfie_max15: i was just wondering would there be a way like, to go around and maybe skip asset pipeline for just this one js, so that i can access it via url?
[08:03:15] rvanlieshout: alfie_max15: ah like that
[08:03:19] rvanlieshout: such files should go in public
[08:03:57] alfie_max15: public/assets/javascrips/widget.js ?
[08:04:20] gingray: has joined #RubyOnRails
[08:04:30] rvanlieshout: yep. stuff in the asset pipeline isn't there for public usage
[08:04:32] artto: has joined #RubyOnRails
[08:04:36] rvanlieshout: it contains a hash others can't know
[08:05:05] alfie_max15: hmm, but i thought it's the same for vendor dir too
[08:05:30] alfie_max15: i know, we can require files in vendor in our manifests, but not the files in public
[08:05:38] rvanlieshout: hence the same issue
[08:05:55] rvanlieshout: you're not using the asset pipeline for a valid use case
[08:06:22] alfie_max15: oh, ok :) hence all the trouble im going through
[08:06:30] alfie_max15: thanks for making it clear
[08:08:18] edwinvdgraaf: has joined #RubyOnRails
[08:10:13] MrDoctor: has joined #RubyOnRails
[08:10:48] chagel: has joined #RubyOnRails
[08:14:24] futilegames: has joined #RubyOnRails
[08:15:49] chagel: has joined #RubyOnRails
[08:17:52] uglybandersnatch: has joined #RubyOnRails
[08:18:06] Coldblackice_: has joined #RubyOnRails
[08:19:37] vernaz: has joined #RubyOnRails
[08:22:35] Devalo: has joined #RubyOnRails
[08:23:25] G: has joined #RubyOnRails
[08:26:20] mrbubbles: has joined #RubyOnRails
[08:28:39] Inside_: has joined #RubyOnRails
[08:30:18] Spami: has joined #RubyOnRails
[08:30:50] chagel: has joined #RubyOnRails
[08:31:04] tjbiddle: has joined #RubyOnRails
[08:32:36] Palsson: has joined #RubyOnRails
[08:32:59] artto: has joined #RubyOnRails
[08:37:11] spellbook: has joined #RubyOnRails
[08:39:30] srinidhi: has joined #RubyOnRails
[08:39:55] htmldrum: has joined #RubyOnRails
[08:39:56] htmldrum_: has joined #RubyOnRails
[08:41:15] srinidhi: has joined #RubyOnRails
[08:42:45] Dbugger: has joined #RubyOnRails
[08:42:49] Dbugger: Hello everyone
[08:42:58] spellbook: hi all. i'm having a bit of trouble and hope someone could help. i'm trying to scrape a table using httparty and it's not working. from the webpage, it looks like the table is generated from a js file, and it looks like the scrape is only picking up the html before any of the scripts are being run.
[08:43:04] n008f4g_: has joined #RubyOnRails
[08:43:17] alfie_max15: hello spellbook
[08:43:22] tjbiddle: Could someone offer their opinion on if I'm handling destroying dependent records in polymorphic assocations properly in this case: https://gist.github.com/thomasbiddle/08880722638a0d54b6e5
[08:44:24] tjbiddle: spellbook: First thing I'd try is see where the javascript is getting it's data from - may be easier to just hit that endpoint directly
[08:44:52] scope: when i have a navber links home always stays highlighted even if I'm on contact how come
[08:45:13] nerium: has joined #RubyOnRails
[08:45:20] Cervajz_: has joined #RubyOnRails
[08:45:40] scope: https://gist.github.com/scope2229/57760a2407c2d934bcc9
[08:46:15] sevenseacat: scope: "<li class="active">" ?
[08:46:20] sevenseacat: you're hardcoding it to be active?
[08:46:34] scope: so do i ned to add class active to all links
[08:46:35] sevenseacat: so thats why it stays highlighted :P
[08:46:45] tjbiddle: scope: Any time you click a link, set the other to active
[08:47:09] scope: how do i do that tjbiddle
[08:47:11] tjbiddle: If they're all separate pages then do somethign like: <li class="sub-menu <%= active_sub_menu('contact') %>">
[08:47:29] tjbiddle: I think that's a helper in my code, sec.
[08:48:08] tjbiddle: scope: https://gist.github.com/thomasbiddle/d71db0e6dfd937bc11d5
[08:48:20] sp1rs: has joined #RubyOnRails
[08:48:21] scope: haha adding class="active to all links doesn't work hahaha
[08:48:30] tjbiddle: That's in my helper/application_helper.rb
[08:48:33] sevenseacat: that would just set them all as active
[08:48:38] tjbiddle: scope: Well then they'd all be active
[08:48:39] sevenseacat: think about what you're actually doing here
[08:49:03] scope: well i don't understand tjbiddles at all I'm way to new
[08:49:08] tjbiddle: You want it so that your application says "Hey - I'm on a controller that's a part of this navigation, I should add the "active" class here"
[08:49:16] scope: what I'm trying to do is highlight the active link
[08:49:32] sevenseacat: andwhat defines 'the active link'?
[08:49:46] sevenseacat: because active in HTML terms means something quite different than you mean
[08:50:14] scope: is there a tutorial about active links
[08:50:40] tjbiddle: scope: My first part: `active_sub_menu('contact')` passes "contact" into that function. My function then has: `return (item == controller_path.classify.split("::").last.downcase) ? 'active' : ''` which says if I have something like MyStuff::ContactController - Then it will turn that into "contact" and it will match that ternary - and return "active"
[08:50:43] DoubleMalt: has joined #RubyOnRails
[08:51:05] chagel: has joined #RubyOnRails
[08:51:09] agit0: has joined #RubyOnRails
[08:52:04] tjbiddle: controller_path would return MyStuff::ContactController into "mystuff/contact" (See: http://apidock.com/rails/ActionController/Base/controller_path) - It would downcase it and take the last argument if there was one
[08:52:14] tjbiddle: So now "contact" matches "contact"
[08:52:17] tjbiddle: So it returns "active"
[08:52:36] tjbiddle: And I have `<li class="<%= active_menu_item('client') %>">` in my navigation
[08:52:49] tjbiddle: So it sets it to `class='active'`
[08:52:52] tjbiddle: And now you have an active link
[08:53:52] sevenseacat: scope: first you need to define what you mean by 'active'
[08:54:12] scope: doesn't bootstrap auto define active
[08:54:23] sevenseacat: it defines a style for active links
[08:54:30] artto: has joined #RubyOnRails
[08:54:30] sevenseacat: it does not define what your app wants to highlight as active
[08:54:31] tjbiddle: Which is why you add it to the class
[08:54:56] sevenseacat: under what circumstances would you want to highlight a link as active?
[08:54:59] tjbiddle: All "active" is a CSS class where now it say something like "Make this green"
[08:55:31] tjbiddle: So now you, in Rails, need to dynamically figure out when you want to make a link be "active" or show as green
[08:55:33] spellbook: tjbiddle: the endpoint isn't easier. the script building the table does a little math to fill up some of the cells which i'd like to keep.
[08:57:00] tjbiddle: spellbook: Hm. I'm just wondering if HTTParty would even render javascript to begin with - as it's not a browser
[08:57:16] mikecmpbll: has joined #RubyOnRails
[08:57:18] jenrzzz: has joined #RubyOnRails
[08:58:44] spellbook: tjbiddle: i was wondering the same thing. the documentation wasn't precise enough. i'm guessing not, since i've been getting just the script tags in place of the table i was aiming for.
[08:59:18] vernaz: has joined #RubyOnRails
[08:59:18] edwinvdgraaf: has joined #RubyOnRails
[08:59:40] startupality_: has joined #RubyOnRails
[08:59:43] tjbiddle: spellbook: Something like this might help: http://stackoverflow.com/a/30748506/1125714
[09:00:25] greenride: has left #RubyOnRails: ()
[09:00:27] merida: has joined #RubyOnRails
[09:00:28] merida_: has joined #RubyOnRails
[09:00:45] tjbiddle: I think HTTParty just does a regular old HTTP method - nothing fancy with javascript interpretation. That SO link has PhantomJS which IIRC I had some old colleagues use for when they wanted to automate some testing after rendering
[09:01:13] tjbiddle: Unless I'm talking out of my ass and mixing something up. But I know headless drivers exist
[09:01:49] spellbook: tjbiddle: i see. thanks! this helps
[09:01:54] tjbiddle: Sure thing!
[09:02:10] Dbugger: Guys, I have a model Team that has_many Users. My User has a field "age". How could I create a scope, to filter just the teams, where people has the same age?
[09:02:46] sevenseacat: those guys, they know everything huh
[09:03:18] Dbugger: alfie_max15, same age as each other
[09:03:25] scope: ok tjbiddle sevenseacat i think i understand
[09:03:34] scope: i'll keep playing and testing
[09:03:34] Dbugger: I want to be able to first filter just the teams, where the members have the same age.
[09:06:27] alfie_max15: Dbugger, scope :by_age, ->(age) {where(age: age)}
[09:06:56] alfie_max15: does that help?
[09:07:06] Dbugger: that is a scope for User. I want a scope for Team
[09:07:06] jsrn: has joined #RubyOnRails
[09:07:49] Dbugger: alfie_max15, besides, I dont want to "get all Teams where all members have age 35". I want to "get all Teams where all member have the same age, no matter what age this is"
[09:07:55] matthias_: has joined #RubyOnRails
[09:08:31] a11: has joined #RubyOnRails
[09:08:41] alfie_max15: ok, so team A and B both have 5 users each and all their age is 35 then you want those two teams to be returned?
[09:09:59] Dbugger: and if there is a Team C where all have age 19, that as well
[09:10:22] Dbugger: if the ages of the team members is homogenous, I want it
[09:10:40] alfie_max15: oh, i get it now
[09:11:26] alfie_max15: ok, i would probably add a new boolean field in team, and update it whenever new user is added or removed from the team.
[09:11:36] alfie_max15: and use that field to write the scope
[09:11:36] naftilos76: has joined #RubyOnRails
[09:11:54] alfie_max15: otherwise it will be a bit complex query and also a costly one
[09:12:35] Dbugger: Yep, but I cant afford to do that
[09:12:42] Dbugger: I dont have control over the DB schema
[09:13:05] a11: How set the source attribute to be the path of a method in another controller? https://gist.github.com/nfxgosu/b86ea3abe760f2d5d25d
[09:13:24] muhammadn: has joined #RubyOnRails
[09:13:31] bricker: has joined #RubyOnRails
[09:15:36] mrbubbles: has joined #RubyOnRails
[09:16:57] arup_r: has joined #RubyOnRails
[09:17:00] marr: has joined #RubyOnRails
[09:17:18] nettoweb: has joined #RubyOnRails
[09:17:31] Ergo: has joined #RubyOnRails
[09:17:42] DoubleMalt: has joined #RubyOnRails
[09:18:57] jhass: has joined #RubyOnRails
[09:22:40] adre: has joined #RubyOnRails
[09:28:20] a11: anyone?
[09:28:47] tjbiddle: a11: https://github.com/railsware/js-routes
[09:29:21] htmldrum: has joined #RubyOnRails
[09:29:24] htmldrum_: has joined #RubyOnRails
[09:29:47] uglybandersnatch: has joined #RubyOnRails
[09:30:17] Pazician: has joined #RubyOnRails
[09:32:14] gmas: has joined #RubyOnRails
[09:38:05] techsethi: has joined #RubyOnRails
[09:41:21] futilegames: has joined #RubyOnRails
[09:43:11] ferr: has joined #RubyOnRails
[09:45:50] arBmind: has joined #RubyOnRails
[09:46:26] camilasan: has joined #RubyOnRails
[09:47:34] kp666: has joined #RubyOnRails
[09:50:02] camilasan: has joined #RubyOnRails
[09:50:41] FooMunki: has joined #RubyOnRails
[09:52:03] universa1: a11: full stack trace
[09:52:28] universa1: a11: and look at the output of rake routes ;)
[09:52:36] universa1: if you haven't solved it already
[09:54:42] techsethi: has joined #RubyOnRails
[09:59:52] camilasann: has joined #RubyOnRails
[10:01:07] scope: i have a responsive nabber which works great apart from when the collapsed nabber appears the brand logo moves out of the nabber
[10:01:16] scope: I've tried using css to fix this but failed
[10:01:40] scope: i even used visible-xs
[10:01:51] alfie_max15: has left #RubyOnRails: ("Ex-Chat")
[10:02:09] renanoronfle: has joined #RubyOnRails
[10:03:43] universa1: sounds like something for #css ;)
[10:04:08] tvw: has joined #RubyOnRails
[10:06:01] sp1rs: has joined #RubyOnRails
[10:07:07] workmad3: has joined #RubyOnRails
[10:10:02] scope: css moved me to bootstrap
[10:10:08] scope: bootstrap moved me to ruby on rails
[10:11:02] tbuehlmann: can understand the first redirect, but not the latter
[10:11:17] tbuehlmann: go there again and don't tell them about rails
[10:12:10] siaW: has joined #RubyOnRails
[10:12:32] scope: ill just keep playing around
[10:14:29] universa1: scope: anyways, you haven't provided enough information for anyone to be able to help you. disclaimer: i've basically no clue of css ;)
[10:14:59] scope: ill try again
[10:15:00] arBmind: has joined #RubyOnRails
[10:16:13] scope: i have a navbar using bootstrap with brand logo on the left links on the right. when i resize the page the links do as told and go into a night dropdown box with icon-bars only the logo moves outside of the nabber
[10:16:18] gmas: has joined #RubyOnRails
[10:17:48] helpa: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[10:18:22] sp1rs: has joined #RubyOnRails
[10:18:41] artto: has joined #RubyOnRails
[10:18:46] bePolite: has joined #RubyOnRails
[10:18:46] bePolite: has joined #RubyOnRails
[10:19:06] scope: https://gist.github.com/scope2229/5e054f1ffa929e8866dd
[10:20:00] blackmesa: has joined #RubyOnRails
[10:20:00] universa1: https://gist.github.com/scope2229/5e054f1ffa929e8866dd#file-_navbar-html-erb-L14 ?!
[10:20:16] scope: sorry i already changed the spelling mistake
[10:20:20] scope: same thing
[10:21:04] scope: when i had the spelling mistake the resized page had no image
[10:21:28] universa1: ok, why are you using the same image for xs and not xs?
[10:21:50] universa1: https://gist.github.com/scope2229/5e054f1ffa929e8866dd#file-_navbar-html-erb-L13-L14
[10:22:08] universa1: another question: why are you not using the rails helpers?
[10:22:20] scope: whats rails helpers
[10:22:32] universa1: path helpers for url generation
[10:22:53] universa1: asset path helpers, for getting the correct url for images
[10:23:04] scope: thats the correct url
[10:23:11] universa1: in production it is not.
[10:23:32] universa1: because then the image is stored under: windsoL-somehash.png
[10:23:53] universa1: !asset-pipeline
[10:23:56] helpa: http://guides.rubyonrails.org/asset_pipeline.html - The Asset Pipeline Guide by Ryan Bigg, Richard Hulse & Mohammad Typaldos
[10:24:09] scope: gggrrrr the damn asset pipeline
[10:24:16] universa1: not really related to your problem, but still.
[10:24:43] universa1: and your links: <li><%= link_to "Home", root_path &></li>
[10:24:53] universa1: and your links: <li><%= link_to "Facilities", facilities_path &></li>
[10:24:56] scope: at this rate i might just stick to html javascript and css hahahahah
[10:25:05] scope: they say rails is quicker I'm yet to see this
[10:25:48] universa1: rails has a steep learning curve... once you're off the steep part, it is most certainly quicker.
[10:26:05] scope: I've been studying for 2 months to no avail
[10:26:14] scope: tutorials for rails are all over the place
[10:26:21] scope: one guy does it one way another another way
[10:26:31] ql6wlld: has joined #RubyOnRails
[10:26:32] scope: then you have versions
[10:27:20] scope: seams like one big mess thats very unorganised
[10:27:21] universa1: welcome to the world of programming ;)
[10:27:42] vasilakisFiL: has joined #RubyOnRails
[10:27:46] scope: i can program in python c+ javascript
[10:27:57] scope: none of them are like this
[10:28:21] scope: it seams rails moves to far ahead and then all the documentation is left all over the place
[10:28:29] helpa: http://guides.rubyonrails.org/ - Ruby on Rails guides. Recommended reading.
[10:28:32] Cervajz: has joined #RubyOnRails
[10:28:41] scope: I've finished hart
[10:28:42] universa1: those provide a very good starting point which cover most of the basics.
[10:29:26] universa1: well, i'm sure that hartl uses the link_to helper etc... ;)
[10:30:02] scope: not very clearly
[10:30:19] scope: I'm going to give one last bash at it i think
[10:30:32] scope: then just stick to html javascript css
[10:30:47] scope: until its smoothed out
[10:30:57] scope: even the tutorials have major errors
[10:31:30] sevenseacat: as you're only new, the tutorials will have fewer errors than you think, some of them will be pebkac. that's not being mean or rude, it's just the truth
[10:32:10] sevenseacat: you'll change things that you don't think are meaningful but they actually are, or you'll miss things
[10:33:26] scope: true but then with the release of rails 5 is it worth going through the rails 4 tutorials again
[10:33:43] scope: as like i said all the documentation is all over the place
[10:33:53] sevenseacat: yes, it is worth it
[10:34:02] sevenseacat: everything that works in rails 4 will work in rails 5
[10:34:23] scope: are you sure as I've read that a lot of rails 2 and 3 don't work in 4 and 5
[10:34:29] sevenseacat: yes, I'm sure.
[10:34:36] sevenseacat: 2 and 3 are not 4 and 5.
[10:35:02] mostlybadfly: has joined #RubyOnRails
[10:35:03] sp1rs: has joined #RubyOnRails
[10:35:08] scope: i know that
[10:35:22] scope: ill have another bash at the tutorials
[10:35:36] sevenseacat: you keep saying 'the tutorials' and 'the documentations' but not naming things
[10:35:48] sevenseacat: do you want some references, us to link you something, anything?
[10:35:56] sevenseacat: or just 'the tutorials'
[10:35:59] scope: theres too many
[10:36:11] sevenseacat: which is why we recommend some
[10:36:16] scope: but take bootstrap bootstrap sass
[10:36:20] sevenseacat: because there are a billion out there and most of them suck
[10:36:24] scope: then date picker
[10:36:30] sevenseacat: ok, thats nothing to do with rails
[10:36:45] sevenseacat: anything rails-related we can help you with?
[10:36:46] scope: but its all used inside of rails
[10:36:52] scope: nah its ok
[10:37:07] scope: I'm going to go back to michael hartl and the rails way 4
[10:37:23] mauro1254: has joined #RubyOnRails
[10:37:25] scope: unless anyone can suggest a better tutorial
[10:37:31] sevenseacat: good luck with that. i havent read the rails 4 way, but i don't think a great deal of michael hartl's tutorial
[10:37:47] scope: so far neither do i
[10:38:05] scope: he uses groups assets which isn't needed
[10:38:05] sevenseacat: which is why I wrote a book that I think is a lot better, but I am admittedly very biased
[10:38:12] scope: pg in only dev
[10:38:15] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[10:38:28] yfeldblum: has joined #RubyOnRails
[10:38:31] scope: thanks ill go through
[10:38:51] chagel: has joined #RubyOnRails
[10:39:12] mauro1254: I guys, in a Api controller, a before action may throw an exceptio and respondo with a json representation of the error. How can I stop the execution of the code related to that action?
[10:40:01] helpa: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[10:44:13] snowy: has joined #RubyOnRails
[10:47:50] mauro1254: https://gist.github.com/anonymous/1a9cad3ff74602b59b19
[10:48:19] mauro1254: Why does the code provided in the gist not work?
[10:48:40] sevenseacat: define 'not work'
[10:49:44] delgiudices: has joined #RubyOnRails
[10:49:50] mauro1254: The exception raised in the set_resource_proxy method does not stop the execution of the action
[10:50:15] sevenseacat: because you're catching it and continuing
[10:50:30] universa1: respond_with most likely doesn't stop the execution... you might need an explicit render json: ...
[10:51:01] mauro1254: I wanna return a json representation of the error and stop the execution
[10:51:13] universa1: return to where?
[10:51:21] sevenseacat: then you likely want a global rescue in your controller
[10:51:31] sevenseacat: instead of rescuing inside the before_action
[10:53:33] mauro1254: Many thanks for your help
[10:53:56] ferr: has joined #RubyOnRails
[10:53:58] pawnbox: has joined #RubyOnRails
[10:56:29] delgiudices: has joined #RubyOnRails
[10:57:47] jenrzzz: has joined #RubyOnRails
[11:00:10] bamorim: has joined #RubyOnRails
[11:00:16] Ropeney: has joined #RubyOnRails
[11:01:08] artto: has joined #RubyOnRails
[11:03:07] trinaldi: has joined #RubyOnRails
[11:04:13] Dbugger: My rubocop seems to be ignoreing the YML in my root... does anyone know why this could be?
[11:04:20] sp1rs: has joined #RubyOnRails
[11:04:30] universa1: how are you starting your rubocop ?
[11:04:52] tetraktys: has joined #RubyOnRails
[11:05:35] chagel: has joined #RubyOnRails
[11:05:48] techsethi: has joined #RubyOnRails
[11:07:56] universa1: how is your yml file named?
[11:08:34] jgpawletko: has joined #RubyOnRails
[11:10:01] arup_r: has joined #RubyOnRails
[11:10:32] brycesenz: has joined #RubyOnRails
[11:10:42] techsethi: has joined #RubyOnRails
[11:14:17] bachmann: has joined #RubyOnRails
[11:14:29] Detch: has joined #RubyOnRails
[11:16:38] srinidhi: has joined #RubyOnRails
[11:19:30] delgiudices: has joined #RubyOnRails
[11:19:33] sp1rs: has joined #RubyOnRails
[11:22:07] htmldrum: has joined #RubyOnRails
[11:22:14] htmldrum_: has joined #RubyOnRails
[11:23:57] bamorim: has joined #RubyOnRails
[11:24:34] chrisml: the rails guides are excellent.
[11:25:24] sp1rs: has joined #RubyOnRails
[11:26:11] snowy: has joined #RubyOnRails
[11:27:58] snowy: has joined #RubyOnRails
[11:32:01] Cohedrin: has joined #RubyOnRails
[11:33:12] davee_: has joined #RubyOnRails
[11:34:40] stardiviner: has joined #RubyOnRails
[11:37:50] voidDotClass: has joined #RubyOnRails
[11:38:20] voidDotClass: if I have a model e.g School, and school has Students, how do I find the students which belong to School # 3 where student.gender = female?
[11:38:28] stannard: has joined #RubyOnRails
[11:38:30] bob434: has joined #RubyOnRails
[11:39:05] blackmesa: has joined #RubyOnRails
[11:39:09] rvanlieshout: @school.students.where(gender: :female)
[11:39:22] rvanlieshout: Student.where(gender: :female, school_id: 3)
[11:41:37] kh0d: has joined #RubyOnRails
[11:41:44] rvanlieshout: voidDotClass: ^
[11:42:35] stannard: has joined #RubyOnRails
[11:46:14] nobitanobi: has joined #RubyOnRails
[11:46:29] arup_r: best is to have an associations called femae_students..
[11:47:17] chrisml: is it recommended to add indices to all columns?
[11:47:51] arup_r: in school.rb has_many :femal_students, -> { where(gender: :female) }, class_name: "Student" <~~~ voidDotClass
[11:48:14] ldnunes: has joined #RubyOnRails
[11:48:31] arup_r: School.find(3).femal_students
[11:48:38] deur-: chrisml: not all of them. usually columns that hold an identifier of sorts
[11:48:42] rvanlieshout: arup_r: why is that best?
[11:48:48] nobitanobi: I currently have this scope for_company_id -> { joins(home: :company).where(companies: {id: company_id}) } - What would be a good way to make the method so that it not only accepts a company_id but also a company object?
[11:48:51] chrisml: deur- gotcha
[11:48:56] rvanlieshout: better would be to have a scope on student
[11:49:00] rvanlieshout: don't include student stuff in school
[11:49:07] rvanlieshout: @school.students.female
[11:49:28] nerium: has joined #RubyOnRails
[11:49:40] rvanlieshout: nobitanobi: what happens if you pass in a company object?
[11:49:50] arup_r: rvanlieshout: not sure why you dislike, do you like this has_many :students inside school.rb ?
[11:49:55] rvanlieshout: you could use a case
[11:50:04] rvanlieshout: arup_r: there already is a has_many :students in school
[11:50:12] rvanlieshout: i dislike the second one; has_many :female_students
[11:50:16] rvanlieshout: which is just a scope of students
[11:50:23] arup_r: yes, the what I wrote above is also fine, .. nothing wrong.
[11:50:44] arup_r: but,, yeah, we have our own taste.. so all is fine
[11:50:48] nobitanobi: rvanlieshout: let me write a test, actually I havent even tried it. I thought that if I do id: X, X has to be a number
[11:50:54] voidDotClass: rvanlieshout, if I wanted to find the students of school # 3 who were born before 2005?
[11:51:05] voidDotClass: students have a birthday col, date
[11:51:07] deur-: chrisml: depending on the complexity of your database scheme you want to combine multiple columns into one index. for instance, if you have a default scope on your model you can index on the scoped column + primary key
[11:51:08] brycesenz: has joined #RubyOnRails
[11:51:42] rvanlieshout: voidDotClass: @school.students.where(gender: :female).where('date_of_birth < ?', Date.parse('2015-01-01'))
[11:52:31] voidDotClass: rvanlieshout, why does this not work: school.students.where('id = ?', 3)?
[11:52:48] rvanlieshout: voidDotClass: that'll fetch all students with id 32
[11:52:58] voidDotClass: but it doesnt work
[11:53:03] rvanlieshout: define doesn't work
[11:53:08] pawnbox: has joined #RubyOnRails
[11:53:17] rvanlieshout: all students with id 3 AND belonging to your scool-variable
[11:53:31] voidDotClass: ActiveRecord::StatementInvalid: PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block
[11:53:36] voidDotClass: i'm running this in sandhox
[11:53:47] voidDotClass: i guess some other query was invalid and its stuck
[11:53:47] rvanlieshout: you had an aborted transaction
[11:55:22] rodfersou: has joined #RubyOnRails
[11:55:47] voidDotClass: rvanlieshout, instead of date.parse, can I use date.today?
[11:56:26] rvanlieshout: voidDotClass: Time.zone.today, but yes
[11:56:42] voidDotClass: rvanlieshout, its a date col rather than datetime
[11:56:47] rvanlieshout: hence the .today
[11:56:50] rvanlieshout: Time.zone.today
[11:59:15] tetraktys: has joined #RubyOnRails
[12:00:32] workmad3: rvanlieshout: or Date.current :)
[12:01:14] Devalo: has joined #RubyOnRails
[12:01:54] ascarter: has joined #RubyOnRails
[12:01:59] workmad3: voidDotClass: Date.current and Time.zone.today are timezone-aware... meaning that they'll get the current date based on the currently set Time.zone, rather than defaulting to whatever happens to be the currently set server TZ (which can be different from both Time.zone and the default rails timezone set in config/application.rb)
[12:02:33] workmad3: voidDotClass: or, in other words, just because it's a date doesn't mean you get to ignore timezone issues
[12:02:39] uglybandersnatch: has joined #RubyOnRails
[12:06:44] bronson: has joined #RubyOnRails
[12:08:13] ascarter: has joined #RubyOnRails
[12:09:08] voidDotClass: rvanlieshout, how would I find all the students which didn't belong to school # 3?
[12:09:40] rvanlieshout: what's the relation from student to school?
[12:09:59] voidDotClass: has_and_belongs_to_many
[12:10:11] voidDotClass: so Student.schools
[12:10:36] rvanlieshout: and what about students that have multiple school relations; one of them being 3
[12:10:40] rvanlieshout: include them?
[12:10:56] voidDotClass: only students who arent in school 3
[12:11:15] delgiudices: has joined #RubyOnRails
[12:11:28] rvanlieshout: ok. then you'll need a subquery
[12:11:31] rvanlieshout: but.. back in 30 min
[12:11:39] ascarter: has joined #RubyOnRails
[12:13:12] johnflux: has joined #RubyOnRails
[12:13:12] johnflux: has joined #RubyOnRails
[12:13:38] ascarter: has joined #RubyOnRails
[12:16:22] bitkiller: has joined #RubyOnRails
[12:16:41] _Tariq: has joined #RubyOnRails
[12:17:04] voidDotClass: anyone else able to tell me how to write that query?
[12:17:07] The: has joined #RubyOnRails
[12:20:36] startupality: has joined #RubyOnRails
[12:21:14] rubyonrails186: has joined #RubyOnRails
[12:21:49] Guest34270: has left #RubyOnRails: ()
[12:22:20] Ergo^: has joined #RubyOnRails
[12:26:15] roshanavand: has joined #RubyOnRails
[12:26:48] crankharder: why would adding 'indexes :location, type: "geo_point"' to my elasticsearch mapping not let me look up objects by ID anymore?
[12:27:20] crankharder: e.g. before I add it /events/event/1 returns an Event. After I addit, nothing... found: false
[12:27:30] srinidhi: has joined #RubyOnRails
[12:27:53] crankharder: and also, after adding it search('*') returns an empty set when it previously didn't
[12:28:19] beauby: has joined #RubyOnRails
[12:30:04] pawnbox: has joined #RubyOnRails
[12:33:20] scope: has joined #RubyOnRails
[12:34:17] pawnbox: has joined #RubyOnRails
[12:35:59] alho: has joined #RubyOnRails
[12:36:07] rvanlieshout: voidDotClass: ok. got an answer yet?
[12:36:12] voidDotClass: rvanlieshout, no
[12:36:25] rvanlieshout: to recap. you don't want students who have any relationship with school 3?
[12:36:48] rvanlieshout: Student.where.not(id: Student.joins(:schools).where(schools: { id : 3 }).select(:id))
[12:37:38] rvanlieshout: would result in a subquery
[12:38:00] statelesscode: has joined #RubyOnRails
[12:39:12] bricker: has joined #RubyOnRails
[12:40:22] voidDotClass: rvanlieshout, could I also do Student.joins(:schools).where.not('schools.id = 3') ?
[12:40:43] rvanlieshout: cause that would include students who have multiple relationships
[12:40:45] chagel: has joined #RubyOnRails
[12:40:51] rvanlieshout: and would exclude students who don't have any relationship
[12:41:05] djellemah_: has joined #RubyOnRails
[12:41:05] halfamind: has joined #RubyOnRails
[12:41:16] rvanlieshout: there is nothing wrong with a subquery
[12:41:21] halfamind: has joined #RubyOnRails
[12:41:58] ghormoon: has joined #RubyOnRails
[12:42:08] blackmesa: has joined #RubyOnRails
[12:42:16] ghormoon: can I make "RAILS_ENV=production bundle exec rails generate active_record:session_migration" print what exactly it does with the database? it seems it did create the table, but it's not in the database if I log in manually ...
[12:43:11] rubyonrails186: has left #RubyOnRails: ()
[12:43:25] WhatTheRails: has joined #RubyOnRails
[12:43:53] bePolite: has joined #RubyOnRails
[12:44:07] pawnbox_: has joined #RubyOnRails
[12:44:30] workmad3: ghormoon: generate creates a migration... it doesn't run it
[12:44:43] rvanlieshout: which you shouldn't run in production
[12:44:44] workmad3: ghormoon: so the answer to 'what that does with the database' is 'nothing'
[12:46:45] chagel: has joined #RubyOnRails
[12:47:40] ghormoon: sorry, my first experience with this, thnaks :) it's not actual production, just using production settings
[12:48:18] bl0m1: has left #RubyOnRails: ("I'll be bacl")
[12:48:48] rvanlieshout: ghormoon: they shouldn't affect generation of stuff
[12:49:21] ghormoon: rvanlieshout: it actually fails in other environments as the login to database is not set for them
[12:49:45] rvanlieshout: you don't have a development database?
[12:49:49] bob434: has joined #RubyOnRails
[12:50:26] ghormoon: I do, but I have the login set up under production section now :)
[12:50:48] rvanlieshout: then your setup is broken i guess :) you need a proper dev env to create this kind of thing
[12:50:51] krzkrz: has joined #RubyOnRails
[12:51:32] startupality: has joined #RubyOnRails
[12:51:46] royvandermeij: has joined #RubyOnRails
[12:53:12] drbayer: has joined #RubyOnRails
[12:54:55] djellemah: has joined #RubyOnRails
[12:55:23] dionysus69: has joined #RubyOnRails
[12:56:51] guest56: has joined #RubyOnRails
[12:57:02] yellow5: has joined #RubyOnRails
[12:58:46] htmldrum: has joined #RubyOnRails
[12:58:47] htmldrum_: has joined #RubyOnRails
[12:59:22] futilegames: has joined #RubyOnRails
[13:00:17] sandbags: has joined #RubyOnRails
[13:01:02] AimlessRAven: has joined #RubyOnRails
[13:01:23] AimlessRAven: hello, someone knows how to start rails s in ngrok 2.0, in old version i just type ngrok localhost:3000 but now ..
[13:03:41] rvanlieshout: the documentation of ngrok would tell you that
[13:04:20] sandbags: has joined #RubyOnRails
[13:05:50] alho: has joined #RubyOnRails
[13:06:07] pawnbox: has joined #RubyOnRails
[13:07:05] ElFerna: has joined #RubyOnRails
[13:08:11] IrishGringo: has joined #RubyOnRails
[13:08:34] davee_: has joined #RubyOnRails
[13:08:51] pawnbox__: has joined #RubyOnRails
[13:08:53] sandbags: has joined #RubyOnRails
[13:14:54] techsethi: has joined #RubyOnRails
[13:15:06] crystal77: has joined #RubyOnRails
[13:15:33] banister: has joined #RubyOnRails
[13:21:04] mfaeh: has joined #RubyOnRails
[13:21:12] DragonPunch: has joined #RubyOnRails
[13:22:34] |PiP|: has joined #RubyOnRails
[13:26:34] mary5030: has joined #RubyOnRails
[13:26:42] Devalo: has joined #RubyOnRails
[13:28:37] Aherin: has joined #RubyOnRails
[13:29:24] matthias_: has joined #RubyOnRails
[13:29:25] mag42c: has joined #RubyOnRails
[13:30:00] techsethi: has joined #RubyOnRails
[13:30:34] nertzy: has joined #RubyOnRails
[13:32:44] maxx88: has joined #RubyOnRails
[13:33:29] treehug88: has joined #RubyOnRails
[13:35:56] dandaman: has joined #RubyOnRails
[13:38:57] mustmodify: has joined #RubyOnRails
[13:39:02] _Tariq: has joined #RubyOnRails
[13:39:25] mustmodify: A client is asking for guidance on how long it will take to upgrade from Rails 3.2 to 5 once it comes out, vs 4.
[13:40:29] bricker: has joined #RubyOnRails
[13:41:37] arup_r: has joined #RubyOnRails
[13:42:54] Ergo: has joined #RubyOnRails
[13:43:42] stannard: has joined #RubyOnRails
[13:43:58] universa1: depends on how versed you are in upgrading... since it looks like upgrading from 4.2 to 5 isn't so hard... ...not much of a difference
[13:44:05] stannard: has joined #RubyOnRails
[13:45:07] blackmesa: has joined #RubyOnRails
[13:45:42] flashpoint9: has joined #RubyOnRails
[13:49:39] fexilal: has joined #RubyOnRails
[13:50:35] merida: has joined #RubyOnRails
[13:50:36] mary5030: has joined #RubyOnRails
[13:50:52] dandaman1: has joined #RubyOnRails
[13:50:59] artto: has joined #RubyOnRails
[13:52:44] Devalo: has joined #RubyOnRails
[13:56:17] epochwolf: It's not quite that simple.
[13:56:48] epochwolf: If there's a critical gem that works with Rails 4 and not Rails 5, upgrading to 5 could be a lot more difficult.
[13:58:05] epochwolf: Personally, I'd just move that application directly to Rails 5.
[13:59:31] uris: has joined #RubyOnRails
[13:59:49] voidDotClass: i'm trying to do School.all.select { |s| s.open? } but getting a syntax error
[13:59:59] voidDotClass: can you do select on rails collections?
[14:00:00] FooMunki: has joined #RubyOnRails
[14:00:21] arup_r: syntax error or no method error?
[14:01:05] rvanlieshout: voidDotClass: you shoulnd't use School.all.select
[14:01:11] rvanlieshout: (not related to your syntax error)
[14:01:25] rvanlieshout: it will fetch _all_ school entries from the db, create model instances and triggers open?
[14:01:32] rvanlieshout: what is open? for a method?
[14:01:38] arup_r: epochwolf: devise_invitable doesn't work with rails 5.. I tried it last month, no idea about other gems..
[14:01:49] voidDotClass: rvanlieshout, what i'm actually doing is like some_school.students.select { |s| s.gender == male}
[14:02:06] voidDotClass: but syntax error
[14:02:26] epochwolf: voidDotClass: Please gist the exact code you're using and the error message.
[14:02:41] rvanlieshout: arup_r, epochwolf https://github.com/scambra/devise_invitable/pull/619
[14:02:44] voidDotClass: Challenge.first.tasks.select {|t| t.peer_review == true}
[14:02:53] rvanlieshout: voidDotClass: equally bad
[14:02:55] rvanlieshout: don't use select
[14:03:01] rvanlieshout: why not .students.where(gender: :male) ?
[14:03:20] voidDotClass: i had a syntax error in my file
[14:03:21] rvanlieshout: Challenge.first.tasks.where(peer_review: true)
[14:03:29] sandbags: has joined #RubyOnRails
[14:03:43] brendan-: has joined #RubyOnRails
[14:04:14] mja: has joined #RubyOnRails
[14:04:16] arup_r: there are some other bugs then.. I didn't make a PR ofcourse, it was a bug some rails.. a big error..
[14:04:58] rvanlieshout: there currently is no open issue for rails 5
[14:05:33] mja: Hi guys! Is there a way to share instance variable from controller A with controller B when redirecting from A to B?
[14:06:08] rvanlieshout: cause there is a huge gap between triggering action 1 and action 2
[14:06:11] rvanlieshout: namely: the client side
[14:06:19] fryguy: mja: there are ways, but you really don't want to do that. use session or cookies instead
[14:06:36] arup_r: yeah, I see that... I didn't use master then,, but that's a past.. not need now any more
[14:06:43] mja: fryguy: the data i want to share between is too damn big
[14:07:00] fryguy: mja: so use session or cookies to store a pointer to it
[14:07:17] mja: fryguy: I'll take a look
[14:08:18] epochwolf: mja: every request needs to load data from the database (or similar external source) or from something the client inputs.
[14:08:43] epochwolf: You can't just toss stuff in variables and have it around for the next request.
[14:08:46] mja: epochwolf: Yep, but the application I'm working on is a bit mess
[14:08:57] WhatTheRails: I have one form where you can create a new guest user, however the guest user can have a partner. I've created the partner model around the User model as well. Does this code look too bad to accomplish what I just described?
[14:09:02] WhatTheRails: https://gist.github.com/lfaire/e6669402d9a2666bc9ef
[14:09:35] epochwolf: fryguy: there really isn't a way to copy variables between requests. There's no guarrentes the request will be served by the same process or even the same machine.
[14:10:06] WhatTheRails: or any good practice suggestions on this code? https://gist.github.com/lfaire/e6669402d9a2666bc9ef
[14:10:30] fryguy: epochwolf: which is why i said what I said
[14:10:41] configged: has joined #RubyOnRails
[14:10:50] RegulationD: has joined #RubyOnRails
[14:11:40] akshat: has joined #RubyOnRails
[14:14:40] brycesenz: has joined #RubyOnRails
[14:15:30] scope: has joined #RubyOnRails
[14:15:56] tetraktys: has joined #RubyOnRails
[14:16:12] naftilos76: has joined #RubyOnRails
[14:16:56] akshat: has joined #RubyOnRails
[14:18:00] joshkovach: has joined #RubyOnRails
[14:18:45] akshat: has joined #RubyOnRails
[14:19:07] mwlang: when did guard become both the rails runner and watcher? I’m used to running rails server in a separate terminal and guard in another, but I just started a new Rails 4.2 project and guard’s doing double-duty.
[14:19:26] tubbo: mja: use the database :)
[14:19:28] peterhorne: has joined #RubyOnRails
[14:19:29] peterhorne: has left #RubyOnRails: ()
[14:20:00] arup_r: mwlang: lucky :p
[14:20:00] tubbo: mwlang: guard-rails has done that since about 2012 at the very least.
[14:20:25] mwlang: ah! I bet that’s it…first time I’m including “guard-rails"
[14:20:44] artto: has joined #RubyOnRails
[14:20:50] tubbo: that's essentially what it does for you. starts `rails server`, restarts when stuff in config/**/* gets changed.
[14:22:11] mwlang: tubbo: good to know….at the moment, it’s kinda buggin’ me, but I’ll leave it for now and see if I can get used to it.
[14:23:00] mwlang: I’m just ridiculously used to stacking three terminal panes: server, guard, and logger output
[14:24:07] gingray: has joined #RubyOnRails
[14:26:11] flashpoint9: has joined #RubyOnRails
[14:27:36] croberts: has joined #RubyOnRails
[14:29:13] mwlang: speaking of gems…which execjs library are most people using these days? I’ve just been “going with the flow” using therubyracer gem, but have never really peeked under the covers on this one.
[14:29:39] fryguy: most people use node nowadays I think
[14:29:46] disgrntld: has joined #RubyOnRails
[14:32:04] kdough: has joined #RubyOnRails
[14:32:22] mwlang: https://github.com/reactjs/react-rails/issues/222
[14:32:49] scope: has joined #RubyOnRails
[14:33:09] rvanlieshout: ah. so therubyracer remains
[14:33:35] mwlang: looks like it’s the undisputed performance king.
[14:33:42] fryguy: interesting, nodejs was substantially better for us
[14:34:09] fryguy: maybe we should revisit with newer versions of ruby/therubyracer
[14:34:59] Takumo: Hi all, this is odd, I've just created a new mailer and while it works in development, if I try to do it in my staging env (after a capistrano deploy), I get a NameError that it can't be found :/
[14:35:19] rvanlieshout: Takumo: sure you restarted the thing that is trying to access the mailer?
[14:35:31] kies: has joined #RubyOnRails
[14:35:37] Takumo: rvanlieshout: I did a cap staging puma:stop && cap staging puma:start to be sure
[14:36:12] flashpoint9: has joined #RubyOnRails
[14:36:23] rvanlieshout: did you verify that actually did what you expect? and are you accessing it from sidekiq or something similar?
[14:37:28] mustmodify: fryguy: I would be interested in seeing a survey about that.
[14:38:13] meekohi_: has left #RubyOnRails: ()
[14:39:36] Takumo: rvanlieshout: well I'm using #deliver_later for activejob but not using sidekiq or anything, its failing to find the mailer class itself
[14:39:50] rvanlieshout: and in a console?
[14:40:33] Takumo: FooMailer.class => Uninitialized constant FooMailer
[14:40:46] Takumo: for some reason
[14:40:51] Takumo: its not there...
[14:40:58] Takumo: ok this is probably a "me" problem!
[14:41:02] bricker: has joined #RubyOnRails
[14:41:06] fryguy: somebody forgot to check something into version control :)
[14:42:07] Takumo: fryguy: no, some git forgot to push
[14:44:11] Takumo: oh no wait, looking at the capistrano logs those commits *were* deployed... and the files *are* in git...
[14:45:04] workmad3: Takumo: is it failing to find the mailer when queuing the job, or when trying to perform the job? what activejob backend are you using?
[14:45:07] rvanlieshout: Takumo: but do they also exist on the deploy target?
[14:45:18] Takumo: ok I think I solved it
[14:46:16] rubyonrails847: has joined #RubyOnRails
[14:51:57] philtr: has joined #RubyOnRails
[14:52:44] zave: has joined #RubyOnRails
[14:52:52] dionysus69: has joined #RubyOnRails
[14:54:37] P4Titan: has joined #RubyOnRails
[14:55:50] JakFrist: has joined #RubyOnRails
[14:56:18] apeiros: any opinions/takes on rails+openapi (aka "swagger")?
[14:56:31] P4Titan: Hello all. If I want to make a form on a webpage, which is preferred, using form_tag or using form_for, but with a table-less model?
[14:59:30] workmad3: P4Titan: if you've got a model (that supports ActiveModel::Naming at a minimum, iirc) I'd opt for form_for
[15:00:06] P4Titan: but should I make a model that supports ActiveModel::Naming w/o any db action
[15:00:14] P4Titan: and use form_for, or simply use form_tag
[15:00:16] workmad3: sure, that's what it's there for
[15:00:28] workmad3: there's even a name for the pattern - form objects :)
[15:01:00] workmad3: some projects even go exclusively for form objects backing forms and avoid using ActiveRecord subclasses in forms at all
[15:01:22] P4Titan: should I add: extend ActiveModel::Naming
[15:01:26] P4Titan: is that all
[15:01:52] speakingcode: has joined #RubyOnRails
[15:02:10] tubbo: apeiros: isn't rails is already an API framework? never saw a need for swagger...
[15:02:28] tubbo: apeiros: what exactly does OpenAPI give you?
[15:02:37] Detch: has joined #RubyOnRails
[15:02:54] mwlang: apeiros: I was looking at this last year…looks like a few interesting developments in last few months.
[15:03:08] universa1: tubbo: mostly nice looking documentation ;)
[15:03:09] P4Titan: workmad3: So, should I create my own .rb file in app/models, create a class in it, and extend accordingly
[15:03:52] apeiros: tubbo: integration into 3rd party software. rails doesn't exactly define a standard for how the API should look like.
[15:03:54] tubbo: universa1: we just started giving raddocs a shot for our API gem: https://github.com/smartlogic/raddocs
[15:04:15] workmad3: P4Titan: that's pretty much it... certainly worth a try, as `form_for` forms are normally easier to deal with in rails :)
[15:04:27] adavia: has joined #RubyOnRails
[15:04:48] P4Titan: workmad3: Is it bad practice to create your own files in app.
[15:04:51] universa1: tubbo: ohh this looks interesting, gonna have a look
[15:04:54] P4Titan: letting the scaffolding do the work
[15:05:13] tubbo: apeiros: that's true...though personally i'm wary of adding unnecessary structural constraints to my API without stakeholders or whatever saying "no we NEED to do this for reasons <X> and <Y>"
[15:05:59] tubbo: that said, rails implicitly standardizes API requests and responses in some way, because a lot of devs (my company included) stick with the standard json formatting of { "object_name
[15:06:05] workmad3: P4Titan: not at all... scaffolding is really only there to help newcomers get the hang of things, and occasionally speed up simple generations for more experienced devs
[15:06:14] tubbo: { "object_name": { "attribute": "value" } }
[15:06:16] tubbo: fucking keyboard
[15:06:28] apeiros: tubbo: that's assuming there aren't other stakeholders :) I'm working for a company which is held by a larger parent company which uses openapi.
[15:06:29] Irikos: has joined #RubyOnRails
[15:07:02] tubbo: apeiros: well, good on you then...you don't have to worry about designing your API structure :)
[15:07:46] apeiros: to a degree I do. also I do have to figure whether rails is actually the proper ruby framework with openapi.
[15:08:10] mwlang: apeiros: so what’s the idea with this? write the API specs and docs in YAML, get Rails routes, controllers, specs generated automatically?
[15:08:19] tubbo: apeiros: why wouldn't it be?
[15:08:30] tubbo: why wouldn't rails be the "proper" ruby framework to use with openapi*
[15:09:53] apeiros: mwlang: the idea is to have less work when integrating parts from different sections of the company on an API level. the question I'm occupied with is what's the best way to go there with ruby.
[15:10:51] apeiros: tubbo: because maybe there's a framework X which is specifically built with openapi in mind, or maybe there's concepts in openapi which conflict with concepts from rails.
[15:10:52] tubbo: frankly if you're using ruby, it really boils down to what framework YOU want to work with. both rails and sinatra and even bare rack apps can do basically the same thing(s)
[15:10:54] apeiros: I'm just starting to dig
[15:11:00] tubbo: ahh i see what you mean, yeah
[15:11:29] apeiros: and I thought maybe somebody else already was at the point I'm now and has some valuable insights :)
[15:11:55] artto: has joined #RubyOnRails
[15:11:58] apeiros: I'd prefer to use rails, since that's what I and the team are already familiar with
[15:12:16] tubbo: apeiros: rails definitely provides a lot more for you than any other framework.
[15:12:44] RegulationD: has joined #RubyOnRails
[15:12:46] tubbo: use rails-api and generate the app with `rails-api new` (or, in the 5.x series, `rails new --api`) so all the unnecessary bits are turned off
[15:13:55] workmad3: apeiros: there's some stuff for swagger in grape, but it's not the nicest stuff to use or figure out what's going on behind the scenes
[15:14:20] apeiros: tubbo: rails5's api stuff is openapi compliant?
[15:14:38] brycesenz: has joined #RubyOnRails
[15:14:39] apeiros: I have to admit I didn't look into rails5 yet because oracle (*swings fist*)
[15:15:13] workmad3: apeiros: it's no more compliant than rails currently is... it's just rails-api is integrated into rails now, and it provides you with a lighterweight controller base-class to build on
[15:15:23] dopie: has joined #RubyOnRails
[15:15:28] apeiros: (oracle driver for ruby is usually a bit behind, so we usually have to wait ~6 months before we can use a new rails version)
[15:15:57] tubbo: apeiros: i think you'll need to define the constraints around what you think "openapi compliant" means...as far as i can tell, there's nothing openapi needs that rails can't provide.
[15:16:04] cpruitt: has joined #RubyOnRails
[15:16:24] tubbo: but yeah, rails-api and rails 5's --api in the generator are practically the same thing.
[15:16:25] apeiros: tubbo: the question is more "what repetitive work can rails remove from me"
[15:16:30] P4Titan: I have this simply code: http://pastie.org/10770045 In my view, I use a form_for referencing @test_form. However, what is the purpose of instantiating this instance variable. Is/can it be used anywhere? Are any of the input form values saved in it?
[15:16:45] apeiros: or: "which wheels will I not have to reinvent myself using rails"
[15:17:19] tubbo: apeiros: well ActiveModel::Serializers will probably help out a lot. if there's no OpenAPI driver yet, you can write one.
[15:17:25] tubbo: but that's not really part of rails, it's just a gem
[15:17:38] bePolite: has joined #RubyOnRails
[15:17:40] |PiP|: has joined #RubyOnRails
[15:17:41] apeiros: see, "you can write one" would be one of those wheels I'd prefer to not have to invent myself ;-)
[15:17:54] chouhoul_: has joined #RubyOnRails
[15:18:10] tubbo: one big +1 to rails use is that it has generators, and you can `rails g generator` your own ones, so you can customize your own framework in that sense.
[15:18:32] tubbo: apeiros: you're over-estimating what "writing a driver for AMS" means.
[15:18:46] adaedra: rails g generator, so meta
[15:18:55] smathy: has joined #RubyOnRails
[15:19:16] akshat_: has joined #RubyOnRails
[15:19:45] apeiros: tbh, generators haven't convinced me in the past. they only reduce work at the very beginning and usually not that much.
[15:19:54] Irikos: has joined #RubyOnRails
[15:20:05] P4Titan: any thoughts?
[15:20:07] tubbo: apeiros: afaik there's no turnkey gem that will just do this work for you :)
[15:20:10] cpruitt: apeiros: Are you asking a “why should I use rails?” question?
[15:20:30] cpruitt: Or am I missing a specific requiorement for a project?
[15:20:45] halfamind: has joined #RubyOnRails
[15:21:02] tubbo: nor does that exist for any API spec
[15:21:11] apeiros: cpruitt: similar, but it's a bit more narrow. I'm asking two things mainly: "are there conflicts between rails and openapi?" (seems answer is "no", or "none known")
[15:21:33] tubbo: P4Titan: just makes the view a little nicer. you can just do form_for TestForm.new as well..
[15:21:37] apeiros: and "those rails (+ some gem) provide me with improved tools to deal with openapi?"
[15:21:40] Ergo^: has joined #RubyOnRails
[15:21:44] apeiros: *does, not those
[15:21:49] drbayer: has joined #RubyOnRails
[15:21:51] krzkrz: has joined #RubyOnRails
[15:22:08] mustmodify: has left #RubyOnRails: ()
[15:22:09] griffindy: has joined #RubyOnRails
[15:22:18] workmad3: apeiros: yeah, there aren't any conflicts between rails and openapi, as you really just need to get the responses from a rails controller to match some standard representation to be 'compliant' and there's nothing stopping that
[15:22:26] apeiros: cpruitt: but yeah, one of the potential answers is "use framework X for openapi stuff, it's better suited"
[15:22:47] P4Titan: tubbo: But are any of the input values saved/accecable from this instance variable after form submittal?
[15:22:54] cpruitt: P4Titan: The variable you have there can be used anywhere in your view. Generally your form would submit to another action (e.g. create) and your controller would create a new instance and use that to save. Save wouldn’t generally be done in the same view. Setting the variable in the controller is better if you have to setup default values on an unsaved instance.
[15:22:57] workmad3: apeiros: it's just how much work there is in generating those representations easily... you could probably get some way there with AMS fairly simply, or you could see if Roar has openapi/swagger presenters, etc.
[15:22:58] fexilal: Hi, why does <% provide(title, 'Homepage') %> work but <% provide (title, "Homepage") %> give an 'Unexpected ')' expecting end keyword' error?
[15:23:17] apeiros: roar is from apotonick?
[15:23:21] tubbo: P4Titan: not really. you're in a separate request, the page reloads.
[15:23:25] tubbo: P4Titan: !xy
[15:23:25] helpa: P4Titan: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[15:23:28] workmad3: apeiros: but the closest I know of a gem actively aimed at swagger is the grape-swagger gem for grape docs
[15:23:45] workmad3: apeiros: yeah, that's the one iirc
[15:23:48] smathy: apeiros, yes.
[15:24:16] workmad3: I know roar has json-api, not sure about openapi/swagger
[15:24:24] apeiros: ok, will certainly take a look at both roar and grape-swagger
[15:24:33] P4Titan: tubbo: What is the purpose of having the instance variable there when it is not used anywhere?
[15:25:21] workmad3: apeiros: grape-swagger made my team-lead almost ragequit when he looked at the code, so consider yourself warned on that part :)
[15:25:25] tubbo: P4Titan: well one benefit is that you can use the same form partial for both new and edit views.
[15:25:26] workmad3: *almost made
[15:25:39] apeiros: tubbo, workmad3: in fantasy fairy land I'd imagine a framework which would allow me to deal with openapi stuff similar as to how AR lets me deal with databases.
[15:25:53] apeiros: workmad3: uh-oh :D
[15:26:18] P4Titan: tubbo: ie have a case in the function which will render one or another way, which within the rendered views, it access the same instance variable
[15:26:25] tomatoes: has joined #RubyOnRails
[15:26:29] smathy: P4Titan, the instance variables are the API between your controller and your view.
[15:26:43] smathy: P4Titan, they're how the controller passes information to the view.
[15:27:03] cpruitt: P4Titan: I’m not sure what you mean “when it is not used anywhere”. Try sharing your view code as well as controller.
[15:27:07] tubbo: P4Titan: like this https://gist.github.com/tubbo/5f104eba536cdf8e5c9e
[15:27:20] tubbo: apeiros: if literally anyone else used OpenAPI that would probably be the case ;)
[15:27:22] halfamind: has joined #RubyOnRails
[15:28:50] workmad3: apeiros: and yeah, that would be a nice fantasy land :) the closest would probably be a driver for AMS or Roar to get the responses into the right format for direct requests, and if you were willing to do some more work, you could probably have API endpoints automatically generate doc endpoints too (although grape has nicer features here than plain rails)
[15:28:59] P4Titan: tubbo: In ur code, how/where is the render call for edit/new placed
[15:29:36] apeiros: I think I'll dig into the swagger docs now
[15:29:45] apeiros: tubbo & workmad3 - thanks for your time and infos :)
[15:29:46] tubbo: P4Titan: they're separate view files.
[15:30:01] P4Titan: because I have a single form which is rendered at the end of my data_entry function
[15:30:03] Irikos: has joined #RubyOnRails
[15:30:13] P4Titan: a single view*
[15:30:21] P4Titan: how come you have two?
[15:30:40] workmad3: apeiros: yw... did some investigation into similar areas recently, so may as well share the bits I picked up :)
[15:30:41] cpruitt: Because create & edit are often separate views
[15:30:48] tubbo: P4Titan: it's a demonstration.
[15:31:12] tubbo: P4Titan: demonstrating why you might want @test_form as an ivar instead of just TestForm.new
[15:31:27] smathy: P4Titan, have you been through any sort of Rails tutorial or guide?
[15:36:07] P4Titan: smathy: Not officially per se
[15:36:12] tubbo: ...so no ;)
[15:36:41] smathy: P4Titan, I don't know what that means, but you need to. These questions are at like step 3 of 10,000.
[15:36:59] P4Titan: I usually find that doing and failing is a good way to learn
[15:37:21] smathy: P4Titan, ok good, so go do that on your own.
[15:37:57] baweaver: has joined #RubyOnRails
[15:38:04] delgiudices: has joined #RubyOnRails
[15:38:05] P4Titan: :| that sounds a tad condescending. I always come w/ good intentions
[15:38:33] pawnbox: has joined #RubyOnRails
[15:40:04] bmalum: has joined #RubyOnRails
[15:41:37] smathy: P4Titan, it's probably just you misunderstanding what this channel is for, we're really not for holding someone's hand through the very initial stages of Rails. Your questions are at such a basic level that you would answer them yourself if you just went through a tutorial or the guides.
[15:42:30] tubbo: P4Titan: most people don't come in here with bad intentions :) other humans are better suited for stuff that tutorials/guides/basic documentation hunting can't help you with.
[15:42:43] cpruitt: P4Titan: I tend to learn the same way you do, so I get it. But at the same time you’re falling into a trap I used to fall into a lot. You’re trying to figure out the why & how of what rails is doing without just going through & getting a working “thing” first. Get your first create / edit down & then go back & say “now why is it done this way”.
[15:43:45] P4Titan: cpruitt: I can see that
[15:43:48] cpruitt: P4Titan: Case in point, you’re creating variables & then asking “why is this variable being created”. Go through a couple tutorials and you’ll probably have that answered.
[15:44:31] cpruitt: If you ask us here we’re just going to be able tell you “because you’re going to need it shortly”.
[15:45:01] P4Titan: well, most places, it just drops the variable and it looked superfluous
[15:45:09] smathy: P4Titan, your question today, about variables, would be like going to a driving instructor to learn how to drive, and asking him to explain why people use a key in the ignition to start the car.
[15:45:09] P4Titan: i've gtg, so bai!
[15:45:42] P4Titan: has left #RubyOnRails: ("party")
[15:46:06] delgiudices: has joined #RubyOnRails
[15:46:50] chipotle: has joined #RubyOnRails
[15:49:16] jottr: has joined #RubyOnRails
[15:49:53] artto: has joined #RubyOnRails
[15:50:25] wroos: has joined #RubyOnRails
[15:52:08] delgiudices: has joined #RubyOnRails
[15:53:48] VeryBewitching: has joined #RubyOnRails
[15:56:00] scope: has joined #RubyOnRails
[15:57:28] baweaver: has joined #RubyOnRails
[16:00:03] delgiudices: has joined #RubyOnRails
[16:01:54] chouhoulis: has joined #RubyOnRails
[16:02:48] [Butch]: has joined #RubyOnRails
[16:04:00] arup_r: What you people use to catch why app pages are loading slow? yes I use chrome devtool and rails server log, bullet gems.. any much better things you experts know and want to say me?
[16:05:59] timdotrb: has joined #RubyOnRails
[16:06:42] Zackio: has joined #RubyOnRails
[16:07:21] mwlang: arup_r: are you using Haml templates?
[16:07:33] arup_r: mwlang: no plain erb ..
[16:07:44] nerium: has joined #RubyOnRails
[16:07:59] fexilal: why does <% provide(title, 'Homepage') %> work but <% provide (title, "Homepage") %> give an 'Unexpected ')' expecting end keyword' error?
[16:08:24] mwlang: arup_r: ok, I was going to suggest the hamlit gem which gave me a huge performance boost in one of our view-heavy apps — just found it last week.
[16:08:32] jottr: Hi all. When I have something like this in my routes.rb: get '/404', to: 'errors#custom'
[16:08:50] mwlang: arup_r: but mostly, I just watch the logs and the number of queries and activity going on there.
[16:08:57] jottr: Can I somehow request this page in a browser? I.e. without actually causing a 404?
[16:09:11] arup_r: fexilal: you have a gap between method name and `(`
[16:09:19] arup_r: that is invalid to Ruby parser
[16:09:38] arup_r: fexilal: method_name args and method_name(args) are only valid
[16:10:02] arup_r: mwlang: I am doing same... page loads like 1.47 sec in avg..
[16:10:22] fexilal: arup_r : thanks
[16:10:24] smathy: arup_r, your logs tell you the breakdown.
[16:10:30] uglybandersnatch: has joined #RubyOnRails
[16:10:34] arup_r: but sometimes, my manager is saying it takes way too much time to load... so not sure how to track it
[16:10:57] smathy: 1.47 second average sounds way too long to me.
[16:10:58] bronson: has joined #RubyOnRails
[16:11:44] smathy: ...but if you mean that sometimes it takes much longer, then for that sort of thing I use tools like honeybadger, new relic, to give me slow page reports.
[16:12:27] arup_r: let me google
[16:12:41] Hates_: arup_r: rack-mini-profiler and newrelic
[16:13:05] Hates_: arup_r: newrelic developmode specifically
[16:13:43] silverdust: yea arup_r the last time I had an issue of paperclip delaying first byte time for my cdn uploads new relic led me straight to the problem
[16:14:07] silverdust: I realized paperclip doesn't play fine with Rackspace
[16:14:09] voidDotClass: has joined #RubyOnRails
[16:14:44] arup_r: ok, I will ask them to buy it for me.. thanks all
[16:14:49] pwnd_nsfw: carrierwave is for winners
[16:15:02] silverdust: I'm on that team now
[16:15:04] pawnbox_: has joined #RubyOnRails
[16:15:08] Hates_: arup_r: buy what?
[16:15:10] silverdust: arup_r: there's a free plan
[16:15:26] arup_r: ok. I thought I need buy plans... I was looking at honeybadger
[16:15:28] jhack: has joined #RubyOnRails
[16:15:33] silverdust: I didn't pay up to $0.0001 on mine
[16:15:52] Hates_: arup_r: sort out the problem locally with the free tools first. even newrelic has a free tier
[16:16:35] smathy: arup_r, FWIW, I found the honeybadger UI much better than NewRelic, and their prices are better.
[16:16:48] Hates_: arup_r: you can even run rack-mini-profiler in production too. and just load it when you need
[16:17:14] Hates_: does Honeybadger have a free plan?
[16:18:19] Hates_: I can't even see where they offer performance insights?
[16:18:21] naftilos76: has joined #RubyOnRails
[16:18:29] arup_r: Hates_: no, https://www.honeybadger.io/pages/plans :)
[16:18:57] Hates_: AFAIK honeybadger is not comparable to NewRelic
[16:19:03] Hates_: Something like Skylight would be
[16:19:21] smathy: Hates_, you're mistaken, they do very similar things.
[16:19:59] smathy: I've always wanted the extra features of the paid plans, $90 a month is a trivial cost compared to the hourly rate of chasing problems down without those tools.
[16:20:16] Quintasan: Is there any way to prevent devise from setting the cookies after registering and confirming or changing password? I'm trying to set up a simple reset password view for my API but once you reset your password you get "logged in" and if you get another password reset email the controller redirects you to root_path
[16:20:40] Hates_: smathy: while there is crossover NewRelic is performance orientated where as HoneyBadger is error orientated no?
[16:20:48] smathy: Hates_, no.
[16:20:55] smathy: Hates_, I can't keep repeating myself.
[16:21:15] merida: has joined #RubyOnRails
[16:21:16] Hates_: smathy: I'm just going by exactly what they pitch themselves as
[16:21:42] griffindy: has joined #RubyOnRails
[16:22:09] d0nn1e: has joined #RubyOnRails
[16:22:13] Hates_: smathy: ah, ok I see they've expanded their performance monitoring now. I take it back
[16:25:03] ivanskie: has joined #RubyOnRails
[16:25:10] AzaToth: has joined #RubyOnRails
[16:25:44] ivanskie: what happened to the rubyonrails site?
[16:26:15] ivanskie: such a drastic change from previous layout
[16:27:08] Hates_: It went full 37Signals
[16:28:25] shinnya: has joined #RubyOnRails
[16:30:20] ivanskie: makes sense
[16:30:35] ivanskie: pushin 5.0 pretty hard there
[16:31:05] n008f4g_: has joined #RubyOnRails
[16:35:23] ascarter: has joined #RubyOnRails
[16:35:58] delgiudices: has joined #RubyOnRails
[16:36:06] Darmani: has joined #RubyOnRails
[16:36:42] Darmani: Radar: Breh
[16:36:56] Maletor: has joined #RubyOnRails
[16:37:18] merida_: has joined #RubyOnRails
[16:37:41] Irikos: has joined #RubyOnRails
[16:39:21] voidDotClass: has joined #RubyOnRails
[16:40:16] FooMunki: has joined #RubyOnRails
[16:43:10] flashpoint9: has joined #RubyOnRails
[16:44:22] mrgreenfur: has joined #RubyOnRails
[16:46:37] petor: has joined #RubyOnRails
[16:47:47] Pazician: has joined #RubyOnRails
[16:47:57] hahuang61: has joined #RubyOnRails
[16:53:25] djellemah: has joined #RubyOnRails
[16:53:53] halfamind: has joined #RubyOnRails
[16:55:24] tubbo: ivanskie: they updated it a few months ago when they announced rails 5. pretty sure it was at railsconf or something.
[16:55:47] trinaldi: has joined #RubyOnRails
[16:55:56] djbkd: has joined #RubyOnRails
[16:56:30] Irikos: has joined #RubyOnRails
[16:57:50] ascarter: has joined #RubyOnRails
[16:58:02] axl_: has joined #RubyOnRails
[16:59:56] sleungcy: has joined #RubyOnRails
[17:00:41] jfelchner: has joined #RubyOnRails
[17:00:56] bronson: has joined #RubyOnRails
[17:01:07] jenrzzz: has joined #RubyOnRails
[17:01:46] yellow5: has joined #RubyOnRails
[17:01:51] muhammadn: has joined #RubyOnRails
[17:01:56] bronson: has joined #RubyOnRails
[17:04:08] audy: has joined #RubyOnRails
[17:05:21] baweaver: has joined #RubyOnRails
[17:07:53] rogue_koder: has joined #RubyOnRails
[17:08:44] brycesenz: has joined #RubyOnRails
[17:10:42] Disavowed: has joined #RubyOnRails
[17:10:46] bob434: has joined #RubyOnRails
[17:12:01] sloggerkhan: has joined #RubyOnRails
[17:12:19] scope: has joined #RubyOnRails
[17:14:09] bePolite: has joined #RubyOnRails
[17:14:09] bePolite: has joined #RubyOnRails
[17:14:32] halfamind1: has joined #RubyOnRails
[17:17:30] sneakerhax: has joined #RubyOnRails
[17:18:37] flashpoint9: has joined #RubyOnRails
[17:18:55] czerasz: has joined #RubyOnRails
[17:19:17] arup_r: has joined #RubyOnRails
[17:21:23] halfamind: has joined #RubyOnRails
[17:25:24] KensoDev: has joined #RubyOnRails
[17:26:13] delgiudices: has joined #RubyOnRails
[17:26:13] th0m_: has joined #RubyOnRails
[17:26:37] nettoweb: has joined #RubyOnRails
[17:27:59] siaW: has joined #RubyOnRails
[17:29:30] sloggerkhan: I'm trying to figure out how to extend/wrap the default/built in logger. Pretty much I'd like to keep using the default/built in one, but write a subset of messages to Redis. Is this something I could do with a custom formatter, or is there a better approach? Most of the things I've found in Google have to do with using entirely different log systems.
[17:29:51] baweaver: has joined #RubyOnRails
[17:30:05] tubbo: SloggerKhan: why not have a redis logger?
[17:30:11] tubbo: like, two separate Logger objects
[17:31:15] sloggerkhan: I don't think I know what you mean. Can I have multiple loggers? If I have multiple loggers what controls when each one logs?
[17:31:51] baweaver: has joined #RubyOnRails
[17:31:59] sloggerkhan: Or do you mean having ones that have to be manually called rather than triggered by logger.info or whatnot.
[17:31:59] tubbo: SloggerKhan: you pass the filename to the Logger when you instantiate it
[17:32:07] tubbo: redis_logger = Logger.new 'log/redis.log'
[17:32:17] tubbo: regular_logger = Logger.new "log/#{Rails.env}.log"
[17:32:37] sloggerkhan: Ah, and then I'd have to call both separately, no?
[17:32:43] tubbo: that would allow you to support different log formats, multiple log levels, etc.
[17:32:46] tubbo: SloggerKhan: yes
[17:33:12] tubbo: SloggerKhan: if you could gist what you have in mind, like how you want to use this new Logger class, i might be able to help you choose what the right way to go is
[17:33:50] DoctorMonocular: has joined #RubyOnRails
[17:33:52] tubbo: there's a few ways to extend objects in Ruby, trouble is figuring out "The Best" way to do it.
[17:33:58] _Sypheren_: has joined #RubyOnRails
[17:34:19] smoitra: has joined #RubyOnRails
[17:34:56] sloggerkhan: I'd like to avoid the complexity of keeping track of multiple calls that are sometimes redundant. I think I can make a gist that outlines the behavior I'd like, it's not that complicated.
[17:36:24] baweaver: has joined #RubyOnRails
[17:36:41] PaulePanter: Hi. http://api.rubyonrails.org/classes/ActiveRecord/Relation.html
[17:36:51] PaulePanter: Where can I find where `each()` is implemented?
[17:37:15] smathy: PaulePanter, !xyproblem
[17:37:15] helpa: PaulePanter: http://mywiki.wooledge.org/XyProblem
[17:39:46] PaulePanter: smathy: Sorry.
[17:39:56] GreatDanton: has joined #RubyOnRails
[17:40:09] smathy: PaulePanter, apology not needed, let's just get to your real problem.
[17:40:12] PaulePanter: Several database systems should be supported, and there there is code doing.
[17:40:56] PaulePanter: http://paste.debian.net/418147/
[17:41:05] PaulePanter: termin_relations is accessed afterward.
[17:41:46] PaulePanter: Now the question is, what is when SQLite is used? Then termin_relation is nil and my collegue introduced a `if termin_relation`, which I find ugly.
[17:42:22] PaulePanter: Because it’s further down, and somebody reading the code in some months or unacquainted will not understand it.
[17:42:26] smathy: PaulePanter, else raise "NOPE!"
[17:42:39] norc_: has joined #RubyOnRails
[17:42:42] PaulePanter: That’s what I thought too.
[17:42:56] smathy: PaulePanter, I imagine a lot of things will break if they're using an unsupported DB.
[17:43:01] yellow5: has joined #RubyOnRails
[17:43:01] PaulePanter: Further down the code is `termin_relation.each`.
[17:43:12] smathy: PaulePanter, won't matter if you raise.
[17:43:26] PaulePanter: So I though about adding `termin_relation.to_a.each` and that’s why I wanted to know how `each` is implemented.
[17:43:50] PaulePanter: On the console it looked like it would be converted to an array. (looking at the return value).
[17:44:31] PaulePanter: smathy: I know, but the next questions are for my Rails understanding. ;-)
[17:44:49] smathy: PaulePanter, if you really wanted then just: else termin_relation = ContentRelation.none
[17:44:51] sloggerkhan: tubbo: I'm envisioning something like this: https://gist.github.com/anonymous/7c5fb5462fb883801c47
[17:45:24] weaksauce: has joined #RubyOnRails
[17:45:30] ascarter: has joined #RubyOnRails
[17:46:06] bmalum: has joined #RubyOnRails
[17:47:18] tubbo: SloggerKhan: that's what i thought. you could do something like this if you wish: https://gist.github.com/tubbo/6d1197e5c12541149ac0
[17:47:19] smathy: PaulePanter, most of AR is very complex, so I'm not sure where that `each` is defined, probably it's one of the Arel ones, Node or Whereis or something.
[17:48:05] beauby: has joined #RubyOnRails
[17:48:06] smathy: PaulePanter, knowing the call stack for that `each` call isn't really going to help you understand Rails better.
[17:48:55] pwnd_nsfw: has joined #RubyOnRails
[17:49:03] ihsw: has joined #RubyOnRails
[17:49:04] ihsw: hi i'm trying to set use_transactional_fixtures to false but i keep getting an undefined method error -- what gives?
[17:49:07] tubbo: SloggerKhan: that will just log to whatever you set in LoggerKhan.new('path/to/your.log') unless the arguments match your requirements, and just send all the args to redis_logger.add
[17:49:20] PaulePanter: smathy: Thanks. It would answer my question, if adding `to_a` would have a downside.
[17:49:48] roshanavand1: has joined #RubyOnRails
[17:49:50] pwnd_nsfw: has joined #RubyOnRails
[17:50:08] DoubleMalt: has joined #RubyOnRails
[17:50:18] smathy: PaulePanter, potentially.
[17:50:25] sloggerkhan: Looks like something along the lines of what I'd like to do is pretty straightforward, then. Though I think I explained myself slightly badly as the "redis_log" isn't a separate log, it's just a subset of entries I'd like in a Redis data structure in addition to the log file.
[17:50:50] pwnd_nsfw: has joined #RubyOnRails
[17:52:03] tubbo: SloggerKhan: ahh i see what you mean
[17:52:39] ihsw: when i run my tests i am getting "ActiveRecord::StatementInvalid: PG::ObjectInUse: ERROR: cannot drop the currently open database" and i don't want rspec to drop my database, how do i prevent it dropping the database:
[17:52:43] tubbo: SloggerKhan: in that case, i'd advise opening the redis connection when the Logger is instantiated, and then overriding `logger.close` to also close your Redis connection.
[17:53:03] sloggerkhan: That makes sense.
[17:53:11] tubbo: ihsw: your test database should be droppable at any moment.
[17:53:32] ihsw: tubbo: it is droppable, but i don't want it to be.
[17:53:37] tubbo: ihsw: why?
[17:53:41] ihsw: because i don't.
[17:53:46] tubbo: ihsw: that's a stupid reason
[17:53:48] ihsw: my intentions are irrelevant.
[17:54:26] smathy: ihsw, probably meant that they don't want it to be *dropped*, not "droppable"
[17:54:28] ihsw: tubbo: so how do i prevent rspec from attempting to drop my database?
[17:54:29] tubbo: ihsw: the test db is supposed to be dropped before every test run and then re-created with the schema and fixture data.
[17:54:44] ihsw: tubbo: that is very fascinating but it is not desirable for me.
[17:54:53] dionysus69: has joined #RubyOnRails
[17:54:54] tubbo: then i think it truncates each table so you always start with the same dat
[17:55:27] solars: has joined #RubyOnRails
[17:55:40] smathy: ihsw, rspec doesn't drop the DB by default, it's something in your configuration.
[17:55:53] JoshGlzBrk: has joined #RubyOnRails
[17:55:54] ihsw: i have found that i can set `config.use_transactional_fixtures = false` but when i use that, i get an method undefined error.
[17:56:37] smathy: ihsw, why wouldn't you want transactional fixtures? What do you *think* that has to do with dropping the DB?
[17:57:03] ihsw: smathy: i have no interest in justifying my goals.
[17:57:06] fryguy: ihsw: you should pay attention to the fact that basically everybody communicating with you is telling you the same thing
[17:57:16] mrgreenfur: Anyone ever use spark or flink with rails? Anyone know a ruby-friendly alternative?
[17:57:18] tubbo: ihsw: my advice is to write less shitty tests so you don't have this problem.
[17:57:21] ihsw: fryguy: that is interesting but it is unrelated.
[17:57:29] ihsw: tubbo: my tests are fine.
[17:57:54] smathy: ihsw, just that you come in asking about a DB being dropped, and you go off talking about transactional fixtures as if it's related. I think you have a misunderstanding.
[17:57:57] ihsw: tubbo: thank you for your advice. is there a way to turn this functionality off?
[17:58:05] JoshGlzBrk: has joined #RubyOnRails
[17:58:18] baweaver: has joined #RubyOnRails
[17:58:30] ihsw: smathy: yes i do have a misunderstanding. when i run my tests, rspec is configured to drop the database. i would like for it to stop doing this.
[17:59:19] ihsw: i am really trying to be respectful guys, i understand the value in fixtures and having well-formed tests, but right now i want to turn this feature off.
[17:59:45] arup_r: has joined #RubyOnRails
[17:59:55] ihsw: i appreciate the advice but i do not at all appreciate being judged, especially being accused of writing shitty tests.
[18:00:37] scope: has joined #RubyOnRails
[18:01:29] ihsw: if it's any consolation, i am using containers for my rails app and my database server, so the state is guaranteed to be fresh and my tests will be fine.
[18:02:09] tildes: has joined #RubyOnRails
[18:02:13] tubbo: ihsw: it's just that you came in here with this super defensive attitude so i'm just baiting you into being more defensive. usually people will break down and tell me about some stupid shit that they're doing, then i say "no just do it this way", and they're better off.
[18:02:36] tubbo: ihsw: that said...i think smathy is right. the db should NOT be dropped between rspec runs, just truncated. so i would look in your config where you're doing that
[18:02:43] tubbo: or if you're running rake db:reset on the container ever, because that'll do it.
[18:03:46] statelesscode: has joined #RubyOnRails
[18:03:54] ihsw: tubbo: it isn't defensive to assert that what i'm doing is fine, and that i have no interest in your guidance. i did not come here for guidance, just some technical help because i am unable to articulate what i want to google.
[18:04:20] manfrin: has joined #RubyOnRails
[18:04:49] smathy: ihsw, as I said 10 minutes ago: rspec doesn't drop the DB by default, it's something in your configuration.
[18:04:54] ihsw: i'm new to rails, activerecord, and rspec. i will look at my config, and i can post it in a gist. would that help?
[18:05:05] tubbo: ihsw: you using DatabaseCleaner?
[18:05:27] ihsw: tubbo: i don't know, this is a new rails project with all the default gems.
[18:05:29] fryguy: ihsw: can you reproduce your behavior from a minimal rails hello world appliation
[18:05:51] ihsw: here is my gemfile https://gist.github.com/ihsw/fd8fa6dde19520e59fc8
[18:05:59] ihsw: and here is my respec config https://gist.github.com/ihsw/25dd7f977fc3f9b6ae39
[18:07:18] tubbo: ihsw: looks good to me.
[18:07:20] ihsw: fryguy: this is a minimal rails hello world, i am starting out a new rails project. https://github.com/galactic-filament/crazy-train/tree/master/app
[18:08:10] fryguy: ihsw: could you do what you want to do with something other than the test database?
[18:08:12] ihsw: i haven't yet committed the database code.
[18:08:46] baweaver: has joined #RubyOnRails
[18:08:47] ihsw: fryguy: it happened after i added the database connection info to the database.yml file.
[18:09:08] theblang: has joined #RubyOnRails
[18:09:26] ihsw: i have committed the new database configuration, it is here. https://github.com/galactic-filament/crazy-train/blob/master/app/config/database.yml
[18:10:05] tubbo: i've never heard of anyone running tests within a docker container
[18:10:14] gingray: has joined #RubyOnRails
[18:11:05] ihsw: tubbo: i don't see it as any different than using a vagrant box, except less heavyweight.
[18:11:08] arup_r: has joined #RubyOnRails
[18:11:40] tubbo: ihsw: well, i've never heard of anyone running tests within a VM either :) what i meant was that most people tend to run tests on their local workstation. it's much faster to run and iterate on.
[18:11:49] arup_r: not able to install any gems from rubygems.org .. seems something wrong there.. ping rubygems.org keep giving timeout.. :(
[18:11:56] fryguy: tubbo: you'd be surprised
[18:11:58] tubbo: arup_r: status.rubygems.org has the info you need :)
[18:12:09] fryguy: I think running tests on local workstation is a pretty bad idea for any reasonably sized organization
[18:12:20] scope_: has joined #RubyOnRails
[18:13:16] tubbo: fryguy: i mean, we're 130 people building like 10-15 projects a year...and we run tests locally. of course we also have CI...as well as a staging server and production server for each app. so at some point, all of the test runs get "converged" onto the same system.
[18:13:41] tubbo: fryguy: i haven't worked for a company in the last 6 years who ran their tests on anything other than local workstations and CI.
[18:14:10] matthias_: has joined #RubyOnRails
[18:14:11] fryguy: tubbo: well the CI part of that is important
[18:14:11] tubbo: there hasn't been very many issues that i could've caught by running tests in a container or VM cluster similar to my prod environment
[18:14:33] fryguy: lots of people package standardized setups for dev environments too, so you are less likely wto write something that runs locally but not in production
[18:14:38] arup_r: thanks tubbo.. trying now.. I didn't know it
[18:15:23] ihsw: tubbo: it's a personal preference tbh, i could install it all locally but i'm not comfortable littering my box with stuff.
[18:15:59] bronson: has joined #RubyOnRails
[18:16:49] tubbo: ihsw: i think your personal preferences are getting in the way of learning rails in this case, unfortunately.
[18:17:05] smathy: ihsw, gist your full backtrace with the PG::ObjectInUse: ERROR
[18:17:14] ihsw: tubbo: i'll keep that in mind.
[18:18:22] tubbo: ihsw: with that said, how is `extends:` working out for you? i'm happy that docker-compose has that...really saves time not having to re-build the same app container twice.
[18:18:51] ihsw: smathy: here is the backtrace. https://gist.github.com/ihsw/da312877c12f148c7bc9
[18:18:55] RegulationD: has joined #RubyOnRails
[18:19:34] ihsw: tubbo: ah, extends is good. i can't work without it now.
[18:19:55] scope_: has joined #RubyOnRails
[18:20:05] ihsw: one of the things i like about my current setup is i can git clone, run ./bin/build-images, and then docker-compose run test
[18:21:07] ihsw: you could subtitute it with git clone, bundle install, and bundle exec rake, but there might be dependencies missing or something else.
[18:21:46] RegulationD: has joined #RubyOnRails
[18:22:01] crankharder: any ideas why i'm getting this error from search with these options? only happens when I add the function_score in https://gist.github.com/josh-m-sharpe/f280fbd3eeca51684cd6
[18:22:12] crankharder: *elasticsearch
[18:22:19] tubbo: ihsw: why not run docker-compose up? doesn't that build the images and then immediately start them?
[18:23:33] ihsw: tubbo: the intention of up is to start something that will be long running, eg an actual rails server, whereas run is for one-off tasks, eg: running tests.
[18:23:45] scope__: has joined #RubyOnRails
[18:23:52] ascarter: has joined #RubyOnRails
[18:24:21] ihsw: up also does port mapping, and if you already have something on port 80 then it will be in the way.
[18:26:08] ihsw: granted, running tests won't try to listen on a port, so it's mostly semantic.
[18:26:57] kalimotxo: has joined #RubyOnRails
[18:27:43] siaW: has joined #RubyOnRails
[18:28:23] ihsw: is there a difference between capybara/rspec and rspec-rails?
[18:28:28] halfamind: has joined #RubyOnRails
[18:29:32] fryguy: ihsw: yes, a pretty big one
[18:29:39] axl_: has joined #RubyOnRails
[18:29:49] fryguy: capybara is for manipulating web browsers and such, whereas rails is just the framework-level tests
[18:30:02] rakm: has joined #RubyOnRails
[18:30:51] ihsw: fryguy: hmm interesting.
[18:31:16] ivanskie: has joined #RubyOnRails
[18:31:30] kalimotxo: has joined #RubyOnRails
[18:32:51] akshat: has joined #RubyOnRails
[18:33:12] scope_: has joined #RubyOnRails
[18:35:00] scope: has joined #RubyOnRails
[18:35:36] tubbo: capybara - the only test framework that lets you browse reddit.
[18:35:59] davee_: has joined #RubyOnRails
[18:37:08] intrigueD: has joined #RubyOnRails
[18:37:12] matthias_: has joined #RubyOnRails
[18:40:31] srinidhi: has joined #RubyOnRails
[18:41:18] moeabdol2: has joined #RubyOnRails
[18:42:43] scope: has joined #RubyOnRails
[18:43:54] kalimotxo: has joined #RubyOnRails
[18:45:06] mikecmpbll: has joined #RubyOnRails
[18:45:44] Devalo: has joined #RubyOnRails
[18:46:20] scope_: has joined #RubyOnRails
[18:47:09] [Butch]: has joined #RubyOnRails
[18:47:20] gabr13l: has joined #RubyOnRails
[18:47:28] ur5us: has joined #RubyOnRails
[18:47:56] AlvaroFernandoMS: has joined #RubyOnRails
[18:48:49] beauby: has joined #RubyOnRails
[18:49:14] Mattx: has joined #RubyOnRails
[18:49:52] Mattx: Hey. What's the fastest way to assing a new object to another one through a HABTM if I don't want to check on the DB if it's already linked?
[18:50:17] scope: has joined #RubyOnRails
[18:50:51] Mattx: For instance: owner.cars.push Car.create_with(color: "black").find_or_create_by foo: 123
[18:51:04] Mattx: this will fail in case the given owner already have that car
[18:51:24] jenrzzz: has joined #RubyOnRails
[18:52:06] Synthead: has joined #RubyOnRails
[18:52:33] tubbo: assing haha
[18:52:42] tubbo: you're not getting away with that one!
[18:53:11] tubbo: but yeah i'm not sure how to resolve that sorry
[18:54:09] LuisC: has joined #RubyOnRails
[18:57:43] scope: has joined #RubyOnRails
[18:59:29] terrorista: has joined #RubyOnRails
[19:00:34] terrorista: has joined #RubyOnRails
[19:00:44] brycesenz: has joined #RubyOnRails
[19:00:47] slash_nick: hmm... in controller tests, are any of you able to get a response with status 400 just by calling params.require(:does_not_exist) in the controller action? I'm expecting a 400 response status, but the MissingParameter exception doesn't get handled/rescued from
[19:01:13] slash_nick: I don't know if I'm expecting the wrong thing out of an actioncontroller test case or if there's a bug here
[19:01:13] croberts: has joined #RubyOnRails
[19:01:55] terrorista: how can I count all votes from a list of posts ?
[19:02:23] slash_nick: terrorista: that depends... :)
[19:02:23] tubbo: terrorista: posts.sum { |post| post.votes.count }
[19:02:34] tubbo: put that in your code and smoke it
[19:02:45] fryguy: hurray n+1 slow query
[19:03:15] tubbo: iirc you can also do posts.sum '<partial sql query here>'
[19:03:47] slash_nick: fryguy: nothing stopping someone from eager loading there
[19:04:16] slash_nick: terrorista: i say it depends... i don't know if you want to count "yes" votes versus "no" votes... or whether a vote is a vote is a vote... or what
[19:04:28] edwinvdgraaf: has joined #RubyOnRails
[19:05:24] terrorista: I want to count like if I have 2 post, one with 1 upvote and 1 downvote, and the other with 1 up ---> 3 votes
[19:05:50] gabr13l: I just noticed in a has_many/belongs_to association (User has many Posts) .new doesn’t set the user_id but create does. Why is that?
[19:06:06] edwinvdgraaf: has joined #RubyOnRails
[19:06:30] baweaver: has joined #RubyOnRails
[19:06:54] yfeldblum: has joined #RubyOnRails
[19:07:41] gabr13l: I’m working from the console. i’m able to properly create an association from the command line w/ create but I can’t do it from my app. here is the code. https://gist.github.com/cgcardona/87c6edbbd6cb86ab5dbc
[19:08:19] gabr13l: I’m sure this is basic but my google fu is failing me ATM.
[19:09:15] slash_nick: terrorista: Vote.where(post_id: [1,2,3,4]).count
[19:09:15] scope: has joined #RubyOnRails
[19:09:27] slash_nick: the post_id array is your list of posts
[19:10:08] pawnbox: has joined #RubyOnRails
[19:11:15] sarink: has joined #RubyOnRails
[19:11:30] terrorista: <%= performance_indicator.improvement_actions.count %> I count all my posts like this . is it possible to do something close to that ?
[19:11:57] edwinvdg_: has joined #RubyOnRails
[19:12:03] fryguy: gabr13l: show the console code you are using successful
[19:13:10] slash_nick: terrorista: if you want to do it effeciently, my suggestion is good (i think)
[19:13:35] slash_nick: terrorista: do you have any code written for what you're trying to do? if you share that we might can work with you
[19:14:22] Sadin: has joined #RubyOnRails
[19:15:14] voidDotClass: What's the best way to validate an input date to see if its in YYYY-MM-DD format?
[19:16:32] terrorista: https://gist.github.com/luisamaro0/a1d91aee9f112c891c7d
[19:16:47] terrorista: im trying to put the counter there
[19:18:18] slash_nick: terrorista: if you're eager loading already, that's not bad... are ya?
[19:18:26] baweaver: has joined #RubyOnRails
[19:18:50] pwnd_nsfw: has joined #RubyOnRails
[19:19:24] slash_nick: terrorista: something like @performance_indicators = PerformanceIndicators.includes(improvement_actions: :votes).where(...) ... please do read: http://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations
[19:19:45] scope: has joined #RubyOnRails
[19:19:48] gabr13l: fryguy: https://gist.github.com/cgcardona/c518a50b577390cb22f3 Note that from the command line `create` properly sets the `user_id` on the Post but `new` + `save` does not.
[19:20:27] tubbo: voidDotClass: !g ruby regular expressions
[19:20:38] slash_nick: terrorista: also, you *would* want to change votes.count to votes.length with this approach
[19:20:38] voidDotClass: chronic gem was the answer
[19:20:47] blackmesa: has joined #RubyOnRails
[19:21:08] tubbo: voidDotClass: a bit more heavy, but definitely works. :)
[19:21:28] djellemah_: has joined #RubyOnRails
[19:21:48] scope_: has joined #RubyOnRails
[19:21:49] gingray_: has joined #RubyOnRails
[19:21:58] gabr13l: I guess I could refactor my `create` action to use `create` w/ `valid?` instead of `new` and `save` but I feel like i’m close to a solution w/ my current code.
[19:22:16] drbayer: has joined #RubyOnRails
[19:23:20] cnk: has joined #RubyOnRails
[19:24:05] HalcyonicStorm: has joined #RubyOnRails
[19:24:51] smathy: voidDotClass, Date.parse(d).to_s(:db) == d
[19:24:53] humbledaisy: has joined #RubyOnRails
[19:25:41] smathy: ...and rescue ArgumentError
[19:28:29] terrorista: it doesnt recognize votes
[19:29:12] slash_kick: terrorista: not sure what you mean... actual output por favor?
[19:29:33] terrorista: undefined local variable or method `votes' for
[19:30:31] slash_kick: terrorista: and what code generated that?
[19:30:38] terrorista: but i dont know what to put in where tho
[19:30:54] slash_kick: terrorista: share with me the controller action that sets @performance_indicators please
[19:31:00] futilegames: has joined #RubyOnRails
[19:32:11] gingray: has joined #RubyOnRails
[19:32:36] terrorista: https://gist.github.com/luisamaro0/a1d91aee9f112c891c7d
[19:32:50] terrorista: i updated with performanceIndicator controller and improvement actions controller
[19:33:27] Radar: GOOD MORNING
[19:33:59] delgiudices: I can code for free master
[19:34:21] gabr13l: Good afternoon Radar
[19:35:07] scope: has joined #RubyOnRails
[19:35:36] slash_kick: terrorista: https://gist.github.com/luisamaro0/a1d91aee9f112c891c7d#gistcomment-1730964
[19:36:16] pawnbox: has joined #RubyOnRails
[19:36:58] djbkd: has joined #RubyOnRails
[19:38:23] crdpink2: has joined #RubyOnRails
[19:39:23] solars: has joined #RubyOnRails
[19:39:27] blackmesa: has joined #RubyOnRails
[19:40:29] terrorista: Association named 'votes' was not found on ImprovementAction; perhaps you misspelled it? . the error was here: <% @performance_indicators.each do |performance_indicator| %>
[19:42:41] scope: has joined #RubyOnRails
[19:44:01] Radar: terrorista: hi again luis
[19:45:07] Radar: terrorista: update gist to show model please
[19:45:13] kiloreux: has joined #RubyOnRails
[19:46:30] scope_: has joined #RubyOnRails
[19:46:49] kiloreux: terrorista : sounds like dangerous name :p
[19:47:05] ur5us: has joined #RubyOnRails
[19:47:09] intrigueD: has joined #RubyOnRails
[19:47:12] terrorista: https://gist.github.com/luisamaro0/a1d91aee9f112c891c7d
[19:51:04] beauby: has joined #RubyOnRails
[19:51:05] SteenJobs: has joined #RubyOnRails
[19:51:22] axl_: has joined #RubyOnRails
[19:52:15] mrgreenfur: has joined #RubyOnRails
[19:52:17] slash_kick: terrorista: where is your performance_indicator.rb model?
[19:52:18] ppnlo: has joined #RubyOnRails
[19:52:41] slash_kick: nevermind! "acts_as_votable"
[19:52:46] slash_kick: let me check int othat
[19:52:59] queuetue: has joined #RubyOnRails
[19:54:04] scope: has joined #RubyOnRails
[19:54:08] slash_kick: it uses polymorphic relationships
[19:55:00] B1n4r10: has joined #RubyOnRails
[19:56:13] jfelchner_: has joined #RubyOnRails
[19:56:32] jon31: has joined #RubyOnRails
[19:56:52] Ergo: has joined #RubyOnRails
[19:57:38] veduardo: has joined #RubyOnRails
[19:58:03] jkahn: has joined #RubyOnRails
[19:58:08] terrorista: i dont know how to count all the improvement votes
[19:58:25] terrorista: only for one
[19:59:26] creature: has joined #RubyOnRails
[19:59:26] creature: has joined #RubyOnRails
[20:00:00] guacamole: has joined #RubyOnRails
[20:01:45] robbyoconnor: has joined #RubyOnRails
[20:03:09] veloutin: has joined #RubyOnRails
[20:03:34] Marquel: has joined #RubyOnRails
[20:04:06] zave: has joined #RubyOnRails
[20:04:17] gmas: has joined #RubyOnRails
[20:04:50] shinnya: has joined #RubyOnRails
[20:05:07] scope: has joined #RubyOnRails
[20:06:04] bool_: has joined #RubyOnRails
[20:06:05] russt: has joined #RubyOnRails
[20:07:15] _Sypheren_: has joined #RubyOnRails
[20:08:50] gingray: has joined #RubyOnRails
[20:08:53] kt2: has joined #RubyOnRails
[20:09:14] scope_: has joined #RubyOnRails
[20:10:10] jkahn: has joined #RubyOnRails
[20:11:19] uglybandersnatch: has joined #RubyOnRails
[20:11:42] siaW: has joined #RubyOnRails
[20:11:44] IrishGringo: has joined #RubyOnRails
[20:12:49] pwnd_nsfw: has joined #RubyOnRails
[20:15:10] baweaver: has joined #RubyOnRails
[20:15:54] epitron: has joined #RubyOnRails
[20:16:43] scope: has joined #RubyOnRails
[20:17:10] pawnbox: has joined #RubyOnRails
[20:17:40] cgfbee: has joined #RubyOnRails
[20:20:40] scope_: has joined #RubyOnRails
[20:22:21] Ergo: has joined #RubyOnRails
[20:22:30] cd-rum: has joined #RubyOnRails
[20:23:43] sarink: has joined #RubyOnRails
[20:27:23] jkahn: has joined #RubyOnRails
[20:28:05] Wolfram74: has joined #RubyOnRails
[20:28:15] scope_: has joined #RubyOnRails
[20:28:19] Wolfram74: the eventmachine and websocket-rails channels are pretty dead...
[20:29:08] scepticulous: has joined #RubyOnRails
[20:29:12] czerasz: has joined #RubyOnRails
[20:30:41] adaedra: It's not dead; it's asynchronous.
[20:31:49] john__: has joined #RubyOnRails
[20:33:49] _Sypheren_: has joined #RubyOnRails
[20:35:02] Wolfram74: adaedra: I'm mixed on how to respond to your exceptionally well phrased sass :p
[20:35:21] mdw: has joined #RubyOnRails
[20:36:00] systemsgotyou: how hard is it to get a remote web dev job as complete junior (never worked in a company but I do have expereince and a github accnt)
[20:37:31] hahuang61: has joined #RubyOnRails
[20:38:20] fryguy: full time remote? probably pretty hard
[20:38:35] kt2: has joined #RubyOnRails
[20:39:30] systemsgotyou: then going full time
[20:39:42] smathy: has joined #RubyOnRails
[20:40:40] jenrzzz: has joined #RubyOnRails
[20:42:03] matthias_: has joined #RubyOnRails
[20:44:01] VeryBewitching: systemsgotyou: In my opinion, it would be in your best interest to work in house for someone for at least a couple of years before trying to get a remote job. Proven skills in the workplace would be essentially a must before I would hire a remote developer.
[20:44:34] akshat: has joined #RubyOnRails
[20:44:48] srinidhi1: has joined #RubyOnRails
[20:45:48] smathy: systemsgotyou, very hard for remote.
[20:47:25] fryguy: you'll learn so much more in person
[20:47:29] fryguy: and scale your pay so much faster
[20:48:34] Pazician: has joined #RubyOnRails
[20:48:46] cd-rum_: has joined #RubyOnRails
[20:49:27] Wolfram74: I worked in house for about half a year, then left the bay because I was really not enjoying the town
[20:49:52] Wolfram74: been working part time as a teacher in iowa city and kind of just doing my own thing
[20:50:27] halfamind: has joined #RubyOnRails
[20:50:27] VeryBewitching: systemsgotyou: !rule12
[20:50:27] helpa: systemsgotyou: Do not PM members of the channel without first asking if that is OK.
[20:51:07] VeryBewitching: Well, you have already so..
[20:51:38] mhoungbo: has joined #RubyOnRails
[20:51:47] beauby: has joined #RubyOnRails
[20:52:20] halfamind: has joined #RubyOnRails
[20:52:57] halfamind: has joined #RubyOnRails
[20:53:32] halfamind: has joined #RubyOnRails
[20:54:17] thebastl: has joined #RubyOnRails
[20:54:42] diegoaguilar: has joined #RubyOnRails
[20:55:50] blackmesa: has joined #RubyOnRails
[20:57:44] treehug88: has joined #RubyOnRails
[20:58:54] yellow5: has joined #RubyOnRails
[20:59:56] ppnlo: has joined #RubyOnRails
[21:00:59] jenrzzz: has joined #RubyOnRails
[21:02:00] WhatTheRails: has joined #RubyOnRails
[21:02:20] WhatTheRails: Any good practice recommendations on this piece of controller code? https://gist.github.com/lfaire/e6669402d9a2666bc9ef
[21:03:02] WhatTheRails: other than the password being hardcoded (it's there just for testing purposes)
[21:05:44] manfrin: has joined #RubyOnRails
[21:05:55] smathy: @user = User.new_for_event user_params.merge event: current_user.event And use accepts_nested_attribute_for for the partner - you might need to override partner_attributes= to add the extra stuff in there.
[21:07:20] SteenJobs: has joined #RubyOnRails
[21:08:39] speakingcode: has left #RubyOnRails: ()
[21:09:11] lemur: has joined #RubyOnRails
[21:10:45] meoblast001: has joined #RubyOnRails
[21:14:50] superlou: has joined #RubyOnRails
[21:15:37] uglybandersnatch: has joined #RubyOnRails
[21:18:20] ionas: has joined #RubyOnRails
[21:18:45] siaW: has joined #RubyOnRails
[21:19:29] tildes: has joined #RubyOnRails
[21:19:53] WhatTheRails: smathy: I tried using accepts_nested_attribute_for but since I'm rendering the form using React, it got a bit complicated
[21:20:05] ppnlo: has joined #RubyOnRails
[21:21:18] ppnlo: has joined #RubyOnRails
[21:21:51] sarink: has joined #RubyOnRails
[21:22:19] WhatTheRails: smathy: But I guess it's not that bad then ?
[21:23:28] Disavowed: has joined #RubyOnRails
[21:24:24] B1n4r10: has joined #RubyOnRails
[21:26:16] manfrin: has joined #RubyOnRails
[21:27:26] baweaver: has joined #RubyOnRails
[21:30:33] ppnlo: has joined #RubyOnRails
[21:31:04] ppnlo: has joined #RubyOnRails
[21:32:59] hahuang61: has joined #RubyOnRails
[21:33:03] Devalo: has joined #RubyOnRails
[21:35:22] arBmind: has joined #RubyOnRails
[21:36:17] yfeldblum: has joined #RubyOnRails
[21:36:23] mrbubbles: has joined #RubyOnRails
[21:36:59] netzfisch: has joined #RubyOnRails
[21:43:56] bamorim: has joined #RubyOnRails
[21:50:25] uglybandersnatch: has joined #RubyOnRails
[21:52:34] beauby: has joined #RubyOnRails
[21:55:45] gabr13l: can someone point me docs for creating the actions and form for a User has_many posts relations ship? I have this current association https://gist.github.com/cgcardona/87c6edbbd6cb86ab5dbc and you can see from the command line code https://gist.github.com/cgcardona/c518a50b577390cb22f3 that I’m able to create the association from the command line w/ create but not new and i’m unable to create the association from the app w/ new and save.
[21:55:53] samael_: has joined #RubyOnRails
[21:56:56] dnewkerk: has joined #RubyOnRails
[21:57:44] _Sypheren_: has joined #RubyOnRails
[21:57:54] stannard: has joined #RubyOnRails
[21:58:06] smathy: gabr13l, !gist-usage <-- for next time, hint: you can multiple files to one gist!
[21:58:06] helpa: gabr13l: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[21:58:29] ionas: has left #RubyOnRails: ()
[21:58:46] jenrzzz: has joined #RubyOnRails
[21:58:47] gabr13l: smathy: i realize that. Thanks. Those are just two gists from a conversation that I had in here earlier. I hadn’t consolidated them.
[21:59:21] smathy: gabr13l, right, why make it easy for the people you're asking right. Anyway, here's a guide to how to do what you want: http://guides.rubyonrails.org/form_helpers.html#nested-forms
[21:59:31] weaksauce: anyone have any success on places like freelancer.com or what's a better site for that stuff?
[22:00:25] samael_: has left #RubyOnRails: ()
[22:00:26] gabr13l: ok i’ll check that out. thanks. i didn’t mean to make it difficult for anyone.
[22:00:36] smathy: weaksauce, yes, for lead generation. You have to view your first job with any client there as a loss-leader.
[22:00:55] htmldrum: has joined #RubyOnRails
[22:00:56] htmldrum_: has joined #RubyOnRails
[22:01:03] rails_newbie: has joined #RubyOnRails
[22:01:04] weaksauce: smathy nice. that loss leader doesn't affect your prices later?
[22:01:25] rails_newbie: has left #RubyOnRails: ()
[22:01:26] VeryBewitching: gabr13l: If you're ever questioning how to do something, I would go back to the guides first. If you need more information on the API, see http://devdocs.io/
[22:02:03] VeryBewitching: gabr13l: The Ruby and Rails documentation is there as well.
[22:02:10] gabr13l: ok thanks.
[22:04:09] smathy: weaksauce, definitely there are some people on there who are just about cost, you can usually tell who they are during the bidding conversations.
[22:04:50] smathy: weaksauce, I usually bring it up there too, that I'm just using this as a lead gen thing, and people understand. I've had some clients offer to pay me more because they were so happy with the work.
[22:05:03] weaksauce: smathy: makes sense. do you have an estimate of % that continue on to be future customers?
[22:05:10] smathy: weaksauce, caveat: I haven't done it for at least 10 years.
[22:06:28] JakFrist: has joined #RubyOnRails
[22:06:50] weaksauce: just trying to figure out some buffer work during downtimes
[22:07:04] weaksauce: appreciate the insight very much
[22:07:39] Baphom3t: has joined #RubyOnRails
[22:07:55] baweaver: has joined #RubyOnRails
[22:08:39] Baphom3t: Hey guys! I'm new on RoR. I'm using MacOS 10.10 and when I try to create a new rails application I got this error msg: Could not locate Gemfile
[22:08:51] Baphom3t: Any help will be great, thanks!
[22:09:12] pwnd_nsfw: What are you using to create the rails application?
[22:09:15] pwnd_nsfw: what command
[22:09:32] pwnd_nsfw: or at least give us step by step till you get the error
[22:09:40] Baphom3t: pwnd_nsfw: rails news app-name
[22:10:07] weaksauce: Baphom3t you can make one `bundle init` but do you have an alias to rails?
[22:11:02] Baphom3t: weaksauce: bundle init works
[22:11:13] Baphom3t: :D thank you guys!
[22:11:20] weaksauce: Baphom3t yeah that just makes a gemfile in the current directory
[22:12:09] Baphom3t: weaksauce: rly thanks for the help :)
[22:13:01] halfamind: has joined #RubyOnRails
[22:14:48] manfrin: has joined #RubyOnRails
[22:15:10] techsethi: has joined #RubyOnRails
[22:16:09] Baphom3t: weaksauce: when I try run rails server on app directory, I got more error msgs...
[22:16:13] siaW: any help with this? http://stackoverflow.com/questions/36144793/devise-omniauth-twitter-twitter-gem-updating-attributes
[22:16:33] weaksauce: Baphom3t !gist
[22:16:37] Baphom3t: Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2
[22:16:37] Baphom3t: Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7
[22:16:37] Baphom3t: Ignoring pg-0.18.4 because its extensions are not built. Try: gem pristine pg --version 0.18.4
[22:16:40] weaksauce: !gist Baphom3t
[22:16:40] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[22:18:08] _Sypheren: has joined #RubyOnRails
[22:18:13] mdw: has joined #RubyOnRails
[22:18:24] Baphom3t: Here: http://pastebin.com/08qHh5TC
[22:19:15] Baphom3t: http://pastie.org/10770426
[22:19:31] weaksauce: Baphom3t gist is preferred but that works
[22:19:51] weaksauce: Baphom3t try bundle install from that directory
[22:19:59] weaksauce: and then bundle exec rails s
[22:20:42] Baphom3t: Bundle complete and the same error msgs
[22:21:41] Baphom3t: weaksauce: http://pastie.org/10770427
[22:21:43] weaksauce: did you try `bundle exec rails s`
[22:22:15] Baphom3t: yes, the result is here: http://pastie.org/10770427
[22:22:46] smathy: has joined #RubyOnRails
[22:23:16] Baphom3t: I followed this guide to install rails https://gorails.com/setup/osx/10.10-yosemite
[22:23:19] weaksauce: bundle exec ruby -v
[22:23:37] Baphom3t: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
[22:23:46] weaksauce: there you go
[22:23:54] bob434: has joined #RubyOnRails
[22:24:03] weaksauce: kill rvm and use the ruby from that guide
[22:24:44] Baphom3t: weaksauce: sry, but how can I kill that? oO
[22:24:55] Arcaire: rvm implode
[22:25:22] weaksauce: rvm implode will do that. it completely uninstalls rvm (hopefully)
[22:25:25] intrigueD: has joined #RubyOnRails
[22:25:59] weaksauce: use rbenv to switch rubies like they say in the tutorial
[22:26:51] gabr13l: smathy and VeryBewitching I got it working. Thanks again for your help. I’m very grateful. 👍🏼
[22:27:08] VeryBewitching: Happy to hear it gabr13l
[22:27:10] Baphom3t: Ok guys, I'll try it here! thks again
[22:27:29] havenwood: The preferred way to install Ruby is to first use RVM, implode RVM and use rbenv, then finally rm -rf rbenv and use chruby.
[22:29:26] cnk: havenwood: lol
[22:29:54] Wolfram74: has left #RubyOnRails: ()
[22:30:14] weaksauce: I skipped rbenv... did i do something wrong havenwood :D
[22:30:21] kiloreux: has joined #RubyOnRails
[22:32:42] jenrzzz: has joined #RubyOnRails
[22:32:42] jenrzzz: has joined #RubyOnRails
[22:33:58] pwnd_nsfw: I'm still on the first step
[22:35:43] cnk: pwnd_nsfw: me too. Not broken so...
[22:37:26] cnk: But thank goodness someone in the python community copied rbenv. I was hating virtualenv until I found pyenv
[22:38:19] quazimodo: has joined #RubyOnRails
[22:40:02] alevy: has joined #RubyOnRails
[22:41:30] ktchup: has joined #RubyOnRails
[22:44:31] jenrzzz: has joined #RubyOnRails
[22:49:19] weaksauce: cnk do they have a better version of pip yet?
[22:49:32] weaksauce: or something as good as bundler
[22:49:50] Arcaire: Pip is ok.
[22:49:53] Arcaire: pip -r requirements.txt
[22:50:05] cnk: I don't know how well pip does dependency resolution so can't really say
[22:50:10] Arcaire: Quite well.
[22:50:19] jottr: has joined #RubyOnRails
[22:50:31] weaksauce: Arcaire yeah but what about dev/testing/deploy environments in the same file?
[22:50:40] mr-spoon: has joined #RubyOnRails
[22:50:48] cnk: the main thing I was missing was cd into a directory and get a resonable env. .pyenv took care of that
[22:51:12] Arcaire: weaksauce: Works fine.
[22:51:16] Arcaire: pip freeze
[22:51:24] Arcaire: Then you have the equivalent of Gemfile.lock.
[22:51:38] cnk: weaksauce: the python projects I have seen use separate requirements files
[22:51:54] weaksauce: cnk yeah that's what I figured they do
[22:52:19] chipotle: has joined #RubyOnRails
[22:52:34] weaksauce: Arcaire in rails we can have a testing block inside the gemfile and you can put stuff like stubbing out email or mocking objects etc.
[22:52:48] weaksauce: i guess they don't care to have it in one file.
[22:53:36] beauby: has joined #RubyOnRails
[22:54:11] Trynemjoel: has joined #RubyOnRails
[22:54:23] Arcaire: #explicitness
[22:55:03] delgiudices: has joined #RubyOnRails
[22:55:56] uglybandersnatch: has joined #RubyOnRails
[22:56:22] silentpost: has joined #RubyOnRails
[22:58:31] kies: has joined #RubyOnRails
[22:59:16] baweaver: has joined #RubyOnRails
[23:05:33] hahuang61: has joined #RubyOnRails
[23:09:59] Spami: has joined #RubyOnRails
[23:11:17] ktchup: has joined #RubyOnRails
[23:13:10] mostlybadfly: has joined #RubyOnRails
[23:13:34] roshanavand1: has joined #RubyOnRails
[23:16:15] kpwarr: Hello. I was going through my codebase, making it conform to my rubocop linter. When I changed `class ActiveSupport::TestCase` to the nested definition version, it caused an error. These are not syntactically equivalent?
[23:16:47] kpwarr: i.e. `class ActiveSupport \ class TestCase`
[23:16:47] Inside: has joined #RubyOnRails
[23:16:47] Inside: has joined #RubyOnRails
[23:16:59] smathy: No they're not.
[23:17:01] smathy: What's the error?
[23:17:20] kpwarr: i.e. `class ActiveSupport \ class TestCase`
[23:17:29] kpwarr: oops "TypeError: ActiveSupport is not a class"
[23:17:43] smathy: kpwarr, right, do you have any idea how to fix it?
[23:18:53] Radar: ActiveSupport is not a class
[23:18:54] kpwarr: oh, does that mean it's a module or something? whoops
[23:18:57] Radar: the error is correct
[23:19:05] smathy: kpwarr, exactly, yes.
[23:20:09] smathy: kpwarr, FWIW, when you are sure something is going to be defined, and if you're not relying on the namespace for constant lookups, then there's nothing at all wrong with `class ActiveSupport::TestCase`
[23:20:34] IrishGringo: has joined #RubyOnRails
[23:20:53] roshanavand1: has joined #RubyOnRails
[23:21:21] kpwarr: smathy: ok thanks!
[23:21:39] smathy: kpwarr, you're welcome.
[23:22:49] delgiudices: has joined #RubyOnRails
[23:25:14] sarink: has joined #RubyOnRails
[23:29:29] manfrin: has joined #RubyOnRails
[23:32:03] mrgreenfur: has joined #RubyOnRails
[23:34:37] uglybandersnatch: has joined #RubyOnRails
[23:36:15] czerasz: has joined #RubyOnRails
[23:36:43] terrorista: can anyone tell me why does my collapse button works normally in a tab and the other don't ?
[23:36:57] terrorista: the same button, but one tabs orders by recent and the other by oldest
[23:37:38] DLSteve: has joined #RubyOnRails
[23:38:56] smathy: Is there a bunch of context from some earlier conversation that I'm missing here terrorista? That question gives almost no information at all.
[23:40:48] terrorista: i have a button that if I click it slides information from the bottom
[23:41:32] terrorista: <button type="button" class="btn btn-default stat-item" data-toggle="collapse" data-parent="#accordion" href="<%= "#collapse_#{improvement_action.id}" %>"> <span class="glyphicon glyphicon-pencil"></span> Comments (<%= improvement_action.comments.count %>) </button>
[23:41:39] terrorista: ups too big for here
[23:42:28] Ropeney: has joined #RubyOnRails
[23:42:34] SteenJobs: has joined #RubyOnRails
[23:45:34] terrorista: https://gist.github.com/luisamaro0/10362ea6ff02160b7848
[23:46:19] terrorista: I have 3 tabs, that just change the order of the posts. in each tab there is a button that collapses, but I dont know why it only works in the first tab
[23:46:35] mikecmpbll: has joined #RubyOnRails
[23:47:23] pwnd_nsfw: has joined #RubyOnRails
[23:48:01] smathy: terrorista, wow, and you make that work with just HTML?
[23:48:08] beauby: has joined #RubyOnRails
[23:48:35] xlegoman: has joined #RubyOnRails
[23:48:43] _Tariq: has joined #RubyOnRails
[23:50:13] terrorista: bootstrap makes the rest
[23:50:19] DragonPunch: has joined #RubyOnRails
[23:52:00] smathy: terrorista, ok, so I'm not sure I'm seeing the Rails angle here.
[23:52:11] smathy: Sounds like you need a bootstrap expert.
[23:52:21] halfamind: has joined #RubyOnRails
[23:52:30] DragonPunch: When there is a def someDefHere in the applications controller for a ruby app, what does that mean?
[23:53:36] smathy: DragonPunch, what do you think it means?
[23:53:50] DragonPunch: smathy ... It's a function?
[23:54:17] smathy: DragonPunch, ok, that's what I was afraid you were asking. You seriously need to learn some ruby before trying to attack a Rails app.
[23:54:22] DragonPunch: like in api_controllers.rb
[23:54:57] smathy: DragonPunch, go with any of the help links on this page: https://www.ruby-lang.org/en/documentation/
[23:56:40] bob434: has joined #RubyOnRails
[23:59:35] bePolite: has joined #RubyOnRails
[23:59:35] bePolite: has joined #RubyOnRails