« Back to channel list

#RubyOnRails - 11 April 2016

« Back 1 day Forward 1 day »
[00:00:40] Ropeney: 250k sounds good to me
[00:01:00] FailBit: hnanon: tried goworker?
[00:01:05] delgiudices: but is there something like average?
[00:01:46] Arcaire: SteenJobs: Rarely.
[00:01:57] SteenJobs: Arcaire: sup dude
[00:02:00] Arcaire: Basically "when there's no other way to do it". There often is a RESTful way to do it.
[00:02:13] Arcaire: delgiudices: Where are you located?
[00:02:20] diegoaguilar: has joined #RubyOnRails
[00:02:21] delgiudices: Dominican republic
[00:02:37] delgiudices: Here average salary is $3
[00:02:55] SteenJobs: Arcaire: yea, and my default is to think of a restful way to do it, but i keep finding myself, with this platform in particular, in a situation where breaking convention would make sense - especially because many of the user flows for this platform are multi-step
[00:03:31] Radar: hnanon: sidekiq
[00:03:51] Arcaire: delgiudices: Yeah you'd be looking at around $10-15.
[00:03:53] Radar: SteenJobs: depends on many different factors
[00:04:07] SteenJobs: have you written anything on the topic?
[00:04:23] SteenJobs: it’s obviously a very nebulous question because it’s so context dependent
[00:04:33] Radar: SteenJobs: !r4ia ;)
[00:04:33] helpa: SteenJobs: 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
[00:04:41] SteenJobs: i know and have it!
[00:04:44] Radar: It would help if there was an example you're asking about.
[00:04:58] SteenJobs: hmm, so i guess in this particular case (there are a bunch of cases in this app):
[00:05:27] stupidystupid: has joined #RubyOnRails
[00:06:22] jstransky: has joined #RubyOnRails
[00:06:59] SteenJobs: there are brands and agencies, agencies create bids on projects belonging to brands. in the bid acceptance flow for brands, which i have in the projects controller, a user can accept, decline, or request more info - each navigating the user to a new template. now i thought to have the accept/decline/request more info logic in the bids controller, but the problem is there’s also a bid creation flow for agencies….so i
[00:06:59] SteenJobs: bids controller for bid acceptance (or creation), i can’t use it for the other bid flow without it getting messy
[00:07:21] SteenJobs: so basically in the projects controller, i added actions for accept_proposal, decline_proposal, etc.
[00:09:06] sleungcy: has joined #RubyOnRails
[00:11:20] SteenJobs: Radar: just trying to get a feel for it rather than ask about a particular case, because it seems to be recurring with this platform since there are plenty of multi-step flows
[00:11:28] SteenJobs: so this way i don’t feel the need to ask for each case
[00:11:58] Sawbones: has joined #RubyOnRails
[00:12:02] Radar: SteenJobs: Seems ok. Do whatever feels right in that case. Doesn't look to me like you're breaking it.
[00:12:16] Radar: SteenJobs: You might want to have a Project::ProposalsController which has the actions for accepting / declining
[00:12:39] SteenJobs: Radar: oh cool. i thought in general writing a non CRUD action in your controller is breaking convention somewhat
[00:12:40] delgiudices: has joined #RubyOnRails
[00:12:53] SteenJobs: yea i was thinking about abstracting the logic into a separate controller
[00:12:55] Radar: SteenJobs: it is, but conventions are conventions and not hard-and-fast rules
[00:13:16] SteenJobs: i guess it’s clear to me what the right move is when breaking convention has minor cons but huge pros in a given situation
[00:13:20] SteenJobs: like enough so that it’s the obvious move
[00:14:34] SteenJobs: it’s amazing how routing really becomes your friend when you know it well
[00:15:37] flashpoint9: has joined #RubyOnRails
[00:15:55] FailBit: 's like when you go into compiler design and you have some crazy parsing idea and then you realize what you wanted was really a job for lexer
[00:16:02] Rubie: has joined #RubyOnRails
[00:17:07] SteenJobs: for those that have never done compiler design, can you explain haha
[00:17:10] pawnbox: has joined #RubyOnRails
[00:17:18] SteenJobs: nothing like a good analogy
[00:17:23] Sawbones: has joined #RubyOnRails
[00:18:32] FailBit: say you want to parse, idunno, a URL enclosed in quotes
[00:19:32] FailBit: and your lexer outputs this [:quot, '"'], [:word, "http:"], [:slash, "/"], [:slash, "/"], [:word, "example.com"], [:quot, '"']
[00:19:41] FailBit: and then you try to build some insane parser rule to match that
[00:19:52] FailBit: that is stupid though
[00:20:11] FailBit: what you would do is change your lexer to output this [:quot, '"], [:link, "http://example.com"], [:quot, '"']
[00:20:15] rahult_: has joined #RubyOnRails
[00:22:31] nettoweb: has joined #RubyOnRails
[00:22:47] hnanon: Thanks, Radar.
[00:25:17] SteenJobs: FailBit: ha yea, word
[00:25:49] ngr: has joined #RubyOnRails
[00:28:04] petor: has joined #RubyOnRails
[00:32:13] RahulT: has joined #RubyOnRails
[00:35:54] wilsonc91: has joined #RubyOnRails
[00:36:15] wilsonc91: Hey guys, im using rails-api, how do i add something like a filter param?
[00:38:33] xcesariox: has joined #RubyOnRails
[00:42:24] ur5us: has joined #RubyOnRails
[00:44:10] johnflux_: has joined #RubyOnRails
[00:45:58] Technodrome: has joined #RubyOnRails
[00:46:12] stupidystupid: has joined #RubyOnRails
[00:47:02] sevenseacat: has joined #RubyOnRails
[00:48:10] stupidystupid: has joined #RubyOnRails
[00:52:12] Ropeney: Many people from here coming to Adelaide Rails Camp?
[00:52:43] stupidystupid: has joined #RubyOnRails
[00:53:41] nandx64: has joined #RubyOnRails
[00:53:50] Ropeney: You've been to most others sevenseacat ?
[00:53:59] sevenseacat: I've been to the last two
[00:54:15] sevenseacat: in canberra and in sydney
[00:54:23] sevenseacat: Radar will most likely be there also
[00:54:31] Radar: negatory.
[00:54:39] Radar: It is within my travel ban period.
[00:54:48] stupidys_: has joined #RubyOnRails
[00:54:49] Radar: With wifey due in August, it is not wise to attend a camp in July.
[00:55:15] Radar: Ropeney: Well I wouldn't live much longer if I decided that is what I was doing.
[00:55:28] Ropeney: I was thinking that when i said it haha
[00:55:55] AckZ: has joined #RubyOnRails
[00:56:35] MEATCHICKEN: has joined #RubyOnRails
[00:57:18] Radar: You would probably see the smoke cloud from your house.
[00:57:25] matt_d: Radar: congrats
[00:57:32] Radar: matt_d: thank you :)
[00:57:44] Radar: sevenseacat: similarly, Elixir Camp (end of Aug) is also out of the question.
[00:57:52] MEATCHICKEN: Question - so it was only recently that rails introduced foreign key support. What is the difference between using native foreign key support and just using _id as a fk
[00:58:01] MEATCHICKEN: Is it just that the database enforces the referential integrity?
[00:58:41] MEATCHICKEN: So I would call it "transitioning to native foreign keys" if I were to make that change?
[00:58:55] MEATCHICKEN: Is it recommended to make all my non-native fks into native fks?
[00:59:30] baweaver: makes for a lot less of a headache later if something depended on something else
[01:00:17] MEATCHICKEN: I will take that as a yes
[01:00:19] MEATCHICKEN: Thank you guys
[01:00:53] sevenseacat: *thank you everyone
[01:01:43] IrishGringo: has joined #RubyOnRails
[01:04:12] FailBit: I've been feeling a lot that I'm doing dumb things and then I wonder if I'm actually stupid DX
[01:04:17] Sawbones: has joined #RubyOnRails
[01:04:26] FailBit: like I just spent 2 hours trying to get something to run outside of a controller to benchmark it
[01:04:37] FailBit: … and then realized I could run rblineprof in the action
[01:05:01] sevenseacat: i dont know what rblineprof is, so i dont think it makes you stupid :P
[01:05:21] apotry: has joined #RubyOnRails
[01:05:31] FailBit: just a C-extention profiler
[01:05:37] FailBit: *extension
[01:05:47] FailBit: much faster than using a native ruby profiler
[01:06:43] pawnbox: has joined #RubyOnRails
[01:08:29] FailBit: anyways, found my hotspot
[01:08:39] Arcaire: Was it the upload function.
[01:08:59] baweaver: has joined #RubyOnRails
[01:09:03] Arcaire: Or was it that method you added in secretly to identify any/all pictures of Rainbow Dash?
[01:09:19] FailBit: it was the #nsfw? method on image
[01:09:27] SteenJobs: if i’m updating a single attribute, an association, is there a way to run a validation check only when that association attribute is being updated (terms of service validation check for example)
[01:09:27] Arcaire: fuckin lol
[01:09:33] Arcaire: FailBit: What was the issue?
[01:09:40] Arcaire: I thought you just had tags for that.
[01:09:42] Technodrome: has joined #RubyOnRails
[01:09:44] SteenJobs: like a clean native way without handling the validation manually
[01:09:47] sleungcy: has joined #RubyOnRails
[01:09:57] FailBit: well, yeah, but it was loading them n+1 style
[01:10:11] sevenseacat: SteenJobs: you can put that in as a conditional
[01:10:14] sevenseacat: on the validation
[01:10:20] Arcaire: FailBit: Huh. Care to share before/after?
[01:10:34] Arcaire: Just out of context gist is fine. I've seen your app before. :^)
[01:10:40] SteenJobs: right - that i got, but how do i express updating a specific attribute as an if: conditiional in a validation check?
[01:10:48] FailBit: I will note that if I wanted to identify pictures of rainbow dash
[01:10:51] FailBit: I would use this https://github.com/rezoo/illustration2vec
[01:10:54] SteenJobs: i guess how to i grab the current attribute trying to be updated
[01:11:03] Arcaire: That's in Python.
[01:11:04] sevenseacat: SteenJobs: got some code? otherwise my hypotheticals arent working]
[01:12:28] sevenseacat: ACTION still trying to get used to new keyboard
[01:12:29] SteenJobs: sevenseacat: ah sorry. not much to show really, i simply have a view where a user accepts TOS for a ‘project’, and then the project is assigned to them - but i need a way to validate that TOS has been accepted before i assign the project. i’ve built partial validations before, my issue here is building the conditiional.
[01:12:35] SteenJobs: sevenseacat: oo what’s the new keyboarD?
[01:13:00] sevenseacat: I bought a mechanical keyboardo n the weekend... is quite different
[01:13:16] sevenseacat: SteenJobs: well I would simply write something like if: :tos_changes
[01:13:22] Arcaire: FailBit: Oh cool that uses a CNN.
[01:13:26] sevenseacat: substitute in your own field name
[01:13:55] SteenJobs: sevenseacat: ahh clever - so even if it’s not accepted, it’ll change and the validation will fire because it’s being set to “0”?
[01:14:09] stupidys_: has joined #RubyOnRails
[01:14:26] nettoweb: has joined #RubyOnRails
[01:14:28] sevenseacat: oh wait, I think i misunderstood
[01:15:08] SteenJobs: sevenseacat: oh right - if it doesn’t change (they don’t accept and then do it a second time), it’s no good
[01:15:21] EdwardIII: has joined #RubyOnRails
[01:15:37] FailBit: Arcaire: full bench of 100 runs https://gist.github.com/liamwhite/65f3f74d157717d691e903b0898ef55e
[01:15:38] SteenJobs: sevenseacat: basically i only need to validate the tos if the project is being assigned, but i don’t know how to capture a particular attribute being assigned as a conditional for a validation
[01:15:47] FailBit: wait for the "duh"
[01:15:57] FailBit: (you'll prob see it right away)
[01:16:21] sevenseacat: SteenJobs: this is where code snippets really help
[01:16:29] SteenJobs: sevenseacat: obviously i don’t want the validation always running, because i want the project object to be able to be updated before the tos is accepted
[01:16:33] SteenJobs: sevenseacat: ok i’ll gist the view
[01:16:38] sevenseacat: like is this a model purely for the assignment? in which case, you just validate on create
[01:17:06] sevenseacat: its a model problem, so the view is kind of irrelevant
[01:17:45] drbayer: has joined #RubyOnRails
[01:18:18] SteenJobs: sevenseacat: https://gist.github.com/jesiegel1/4f22e8aa8029a6cd9b338b1f8dc2adc4
[01:18:22] SteenJobs: sevenseacat: included the model
[01:19:10] SteenJobs: sevenseacat: and no, the project object is created in an earlier use case - this use case, a bid from an agency is being accepted, and so the project, created by a brand, needs to be assigned to an agency.
[01:19:45] SteenJobs: sevenseacat: so after the brand accepts TOS, the project will be assigned to the agency
[01:20:21] joshkovach: has joined #RubyOnRails
[01:20:41] sevenseacat: in that case, I'd probably use a validation context
[01:21:35] Arcaire: FailBit: *squints intently*
[01:21:41] Arcaire: FailBit: Did you write that while otherwise occupied?
[01:21:54] stupidys_: has joined #RubyOnRails
[01:22:05] FailBit: I did not write it, in fact
[01:22:16] FailBit: the infamously bad lead coder did
[01:22:26] sevenseacat: http://www.justinweiss.com/articles/a-lightweight-way-to-handle-different-validation-situations/
[01:22:28] FailBit: and it's also a holdover from when we used mongodb, surprise!
[01:22:29] Arcaire: Was it compwhizii.
[01:22:57] ekinmur: has joined #RubyOnRails
[01:23:50] FailBit: updated gist with rebench
[01:23:56] eljimbo: has joined #RubyOnRails
[01:24:13] bronson: has joined #RubyOnRails
[01:24:16] SteenJobs: sevenseacat: thanks! reading now
[01:25:13] yfeldblum: has joined #RubyOnRails
[01:25:56] FailBit: rebenching with a TLS
[01:26:11] SteenJobs: sevenseacat: yea so that’s what i did in other places for partial validations - i added a status attribute to my object, and set my validations based on the value of status
[01:26:15] Arcaire: FailBit: 50ms drop
[01:26:27] sevenseacat: thats... not what the article says
[01:27:50] SteenJobs: no, but the usage of contexts is very similar in how it works
[01:27:59] SteenJobs: i meant to say just similar in style
[01:28:26] SteenJobs: but yea, this is great. thanks!
[01:28:58] DoctorMonocular: has joined #RubyOnRails
[01:29:15] stupidystupid: has joined #RubyOnRails
[01:29:27] stupidys_: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[01:32:04] FailBit: Arcaire: updated again with moar memoization
[01:32:10] smathy: ACTION hates validation contexts
[01:32:43] smathy: ...now the CALLER has to know the internal state of a model and send the right arg in with a save? That's the opposite of useful.
[01:33:10] sevenseacat: its nothing to do with the internal state
[01:33:14] smathy: ...better to just write your own custom validation method to do whatever you want.
[01:38:43] SteenJobs: sevenseacat: perfect, using contexts worked and it’s really clean. i like it!
[01:41:56] flashpoint9: has joined #RubyOnRails
[01:41:56] ramortegui: has joined #RubyOnRails
[01:42:09] _Tariq: has joined #RubyOnRails
[01:43:44] wilsonc91: What linter do you guys use for rails? Rubocop?
[01:44:08] FailBit: I take its output with a grain of salt, but I use rubocop
[01:46:46] pawnbox: has joined #RubyOnRails
[01:50:42] sevenseacat: i prefer to not use one
[01:52:23] djbkd: has joined #RubyOnRails
[01:55:28] Technodrome: has joined #RubyOnRails
[01:56:52] sypheren: has joined #RubyOnRails
[01:57:57] Cooooo: has joined #RubyOnRails
[01:58:50] draig: has joined #RubyOnRails
[01:58:52] P4Titan: has joined #RubyOnRails
[01:59:09] P4Titan: Hello all. I have a question regarding how the application.js and application.css work
[01:59:20] scott_o: has joined #RubyOnRails
[01:59:40] P4Titan: Why is it that, without explicitly including the vendor/assets/js directory, I can plop my js files there and they'll be included
[02:00:00] P4Titan: but for css, I have to explicity include the files I desire in application.css
[02:00:11] cac_: has joined #RubyOnRails
[02:00:20] P4Titan: Though note that for js, I ploped a directory of js files in the vendor/assets/js directory
[02:00:23] P4Titan: could that be why?
[02:00:42] morenoh149: has joined #RubyOnRails
[02:00:45] someish: has joined #RubyOnRails
[02:01:01] Rubie: has joined #RubyOnRails
[02:01:44] JFlash: has joined #RubyOnRails
[02:03:04] renegadeandy: Hello. can anybody help me with my sunspot searchable block for my event object : https://gist.github.com/anonymous/7f9b44880ce186daf7238c4e5b88205a - I want it to index on the associations venue.address_line_1 attribute, but its not working and im not sure why
[02:10:05] ramortegui: has joined #RubyOnRails
[02:10:31] rahult_: has joined #RubyOnRails
[02:10:39] sleungcy: has joined #RubyOnRails
[02:11:15] duderonomy: has joined #RubyOnRails
[02:11:44] FailBit: P4Titan: uh?
[02:11:50] FailBit: you still have to require them
[02:11:56] FailBit: be it require_tree or explicit
[02:12:31] baweaver: has joined #RubyOnRails
[02:12:37] Palsson: has joined #RubyOnRails
[02:12:59] P4Titan: In my application.js
[02:13:14] P4Titan: no where do I include the directory I put in vendor
[02:13:18] P4Titan: and it still gets included
[02:13:21] Technodrome: has joined #RubyOnRails
[02:13:22] sevenseacat: renegadeandy: !didntwork
[02:13:22] helpa: renegadeandy: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[02:14:09] chagel: has joined #RubyOnRails
[02:14:27] ekinmur: has joined #RubyOnRails
[02:14:45] renegadeandy: sevenseacat: I would like my event model to only become indexed and searchable, once event.live is true…but im not sure how to make that happen : https://gist.github.com/anonymous/28cd038a44a4cc86c72b0f3e08d73f68
[02:14:54] FailBit: P4Titan: gist your application.js and application.css
[02:15:09] sevenseacat: renegadeandy: ok, thats a totally diffedrent question
[02:15:09] FailBit: just the tops if you want
[02:15:54] sevenseacat: and its not one that makes a lot of sense tbh - why would you not do the event.live filtering at search time, not at index time?
[02:16:37] P4Titan: FailBit: http://pastie.org/private/f1rjzvnwuufaxiysshsda
[02:16:50] pawnbox: has joined #RubyOnRails
[02:17:09] sevenseacat: that JS file wont include anything from vendor, let alone the whole trere
[02:17:36] P4Titan: it does however
[02:17:37] FailBit: do you by chance have another file in your app/assets with a name of application.* ?
[02:17:40] joshkovach: has joined #RubyOnRails
[02:17:46] P4Titan: I'll check
[02:17:56] FailBit: because sprockets will blindly compile any file matching that pattern
[02:18:09] P4Titan: should I check app/assets/javascript?
[02:18:12] P4Titan: or app/assests?
[02:18:33] sevenseacat: that file does not
[02:18:51] renegadeandy: sevenseacat: ok so if i was doing it at search time….how would i add that in here? https://gist.github.com/anonymous/3fbea0cbfc237bb131733a198a14ac7e
[02:19:05] renegadeandy: Event.where(:live=>true).search ?
[02:19:07] P4Titan: I only have application.js in my app/assets/javascript
[02:19:28] sevenseacat: renegadeandy: https://github.com/sunspot/sunspot#searching-objects by adding another conditional
[02:20:28] renegadeandy: sevenseacat: oh interesting so like with :live,true
[02:21:35] dfockler: has joined #RubyOnRails
[02:21:53] FailBit: solr is weeeird
[02:22:03] FailBit: ACTION bedtime
[02:22:43] sevenseacat: I find it much easier to work with than things like elasticsearch :)
[02:23:23] FailBit: it's "almost elasticsearch"
[02:23:56] sevenseacat: if by 'almost' you mean theyre both searching platforms, then yes
[02:25:09] FailBit: both searching platforms powered by lucene with similar query execution
[02:25:39] sevenseacat: indeed. so you could really say elasticsearch is 'almost solr'!
[02:26:27] FailBit: here's my main gripe with ES
[02:26:31] Contigi: has joined #RubyOnRails
[02:26:35] FailBit: it lies about execution time
[02:27:03] andrew9184: has left #RubyOnRails: ()
[02:27:29] FailBit: if you were to benchmark end-to-end a match_all query on one collection in solr what would you expect to get (ms)
[02:29:13] petor: has joined #RubyOnRails
[02:30:06] FailBit: ES says 2ms, end-to-end you get an average of 40ms (!) for a match_all
[02:31:02] FailBit: it seems that this overhead is per-request, even using persistent connections
[02:31:26] FailBit: using the multisearch API gets rid of this stupid individual request overhead
[02:31:47] FailBit: but you still pay it once...
[02:32:00] FailBit: and once is too many when it's 40ms...
[02:32:01] SteenJobs: has joined #RubyOnRails
[02:32:28] nettoweb: has joined #RubyOnRails
[02:34:29] FailBit: maybe it sounds stupid, but at peak daily load, all our appservers are pegged waiting on ES
[02:34:55] FailBit: reducing the per-request time by 10ms would stop the queue from piling up so much
[02:36:50] ur5us: has joined #RubyOnRails
[02:38:20] bronson: has joined #RubyOnRails
[02:41:37] Ropeney: FailBit, sounds a little odd. Have you optimised your ES deployment?
[02:42:15] renegadeandy: sevenseacat: can you help me understand why i am getting unrecognized field no :live, https://gist.github.com/anonymous/9e9216e86ca1d07ee1028ab9a66717a4
[02:42:30] Ropeney: FailBit, ES default configurations are great for development, not production
[02:42:55] FailBit: we have all the memory stuff done yadda 32G
[02:43:11] Ropeney: so a 64gb ram server?
[02:43:18] FailBit: 128, actually
[02:43:27] sevenseacat: renegadeandy: did you reindex your data after adding that field in your model's searchable block?
[02:43:39] Ropeney: why not 64 then? more then that running?
[02:43:54] FailBit: because of jvm pointer compression
[02:44:07] FailBit: you're not supposed to give elastic more than 32G of heap
[02:44:10] renegadeandy: sevenseacat: yep i did bundle exec rake sunspot:solr:reindex
[02:44:34] Ropeney: FailBit, is that still java 8?
[02:44:59] sevenseacat: renegadeandy: it's likely then because you defined the field as test
[02:45:03] jstransky: has joined #RubyOnRails
[02:45:15] sevenseacat: whereas you're not querying it that way
[02:45:23] renegadeandy: sevenseacat: the live field is a boolean live :boolean
[02:45:31] sevenseacat: not in the gist you posted
[02:45:45] renegadeandy: sevenseacat: which line, the with :live,true one?
[02:45:53] sevenseacat: https://gist.github.com/anonymous/9e9216e86ca1d07ee1028ab9a66717a4#file-model-rb-L6
[02:46:06] renegadeandy: sevenseacat: oh crap!
[02:46:27] ur5us: has joined #RubyOnRails
[02:46:35] Ropeney: FailBit, very interesting regardless then
[02:46:47] FailBit: we never upgraded our indices and they still use fielddata and not doc_values, but that shouldn't matter because it all still fits into memory
[02:46:54] pawnbox: has joined #RubyOnRails
[02:47:09] diego1: has joined #RubyOnRails
[02:47:32] renegadeandy: sevenseacat: Wonderful - now it works, thank you. How can I add a solr reindex to a capistrano deployment?
[02:47:35] diego1: has joined #RubyOnRails
[02:47:45] sevenseacat: no idea. i dont use capistrano.
[02:47:52] sevenseacat: run the command manually?
[02:49:07] FailBit: Ropeney: if you 'time curl' a match_all on some collection what do you get on average?
[02:49:10] FailBit: I'm curious now
[02:51:39] Ropeney: FailBit, I can't do much testing on my end atm sorry
[02:51:52] Ropeney: FailBit, but i am wondering if your getting GC freezes
[02:52:23] FailBit: I've checked all of this stuff, GC, hot threads, done literally everything except use a jvm profiler
[02:52:47] FailBit: speaking of that do you have any jvm profilers you can recommend for this
[02:53:18] Ropeney: FailBit, I don't have any profilers i've just looked at different flags you can set for different messages.
[02:53:25] Sawbones: has joined #RubyOnRails
[02:54:10] Ropeney: FailBit, i no way claim to have a deep knowledge of this, just am very suprised as it goes against alot I've heard
[02:55:12] FailBit: I'll try to bench ES tomorrow to see where it's gaining 38ms of execution time
[02:55:21] FailBit: but for now it's bedtime
[02:56:02] Ropeney: FailBit goodluck, you must have alot of app servers hitting it
[02:57:34] Ropeney: I want to say split that server into two instances and have 2 nodes and see haha
[02:58:23] DoctorMonocular: has joined #RubyOnRails
[02:58:24] FailBit: each index has 2 shards
[02:58:36] Ropeney: but 1 node?
[02:58:52] Ropeney: would be interesting if you've just scaled too high, instead of out
[02:59:18] FailBit: it does it on an empty index too though
[02:59:21] FailBit: that's the thing
[02:59:29] FailBit: 40ms end-to-end, 0ms in lucene
[02:59:39] FailBit: with default configuration and everything
[03:00:49] Ropeney: FailBit: `Searched 1 of 1 shards. 830 hits. 0.005 seconds` just in one im running now
[03:01:07] Ropeney: doing it multiple times is 0.002
[03:01:18] FailBit: is that timing curl
[03:01:28] Ropeney: I think timing curl is a bad idea
[03:01:32] FailBit: or response['took']
[03:01:49] FailBit: timing curl gives you end to end response times
[03:01:59] FailBit: what actually matters
[03:02:03] FailBit: in the context of a webapp
[03:02:19] Ropeney: So thats then not ES being the problem
[03:02:49] Ropeney: if i time curl localhost:9200 it takes 0.013s
[03:02:49] FailBit: except it is, because you get this same 40ms delay even when you use persistent connections
[03:02:57] FailBit: see my earlier comment about msearch
[03:02:57] renegadeandy: sevenseacat: how can i do a fulltext search against multiple different words, rather than all words in the query string?
[03:03:06] _Tariq: has joined #RubyOnRails
[03:03:16] renegadeandy: rather than fulltext params[:q] which will try to match “outdoor sports"
[03:03:22] sevenseacat: don't pass the query string to the search function?
[03:03:27] renegadeandy: i want to search for both outdoor ,and sports, fuzzy search :)
[03:03:41] renegadeandy: sevenseacat: msearch?
[03:03:56] FailBit: I'm not sevenseacat
[03:07:42] Chagel_: has joined #RubyOnRails
[03:07:55] sevenseacat: ACTION narrows eyes
[03:08:12] FailBit: ACTION plays dramatic theme
[03:09:57] sevenseacat: re definitely not me.
[03:10:05] sevenseacat: I would have had a much cooler comeback to that.
[03:11:22] sleungcy: has joined #RubyOnRails
[03:11:51] apotry: has joined #RubyOnRails
[03:12:10] Technodrome: has joined #RubyOnRails
[03:14:11] crameth: has joined #RubyOnRails
[03:14:32] kadoppe: has joined #RubyOnRails
[03:14:48] crameth: has joined #RubyOnRails
[03:17:41] braincras: has joined #RubyOnRails
[03:21:02] renegadeandy: sevenseacat: i cannot find your message where you mention ‘msearch'
[03:22:01] stupidys_: has joined #RubyOnRails
[03:23:38] Jameser: has joined #RubyOnRails
[03:23:39] renegadeandy: sevenseacat: i dont understand, how can i search for seperate words in fulltext?
[03:23:47] Radar: renegadeandy: FailBit mentioned msearch, not sevenseacat
[03:24:06] renegadeandy: Radar: yeah I see that now :/ im a doofus, but still need an answer for my real question
[03:26:35] DoctorMonocular: has joined #RubyOnRails
[03:27:17] arBmind1: has joined #RubyOnRails
[03:27:35] renegadeandy: aha, i used minimum_match
[03:27:57] akshat: has joined #RubyOnRails
[03:29:57] RegulationD: has joined #RubyOnRails
[03:34:11] stupidystupid: has joined #RubyOnRails
[03:39:50] RahulT: has joined #RubyOnRails
[03:40:15] emchamp-dt: has joined #RubyOnRails
[03:44:22] smoitra: has joined #RubyOnRails
[03:49:59] Sawbones_: has joined #RubyOnRails
[03:54:18] DoctorMonocular: has joined #RubyOnRails
[03:57:52] hinbody: has joined #RubyOnRails
[03:58:47] baweaver: has joined #RubyOnRails
[03:58:52] pawnbox: has joined #RubyOnRails
[03:59:01] treaki_: has joined #RubyOnRails
[04:03:10] eyeamaye: has joined #RubyOnRails
[04:08:29] joshsmith: has joined #RubyOnRails
[04:11:40] sandelius: has joined #RubyOnRails
[04:14:49] Sawbones: has joined #RubyOnRails
[04:23:33] owenjones: has joined #RubyOnRails
[04:23:38] SteenJobs: has joined #RubyOnRails
[04:27:52] ZerGabriel: has joined #RubyOnRails
[04:30:20] petor: has joined #RubyOnRails
[04:30:35] sevenseacat: has joined #RubyOnRails
[04:31:34] morenoh149: has joined #RubyOnRails
[04:34:51] Technodrome: has joined #RubyOnRails
[04:39:36] IrishGringo: has joined #RubyOnRails
[04:40:55] DoctorMonocular: has joined #RubyOnRails
[04:44:48] Devalo: has joined #RubyOnRails
[04:49:01] mhenrixon: has joined #RubyOnRails
[04:56:13] njero: has joined #RubyOnRails
[05:01:42] krz: has joined #RubyOnRails
[05:07:20] jtong: has joined #RubyOnRails
[05:07:29] pawnbox_: has joined #RubyOnRails
[05:08:05] DoctorMonocular: has joined #RubyOnRails
[05:14:42] bruno-: has joined #RubyOnRails
[05:15:53] djbkd: has joined #RubyOnRails
[05:15:53] paradisaeidae_: has joined #RubyOnRails
[05:20:00] AntiSpamMeta: has joined #RubyOnRails
[05:20:07] merida: has joined #RubyOnRails
[05:21:51] bronson: has joined #RubyOnRails
[05:24:57] djbkd: has joined #RubyOnRails
[05:30:21] DoctorMonocular: has joined #RubyOnRails
[05:34:59] chagel: has joined #RubyOnRails
[05:35:10] idefine: has joined #RubyOnRails
[05:37:58] idefine: Hi, is there a way to set a database session variable before performing a query? I'd like to do something like SET SESSION key = value; before executing a query to select some data.
[05:38:03] ZerGabriel: has joined #RubyOnRails
[05:38:48] paradisaeidae: has joined #RubyOnRails
[05:39:30] jstransky: has joined #RubyOnRails
[05:40:47] njero: has joined #RubyOnRails
[05:42:04] dionysus69: has joined #RubyOnRails
[05:43:24] diegoaguilar: has joined #RubyOnRails
[05:44:39] zpe: has joined #RubyOnRails
[05:44:45] chagel: has joined #RubyOnRails
[05:44:56] kadoppe: has joined #RubyOnRails
[05:47:28] sandelius: has joined #RubyOnRails
[05:48:56] cac: has joined #RubyOnRails
[05:50:38] Chagel_: has joined #RubyOnRails
[05:52:22] pawnbox: has joined #RubyOnRails
[05:52:34] merida: has joined #RubyOnRails
[05:54:22] norc: has joined #RubyOnRails
[05:56:28] flashpoint9: has joined #RubyOnRails
[06:00:26] futilegames: has joined #RubyOnRails
[06:02:21] zpe: has joined #RubyOnRails
[06:03:42] DoctorMonocular: has joined #RubyOnRails
[06:03:51] RahulT: has joined #RubyOnRails
[06:03:57] edwinvdgraaf: has joined #RubyOnRails
[06:09:30] chouhoulis: has joined #RubyOnRails
[06:13:17] sleungcy: has joined #RubyOnRails
[06:13:42] maxdoubt: has joined #RubyOnRails
[06:16:43] bruno-: has joined #RubyOnRails
[06:20:38] roelof: has joined #RubyOnRails
[06:20:54] Dimik: has joined #RubyOnRails
[06:21:06] roelof: someone who knows how I can change the abbr tag in simple form to something else ?
[06:21:23] aganov: has joined #RubyOnRails
[06:25:44] norc: roelof: Honest question, did you bother to google for that?
[06:26:41] arup_r: has joined #RubyOnRails
[06:30:01] solars: has joined #RubyOnRails
[06:30:19] norc: roelof: Are you just trying to change the label text to something else, or change the tag entirely_
[06:30:43] roelof: I want to change the tag <abbr> to something else
[06:31:29] petor: has joined #RubyOnRails
[06:33:31] roelof: I do not like the way the abbr works. im looking for a better looking one
[06:33:34] AimlessRAven: has joined #RubyOnRails
[06:33:46] AimlessRAven: = form_tag brands_path, method: :get do
[06:33:55] AimlessRAven: how would be looks like my search input for brand names
[06:34:04] AimlessRAven: = search_field :brand_name_cont ?
[06:34:09] roelof: maybe I just use the required word of html5 , norc
[06:34:28] norc: roelof: Fair enough.
[06:35:46] norc: roelof: From the looks you have to monkey patch something in this call chain SimpleForm::Components::Labels#label > label_text > required_label_text > translate_required_html
[06:37:28] norc: The exact location really depends on your goals.
[06:39:02] norc: roelof: And oops I meant SimpleForm::Components::Labels::ClassMethods#label
[06:40:16] norc: roelof: Or better yet, provide your own label methods, and then write your own input wrapper.
[06:41:30] AimlessRAven: https://gist.github.com/anonymous/2661f27fcb3dca5ae4530291833b6822
[06:41:32] PedramT: has joined #RubyOnRails
[06:41:39] AimlessRAven: how to make this input to search by brand name
[06:41:44] AimlessRAven: i have ransack loadet to it
[06:42:01] roelof: Oke, I will google how to do this
[06:42:29] roelof: or I will try to make the html5 tag requiered work
[06:45:34] sergey_makagon: has joined #RubyOnRails
[06:48:27] bmf: has joined #RubyOnRails
[06:49:35] petor: has joined #RubyOnRails
[06:50:50] jstransky: has joined #RubyOnRails
[06:58:20] zpe: has joined #RubyOnRails
[07:02:12] AimlessRAven: https://gist.github.com/anonymous/37456dd4f438f95b71fc2ecc8e229239
[07:02:18] AimlessRAven: how to set correct name for my search field
[07:02:46] sevenseacat: AimlessRaven: seriously?
[07:03:02] sevenseacat: did you even look at the code before posting it?
[07:03:14] pawnbox: has joined #RubyOnRails
[07:03:38] sevenseacat: so how do you think you would set the correct name?
[07:04:05] sevenseacat: given you havent even told us what the "correct name" is
[07:04:12] helpa: http://i.imgur.com/tyViD.gif
[07:04:27] Ergo: has joined #RubyOnRails
[07:04:36] AimlessRAven: i have connected ransack to that form, i just need to change name to use what ransack expect
[07:04:47] sevenseacat: great, so whats stopping you from doing that?
[07:05:18] ur5us: has joined #RubyOnRails
[07:05:28] Palsson: has joined #RubyOnRails
[07:06:06] AimlessRAven: sevenseacat: mm just i need to set :name => name_cont ?
[07:06:29] sevenseacat: if thats the change you want to make, have you tried it?
[07:07:09] sevenseacat: AimlessRaven: this is your very very last warning about doing some thinking instead of posting irrelevant code snippets
[07:08:01] helpa: Do your research before hand. Your question may be answerable with a quick Google search or by simply experimenting. If you're using a method in Rails, look it up in the API Docs or in the Official Guides.
[07:08:18] Radar: https://gist.github.com/radar/996779#what-happens-when-you-break-the-rules
[07:08:37] PedramT: has joined #RubyOnRails
[07:09:25] delgiudices: has joined #RubyOnRails
[07:09:57] jxs_: has joined #RubyOnRails
[07:10:39] Palsson: has joined #RubyOnRails
[07:11:37] chouhoulis: has joined #RubyOnRails
[07:12:27] DoctorMonocular: has joined #RubyOnRails
[07:13:49] norc: DelayedJon is pumping an SQL log statement every 5 seconds into my <environment>.log: Delayed::Backend::ActiveRecord::Job Load (4.6ms) SELECT * FROM (SELECT "DELAYED_JOBS".* FROM "DELAYED_JOBS" ....
[07:14:05] norc: Is there a way to redirect these messages to a different file so it does not clutter up my regular log_
[07:14:22] sleungcy: has joined #RubyOnRails
[07:15:37] norc: (Or for all I care these messages can be filtered out entirely)
[07:16:20] mark3: has joined #RubyOnRails
[07:16:56] arup_r: norc: http://stackoverflow.com/a/14632217/2767755
[07:17:20] norc: arup_r: that is a different log altogether.
[07:17:31] norc: Though I think I have found a fix.
[07:18:14] bruno-: has joined #RubyOnRails
[07:18:42] norc: https://github.com/collectiveidea/delayed_job/issues/477#issuecomment-33151306
[07:18:53] norc: Not very pretty though.
[07:19:31] nartes: has joined #RubyOnRails
[07:19:39] nartes: http://pastebin.com
[07:19:52] sevenseacat: that issue seems to ask why so many queries are required... which makes me wonder if they know what DJ is actually doing
[07:19:55] nartes: aaat. Sorry
[07:19:57] Radar: nartes: hi
[07:20:02] drbayer: has joined #RubyOnRails
[07:20:06] nartes: Guys what do you use instead that site with lot of ads.
[07:20:20] nartes: Id like to share some code, but gist from github doesn't allow raw files
[07:20:34] Radar: nartes: "raw files"?
[07:20:43] Radar: what are raw files?
[07:20:45] nartes: like a huge log
[07:20:51] nartes: from wpa_supplicant
[07:20:56] Radar: Why do you need to share a huge log with us?
[07:21:01] sevenseacat: seems... irrelevant to rails
[07:21:02] nartes: not with you
[07:21:02] Radar: Why not just get the pieces that are relevant?
[07:21:12] Radar: put it in a github repo?
[07:21:12] sevenseacat: then why are you asking us?
[07:21:15] nartes: please, propose some pastebin without ads,
[07:21:24] Ergo^: has joined #RubyOnRails
[07:21:25] helpa: Next question, please!
[07:22:16] norc: sevenseacat: It is fairly simple. DelayedJob uses a Job table, so that has to be queried every few seconds for DJ to know whether it has to execute a job - that part is unavoidable.
[07:22:32] sevenseacat: norc: yes I know that, but many of the people in that issue do not
[07:22:40] Radar: use Sidekiq instead. Problem solved.
[07:22:40] futilegames: has joined #RubyOnRails
[07:22:56] norc: Radar: Thought about it, but didn't want the extra redis dependency.
[07:23:21] Radar: norc: But you're OK with the MySQL/PostgreSQL/whatever dependency?
[07:23:30] Radar: Redis isn't that difficult to manage.
[07:23:39] Radar: Easier than mysql + postgresql by a long shot
[07:23:42] norc: Radar: We already have the Oracle database running, that is not an extra dependency.
[07:23:44] PedramT: has joined #RubyOnRails
[07:23:52] Radar: Why am I arguing with randos on the internet at almost 5:30pm
[07:24:18] sevenseacat: Radar: go home!
[07:24:23] Radar: sevenseacat: sooooooon
[07:24:24] norc: Radar: For what its worth you are absolutely correct. It is not hard.
[07:24:38] valetudo: has joined #RubyOnRails
[07:24:54] norc: A while ago I looked at DJ, sidekiq and resque, and for pure ease I went for DJ. Guess this is now payback. ;)
[07:25:30] Radar: DJ will also run jobs much slower than Sidekiq (single-threaded, iirc) so there's also that.
[07:25:44] Radar: We've been using Sidekiq here at Marketplacer for almost 9 months and it's smoooooooth.
[07:25:49] norc: Our jobs run at a frequency of 200 per hour, so performance really is not an issue. :)
[07:25:56] Radar: I've been using on my side project for about two years and it's great.
[07:26:22] Radar: 6.6mil jobs processed on one server so far.
[07:26:27] PedramT: has joined #RubyOnRails
[07:26:34] Radar: Averaging about 10k per day
[07:27:46] antgel: has joined #RubyOnRails
[07:29:18] PedramT: has joined #RubyOnRails
[07:31:26] RegulationD: has joined #RubyOnRails
[07:33:10] neanderslob_: has joined #RubyOnRails
[07:33:22] Macaveli: has joined #RubyOnRails
[07:33:44] mikecmpbll: has joined #RubyOnRails
[07:34:02] petertretyakov: has joined #RubyOnRails
[07:35:52] sp1rs: has joined #RubyOnRails
[07:37:51] bronson: has joined #RubyOnRails
[07:39:48] ur5us: has joined #RubyOnRails
[07:39:59] krz: has joined #RubyOnRails
[07:40:03] AimlessRAven: https://gist.github.com/anonymous/c05ce750498110db76dbdf6055dea090
[07:40:29] AimlessRAven: this generate me link ocalhost:3000/buy-gift-cards?utf8=✓&q%5Bname_cont%5D=xbox
[07:40:39] AimlessRAven: but find all cards, i wanna find only xbox
[07:41:13] sevenseacat: your question is unrelated to the code you posted
[07:43:00] jxs_: has joined #RubyOnRails
[07:43:18] jacobat: has joined #RubyOnRails
[07:43:27] petertretyakov: has joined #RubyOnRails
[07:45:57] futilegames: has joined #RubyOnRails
[07:48:02] Balzrael: has joined #RubyOnRails
[07:48:24] chagel: has joined #RubyOnRails
[07:49:56] DoubleMalt: has joined #RubyOnRails
[07:50:41] dionysus69: has joined #RubyOnRails
[07:53:23] nartes: has joined #RubyOnRails
[07:54:17] sandelius: has joined #RubyOnRails
[07:57:18] lacrosse: has joined #RubyOnRails
[07:57:43] czerasz: has joined #RubyOnRails
[07:59:01] ramfjord: has joined #RubyOnRails
[07:59:53] ferr: has joined #RubyOnRails
[07:59:59] jxs_: has joined #RubyOnRails
[08:01:15] mikecmpbll: has joined #RubyOnRails
[08:01:44] baweaver: has joined #RubyOnRails
[08:03:50] drptbl: has joined #RubyOnRails
[08:08:54] dannyguk: has joined #RubyOnRails
[08:10:20] Jasaka|NA: has joined #RubyOnRails
[08:11:54] Jasaka: has joined #RubyOnRails
[08:12:36] chouhoulis: has joined #RubyOnRails
[08:13:32] Jasaka: has joined #RubyOnRails
[08:13:49] blackmesa: has joined #RubyOnRails
[08:14:24] Pumukel: has joined #RubyOnRails
[08:14:42] darutoko: has joined #RubyOnRails
[08:15:10] sleungcy: has joined #RubyOnRails
[08:15:34] norc: Okay, maybe someone here can give me a pointer.
[08:16:20] norc: Im running Rails using Unicorn behind an Apache2 for TLS termination. However, in all my requests I only see as the remote IP address. Can someone give me a pointer as to why Rails is not using the X-Forwarded-For that Apache2 is supplying_
[08:16:43] jsrn: has joined #RubyOnRails
[08:17:57] renegadeandy: If i have a Pass object, which has a date and a ticket_id , and I only want to select unique ticket ids from a query how do i do it? Pass.where(:date=>date).????
[08:18:48] norc: https://gist.github.com/norc/86c920fb438782e4f803fd686d30c98b -- this is my apache vhost configuration that I am using currently.
[08:19:26] norc: renegadeandy: .uniq.pluck(:ticket_id)
[08:22:31] norc: Wrong gist, updated for new one: https://gist.github.com/norc/73490c02f530e08c900e818fe651ddca
[08:23:15] renegadeandy: norc: but i want the entire object, not just an id...
[08:25:20] norc: renegadeandy: What you want is not sensibly possible. If you have 2 objects with the same ticket_id, which one should it show?
[08:25:34] renegadeandy: any of them, i dont mind...
[08:27:07] n008f4g_: has joined #RubyOnRails
[08:29:44] norc: renegadeandy: There is no trivial way to accomplish this by pure aggregation, since SQL does not think in these terms.
[08:30:02] norc: renegadeandy: .group_by {}.map is your best bet then.
[08:30:20] norc: Note though that if your table has a reasonable size, this can quickly be a real issue.
[08:31:09] marr: has joined #RubyOnRails
[08:32:13] norc: The only SQL way would be database specific, since you would have to do an INNER JOIN based on ROW_NUMBER, the last of which is done differently in each RDBMS afaik.
[08:33:31] norc: So relation.group_by { |record| record.ticket_id }.map(&:first) for the quick and dirty way, if that works for you.
[08:34:22] toomus: has joined #RubyOnRails
[08:36:19] antgel: has joined #RubyOnRails
[08:44:31] toomus: In my I18n file I have groups of keys wich have the same <a> element with other text. This looks ugly and it's difficult to maintain, but thanks to, translator can understand the context of link.
[08:47:59] qejk: has joined #RubyOnRails
[08:48:06] toomus: Is it possible to define some macros/functions in yaml which will generate link?
[08:51:49] merida: has joined #RubyOnRails
[08:53:11] chagel: has joined #RubyOnRails
[08:55:36] norc: toomus: Sort of.
[08:55:57] tetraktys: has joined #RubyOnRails
[08:55:58] norc: toomus: I18n allows for interpolation of parameters if that helps. If thats not enough, you need to use a helper method or a decorator.
[08:57:16] snowy: has joined #RubyOnRails
[08:57:25] dannyguk: has joined #RubyOnRails
[08:59:02] akkmaxon: has joined #RubyOnRails
[08:59:24] moep: has joined #RubyOnRails
[09:02:34] jxs_: has joined #RubyOnRails
[09:02:43] blackhuey: has joined #RubyOnRails
[09:04:41] RubyJedi-ing_: has joined #RubyOnRails
[09:07:17] toomus: has joined #RubyOnRails
[09:07:46] sp1rs: has joined #RubyOnRails
[09:07:50] Chagel_: has joined #RubyOnRails
[09:11:39] skislak: has joined #RubyOnRails
[09:11:49] zeel: has joined #RubyOnRails
[09:12:23] AimlessRAven: has joined #RubyOnRails
[09:13:23] chouhoulis: has joined #RubyOnRails
[09:14:19] AimlessRAven: https://gist.github.com/anonymous/855c55c805cefc230579f9367ee872a0
[09:14:26] AimlessRAven: why this dont show my wanted result
[09:14:38] AimlessRAven: show all cards, but i want only this who name is cont
[09:16:59] dgncn: has joined #RubyOnRails
[09:19:19] bruno-: has joined #RubyOnRails
[09:19:47] pawnbox: has joined #RubyOnRails
[09:20:15] jxs_: has joined #RubyOnRails
[09:21:59] solars: quick question, if I need to bootstrap data for a table, where do I put it isn't missing if for example setting the app up on a new server?
[09:22:00] Macaveli: has joined #RubyOnRails
[09:22:28] rafaelfranca: has joined #RubyOnRails
[09:22:40] norc: solars: Rephrase your question in proper English, so people can make sense of it.
[09:23:22] d0nn1e: has joined #RubyOnRails
[09:24:33] solars: *so it isn't missing
[09:27:13] apeiros: solars: rake task is one way
[09:27:25] apeiros: the other way is setting up your seeds so it has different envs
[09:27:44] apeiros: i.e. my seeds.rb loads global seeds + env specific seeds.
[09:28:48] norc: solars: Oh, it looked garbled to me, without that small word. :)
[09:30:58] BaNzounet: is it possible to have setter for instance variable (e.g. @foo = 'string', would call the setter)
[09:31:19] apeiros: BaNzounet: no
[09:31:27] timmyBsd: has joined #RubyOnRails
[09:31:42] apeiros: if you want setters, use method calls. self.foo = 'string'
[09:32:13] RegulationD: has joined #RubyOnRails
[09:32:19] workmad3: has joined #RubyOnRails
[09:32:39] sandelius: has joined #RubyOnRails
[09:32:49] nettoweb: has joined #RubyOnRails
[09:32:52] solars: apeiros, thanks
[09:32:57] norc: BaNzounet: Actually there is a way...
[09:33:15] solars: norc, np :) I thought so
[09:33:41] apeiros: norc: it looked the same garbled to me, if that's of any consolation :)
[09:33:55] norc: BaNzounet: It requires a really small ruby extension to allow for user defined dynamic variables ($1 for example), if you really insist.
[09:34:03] solars: apeiros, haha
[09:34:41] BaNzounet: ok, I'll just use self.foo, and set @foo inside def foo=()
[09:34:57] apeiros: norc: does that work for @ivars too? afaik ruby only has that mechanic for $pseudo_globals
[09:35:26] bmf: has joined #RubyOnRails
[09:35:36] solars: apeiros, do you know if db:seed is executed automatically when doing the db setup?
[09:35:49] norc: apeiros: Well, the moment we allow for modifications to Ruby that question is kind of moot. :p
[09:36:19] apeiros: solars: since I never run the db:setup task - no idea. but you can just check its dependencies. iirc it does all, create the db, migrate and then seed.
[09:36:39] solars: thanks, I'll verify that
[09:36:50] apeiros: norc: not really. there's only so much you can do with native extensions. at some point you need to patch ruby itself.
[09:37:17] djellemah: has joined #RubyOnRails
[09:37:22] apeiros: (and I don't use it because in my envs that fails at trying to create the db - the rails user doesn't have the permissions to do that)
[09:38:36] norc: apeiros: Oh boy. Last week I had another debugging session with Oracle. So I got tons of random errors of wrong buffer lengths from the depths of OCI8...
[09:38:37] norc: apeiros: After 3 hours of debugging I found out, that my boss had increased the VARCHAR2 length of the table without restarting my rails application.
[09:38:58] norc: Fun stuff.
[09:38:58] andyjeffries: has joined #RubyOnRails
[09:39:17] apeiros: norc: still not sure how I should feel about moving from one horror (oracle) to the next (mssql)
[09:39:31] norc: Hah, how has the experience been so far?
[09:39:47] blackmesa: has joined #RubyOnRails
[09:40:07] apeiros: I haven't had anything to do with it so far.
[09:40:29] andyjeffries: I have a problem with a Gem I wrote - it's messing with the generator parts of Rails, without there being any code that I can see that's trying to do it. Anyone fancy having a quick look for me? The gem is https://github.com/absolutedevops/civo and there are simple steps to reproduce at https://gist.github.com/andyjeffries/a5ce971971a0091651beea676efb120b As the steps show - creating a migration from a new Rails app with that gem included
[09:40:30] andyjeffries: puts the generated file inside the gem's code rather than the project's.
[09:40:38] apeiros: oh, well, actually - we set up a vm. and the experience was "oh funny, as long as my wifi is connected, I can't connect from osx to the windows in the vm"
[09:40:51] yfeldblum: has joined #RubyOnRails
[09:41:23] pawnbox: has joined #RubyOnRails
[09:43:02] quazimodo: has joined #RubyOnRails
[09:43:02] quazimod1: has joined #RubyOnRails
[09:45:09] petor: has joined #RubyOnRails
[09:46:37] norc: apeiros: Heh.
[09:46:38] nettoweb: hello, do you guys know a good alternative to codebasehq?
[09:47:02] norc: nettoweb: We use Stash.
[09:47:18] chagel: has joined #RubyOnRails
[09:47:31] norc: nettoweb: (Or bitbucket if you want a hosted solution). There is also Github, and tons of other services.
[09:48:02] nettoweb: norc Yeah, I know BitBucket and Github so far
[09:48:25] nettoweb: yes, I need to host less than 10 repos... seems that jus BitBucket
[09:48:36] nettoweb: just Bitbucket can do it, right?
[09:49:56] sevenseacat: any code hosting service could do it
[09:50:54] andyjeffries: Gitlab.com is free for any number of private repos/collaborators.
[09:51:29] andyjeffries: It's nice to use a self-hosted GitLab at work and GitLab.com for my personal stuff.
[09:51:46] andyjeffries: (I have nothing to do with them, I'm just a happy user)
[09:56:06] petor: has joined #RubyOnRails
[09:57:56] pawnbox: has joined #RubyOnRails
[10:03:49] nartes: has joined #RubyOnRails
[10:05:13] srinidhi: has joined #RubyOnRails
[10:09:04] Rixius: has joined #RubyOnRails
[10:11:29] johnflux_: has joined #RubyOnRails
[10:11:47] valetudo: has joined #RubyOnRails
[10:12:23] arBmind: has joined #RubyOnRails
[10:14:35] El3k0n: has joined #RubyOnRails
[10:16:56] sleungcy: has joined #RubyOnRails
[10:19:20] zpe_: has joined #RubyOnRails
[10:20:30] bruno-: has joined #RubyOnRails
[10:22:45] reactormonk: has joined #RubyOnRails
[10:23:03] reactormonk: What does RoR return on a successful DELETE rest api call?
[10:23:22] Radar: reactormonk: depends on your code
[10:23:37] merida: has joined #RubyOnRails
[10:24:04] jgt4: has joined #RubyOnRails
[10:24:31] tetraktys: has joined #RubyOnRails
[10:25:02] arBmind: has joined #RubyOnRails
[10:25:17] sevenseacat: whatever your controller returns
[10:28:56] FailBit: has left #RubyOnRails: ("WeeChat 0.4.2")
[10:31:03] blackhuey: has joined #RubyOnRails
[10:31:46] Detch: has joined #RubyOnRails
[10:31:56] sandelius: has joined #RubyOnRails
[10:34:13] blackmesa: has joined #RubyOnRails
[10:35:15] Ropeney: has joined #RubyOnRails
[10:36:42] Palsson: has joined #RubyOnRails
[10:44:06] chouhoulis: has joined #RubyOnRails
[10:45:24] FooMunki: has joined #RubyOnRails
[10:45:27] GodFather: has joined #RubyOnRails
[10:48:45] bmf: has joined #RubyOnRails
[10:49:49] morenoh149: has joined #RubyOnRails
[10:51:50] stien: has joined #RubyOnRails
[10:52:30] UKn0Me: has left #RubyOnRails: ()
[10:53:11] nettoweb: norc sevenseacat I need to host some repos, need to catch exceptions and someting like notebook to note important things there
[10:53:48] sevenseacat: catching exceptions isnt really the responsibility of a code hosting service
[10:53:55] sevenseacat: there are dedicated error trackers for that
[10:54:17] Jasaka: has joined #RubyOnRails
[10:55:16] tetraktys: has joined #RubyOnRails
[10:55:45] workmad3: something like honeybadger is nice for exception notification... it also has github integration, allowing you to do things like set HB up to open new github issues when exceptions happen, etc.
[10:56:02] dvinciguerra_: has joined #RubyOnRails
[10:56:23] workmad3: but yeah, you're not likely to find everything in one place
[10:59:37] reactormonk: Radar, any recommendations on what to return? deleted items? An empty object?
[11:03:24] workmad3: reactormonk: a 204 No Content, or a 200 OK with the deleted item(s) seems reasonable to me
[11:03:36] workmad3: reactormonk: but it's up to you to decide when designing your API
[11:04:02] workmad3: reactormonk: if you're talking HTML browsable, the common decision is to redirect to the collection url
[11:04:47] reactormonk: workmad3, nah, json. Nice idea about the 204.
[11:06:24] Skelz0r: has joined #RubyOnRails
[11:08:09] Ropeney: has joined #RubyOnRails
[11:11:23] szulak: has joined #RubyOnRails
[11:12:41] adlerdias: has joined #RubyOnRails
[11:14:05] Pazician: has joined #RubyOnRails
[11:16:12] DoubleMalt: has joined #RubyOnRails
[11:16:13] pawnbox: has joined #RubyOnRails
[11:16:21] szulak: has joined #RubyOnRails
[11:17:28] sleungcy: has joined #RubyOnRails
[11:18:10] trinaldi: has joined #RubyOnRails
[11:18:42] Skelz0r: has joined #RubyOnRails
[11:18:45] arup_r: has joined #RubyOnRails
[11:20:11] Pazician: has joined #RubyOnRails
[11:23:36] Ergo: has joined #RubyOnRails
[11:24:30] GG: has joined #RubyOnRails
[11:28:43] FailBit: has joined #RubyOnRails
[11:28:48] FailBit: ACTION yawns
[11:28:52] petertretyakov: has joined #RubyOnRails
[11:29:02] RubyJedi-ing: has joined #RubyOnRails
[11:32:02] Skelz0r: has joined #RubyOnRails
[11:33:30] w09x: has joined #RubyOnRails
[11:34:13] petor: has joined #RubyOnRails
[11:35:04] norc: nettoweb: Our need to combine code hosting with error tracking, as well as flexible team collaboration led us to buy Jira/Stack/Confluence.
[11:35:22] norc: nettoweb: Its best if you just write down a list of specific features you want, so you can compare products out there that meet your requirements.
[11:35:48] nobitanobi: has joined #RubyOnRails
[11:35:53] sevenseacat: has joined #RubyOnRails
[11:37:04] ldnunes: has joined #RubyOnRails
[11:39:23] Ergo^: has joined #RubyOnRails
[11:39:57] kadoppe: has joined #RubyOnRails
[11:40:06] nobitanobi: Is there any way with ActiveRecord to not allow accessing attributes of an associated model? So, if a User belongs_to Phone, and I am currently doing user.phone.name, I want that if anybody tries to do user.phone.name raise an error. Basically I am refactoring attributes that are in phone and shouldn't be there, and I want to make sure nobody in the application tries to access them through user.
[11:40:21] norc: Okay, Im absolutely lost. Im running Rails with Unicorn behind an Apache reverse proxy on the same host. In all my logs I just see for the requests, even though Apache passes the correct IP address in an X-Forwarded-For header.
[11:40:39] techsethi: has joined #RubyOnRails
[11:40:56] norc: nobitanobi: Just define the method and use self['attr_name'] to actually get it.
[11:41:27] norc: nobitanobi: def attr_name; self['attr_name'] or raise YourError; end
[11:41:35] nobitanobi: norc: I want that if anybody with a user object tries to do user.phone.name gets an error
[11:41:51] nobitanobi: wouldn't I need to create a proxy class inside user for the phone association?
[11:42:02] norc: nobitanobi: I think I misunderstood.
[11:42:03] nobitanobi: like, if somebody tries to do phone.name directly, it shouldn't raise an error.
[11:42:12] nobitanobi: it's just if it's accessed through user
[11:42:16] norc: nobitanobi: What is your exact goal.
[11:42:27] norc: Are you trying to enforce coding guidelines?
[11:42:40] norc: Are you trying to enforce some kind of security policy?
[11:42:54] sp1rs: has joined #RubyOnRails
[11:43:21] nobitanobi: My end goal is that at any part of the code that a user object exists, you can't do user.phone.name
[11:43:30] norc: nobitanobi: To what end?
[11:43:32] nobitanobi: But, you can do user.phone.number or user.phone.prefix
[11:43:40] nobitanobi: Killing a coupling between these two models
[11:43:44] nobitanobi: that shouldn't be there on the first place
[11:43:59] norc: nobitanobi: Again, to what end? Coding style? Security?
[11:44:20] norc: If you want to raise exceptions it means you are concerned about someone trying to do it.
[11:44:31] nobitanobi: Coding style yes
[11:44:40] chouhoulis: has joined #RubyOnRails
[11:44:44] stien: has joined #RubyOnRails
[11:44:46] nobitanobi: so that any developer working with these models doesn't have the assumption of from a user being able to get the name through the phone
[11:45:31] norc: nobitanobi: define a method "name" on Phone that raises an Deprecated error perhaps?
[11:45:56] nobitanobi: norc: the issue is that I just want this to happen if this attribute is get through user
[11:46:04] nobitanobi: if I do phone.name, I still want to return something
[11:46:58] nobitanobi: I was hoping AR would allow to do something like belongs_to :phone, except_attributes: [:name]
[11:47:00] norc: nobitanobi: I think you are overthinking this. If you have special relationships between your models then document it. If a developer still fails to adhere, let him spent his time to debug it.
[11:47:11] FailBit: you can enforce it with a proxy on the user model, I guess
[11:47:20] FailBit: but why would you honestly
[11:47:40] FailBit: just git grep for ".phone.name"
[11:47:44] FailBit: and tear it out
[11:47:57] FailBit: "\.phone\.name" because regexp
[11:48:09] nobitanobi: FailBit: I have done a refactor so that this assumption is gone. But since the models are related, I want to restrict nobody else assumes that it can get this attribute
[11:48:59] norc: nobitanobi: Write it in your changelog.
[11:49:18] FailBit: class User; def phone; @phone ||= super.instance_eval { undef :name }; end; end
[11:49:35] FailBit: is one way to do it
[11:49:40] norc: FailBit: That is elegant.
[11:49:57] nobitanobi: FailBit: gladly appreciate this
[11:50:00] nobitanobi: norc: same to you
[11:50:19] norc: FailBit: Though this should not work, should it?
[11:50:32] FailBit: ah yeah right
[11:50:36] FailBit: it needs to return self
[11:50:44] nfk|laptop: has joined #RubyOnRails
[11:50:47] FailBit: class User; def phone; @phone ||= super.instance_eval { undef :name; self }; end; end
[11:50:49] norc: FailBit: No because attributes in AR come from method_missing.
[11:51:16] norc: FailBit: And even if they did not, they would belong to an actual module or class, and not a singleton class.
[11:51:30] FailBit: then you could override it with a fail method
[11:51:42] nobitanobi: trying to follow this conversation
[11:51:43] FailBit: def name; fail; end
[11:51:53] norc: That would work.
[11:52:02] nobitanobi: FailBit: what is the purpose of doing super.instance_eval?
[11:52:22] FailBit: to get the phone record from AR
[11:52:32] norc: nobitanobi: class User; def phone; @phone ||= super.instance_eval { def name; raise DeprecationError; end; self }; end; end
[11:53:27] King_Rex: has joined #RubyOnRails
[11:54:08] norc: nobitanobi: Also it allows you to define a method on the singleton class of the AR object (so that you do not conflict with other objects of the Phone class).
[11:55:09] nobitanobi: playing with it. Thanks
[11:57:43] nobitanobi: one question, when we do super, we are getting into the ActiveRecord::Base class, how does it know you are refering to phone? Is it because the method name is the same, yes?
[11:58:20] workmad3: nobitanobi: `super` calls the original `phone` method, which returns an instance of Phone (or whatever that model class is called)
[11:58:33] workmad3: nobitanobi: and then you're using `instance_eval` on that returned instance
[11:58:38] Skelz0r: has joined #RubyOnRails
[11:58:40] nobitanobi: yep, nice. Thank you folks
[11:58:43] norc: nobitanobi: super invokes __method__ one level higher in your inheritance chain.
[11:59:18] norc: nobitanobi: Note the lack of arguments _and_ parens to super. Using that style, it will automatically pass any arguments.
[11:59:31] norc: (Whereas super() would call __method__ with no arguments)
[11:59:31] nobitanobi: fantastic :)
[11:59:34] nobitanobi: I really appreciate this
[11:59:40] workmad3: nobitanobi: btw, I'd probably suggest that instead of messing around with the singleton class, that you instead introduce an explicit wrapper around Phone that forwards what you want on... `def phone; PhoneWrapper.new(super); end`
[11:59:41] norc: It is a subtle but disgusting difference.
[12:00:02] workmad3: and then PhoneWrapper can be used to introduce any modifications you want
[12:00:28] nobitanobi: workmad3: I see
[12:00:48] workmad3: (I'd also be tempted to play with the name... DeprecatedUserPhone maybe?)
[12:01:00] rvanlieshout: has joined #RubyOnRails
[12:01:01] nobitanobi: you mean for the wrapper yeah?
[12:01:04] nobitanobi: yeah, good point
[12:01:13] nobitanobi: I would need to look on how to delegate everything
[12:01:17] nobitanobi: except X,Y,Z
[12:01:21] nobitanobi: where I want to raise
[12:01:38] norc: nobitanobi: Personally though Im not a fan of raising exceptions, even in these cases. I would simply emit a warning in your log, that way if users have some bizarre reason to try anyway, they do not get an exception thrown into your face.
[12:01:51] norc: nobitanobi: Reason being the model itself will have the *name* attribute regardless.
[12:02:02] nobitanobi: norc: thanks for your thoughts
[12:02:09] FailBit: personally
[12:02:14] FailBit: I am not a fan of wrapper classes
[12:02:37] FailBit: it leads to shitty lasagna code and I've spent months cleaning up
[12:02:50] FailBit: especially if you're just overriding one method
[12:03:02] workmad3: FailBit: not as much, IME, as defining methods on the fly inside other objects :)
[12:03:07] nobitanobi: workmad3: why would you avoid messing around with the singleton class?
[12:03:21] tvw: has joined #RubyOnRails
[12:03:22] nobitanobi: also, when we refer to singleton class, which one are we refering to?
[12:03:53] norc: Since we are all awake, who here has an idea why Rails would write into the log for requests, instead of 192.168.x.156 when sitting behind an Apache reverse proxy that passes a correct X-Forwarded-For header?
[12:04:05] mentero: has joined #RubyOnRails
[12:04:25] norc: (My action_dispatch.trusted_proxies is modified to exclude the 192.168/24 subnet)
[12:04:33] FailBit: nobitanobi: the one you're calling instance_eval on
[12:04:36] FailBit: that's the singleton
[12:04:56] nobitanobi: gotcha, because you can just have one per user
[12:05:45] qejk: has joined #RubyOnRails
[12:05:48] workmad3: nobitanobi: `singleton_class` is a ruby feature, basically every object you create has a singleton_class that allows you to define customisations for just that object
[12:06:13] norc: nobitanobi: Each object instance automatically has an associated singleton_class. This is why you can for example do: a = "foo"; def a.bla; self.length; end; a.bla
[12:06:19] norc: Oh boy, Im just too slow today.
[12:06:22] nobitanobi: workmad3: ok thanks
[12:06:40] norc: (Ruby only allows methods on modules and classes, nothing else)
[12:07:18] nobitanobi: guys this was really useful. I will play with both using the singleton class or the wrapper and see what fits best
[12:09:13] dANOKELOFF: has joined #RubyOnRails
[12:12:03] workmad3: nobitanobi: the reason I'd avoid using it is because modifying the singleton_class essentially means you're introducing 2 different forms of `Phone` object... one of them (`UserPhone`) behaves in different ways to the other (`NonUserPhone`), and the difference isn't being represented anywhere except as 2 lines of code nested inside your `User` model
[12:12:47] nobitanobi: I see workmad3
[12:13:15] workmad3: nobitanobi: the technical term is that you're violating Liskov's Substitution Principle :)
[12:13:18] eljimbo: has joined #RubyOnRails
[12:13:34] aegis3121: has joined #RubyOnRails
[12:14:22] nobitanobi: workmad3: makes sense :)
[12:17:08] dANOKELOFF: Hi, in activeadmin I know is possible to create some custom filter, but in my case, I have some Order and each orders has many order_details with product, price_unit etc... And I want to create a custom filter for search an order depend of his Includ tax price but I dont know if it's possible, anyone can help me ?
[12:17:20] szulak: has joined #RubyOnRails
[12:17:22] diegoaguilar: has joined #RubyOnRails
[12:18:15] sleungcy: has joined #RubyOnRails
[12:21:06] snowy: has joined #RubyOnRails
[12:22:38] zpe: has joined #RubyOnRails
[12:23:06] Fernando-Basso: has joined #RubyOnRails
[12:30:04] nartes: has joined #RubyOnRails
[12:32:00] GG: has joined #RubyOnRails
[12:32:39] bbrowning: has joined #RubyOnRails
[12:37:08] dvinciguerra: has joined #RubyOnRails
[12:37:25] rafaelfranca: has joined #RubyOnRails
[12:38:35] nartes: has joined #RubyOnRails
[12:39:03] pwnd_nsfw`: dANOKELOFF, you could possibly write the filter inside of the order/order_details model
[12:40:46] sp1rs: has joined #RubyOnRails
[12:41:50] RORapprentice: has joined #RubyOnRails
[12:42:11] flashpoint9: has joined #RubyOnRails
[12:42:38] bruno-: has joined #RubyOnRails
[12:44:39] IrishGringo: has joined #RubyOnRails
[12:44:52] drbayer: has joined #RubyOnRails
[12:45:11] dannyguk: has joined #RubyOnRails
[12:45:26] chouhoulis: has joined #RubyOnRails
[12:48:40] RegulationD: has joined #RubyOnRails
[12:51:11] AmiMoench: has joined #RubyOnRails
[12:54:10] kadoppe: has joined #RubyOnRails
[12:57:39] RORapprentice: Good day. I am currently in the process of upgrading a Rails 2.3.18 ruby 1.8.7 app. For the moment I need to run a migration with a foreign key, failing due to foreign key constraint. https://gist.github.com/alexmalus/6621a3914af103fd488fd526ad1c68c9
[12:58:40] rvanlieshout: RORapprentice: what should it do? ignore the constraints during migration?
[12:59:46] RORapprentice: rvanlieshout: I have defined the constraints in my models
[12:59:58] ramortegui: has joined #RubyOnRails
[13:00:07] rvanlieshout: but that's not hte issue
[13:00:24] mcr-credil: has joined #RubyOnRails
[13:00:28] rvanlieshout: your update in the db conflicts with a foreign key constraint
[13:01:53] RORapprentice: rvanlieshout: I see, looking at all the foreign keys in the table as we speak
[13:02:23] rake_db_migrate: has joined #RubyOnRails
[13:02:26] rvanlieshout: so what should it do?
[13:02:34] rvanlieshout: who is wrong here? you or the foreign key constraint
[13:03:55] bruno-: has joined #RubyOnRails
[13:06:28] andywww: has joined #RubyOnRails
[13:06:46] RORapprentice: rvanlieshout: I am trying to make a belongs_to has_many relationship. One table belongs_to another through that foreign_key.
[13:08:36] rvanlieshout: RORapprentice: but the constraint here tells you you're doing something invalid
[13:09:14] rvanlieshout: Cannot resolve table name close to:
[13:09:14] rvanlieshout: (id), FOREIGN KEY (status_id) REFERENCES statuses (id), FOREIGN KEY (employee_id) REFERENCES employee_student_employees (id)) ENGINE=InnoDB
[13:09:24] rvanlieshout: so i guess there is no statusses table
[13:10:01] jtong: has joined #RubyOnRails
[13:12:47] akshat: has joined #RubyOnRails
[13:14:22] jokke: i'm implementing russian doll caching for a rails app according to https://signalvnoise.com/posts/3113-how-key-based-cache-expiration-works
[13:14:43] RORapprentice: rvanlieshout: all the required tables are present. the same migration runs fine on rails 3
[13:14:43] andywww: has joined #RubyOnRails
[13:15:01] norc: Why am I getting the address for requests in my server (behind a reverse proxy on the same machine) log?
[13:15:14] jokke: i have a publishing system in the app that uses cancancan and accessible_by(current_ability)
[13:15:31] jokke: so somehow i need to bust the cache at this point
[13:15:53] tetraktys: has joined #RubyOnRails
[13:15:59] ekinmur: has joined #RubyOnRails
[13:16:09] jokke: how can i make a view exclude itself from the russian doll caching and make sure it's rendered every time
[13:16:49] jokke: i'd add an if clause that would check if there is a user logged in. if not the cache can be used
[13:17:04] yottanami: has joined #RubyOnRails
[13:17:47] yottanami: I am trying to override devise registration so I used ` devise_for :users, :controllers => {:registrations => "registrations"}` in routes but I got this error http://dpaste.com/1TMFETQ am I doing wrong?
[13:18:45] joshkovach: has joined #RubyOnRails
[13:18:54] pawnbox: has joined #RubyOnRails
[13:19:03] jokke: ah perfect: http://stackoverflow.com/questions/13857160/rails-how-to-exclude-blocks-of-code-from-fragment-cache#13857696
[13:19:05] sleungcy: has joined #RubyOnRails
[13:19:21] norc: yottanami: did you generate your user model, like the Getting Started section told you?
[13:19:51] context: did you read the error ?
[13:21:27] drbayer: has joined #RubyOnRails
[13:22:43] dblessing: has joined #RubyOnRails
[13:23:19] jerohm: has joined #RubyOnRails
[13:24:32] aresela: has joined #RubyOnRails
[13:25:42] CornishPasty: Does anyone here use the rails:onbuild docker image?
[13:26:36] merida: has joined #RubyOnRails
[13:28:05] delgiudices: has joined #RubyOnRails
[13:28:06] bruno-: has joined #RubyOnRails
[13:31:30] RORapprentice: rvanlieshout: I've looked more on stackoverflow for this problem, some just created the table and added the refs to it, I also tried it but failed for rails 2, works for rails 3, gist updated: https://gist.github.com/alexmalus/5549424a6e744719844a172bbce21c47
[13:33:22] rvanlieshout: RORapprentice: is that table also present at that time?
[13:33:26] rvanlieshout: when running that migration
[13:33:30] rvanlieshout: or is it created afterwards?
[13:33:35] pawnbox: has joined #RubyOnRails
[13:33:39] JFlash: has joined #RubyOnRails
[13:33:39] RORapprentice: rvanlieshout: present
[13:33:39] quazimodo: has joined #RubyOnRails
[13:33:41] quazimod1: has joined #RubyOnRails
[13:33:56] RORapprentice: first I'm creating the table, then running the migration for the refs
[13:34:08] rvanlieshout: what table are you creating?
[13:34:09] rvanlieshout: which of the 2
[13:34:19] context: can you define "cannot run" ...
[13:34:25] RORapprentice: pman_product_feasibilities
[13:34:33] ellen_: has joined #RubyOnRails
[13:34:44] conta: has joined #RubyOnRails
[13:34:53] rvanlieshout: RORapprentice: the statment complains about statuses and employee_student_employees
[13:34:53] context: i imagine you get an error, SOME error. or does rake db:migrate literallyt say "cannot run" and exit ?!?!
[13:34:58] someish: has joined #RubyOnRails
[13:35:03] rvanlieshout: t.column :employee_id, :int, :null => false, :references => :employee_student_employees
[13:35:18] rvanlieshout: RORapprentice: so employee_student_employees is present? and also created in a migration before this one?
[13:35:34] RORapprentice: rvanlieshout: yes it is present and created in a migration before this one
[13:35:59] rvanlieshout: RORapprentice: and which one has the status_id reference?
[13:36:11] rvanlieshout: and the table statuses is prsent too?
[13:37:10] jyraff: has joined #RubyOnRails
[13:37:18] context: so wait a minute
[13:37:23] context: your upgrading from rails 2 -> 3
[13:37:36] context: why do you care if the migration runs on rails 2 then ?
[13:38:20] RORapprentice: context: because in the same time my client also wants to fix something in rails 2, I also have to maintain the rails 2 app
[13:38:32] context: then keep separate branches.
[13:38:45] context: stop trying to have the same code run on rails 2 & 3
[13:38:49] context: thats not the way this wroks
[13:38:51] RORapprentice: context: I have two separate apps
[13:38:56] RORapprentice: context: with the same db
[13:39:01] context: do you maintain your car to run on gasoline & deisel ? no. you have two cars.
[13:39:15] pwnd_nsfw`: http://www.21cpw.com/wp-content/uploads/2015/02/d1Z-thats-not-how-it-works-thats-not-how-any-of-this-works.jpg
[13:39:39] GodFather: has joined #RubyOnRails
[13:39:47] bronson: has joined #RubyOnRails
[13:39:56] context: the same schema or same... db
[13:40:04] norc: context: I used to have a vehicle that worked with both...
[13:40:07] norc: I know thats not helping but...
[13:40:13] context: rorapprentice: just make them upgrade then fix the problem in rails 3 ;)
[13:40:33] context: norc: you just had to be that guy huh ;)
[13:40:47] pwnd_nsfw`: Why are we not upgrading to 4 btw
[13:40:56] pwnd_nsfw`: does this client enjoy being a step behind at all times?
[13:40:56] sp1rs: has joined #RubyOnRails
[13:40:58] pwnd_nsfw`: or several steps
[13:41:08] context: cause, maintaining insecure rails 2 apps are fun
[13:41:37] chouhoulis: has joined #RubyOnRails
[13:41:38] pwnd_nsfw`: job security is nice
[13:41:48] context: rorapprentice: i told a client once i wouldn't fix/add to an app until it was upgraded.
[13:42:17] norc: context: I know, right? And since that was too boring by itself, my car also had to have a 120mm smooth bore gun ontop. In for a penny, in for a pound.
[13:42:24] pwnd_nsfw`: That's a large deal behind the rails community anyways
[13:42:29] pwnd_nsfw`: like, that you really NEED to upgrade
[13:42:44] RORapprentice: context: that might be a good idea.
[13:42:56] loechel: has joined #RubyOnRails
[13:43:36] RORapprentice: thank you all for your tips, much appreciated
[13:43:46] context: i dont pride myself on trying to keep track of rails 2 semantics. i learned them once, not learning them again for a few dollars
[13:43:58] apotry: has joined #RubyOnRails
[13:44:03] pwnd_nsfw`: I would for a full time salary
[13:44:04] stannard: has joined #RubyOnRails
[13:44:13] RORapprentice: pwnd_nsfw`: mine is part time
[13:44:16] Palsson: has joined #RubyOnRails
[13:44:29] context: rorapprentice: and if you have to mess with rails 2, i personally wouldn't go aout of my way to try to get foreign key constraints to work
[13:44:50] norc: With all the expertise, is there noone here who can tell me why Rails refuses to log the correct remote ip address from X-Forwarded-For (its not included in the trusted proxies list)?
[13:45:09] norc: (For requests in the rails application log)
[13:45:27] stannard: has joined #RubyOnRails
[13:45:39] pwnd_nsfw`: ACTION shrugs.
[13:45:45] kalido: has joined #RubyOnRails
[13:45:49] context: http://api.rubyonrails.org/classes/ActionDispatch/RemoteIp.html
[13:45:51] context: rake middleware
[13:46:05] CornishPasty: I have the following issue with a rails application running inside docker / rails:4.2 - https://gist.github.com/wizardfrag/172ce547c9f724d4d1bbf874aeffb7a1
[13:46:19] kalido: anyone know why is this happening? PG::UndefinedTable: ERROR: relation "votes" does not exist
[13:46:20] CornishPasty: Can't seem to work out what the problem is, bundler has definitely installed that gem
[13:46:50] pwnd_nsfw`: kalido, what does your schema look like
[13:46:59] norc: Okay, I guess I have to debug from the logger then. :(
[13:47:32] jokke: hey, one more thing about russian doll caching: i have a model which has a method that aggregates multiple instances of it's parent models class. I can't invalidate the cache with :touch. How can i make sure i wont serve stale data?
[13:47:39] RORapprentice: context: when you run a migration, isn;t the schema.rb updating to reflect the current state of the database? I know for rails 3+ onwards they do, don't quite see it in the rails guides for rails2. It's my last attempt to understand why I can't solve this.
[13:48:01] RORapprentice: context: http://guides.rubyonrails.org/v2.3.11/migrations.html do I need to run rake db:migrate to have the schema upgrade? it's from my understanding of the context
[13:48:11] jokke: https://p.jreinert.com/DncSQ/haml
[13:48:32] jokke: line 7 calls the method
[13:49:02] RORapprentice: shame rvan quit, wanted to say thanks for his trouble :(
[13:49:09] pwnd_nsfw`: jokke, line 7 is blank
[13:49:17] jokke: uh sorry 8
[13:49:33] kalido: my shema: https://gist.github.com/luisamaro0/2c7af85a793cab90036a632bdcef8d55
[13:50:05] pwnd_nsfw`: kalido, and the relevant models?
[13:50:06] jokke: you'd think there's some way to exclude parts from the cache
[13:50:10] pwnd_nsfw`: votes isn't a table, I'll say that much
[13:50:35] aresela: has left #RubyOnRails: ()
[13:50:50] pwnd_nsfw`: kalido, update the gist with all relevant files. Controller, models, no views though
[13:50:54] jokke: on the other hand this would mean that all parent caches can't be built either
[13:51:25] maxdoubt: has joined #RubyOnRails
[13:52:00] context: rorapprentice: yes.
[13:52:12] context: rorapprentice: db:migrate is how you.... migrate the db
[13:52:16] tetraktys: has joined #RubyOnRails
[13:52:17] context: since migrations existed
[13:52:23] jtong: has joined #RubyOnRails
[13:52:39] RORapprentice: context: thank you
[13:53:06] roelof: has joined #RubyOnRails
[13:53:47] roelof: Hello, Is it with Formtastic easy to get a red * when a field is required ?
[13:53:57] kalido: https://gist.github.com/luisamaro0/2c7af85a793cab90036a632bdcef8d55
[13:54:49] pwnd_nsfw`: kalido, what are you doing when this error turns up?
[13:55:01] pwnd_nsfw`: roelof, simple_form
[13:55:19] pwnd_nsfw`: It's not red though, but you can change it I'm sure
[13:55:19] kalido: i was implementing active record reputation system
[13:55:36] pwnd_nsfw`: kalido, what command ..
[13:56:01] roelof: pwnd_nsfw`: I know but simple_form makes it a abbr tag which I do not like.
[13:56:12] kalido: its on running
[13:56:20] kalido: when i go to posts
[13:56:39] pwnd_nsfw`: Why did you not give me posts model
[13:57:08] agent_white: has joined #RubyOnRails
[13:57:10] kalido: its the improvement.rb
[13:57:19] kalido: posts = improvements in my case
[13:57:59] pwnd_nsfw`: kalido, did you restart server
[13:58:04] pwnd_nsfw`: and make sure all migrations are run
[13:58:22] sunya7a_: composite keys in activerecord. I only find composite_primary_keys gem....is there a native solution in place...or any plans for one in the works?
[13:59:14] drbayer: has joined #RubyOnRails
[13:59:23] pwnd_nsfw`: kalido, do you have your code on github?
[13:59:26] pwnd_nsfw`: the whole project
[14:01:04] workmad3: kalido: it looks like you've either not run `rake db:migrate` or you've missed a step in setting up your vote/reputation gem, because you don't have a `votes` table that I'm betting is expected for the `acts_as_votable` incantation
[14:01:13] pwnd_nsfw`: kalido, rails generate acts_as_votable:migration
[14:01:32] workmad3: sunya7a_: no native solution or plans for one afaik
[14:02:01] dANOKELOFF: has joined #RubyOnRails
[14:02:04] kalido: is it possible that the gem activerecord reputation system is conflicting with acts_as_votable?
[14:02:16] lawton: has joined #RubyOnRails
[14:02:16] kalido: because acts as votable was working normally
[14:02:49] pwnd_nsfw`: Well, your schema is missing act_as_votable fields
[14:03:24] pwnd_nsfw`: I'm pretty sure anyways
[14:03:52] pwnd_nsfw`: it's missing the entire votes table
[14:03:55] jmignault: has joined #RubyOnRails
[14:04:10] kalido: hm yes it is
[14:04:27] pwnd_nsfw`: run that generator, then run db:migrate
[14:05:06] CornishPasty: ACTION waits
[14:05:43] DragonPunch: has joined #RubyOnRails
[14:06:12] jtong: has joined #RubyOnRails
[14:06:49] jyraff: has joined #RubyOnRails
[14:06:59] kalido: its giving me the same
[14:07:06] pwnd_nsfw`: Schema again please
[14:07:12] norc: context: Thank you for your humous remark by the way, it made me use the source, Luke.
[14:07:16] AlexJakeGreen: has joined #RubyOnRails
[14:07:18] pwnd_nsfw`: and output from running the acts_as_votable generator
[14:07:44] norc: context: Quickly learned that the logger could not possibly use the middleware code that you linked, and that Im better off supplying my own logger.
[14:08:57] arup_r1: has joined #RubyOnRails
[14:09:02] chouhoulis: has joined #RubyOnRails
[14:09:27] arup_r1: estimating.. :) pwnd_nsfw`
[14:09:49] arup_r: yes.. tickets I have assigned to.. :)
[14:10:11] kalido: ok its working now, i had to delete the migration and run the generator again
[14:10:21] kalido: idk why this deleted the votes table
[14:10:24] arup_r: last 1 I gave 1 hour, and took whole day. So project manager said, do it properly.. hehe
[14:11:12] CornishPasty: Oh I give up on this :@
[14:11:13] arup_r: I didn't know tests take 30mins to finish its all specs :/
[14:11:24] pwnd_nsfw`: CornishPasty, ? I didn't see you post anything, sorry.
[14:11:29] pwnd_nsfw`: arup_r, it can lol
[14:11:33] arup_r: 4000 + tests.
[14:11:37] CornishPasty: pwnd_nsfw`: I have the following issue with a rails application running inside docker / rails:4.2 - https://gist.github.com/wizardfrag/172ce547c9f724d4d1bbf874aeffb7a1
[14:11:43] arup_r: hmm.. first time I am seeing these many
[14:11:46] CornishPasty: I'm just getting frustrated with this :(
[14:11:48] pwnd_nsfw`: Oh, right. Sorry, I dont' know much abotu docker
[14:12:00] CornishPasty: Probably doesn't help that it needs to be done today, and it's 15:11 :P
[14:12:13] Malgorath: has joined #RubyOnRails
[14:12:56] pwnd_nsfw`: should you be copying the gem lock file
[14:13:04] pwnd_nsfw`: I'm just guessing
[14:13:15] CornishPasty: I've pretty much just cloned: https://github.com/docker-library/rails/blob/9df9b5e6b1519faf22e1565c2caaebf7cc1c665b/onbuild/Dockerfile
[14:13:41] roelof: I see this : https://learning-rails-wissel-1.c9users.io/articles/new now. It's there a way I can tell simple_form that the title input box must be under the label ?
[14:14:03] CornishPasty: pwnd_nsfw`: that dockerfile works fine with a different app...
[14:14:11] pwnd_nsfw`: That one looks significantly different
[14:14:30] sunya7a_: workmad3: okay...so the gem is pretty much what people use? or just kind of manually manage is better? (in your opinion.)
[14:14:48] jyraff: has joined #RubyOnRails
[14:15:00] CornishPasty: pwnd_nsfw`: just ignore the "ONBUILD" part, and the apt-get installations at the bottom are done in rails:4.2 instead
[14:15:10] SeanLazer: has joined #RubyOnRails
[14:15:21] akshat_: has joined #RubyOnRails
[14:15:31] SeanLazer: Does anyone know how to access path helpers for routes that are outside of my current constraint?
[14:15:47] SeanLazer: Eg. i'm within a subdomain but i want to use a route helper to generate a link back into the "main app"
[14:15:49] JakFrist: has joined #RubyOnRails
[14:15:59] pwnd_nsfw`: erm... just do it?
[14:16:08] someish: has joined #RubyOnRails
[14:16:10] pwnd_nsfw`: Will provide you the necessities
[14:16:30] pwnd_nsfw`: You basically just put _path after it? I haven't worked with subdomains yet
[14:16:31] SeanLazer: doesn't work, the path helper is unavailable
[14:16:39] pwnd_nsfw`: It gives you an error?
[14:16:49] SeanLazer: undefined method `new_user_registration_path'
[14:17:19] pwnd_nsfw`: Can you gist output for rake routes?
[14:17:37] maxdoubt: has joined #RubyOnRails
[14:17:57] SeanLazer: Here's the relevant line
[14:17:58] SeanLazer: new_user_registration GET /users/sign_up(.:format) registrations#new
[14:18:21] jyraff: has joined #RubyOnRails
[14:18:22] SeanLazer: i think it's because i'm using constraints though
[14:18:41] pwnd_nsfw`: can you gist relevant code
[14:18:57] SeanLazer: https://gist.github.com/SeanRoberts/55581c18fab89fcc8537e3f3ec4f7339
[14:18:58] pwnd_nsfw`: routes, controllers
[14:19:18] pwnd_nsfw`: Contraint file too
[14:19:39] SeanLazer: https://gist.github.com/SeanRoberts/55581c18fab89fcc8537e3f3ec4f7339
[14:19:45] sleungcy: has joined #RubyOnRails
[14:20:25] SeanLazer: essentially i'm allowing sign-in on to any subdomain
[14:20:29] SeanLazer: but registration can only happen on the main app
[14:20:45] SeanLazer: so from within a subdomain i want to be able to link back to the main app registration page
[14:20:47] mwlang: has joined #RubyOnRails
[14:21:02] SeanLazer: but i don't have access to that path helper because i'm not within the MainAppConstraint
[14:22:01] jyraff: has joined #RubyOnRails
[14:22:46] Frem: has joined #RubyOnRails
[14:22:46] n008f4g_: has joined #RubyOnRails
[14:24:51] pwnd_nsfw`: SeanLazer, I've never used constraints like that, so I apologize I myb won't be of help
[14:25:07] SeanLazer: No problem, thanks for taking a look!
[14:25:16] pwnd_nsfw`: I'll normally use namespaces, and use constraints as an attribute
[14:25:44] CornishPasty: pwnd_nsfw`: Looks like it's related to my DATABASE_URL environment variable, not docker!
[14:25:48] CornishPasty: pwnd_nsfw`: https://gist.github.com/wizardfrag/bddc0992d25458aebd2c71c398771392
[14:25:52] yellow5: has joined #RubyOnRails
[14:25:56] jtong: has joined #RubyOnRails
[14:26:03] SeanLazer: I think you would still have the same eventual issue though, I don't think path helpers that are scoped to one constraint are available in a different constraint
[14:26:09] SeanLazer: I think I'll just have to hardcode the URL
[14:26:23] morenoh149: has joined #RubyOnRails
[14:26:35] kies: has joined #RubyOnRails
[14:26:39] CornishPasty: (works fine with psql, so it's a valid URL)
[14:26:50] smathy: has joined #RubyOnRails
[14:27:51] context: uri looks fine to me
[14:28:17] context: parses just fine using URI() here
[14:28:24] CornishPasty: Okay, it's my fault
[14:28:30] CornishPasty: The password has a ^ in it
[14:28:44] CornishPasty: I do apologise everybody
[14:28:53] context: ahh yeah, URI's are awesome when it comes to special chars ;)
[14:29:03] CornishPasty: ACTION fails :D
[14:30:11] jhack: has joined #RubyOnRails
[14:30:18] sypheren: has joined #RubyOnRails
[14:30:33] drbayer: has joined #RubyOnRails
[14:35:21] pwnd_nsfw`: CornishPasty, at least ya got it fixed in time :D
[14:35:24] renegadeandy: Can somebody please help explain this oddity to me please : https://gist.github.com/anonymous/f7f3c903bf6319141d344432a09092c4
[14:35:57] IbRAP89889: has joined #RubyOnRails
[14:37:22] pwnd_nsfw`: Describe the problem more renegadeandy. Which action?
[14:37:32] renegadeandy: pwnd_nsfw`: refunds
[14:38:12] renegadeandy: pnwd i am doing a post to this url : action="/charges/refund"
[14:39:04] pwnd_nsfw`: How do you know it's running it? Sorry, your code is 'pseudo' which is against the rules
[14:39:22] pwnd_nsfw`: I don't have the full picture, so.. I may ask redundant questions
[14:41:08] context: yeah, check your logs... my bet is its executing #create
[14:41:22] lightheaded: has joined #RubyOnRails
[14:41:35] pwnd_nsfw`: good call context
[14:41:41] pwnd_nsfw`: put the refund route first renegadeandy
[14:41:53] kadoppe: has joined #RubyOnRails
[14:42:37] sevenseacat: youve also given absolutely no reason why it *shouldnt* be running validate_charge_params
[14:43:01] arup_r1: has joined #RubyOnRails
[14:43:04] context: sevenseacat: he wanted us to work to be able to see his problem ;)
[14:43:22] context: sevenseacat: isnt that a good thing. make us work to help you ;)
[14:44:03] dannyguk: has joined #RubyOnRails
[14:44:33] jhack: has joined #RubyOnRails
[14:45:18] pwnd_nsfw`: I hate when I'm helping someone and they don't respond right away with feedback on my help :(
[14:45:24] siaW: has joined #RubyOnRails
[14:45:28] pwnd_nsfw`: Like.. I'm sitting here.. the anxiety and suspense is killing me!
[14:45:46] ekinmur: has joined #RubyOnRails
[14:45:52] siaW: my index looks like this. why is my “developer.id” showing ONLY the id of the FIRST developer? https://gist.github.com/siaw23/ac390b71b7530f76827babcd0187cd2f#file-index-html-erb-L13
[14:46:10] krz: has joined #RubyOnRails
[14:46:31] sevenseacat: not enough context to say. what is @developers ?
[14:46:36] bronson: has joined #RubyOnRails
[14:46:42] siaW: i can’t tell what i’m doing wrong. i want it to show the id EACH developer
[14:46:44] renegadeandy: pwnd_nsfw`: im on my way!
[14:47:10] context: pwnd_nsfw`: "glad i could help... im assuming you figured it out. Next!"
[14:47:11] pwnd_nsfw`: siaw, she asked what @developers was
[14:47:23] arup_r: renegadeandy: responds slow, yesterday I saw, and I slept finally ...:/
[14:47:23] pwnd_nsfw`: what's the code in the controller?
[14:47:42] petor: has joined #RubyOnRails
[14:48:36] FailBit: browsing 4chan at work is a bad idea I should stop doing that
[14:48:43] pwnd_nsfw`: browsing 4chan ever
[14:48:52] renegadeandy: pwnd_nsfw`: that works!
[14:49:07] pwnd_nsfw`: renegadeandy, because it thinks "refund" is an id
[14:49:13] siaW: sevenseacat: @developers is a paginated array. looks like this
[14:49:14] pwnd_nsfw`: so, it matches /:id
[14:49:28] renegadeandy: :/ dont understand
[14:49:53] Jet4Fire: has joined #RubyOnRails
[14:49:54] context: renegadeandy: first route matches
[14:49:54] pwnd_nsfw`: post 'charges/:id', to: 'charges#create'
[14:50:02] pwnd_nsfw`: will match 'charges/refund' url
[14:50:20] pwnd_nsfw`: so, it will go to the create action, params[:id] being 'refund'
[14:50:37] context: renegadeandy: nothing in routes says ':id' has to a "number" and this "refund" matches :id
[14:51:14] pwnd_nsfw`: You don't sound sure still
[14:51:15] renegadeandy: but my other route also works. so thats good!
[14:51:23] siaW: sevenseacat: @developers looks like this https://gist.github.com/siaw23/ac390b71b7530f76827babcd0187cd2f#file-developers_controller-rb
[14:51:28] renegadeandy: pwnd_nsfw`: i dont completely understand
[14:51:30] Malgorath: Anyone here use content_tag? I'm trying to pass a variable to a path, not sure how to do so and the api on it isn't clear how to do this
[14:51:36] context: renegadeandy: which part
[14:51:59] workmad3: Malgorath: !gist what you have already
[14:51:59] helpa: Malgorath: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[14:52:01] context: siaw: <%= @developers.inspect %>
[14:52:07] AzaToth: has joined #RubyOnRails
[14:52:09] jhack: has joined #RubyOnRails
[14:52:11] sevenseacat: siaw: that does not tell me what value it has in that view
[14:52:11] pwnd_nsfw`: siaw, in your console do Developer.all
[14:52:15] sevenseacat: which is what i asked
[14:52:16] pwnd_nsfw`: or do what context said
[14:52:18] renegadeandy: context: if i had a second route of /charges/refunds/:id then that would have worked right?
[14:52:30] zave: has joined #RubyOnRails
[14:52:34] pwnd_nsfw`: renegadeandy, yeah probably
[14:52:42] renegadeandy: pwnd_nsfw`: ok cool, got it :) thankyou very much
[14:53:24] Malgorath: workmad3: not really got much at all TBH, I'm trying to find out how to even generate it, its one line only. <%= content_tag 'li', h('WP Todo Lists'), wp_todos_path %> but I can't figure out where or how to add my work_package.id
[14:53:25] agent_white: has joined #RubyOnRails
[14:53:46] bruno-: has joined #RubyOnRails
[14:54:02] nobitanobi: workmad3: thanks for your suggestion on creating this proxy class, I like it
[14:54:08] siaW: pwnd_nsfw`: https://gist.github.com/siaw23/ac390b71b7530f76827babcd0187cd2f#file-developer_all-txt
[14:54:18] JakFrist: has joined #RubyOnRails
[14:54:23] pwnd_nsfw`: pass a variable to a path? some_path(id: id_value) ?
[14:54:26] nobitanobi: I have a question for you though, how would you make any calls to that proxy class, delegate to the object it was initialized with?
[14:54:41] siaW: sevenseacat: developer.all looks like this https://gist.github.com/siaw23/ac390b71b7530f76827babcd0187cd2f#file-developer_all-txt
[14:54:50] pwnd_nsfw`: siaw, do what context said
[14:54:55] pwnd_nsfw`: in your view @developers.inspect
[14:55:09] pwnd_nsfw`: Developer.paginate will return something different, ofc
[14:55:12] sevenseacat: ACTION gives up
[14:55:37] siaW: ok let me check
[14:55:41] sevenseacat: i asked a question three times
[14:55:50] sevenseacat: and got three different responses, none of which answered the question
[14:55:55] sevenseacat: i only have so much patience
[14:56:02] pwnd_nsfw`: ok r4dar, calm down
[14:56:23] sevenseacat: pwnd_nsfw`: you didnt help the situation by telling them to do something unrelated
[14:56:28] pwnd_nsfw`: Yeah, I know
[14:57:01] siaW: oops, @developers.inspect returns nil
[14:57:15] pwnd_nsfw`: how does it even give you the first id then?
[14:57:23] pwnd_nsfw`: You said it gives you the first, right?
[14:57:46] pwnd_nsfw`: can you show us where/how you're calling it
[14:58:33] adavia: has joined #RubyOnRails
[14:58:49] seaworthy: has joined #RubyOnRails
[14:59:08] Begi: has joined #RubyOnRails
[14:59:29] Begi: has left #RubyOnRails: ()
[14:59:29] siaW: actually no
[14:59:48] fxn: has joined #RubyOnRails
[14:59:59] siaW: if i do `developer.inspect` in an each block, i get https://gist.github.com/siaw23/ac390b71b7530f76827babcd0187cd2f#file-developer-inspect-text
[15:00:50] siaW: so i’m calling `developer.inspect’` inside of this https://gist.github.com/siaw23/ac390b71b7530f76827babcd0187cd2f#file-index-html-erb-L2
[15:01:23] pwnd_nsfw`: but what is @developers
[15:01:31] sevenseacat: siaw: it would be really, really nice if you could give a straight answer to a simple question.
[15:01:46] bruno-: has joined #RubyOnRails
[15:01:47] siaW: @developers = https://gist.github.com/siaw23/ac390b71b7530f76827babcd0187cd2f#file-developers_controller-rb-L5
[15:02:07] sevenseacat: siaw: this is now the sixth time you've been asked.
[15:02:11] siaW: i thought i did post this already :)
[15:02:26] dopie2: has joined #RubyOnRails
[15:02:30] aegis3121: has joined #RubyOnRails
[15:02:31] sevenseacat: you have not yet answered the question about the value of the @developers variable.
[15:02:32] tvw: has joined #RubyOnRails
[15:02:35] sevenseacat: you have one more chance.
[15:03:11] pwnd_nsfw`: We want you to print the contents of @developers
[15:03:57] jinette: has joined #RubyOnRails
[15:04:19] pwnd_nsfw`: in fact, we dare you
[15:04:19] epochwolf: ACTION waits to see the carnage. 
[15:05:30] siaW: ok so @developers in my views is there https://gist.github.com/siaw23/ac390b71b7530f76827babcd0187cd2f#file-index-html-erb-L5 and the result of that is #<Developer::ActiveRecord_Relation:0x007ffa59320db0>
[15:05:42] siaW: better answer now? :)
[15:06:19] sevenseacat: [22:54:55] pwnd_nsfw`: in your view @developers.inspect
[15:06:23] sevenseacat: that was 15 minutes ago
[15:06:31] sevenseacat: one more chance.
[15:06:38] pwnd_nsfw`: One more one more chance
[15:06:47] context: <%= @developers.count %>
[15:07:05] context: .inspect will say Relation since he never instantiated the query
[15:07:18] i: has joined #RubyOnRails
[15:07:37] siaW: <%= @developers.inspect %> shows this #<ActiveRecord::Relation [#<Developer id: 1, login: "siaw23", full_name: "Emmanuel Mensah", about: "hellow world", created_at: "2016-04-11 14:42:13", updated_at: "2016-04-11 14:42:13">, #<Developer id: 2, login: "pankowecki", full_name: "Robert", about: "hi my name is robert", created_at: "2016-04-11 14:42:36", updated_at: "2016-04-11 14:42:36">]>
[15:07:39] sevenseacat: yes he did, on line 3
[15:07:42] context: although he did @developers, i thought that wouldnt instantiated
[15:07:57] context: siaw: and .count says 2?
[15:07:58] sevenseacat: hooray, so you have two records in your relation
[15:08:11] sevenseacat: so when you print out their IDs, you will get 1 and 2
[15:08:26] mark3: has joined #RubyOnRails
[15:08:28] RegulationD: has joined #RubyOnRails
[15:08:35] siaW: context: .counts says 2
[15:08:40] context: can tell they are learning rails.
[15:08:48] context: set_* methods. /me runs away
[15:09:09] context: siaw: the @developers.each do .. will print two records.
[15:09:21] diegoaguilar: has joined #RubyOnRails
[15:09:34] pwnd_nsfw`: inb4beenworkingallalong
[15:09:42] siaW: yes, i know it’ll print 2 records.
[15:10:05] siaW: i have applied a modal that on click of each record, it should show the id of that clicked record
[15:10:17] siaW: but it shows the id of ONLY the first record
[15:10:19] sevenseacat: well this new information
[15:10:20] sevenseacat: wheres the code for that?
[15:10:34] context: siaw: no. we helped with the question you asked. thats it.
[15:10:48] bronson: has joined #RubyOnRails
[15:11:03] context: pretty sure modal or html/js code for modal was never involved in anything you gisted
[15:11:06] polishdub: has joined #RubyOnRails
[15:11:08] sevenseacat: ohhhhhh I see, its that invalid HTML in the middle of the table
[15:11:09] context: also pretty sure it was never in your question.
[15:11:18] siaW: it was :)
[15:11:22] sevenseacat: siaw: you cannot have two modal windows with the same ID like that
[15:11:27] siaW: sevenseacat: https://gist.github.com/siaw23/ac390b71b7530f76827babcd0187cd2f#file-index-html-erb-L17
[15:11:31] siaW: from line 17 downwards
[15:11:34] sevenseacat: your HTML is also completely invalid, you can't have divs in between table rows
[15:12:05] sevenseacat: but it would have been really nice for you to tell us that the problem was when you popped up a model window, instead of just 'an invalid ID on the page'
[15:12:08] context: yeah wtf does @developers have to do with an HTML modal....
[15:12:25] siaW: i’m sure i did mention that :)
[15:12:39] sevenseacat: no, you did not
[15:12:50] context: is that why you let us continue to help you try to get both records on screen, when you clearly already seen both records on screen ?
[15:13:10] JakFrist: has joined #RubyOnRails
[15:13:18] context: Anyways! sevenseacat already told you what was wrong. duplicate #id, invalid html.
[15:13:25] siaW: context: i think there was a misunderstanding, sorry my fault
[15:13:44] siaW: context: where’s the duplicate id?
[15:13:50] siaW: i can’t see it
[15:13:51] pwnd_nsfw`: <div class="modal fade" id="snapmodal" tabindex="-1" role="dialog">
[15:13:52] sevenseacat: https://gist.github.com/siaw23/ac390b71b7530f76827babcd0187cd2f#file-index-html-erb-L24
[15:13:54] context: id=:"snapmodal"
[15:13:55] pwnd_nsfw`: will print twice
[15:14:08] pwnd_nsfw`: well, for every record in @developers
[15:14:47] siaW: now i’m getting it
[15:15:19] pwnd_nsfw`: you could like... id="snapmodal-#{developer.id}" and have js look for it still
[15:15:22] siaW: so in this case i’m thinking to move https://gist.github.com/siaw23/ac390b71b7530f76827babcd0187cd2f#file-index-html-erb-L24 out of the .each block
[15:15:27] i: has joined #RubyOnRails
[15:15:45] pwnd_nsfw`: all of these things are supposed to show up on the modal?
[15:15:51] pwnd_nsfw`: there's only supposed to be one modal?
[15:15:56] siaW: just one modal
[15:16:03] pwnd_nsfw`: Yeah, that'd be wise then...
[15:16:05] siaW: to dispay the id of each user clicked
[15:17:05] merida_: has joined #RubyOnRails
[15:17:39] lightheaded: has joined #RubyOnRails
[15:19:07] context: you can do one of two things
[15:19:20] context: loop twice, creating a unique modal window for each record OUTSIDE of the table.
[15:19:27] context: ^^ thats #3
[15:19:42] context: or 2: create one modal, and change the contents based off the record clicked when they open it
[15:21:05] siaW: context: with option 2, it would look like this right? https://gist.github.com/siaw23/ac390b71b7530f76827babcd0187cd2f#file-index-html-erb
[15:21:07] Devalo: has joined #RubyOnRails
[15:21:25] siaW: modal starts on line 19
[15:21:47] context: you could..... try it
[15:21:48] context: and no #2 requires that you learn JS
[15:22:31] context: but id recommend learning some ruby basics. your mixing of @developer and developer implies you might not know the difference between them
[15:23:34] kadoppe: has joined #RubyOnRails
[15:24:33] nobitanobi: workmad3: I'm actually getting issues with that approach. Since user.phone is no longer returning Phone, but a ProxyPhone, there are issues when for example creating factories with FactoryGirl. I get a AssociationTypeMismatch, where a phone was expected, but received a ProxyPhone
[15:24:39] drbayer: has joined #RubyOnRails
[15:25:06] siaW: context: can you please help me fix it?
[15:25:46] siaW: i have no idea how to make the use id in the modal reflect the id of the item clicked
[15:25:47] baweaver: has joined #RubyOnRails
[15:26:00] fxn: has joined #RubyOnRails
[15:26:41] workmad3: nobitanobi: ah, that sucks :(
[15:26:57] nobitanobi: hehe yeah it's interesting though
[15:27:08] nobitanobi: if it quacks like a duck is a duck
[15:27:11] nobitanobi: not really :D
[15:28:45] arup_r: has joined #RubyOnRails
[15:29:03] B4daBing73: has joined #RubyOnRails
[15:29:03] B4daBing73: has joined #RubyOnRails
[15:32:08] siaW: i’m stuck, can someone help me?
[15:33:20] snowy: has joined #RubyOnRails
[15:33:36] sypheren: has joined #RubyOnRails
[15:33:45] nickenchuggets: has joined #RubyOnRails
[15:33:47] jtong_: has joined #RubyOnRails
[15:34:29] soahccc: does anyone have an idea on how to catch this error so that it doesn't spam my exception logger? :) https://gist.github.com/2called-chaos/e763013533d603ec88a447363ac97acb
[15:34:42] context: siaw: thanks. you have solved the life long question of how vague can someone be on irc.
[15:35:10] siaW: context: i need help with the same thing?
[15:35:35] siaW: showing a modal for each user to display their id
[15:35:37] context: soahccc: uhh, you odnt need to merge get/post params
[15:35:51] soahccc: context: this is straight from rack source
[15:35:53] context: siaw: you still havent asked a question....
[15:36:21] GG: has joined #RubyOnRails
[15:36:31] soahccc: context: I also don't get it since it's a GET request
[15:37:01] context: soahccc: ahh. no idea why you would be getting an error liek that unless you are running a modified rack or master possibly? never seem something like that before
[15:37:04] context: try google?
[15:37:39] soahccc: context: I only get these errors from those scriptkiddies (we have ruby so we obviously don't need WP ;) )
[15:37:41] context: https://github.com/rack/rack/issues/430
[15:37:45] context: google.. google helps.
[15:37:53] KensoDev: has joined #RubyOnRails
[15:39:00] context: seems it was fixed.. 3 years ago
[15:39:16] rafaelfranca: has joined #RubyOnRails
[15:39:28] soahccc: context: thanks, gotta investigate what happened there... 3 years gosh
[15:39:30] sandelius: has joined #RubyOnRails
[15:41:26] sleungcy: has joined #RubyOnRails
[15:42:33] blackmesa: has joined #RubyOnRails
[15:42:44] soahccc: context: well we have the most recent version of rack that actionpack depends on (rails 4). I have the feeling this is going to be a nasty one to fix
[15:43:04] siaW: thanks everyone :)
[15:43:15] epochwolf: siaw: !enternotspace
[15:43:15] helpa: siaw: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[15:44:16] nobitanobi: workmad3: this is getting interesting. I can't use `define_method` within the instance_eval. Trying to use `define_method` because there are several methods that I want to deprecate :)
[15:45:28] context: soahccc: two things. rails 4 is old. and you lie. bundle upgrade rack
[15:46:10] context: rails 4.0/4.1 depend on rack ~> 1.5.2. which you are running. most recent is 1.5.5
[15:46:35] [Butch]: has joined #RubyOnRails
[15:47:13] kristofferR: has joined #RubyOnRails
[15:47:56] context: soahccc: 1.5.2 was released Feb 2013. Fix was merged May 2013.
[15:48:33] context: soahccc: your welcome for googling the first line of the error for you
[15:49:19] flashpoint9: has joined #RubyOnRails
[15:49:39] sypheren: has joined #RubyOnRails
[15:50:50] colept: has joined #RubyOnRails
[15:51:15] soahccc: context: hmm nevermind, there is another gem with a stupid dependency on =1.5.2. I'm pulling my hair out here and running round in circles
[15:51:48] colept: Hello fella! I've been searching Google for hours and have not found out where @options[:url_options] is set via Active Model Serializers? Wondering if someone can point me in the right direction.
[15:52:30] macsteps: has joined #RubyOnRails
[15:53:27] tagaulap: has joined #RubyOnRails
[15:53:51] colept: I can't seem to find where @options is set
[15:53:59] edg205: has joined #RubyOnRails
[15:55:01] bronson: has joined #RubyOnRails
[15:57:53] drbayer: has joined #RubyOnRails
[15:57:55] mostlybadfly: has joined #RubyOnRails
[15:58:10] Quintasan: how the hell do I test my controllers when building an API with JBuilder templates? I am constantly getting ActionView::MissingTemplate
[15:59:12] blackmesa: has joined #RubyOnRails
[16:01:06] baweaver: render views true Quintasan
[16:01:11] baweaver: let me find that flag again
[16:01:52] baweaver: https://www.relishapp.com/rspec/rspec-rails/v/2-6/docs/controller-specs/render-views#render-views-globally
[16:02:02] baweaver: JBuilder counts as a rendered view
[16:02:53] rake_db_migrate: has joined #RubyOnRails
[16:05:22] fox_mulder_cp: hi. i intrested in make diagrams in js based on json generated data from my app
[16:05:28] disgrntld: has joined #RubyOnRails
[16:05:33] KensoDev: has joined #RubyOnRails
[16:06:14] bruno-: has joined #RubyOnRails
[16:06:18] dionysus69: has joined #RubyOnRails
[16:06:47] snowy: has joined #RubyOnRails
[16:07:15] tagaulap: has joined #RubyOnRails
[16:07:15] tagaulap: has joined #RubyOnRails
[16:07:21] kalido: how can i hide the like button after voting ?
[16:07:36] kalido: im using activerecord reputation system
[16:08:13] pwnd_nsfw`: checking to see if the vote exists?
[16:08:40] pwnd_nsfw`: <% if vote doesn't exists %>
[16:08:42] pwnd_nsfw`: do thsi stuff
[16:08:54] kalido: im doing like this tutorial, but its not working idk why : http://railscasts.com/episodes/364-active-record-reputation-system?autoplay=true
[16:09:09] pwnd_nsfw`: ACTION shrugs.
[16:09:13] pwnd_nsfw`: I can't see your code
[16:11:25] kalido: https://gist.github.com/luisamaro0/2c7af85a793cab90036a632bdcef8d55
[16:12:01] pwnd_nsfw`: and by "its not working", no errors?
[16:12:37] kalido: no errors, but it wont hide
[16:12:53] pwnd_nsfw`: Post your view in the gist please
[16:13:10] nodejunkie: has joined #RubyOnRails
[16:13:23] SteenJobs: has joined #RubyOnRails
[16:13:28] kalido: i call like this <% if current_user && !current_user.voted_for?(improvement_action) %>
[16:13:29] bmf: has joined #RubyOnRails
[16:13:30] srinidhi: has joined #RubyOnRails
[16:13:31] pwnd_nsfw`: nodejunkie, you should go to rehab muh bro
[16:13:43] pwnd_nsfw`: I want the view, not a snippet of the view
[16:13:48] pwnd_nsfw`: also, what action are we calling here?
[16:14:03] edwinvdgraaf: has joined #RubyOnRails
[16:14:19] nettoweb: has joined #RubyOnRails
[16:15:30] kalido: https://gist.github.com/luisamaro0/2c7af85a793cab90036a632bdcef8d55
[16:18:12] pwnd_nsfw`: kalido, put rsevaluation in there too
[16:20:43] szulak: has joined #RubyOnRails
[16:21:10] diegoviola: has joined #RubyOnRails
[16:21:37] kalido: thats from the gem
[16:22:21] kalido: it appears only in schema: https://gist.github.com/luisamaro0/2c7af85a793cab90036a632bdcef8d55
[16:23:50] pwnd_nsfw`: kalido, in the console, are you able to get a result for RSEvalations.where(....)
[16:24:21] Fernando-Basso: has joined #RubyOnRails
[16:26:01] amgs: has joined #RubyOnRails
[16:28:13] Maletor: has joined #RubyOnRails
[16:28:55] kalido: i can only check in the db
[16:30:30] cabargas: has joined #RubyOnRails
[16:31:06] reactormonk: has left #RubyOnRails: ("WeeChat 1.4")
[16:32:35] ramfjord: has joined #RubyOnRails
[16:33:17] PedramT: has joined #RubyOnRails
[16:45:18] sleungcy: has joined #RubyOnRails
[16:45:33] arup_r: Need small idea. Hey, I am trying to upgrade Spree. If you see my `git diff Gemfile`, you will see what I changed. https://gist.github.com/aruprakshit/1afa2753c3e24251dc9ca53ba7aee99e . Problem is the extensions gems are not allowing me to proceed. How to approach? Idea please.
[16:46:52] arup_r: I did follow https://github.com/spree/spree/tree/3-1-stable#getting-started .
[16:46:54] sbarg: has joined #RubyOnRails
[16:49:21] petor: has joined #RubyOnRails
[16:50:14] bratsche: has joined #RubyOnRails
[16:51:03] bronson: has joined #RubyOnRails
[16:53:25] drptbl_: has joined #RubyOnRails
[16:53:53] petertretyakov: has joined #RubyOnRails
[16:55:01] podman: If I'm upgrading from a 3.2 app, should I bother upgrading to 4 or should I just skip to 5 even though it's still in beta?
[16:55:02] rodfersou: has joined #RubyOnRails
[16:55:52] pwnd_nsfw`: kalido, so does it exist or not...
[16:56:27] treehug88: has joined #RubyOnRails
[16:56:54] kalido: yes, all the votes are there
[16:57:55] mwlang: is there a more Arel friendly way to implement this? shipping_charges = ShippingCharge.where("? between quantity_from and quantity_to", quantity).order(:quantity_from).first
[16:58:15] pawnbox: has joined #RubyOnRails
[16:58:17] arup_r: podman: read rails upgrade guide. and you will be fine and well guided ( Don't skip )
[16:58:36] podman: arup_r: thanks. will check it out
[16:58:49] mwlang: podman: I’d target 4 for now, but pay attention to what’s deprecated by 5 and implement accordingly in 4.
[16:59:51] arup_r: mwlang: Your between query seems like I never saw.. :p still staring at this...
[17:00:04] podman: mwlang: the last time I upgraded this app was from 2 to 3 and 4 came out a few months later so... i just didn't bother. I don't want the same thing to happen again
[17:00:23] arup_r: I know a column_name BETWEEN val1 AND val2
[17:00:33] mwlang: podman: I suspect the transition from 4.2 to 5 will be far less dramatic than 2 => 3 => 4
[17:00:35] renegadeandy: How can i make this validtion only happen after the object has been created ?validates :quantity,:allow_nil => true,
[17:00:36] renegadeandy: :numericality => { :greater_than => 0, :less_than => 60000 }, :unless => Proc.new { |r| r.quantity_type == "1-To-1"}
[17:00:49] arup_r: mwlang: quantity_from and quantity_to is value of column name?
[17:00:50] podman: mwlang: one can hope!
[17:01:01] mwlang: arup_r: I have the quantity in hand. I need to bracket the query on the given quantity.
[17:01:52] arup_r: podman: http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html
[17:03:00] mwlang: arup_r: the query then becomes: SELECT TOP (1) [shipping_charges].* FROM [shipping_charges] WHERE (1 between quantity_from and quantity_to) ORDER BY [shipping_charges].[quantity_from] ASC
[17:03:33] arup_r: ok.. mwlang, your DB is?
[17:03:47] mwlang: arup_r: ya don’t wanna know. ;-)
[17:04:11] VeryBewitching: has joined #RubyOnRails
[17:04:51] mwlang: db doesn’t matter anyway, most rdbms support X between A and B
[17:05:03] arup_r: yeah, I know
[17:05:47] svkurowski: has joined #RubyOnRails
[17:06:05] arup_r: may be I know this query, right now I am able to recognize it.. Anyway,,, query looks ok to me :)
[17:06:22] arup_r: not able to recognize the pattern**
[17:07:43] a1fa: wow, cancancan + strongparameters == very picky
[17:08:10] manfrin: has joined #RubyOnRails
[17:08:57] meoblast001: has joined #RubyOnRails
[17:09:09] FailBit: now shoot the apple on his head
[17:09:17] macsteps: has joined #RubyOnRails
[17:09:29] mwlang: oh, nice article on writing complex, but maintainable queries with Arel: http://jpospisil.com/2014/06/16/the-definitive-guide-to-arel-the-sql-manager-for-ruby.html
[17:12:01] rodferso1: has joined #RubyOnRails
[17:12:15] shinnya: has joined #RubyOnRails
[17:13:32] rake_db_migrate: has joined #RubyOnRails
[17:13:57] Kilo`byte: has joined #RubyOnRails
[17:14:30] Disavowed: has joined #RubyOnRails
[17:15:35] baweaver: has joined #RubyOnRails
[17:15:59] sbarg: has left #RubyOnRails: ()
[17:16:10] aegis3121: has joined #RubyOnRails
[17:16:14] edwinvdgraaf: has joined #RubyOnRails
[17:18:10] PedramT: has joined #RubyOnRails
[17:19:52] petor: has joined #RubyOnRails
[17:20:47] jino: has joined #RubyOnRails
[17:20:59] Diabolik: has joined #RubyOnRails
[17:22:38] merida: has joined #RubyOnRails
[17:22:39] [Butch]_: has joined #RubyOnRails
[17:23:15] mikecmpbll: has joined #RubyOnRails
[17:26:42] yellow5: has joined #RubyOnRails
[17:27:22] Regulati_: has joined #RubyOnRails
[17:28:38] a1fa: whats the best way to pass :var between new and create action? as a param?
[17:29:34] svkurowski: has joined #RubyOnRails
[17:29:47] funnel: has joined #RubyOnRails
[17:29:48] SteenJobs: a1fa: what is it exactly that you’re passing?
[17:30:17] a1fa: an id which will be used to autopopulate other fields in the database, in the background
[17:30:21] dopie: has joined #RubyOnRails
[17:30:27] Diabolik: has joined #RubyOnRails
[17:31:01] Kilo`byte: has joined #RubyOnRails
[17:31:11] smathy: a1fa, session.
[17:31:21] a1fa: smathy: briliant
[17:31:23] SteenJobs: a1fa: either store it in session, or create an instance var in #new, and pass the instance var as an argument in your form’s url (some_url/:id), but session is best for your case
[17:31:29] SteenJobs: oh smathy, you mother effer
[17:31:34] SteenJobs: i was typing it!
[17:31:39] smathy: ...when a single word is enough
[17:31:48] SteenJobs: i’m working on being less verbose
[17:31:49] chouhoulis: has joined #RubyOnRails
[17:31:52] a1fa: +1 smathy - man you are always on point
[17:32:08] SteenJobs: i totally deserve that +1 haha. i’ll get you next time :)
[17:32:08] a1fa: going to start a smathy beer fund
[17:32:19] SteenJobs: a1fa: yea he really is
[17:32:29] smathy: All hail smathy.
[17:33:04] a1fa: so pass param to new, save to session, fetch+delete in create
[17:33:43] a1fa: very excellent :)
[17:34:13] jyraff: has joined #RubyOnRails
[17:34:29] a1fa: should i append params in create, or let the model take it from there?
[17:34:39] a1fa: users wont be able to edit these attributes after create
[17:35:06] baweaver: has joined #RubyOnRails
[17:35:28] Devalo: has joined #RubyOnRails
[17:35:46] blackmesa: has joined #RubyOnRails
[17:36:20] fox_mulder_cp: hi. i have a People which has_many pets. pet has property age. how find people, which has 2+ years older pets?
[17:36:41] PedramT: has joined #RubyOnRails
[17:37:13] JakFrist: has joined #RubyOnRails
[17:37:30] cabargas: has joined #RubyOnRails
[17:37:34] smathy: a1fa, not sure what "append params in create" means.
[17:38:03] smathy: fox_mulder_cp, what are you trying?
[17:38:32] fox_mulder_cp: smathy: People.where (people.pet.age >= 2)
[17:38:46] a1fa: smathy: when i do Model.new(model_params), i could fill in the blanks to model_params
[17:38:46] fox_mulder_cp: mistake in syntax
[17:39:01] Mia: has joined #RubyOnRails
[17:39:01] Mia: has joined #RubyOnRails
[17:39:10] smathy: fox_mulder_cp, go through this: http://guides.rubyonrails.org/active_record_querying.html
[17:39:28] fox_mulder_cp: a1fa: Model.property = blabla; ??
[17:39:38] smathy: a1fa, ok, so then what's the alternative you're asking about? "let the model take it from there" ?
[17:39:51] fox_mulder_cp: or in model class in new hook?
[17:40:07] a1fa: smathy: rigth, whats better, before_save or do it in the controller?
[17:40:30] smathy: a1fa, how would the before_save get the value from your session?
[17:40:50] a1fa: smathy, it gets the id, the id calls another Model
[17:41:29] smathy: a1fa, you can't access the session in the model.
[17:41:39] a1fa: controller it is then :(
[17:43:03] IbRAP89889: has joined #RubyOnRails
[17:43:31] Cooooo: has joined #RubyOnRails
[17:44:49] hervie_: has joined #RubyOnRails
[17:45:39] manfrin: has joined #RubyOnRails
[17:46:03] baweaver: has joined #RubyOnRails
[17:46:07] bruno-: has joined #RubyOnRails
[17:46:33] jtong: has joined #RubyOnRails
[17:46:48] Cohedrin: has joined #RubyOnRails
[17:47:37] nobitanobi: has joined #RubyOnRails
[17:47:53] jtong_: has joined #RubyOnRails
[17:49:02] ascarter: has joined #RubyOnRails
[17:50:48] ascarter: has joined #RubyOnRails
[17:52:43] chouhoulis: has joined #RubyOnRails
[18:00:40] akkmaxon: has joined #RubyOnRails
[18:01:24] Devalo: has joined #RubyOnRails
[18:02:32] kadoppe: has joined #RubyOnRails
[18:05:36] zave: has joined #RubyOnRails
[18:07:35] snowy: has joined #RubyOnRails
[18:08:46] mikecmpbll: has joined #RubyOnRails
[18:09:15] matthias_: has joined #RubyOnRails
[18:09:23] siaW: my rails app loads images in a modal. sometimes when i click the modal the image, which is loaded externally, from another URL, is not ready yet. so the modal shows no image. is there a way to load images in the background quickly, and possibly cache them so that the user wouldn’t have to refresh the page to load another modal?
[18:10:09] FailBit: Cache-Control
[18:10:47] baweaver: has joined #RubyOnRails
[18:11:44] smathy: siaw, does "externally, from another URL" mean from another server that you have no control over?
[18:11:54] yellow5: has joined #RubyOnRails
[18:13:11] smathy: siaw, and by "load images in the background" - do you mean for your Rails app to pull the images from their other location and store them all locally on your own server? Or you mean doing something in the browser, in javascript?
[18:13:58] siaW: i would love to have it loaded on my heroku server for future use
[18:14:58] yfeldblum: has joined #RubyOnRails
[18:16:00] ramfjord: has joined #RubyOnRails
[18:16:34] roelof: has joined #RubyOnRails
[18:16:34] smathy: siaw, oh, heroku - no can do.
[18:17:02] roelof: Does anyone know a good tutorial how to setup SublimeText to work with Rails ?
[18:17:06] siaW: “no can do” means i can’t do that on heroku?
[18:17:07] smathy: siaw, so just preload the images with JS.
[18:17:13] smathy: siaw, correct.
[18:17:29] siaW: smathy: is there a gem that could help with that?
[18:17:40] smathy: roelof, https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=rails%20sublime%20text%202
[18:18:56] zave: has joined #RubyOnRails
[18:18:56] smathy: siaw, no idea, just google: preload images javascript
[18:19:15] siaW: already on it. thanks
[18:19:24] petor: has joined #RubyOnRails
[18:20:26] roelof: smathy: I wonder this one is good : https://mattbrictson.com/sublime-text-3-recommendations
[18:22:43] jtong: has joined #RubyOnRails
[18:23:25] jstransky: has joined #RubyOnRails
[18:25:12] jerohm: has joined #RubyOnRails
[18:27:40] baweaver: roelof: you're going to need to be self sufficient on this type of thing and just read.
[18:28:12] arup_r: has joined #RubyOnRails
[18:28:15] Cohedrin: has joined #RubyOnRails
[18:28:42] RegulationD: has joined #RubyOnRails
[18:30:50] blackmesa: has joined #RubyOnRails
[18:32:17] sypheren: has joined #RubyOnRails
[18:32:21] sandelius: has joined #RubyOnRails
[18:33:10] LastWhisper____: has joined #RubyOnRails
[18:33:14] macsteps: has joined #RubyOnRails
[18:34:13] djbkd: has joined #RubyOnRails
[18:35:27] siaW: has left #RubyOnRails: ()
[18:39:13] harrymoreno: has joined #RubyOnRails
[18:39:51] jsrn: has joined #RubyOnRails
[18:42:10] bronson: has joined #RubyOnRails
[18:42:11] andrew-l: hmm... I have a SQL query which joins data from two different models together. is there a way to use a active record query to do the same thing instead of using connection.execute? I've tried building out the same query, but notice that active record doesn't return any fields not on a model
[18:43:26] arup_r: Yes ofcourse
[18:43:35] arup_r: .joins() is a method
[18:43:57] MEATCHICKEN: has left #RubyOnRails: ("Leaving")
[18:44:36] eyeamaye: has joined #RubyOnRails
[18:44:45] spaghetti-o: has joined #RubyOnRails
[18:44:53] spaghetti-o: I have a helper that calls current_page?
[18:44:55] optimus55: has joined #RubyOnRails
[18:45:01] spaghetti-o: How do I spy on this and return a fake value using rspec
[18:45:10] pawnbox: has joined #RubyOnRails
[18:46:06] djbkd: has joined #RubyOnRails
[18:46:06] bruno-: has joined #RubyOnRails
[18:46:49] Cohedrin: has joined #RubyOnRails
[18:47:08] optimus55: Can someone give me a hand with pre-loading, scopes, etc? I have a list of "issues" with a has many relation to states ('open', 'closed', etc). I'm tracking the states as separate entries for historical purposes. I'd like to get the latest state included when I pull an issue (states: order_by 'created_at', limit(1)) to avoid N+1 queries, but I can't seem to find the right way to do it in active record.
[18:47:28] djbkd: has joined #RubyOnRails
[18:49:12] andrew-l: arup_r: yeah, I have the .joins working, the problem is I'm selecting items from both models and ActiveRecord isn't displaying items from the other model.
[18:50:09] arup_r: andrew-l: can you show the code? and how are you inspecting them?
[18:50:41] andrew-l: i'm doing something like: Model_A.joins("JOIN model_bs ON model_as.id == model_bs.model_a_id").select("model_as.item_name").select("model_bs.product_description")
[18:50:43] a1fa: under create action, i have a AnotherModel.where('id = ?',session[:anothermodel_id]), but that line is never loaded
[18:50:57] djbkd: has joined #RubyOnRails
[18:51:40] andrew-l: arup_r: Model_A.item_name come through, but not Model_B.product_description
[18:52:02] a1fa: hardcoding the anothermodel_id, does not help either.. in log, i never see that ActiveRecord tried to select from AnotherModel's table
[18:52:06] smathy: andrew-l, !querying
[18:52:06] helpa: andrew-l: http://guides.rubyonrails.org/active_record_querying.html - ActiveRecord Querying Guide by Ryan Bigg
[18:52:55] a1fa: huh.. .take?
[18:53:21] FailBit: cookie.take
[18:53:25] a1fa: doh :) it worked
[18:53:26] FailBit: ACTION steals the jar
[18:53:32] cpruitt: has joined #RubyOnRails
[18:54:17] epochwolf: ACTION is in the otherwise empty jar
[18:54:49] epochwolf: FailBit: one would be well advised not to steal honey pots. :P
[18:55:02] FailBit: that's why you put onions in them
[18:55:21] FailBit: ACTION makes layered obscure joke that nobody will get
[18:55:23] andrew-l: smathy helpa - yeah, i read through that. i don't see anything where details of two different models are joined together in the query, only from one or the other... or am i missing something?
[18:57:32] rake_db_migrate: has joined #RubyOnRails
[18:57:43] cpruitt: has joined #RubyOnRails
[18:58:23] netzfisch: has joined #RubyOnRails
[18:59:20] smathy: andrew-l, I don't know what you mean "from one or the other" - it's not at all clear what you're trying to do.
[18:59:21] arup_r: andrew-l: when you have like Post has many comments, then res = Post.joins(:comments).select("posts.desc, comments.desc") should work and inspect them like `res.first.attributes` and you will see both column present
[19:00:32] andrew-l: i think i am missing somethign
[19:00:33] njero: has joined #RubyOnRails
[19:00:47] ascarter: has joined #RubyOnRails
[19:01:39] andrew-l: aaaah, .attributes shows me the other items!
[19:01:51] andrew-l: thanks arup_r! totally didn't know that
[19:02:12] arup_r: andrew-l: that is why I asked how are you inspecting..
[19:02:24] andrew-l: yeah, i was just looking directly on the Model_A
[19:02:45] arup_r: because when using .select(..) .. and have many columns, rails wouldn't show all them ..You have to call .attributes to see what all are there
[19:02:48] andrew-l: SOoooo... any AR response can be inspected via .attributes ?
[19:02:54] smathy: So sure this is just an issue with what's being printed.
[19:03:04] SteenJobs: when updating an object that belongs_to another object, why would the foreign key disappear?
[19:03:20] arup_r: It is always like that with .select() .. smath.
[19:03:33] smathy: It's not actually.
[19:03:33] arup_r: rails don't show in console all attributes ..
[19:03:44] smathy: ...but I don't have the patience to unwind all this misunderstanding.
[19:04:00] smathy: ...especially when no code.
[19:04:22] emachnic: has joined #RubyOnRails
[19:04:53] smathy: (you're right that the output in console doesn't show any fields not belonging to the base model)
[19:05:04] andrew-l: smathy: is there another way to access the output?
[19:05:06] arup_r: andrew-l: can you do run the query in rails console, and make a gist with rails default inspection ..? Lets take this as an oppurtunity to learn.
[19:06:27] andrew-l: sure, give me a moment to rename models
[19:06:41] smathy: Don't rename anything, just copy/paste.
[19:06:44] SteenJobs: can i not update my profile object by doing Profile.find, but instead user.profile.update_attributes()?
[19:07:21] smathy: SteenJobs, !code
[19:07:21] helpa: SteenJobs: 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.
[19:07:30] SteenJobs: it’s a classic case. one sec
[19:08:35] SteenJobs: smathy: https://gist.github.com/jesiegel1/403f8dce045c232c831dda9525e94ef3#file-update-rb-L8
[19:08:52] andrew-l: https://gist.github.com/a-leung/ec8f6806c37ce2a9ff8cd591b01a753e
[19:09:03] emachnic: has joined #RubyOnRails
[19:09:43] andrew-l: just copy/pasted, as per smathy's request. ;-)
[19:09:45] solars: has joined #RubyOnRails
[19:09:48] smathy: SteenJobs, that will set `user_id` to `nil` if, for example, `profile_params[:user_id]` is `nil`
[19:10:32] SteenJobs: smathy: that’s what i was thinking…i mean :user_id isn’t even in the params hash - what’s the proper way to update an object in a belongs_to association then?
[19:10:35] Cohedrin_: has joined #RubyOnRails
[19:11:29] smathy: andrew-l, type: a.first.type
[19:11:54] aegis3121: has joined #RubyOnRails
[19:13:11] SteenJobs: not sure how i don’t know this
[19:13:39] smathy: SteenJobs, you haven't shown any belongs_to association in your gist, you're retrieving a profile from the DB and then calling `update_attributes` on it, that's all I can see.
[19:13:46] andrew-l: smathy: updated.
[19:13:49] smathy: SteenJobs, there's nothing improper with that.
[19:13:53] SteenJobs: smathy: yea so profile belongs_to user
[19:13:53] DoctorMonocular: has joined #RubyOnRails
[19:13:55] andrew-l: aaaaah... it's just a hash
[19:14:03] andrew-l: (the AR response)
[19:14:12] SteenJobs: smathy: i presume finding the profile by id would be no different than current_user.profile…
[19:14:18] smathy: andrew-l, no, it's not a hash.
[19:14:35] smathy: andrew-l, ...but anyway, as you can see, you can call the other things you selected as methods on what's returned.
[19:15:32] harrymoreno1: has joined #RubyOnRails
[19:15:40] SteenJobs: smathy: but i guess there is a difference?
[19:15:47] smathy: andrew-l, the method that is called to print out the object will only show the values that belong to the base object.
[19:17:01] smathy: SteenJobs, you mean `current_user.company` - that's all that's in your gist.
[19:17:22] andrew-l: smathy: aaah, not a 'hash', but an actual ruby object, right?
[19:17:55] smathy: andrew-l, well everything is a ruby object, but yes, what is returned is not a Hash object.
[19:17:55] drbayer: has joined #RubyOnRails
[19:17:57] zave: has joined #RubyOnRails
[19:18:05] Cohedrin: has joined #RubyOnRails
[19:18:23] SteenJobs: smathy: that @profile object belongs_to current_user. so i was curious, and instead of current_user.profile, i queried the profile object by doing Profile.find(params[:id])…after all they’re the same object. so why does the latter cause the user_id to be erased whereas the former wouldn't?
[19:19:09] baweaver: has joined #RubyOnRails
[19:19:09] Disavowed: has joined #RubyOnRails
[19:20:00] blackmesa: has joined #RubyOnRails
[19:20:02] eyeamaye1: has joined #RubyOnRails
[19:22:54] andrew-l: so, it looks like AR didn't return anything from the query because items selected didn't map into the base model object BUT AR did return everything as its own object
[19:22:59] smathy: SteenJobs, do what you're talking about in a rails console, showing the actual values of the profile objects you're selecting, and the behavior you're suggesting, and I'll explain it.
[19:23:01] petor: has joined #RubyOnRails
[19:23:19] SteenJobs: smathy: already did :)
[19:23:33] smathy: SteenJobs, !gist or it didn't happen
[19:23:33] helpa: SteenJobs: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[19:23:45] SteenJobs: i did current_user.profile == Profile.first
[19:23:59] smathy: andrew-l, "AR didn't return anything" and "AR did return everything" are mutually exclusive.
[19:24:16] sypheren: has joined #RubyOnRails
[19:24:53] SteenJobs: smathy: ahhh i see the difference in the query
[19:24:58] smathy: SteenJobs, :)
[19:24:58] andrew-l: on the rails console, it looked like AR didn't return anything, but underneath, the AR response object had everything.
[19:25:10] SteenJobs: smathy: but that’s still odd, because they ARE the same object
[19:26:06] arBmind: has joined #RubyOnRails
[19:29:21] zpe: has joined #RubyOnRails
[19:30:41] Gasher: has joined #RubyOnRails
[19:30:56] manfrin: has joined #RubyOnRails
[19:31:19] arup_r1: has joined #RubyOnRails
[19:31:51] naftilos76: has joined #RubyOnRails
[19:32:12] Gasher: hello everyone, I'm getting an error of missing /usr/lib/ruby/include/ruby.h file each time I want to install rails gem.
[19:32:21] Gasher: I'm on Ubuntu
[19:32:29] emachnic: has joined #RubyOnRails
[19:32:40] smathy: Gasher, this is a Rails problem how?
[19:32:44] dionysus69: has joined #RubyOnRails
[19:33:03] Gasher: because it only happens when I try to install Rails
[19:33:45] baweaver: has joined #RubyOnRails
[19:33:46] smathy: What else are you able to do ok? Because I was just watching you over in #ruby complaining that your rvm ruby was broken.
[19:33:53] fox_mulder_cp: works ok: payments.where('payments.category.income': true).sum('summ')
[19:34:16] GodFather: has joined #RubyOnRails
[19:34:27] fox_mulder_cp: but when change to false ot nil - says zero, but must be one record with value
[19:34:43] epochwolf: Gasher: we recommend using OS X for rails development. Ubuntu is unsupported.
[19:35:03] Gasher: smathy; just wanted to try to update my ruby with gem first
[19:35:07] Gasher: epochwolf; really?
[19:35:14] tbuehlmann: epochwolf: please don't do that, people might believe you
[19:35:21] epochwolf: tbuehlmann: :P
[19:35:48] jenrzzz: has joined #RubyOnRails
[19:35:48] jenrzzz: has joined #RubyOnRails
[19:35:58] smathy: Gasher, so everything else works fine, you can install every other gem out there except Rails, your ruby runs fine, gem runs fine, the only problem is Rails?
[19:36:05] adaedra: smathy: voyeur.
[19:36:15] smathy: adaedra, OMG, the nerve of this one.
[19:36:39] Gasher: smathy; pretty much, of course don't know if any other gem, but for sure any other gem that I've installed
[19:36:40] pawnbox: has joined #RubyOnRails
[19:36:51] Gasher: or tried to
[19:36:57] context: install the -dev package for ruby.
[19:37:06] n008f4g_: has joined #RubyOnRails
[19:37:17] blackmesa: has joined #RubyOnRails
[19:37:20] smathy: Gasher, !gist your terminal showing you installing another gem, and the full error when you try to install rails.
[19:37:20] helpa: Gasher: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[19:38:27] adaedra: smathy: sorry.
[19:38:50] Gasher: epochwolf; http://www.straferight.com/forums/attachments/shooters/19692d1320857459-mw3-pc-release-not-sure-if-trolling-just-stupid.jpg
[19:38:53] Gasher: my reaction ^
[19:39:05] machty: Is there a way to specify a cascading delete policy within a rails migration t.references, something like t.references :location, index: true, foreign_key: true, on_delete: :cascade
[19:39:10] jaequery: has joined #RubyOnRails
[19:39:20] machty: docs only mention on_delete: :cascade on add_foreign_key
[19:39:36] ChanServ: +q *!*@
[19:40:30] baweaver: has joined #RubyOnRails
[19:40:41] akkmaxon: has joined #RubyOnRails
[19:41:41] epochwolf: Gasher: mine: 👏
[19:44:17] King_Rex: has joined #RubyOnRails
[19:46:05] dionysus69: has joined #RubyOnRails
[19:46:11] epochwolf: machty: cascading deletes are defined on foreign keys in the database. It's not a property of the table schema.
[19:46:43] smathy: machty, if it was supported in the column specification then it'd be: foreign_key: { on_delete: :cascade } You can try that, but I don't think it works.
[19:47:03] machty: smathy: i looked at the code, doesn't seem to be supported
[19:47:09] edwinvdgraaf: has joined #RubyOnRails
[19:48:40] ChanServ: -q *!*@
[19:49:02] FooMunki: has joined #RubyOnRails
[19:49:36] Gasher: why the silence?
[19:49:54] Gasher: I just wanted to thank context
[19:51:06] machty: smathy: i misspoke! it totally does work the way you suggested :)
[19:51:08] moep: has joined #RubyOnRails
[19:51:11] machty: good call
[19:51:14] smathy: machty, cool :)
[19:51:24] stannard: has joined #RubyOnRails
[19:51:33] epochwolf: cool, I didn't even know that was an option in rails 4.2
[19:51:52] rodfersou: has joined #RubyOnRails
[19:52:01] smathy: Sometimes it pays to just guess.
[19:52:05] machty: epochwolf: not sure if it shows up in db/schema but definitely in db/structure
[19:52:34] epochwolf: machty: I mispoke. It's not a property of a table field, but rather a table constraint.
[19:53:03] djbkd: has joined #RubyOnRails
[19:53:27] epochwolf: Relational Databases are wierd, old cranky things that don't map easily into objects and stuff.
[19:53:34] ur5us: has joined #RubyOnRails
[19:53:38] FailBit: meme harder epochwolf
[19:54:56] epochwolf: FailBit: If a turtle loses its shell, is it naked or homeless?
[19:54:57] yfeldblum: has joined #RubyOnRails
[19:55:36] epochwolf: ACTION waits to see how FailBit answers. 
[19:55:38] FailBit: it's dead.
[19:55:48] FailBit: neither of those are of concern
[19:55:53] baweaver: epochwolf: I think they won
[19:56:23] epochwolf: FailBit has answered correctly.
[19:56:29] ascarter: has joined #RubyOnRails
[19:56:50] epochwolf: FailBit: you, sir, have done me proud.
[19:57:12] epochwolf: Now, for more meme....
[19:57:24] epochwolf: Is there another word for synonym?
[19:58:18] smathy: Take it to -ot
[19:58:49] FailBit: unless you wanted a k/vstore
[19:58:53] FailBit: nonrelational databases suck
[19:59:34] epochwolf: FailBit: Postgres for the win./
[19:59:59] FailBit: I have an app that I migrated from mongodb to postgres
[20:00:35] FailBit: we managed to cut 3/4 of our time spent in db lookup by donig this
[20:00:50] FailBit: that drove our app RT average below 90ms for peak load which was awesome
[20:00:54] context: no one ever said mongo didnt suck
[20:01:16] apotry: has joined #RubyOnRails
[20:01:21] bruno-: has joined #RubyOnRails
[20:01:29] dopie: has joined #RubyOnRails
[20:01:32] PedramT: has joined #RubyOnRails
[20:01:50] DoctorMonocular: has joined #RubyOnRails
[20:02:53] FailBit: then https://i.imgur.com/SNDSKEI.png now https://i.imgur.com/htpnvFu.png
[20:03:30] FailBit: y-axis isn't the same but db time is much improved
[20:03:35] FailBit: search time is not. fu elastic
[20:03:53] dopie: has joined #RubyOnRails
[20:04:29] smathy: A doc store doesn't handle runtime queries? That's unpossible!
[20:04:58] FailBit: https://rpm.newrelic.com/public/charts/5HL9PuWRSLT
[20:05:04] rake_db_migrate: has joined #RubyOnRails
[20:06:09] epochwolf: smathy: to be fair, Mongo DB was something new that wasn't well supported when they started.
[20:06:27] epochwolf: They forced Postgres to up their game.
[20:07:35] Gasher: has left #RubyOnRails: ("Leaving")
[20:09:31] arup_r: has joined #RubyOnRails
[20:10:49] arup_r: If anyone around here did Spree upgrade, can share what steps you took? because if I just change the version number of the Spree in gemfile, and do `bundle update spree` its extension gems are throwing error because dependency ..
[20:11:13] arup_r: so finally not able to do it.. :/
[20:12:00] twilling: has joined #RubyOnRails
[20:13:34] Cohedrin_: has joined #RubyOnRails
[20:14:26] fox_mulder_cp: i really can't fix this: payments.joins(:category).where("payments.category" => 2) for "payments.category.someproperty"
[20:14:28] hahuang61: has joined #RubyOnRails
[20:14:36] Macaveli: has joined #RubyOnRails
[20:15:01] fox_mulder_cp: it's work only for category.id, but not for all other properties (
[20:16:21] arup_r: what is the relationship between them? fox_mulder_cp
[20:16:59] baweaver: has joined #RubyOnRails
[20:17:09] n008f4g_: has joined #RubyOnRails
[20:17:40] fox_mulder_cp: arup_r: payment has one category, category has many payments
[20:17:54] epitron: Is there a testing tool that just clicks all the links on all the pages and makes sure nothing blows up?
[20:18:03] tvw: has joined #RubyOnRails
[20:18:08] epochwolf: arup_r: https://guides.spreecommerce.com/developer/upgrades/
[20:18:47] arup_r: fox_mulder_cp: Payment.joins(:category).where("payments.category_id = ?", 2)
[20:19:11] fox_mulder_cp: arup_r: i need som other property from category.
[20:19:31] harrymoreno1: has joined #RubyOnRails
[20:19:59] fox_mulder_cp: expenses = @payments.where('payments.category.income': false)
[20:20:00] arup_r: ok.. do like .where("categories.field_name = ?",..)
[20:20:25] arup_r: Your one is wrong.. that;s why
[20:20:50] fox_mulder_cp: payments.joins(:category).where("payments.category.income ": false).explain
[20:20:54] arup_r: Payment.joins(:category).where("payments.category_id = ? AND categories.income ", 2, flase)
[20:21:00] fox_mulder_cp: EXPLAIN for: SELECT "payments".* FROM "payments" INNER JOIN "categories" ON "categories"."id" = "payments"."category_id" WHERE "payments"."user_id" = 1 AND "payments"."category_id" = 0
[20:21:50] arup_r: Why did you did explain? that is for something else.. I use `.to_sql`
[20:21:57] polishdub: has joined #RubyOnRails
[20:22:05] arup_r: I never tried a syntax like .where("payments.category.income ": false) .. so not sure it works
[20:22:47] arup_r: ** Payment.joins(:category).where("payments.category_id = ? AND categories.income = ? ", 2, flase)
[20:23:49] PedramT: has joined #RubyOnRails
[20:24:04] fox_mulder_cp: i must use only bool value, without id
[20:24:38] smathy: epitron, yes, but QA people really hate being called tools.
[20:24:40] fox_mulder_cp: but my syntax is wrong and true/flase transformed to category.id...
[20:24:48] context: smathy: sometimes to truth hurts
[20:25:24] context: smathy: tell them to get one of those 'Safe Place' signs to hang up on their cubicle and everything will be alright
[20:26:07] epitron: smathy: zing!
[20:26:27] fox_mulder_cp: Payment.joins(:category).where("categories.income": true) you!
[20:27:10] arup_r: fox_mulder_cp: where you saw that syntax, dude? :D
[20:27:29] fox_mulder_cp: ACTION trololo
[20:27:38] arup_r: I know Payment.joins(:category).where({categories: { income: true} })
[20:27:40] FailBit: foudn some pictures of a guy who refurbished the action in the one I have. mine looks nothing like it :(
[20:27:43] smathy: epitron, but seriously, it'd be pretty simple to do with capybara or other browser drivers, just load the page, save the URLs from page.all("a"), then load all of them.
[20:27:45] FailBit: er, wrong channel
[20:27:46] smathy: ...assert they 200
[20:28:05] epitron: smathy: indeed. Definitely doable
[20:28:32] epochwolf: FailBit: refurbished controller actions? Do tell.
[20:28:34] fox_mulder_cp: arup_r: i must sleep more, more....
[20:28:34] epitron: smathy: you can just use rails' built in integration tests too
[20:29:01] epitron: I just thought that 10 years into rails, someone would've made that
[20:29:22] smathy: Sounds like about 4 lines of code, I wouldn't hold my breath :)
[20:29:34] dopie: has joined #RubyOnRails
[20:29:36] epitron: You have to detect loops too
[20:29:48] FailBit: epochwolf: I'll ask you this
[20:29:50] epitron: Maybe 15 lines
[20:30:01] FailBit: can you guess what I was talking about
[20:30:04] smathy: Pfft, store as hash keys instead of in an array, still 4.
[20:30:09] epochwolf: FailBit: guns. Lots of guns.
[20:30:24] epitron: What about pretty output
[20:30:33] epochwolf: FailBit: I prefer guns.,
[20:30:38] smathy: epitron, that's why it was 4 and not 3 ;)
[20:30:38] epitron: I think you're low balling this
[20:30:59] smathy: epitron, always possible, still it's a long way short of a gem.
[20:31:00] jstransky: has joined #RubyOnRails
[20:31:19] srinidhi: has joined #RubyOnRails
[20:31:34] epitron: I dunno, it seems like a worthwhile gem
[20:31:47] epitron: Who wants to rewrite that every project
[20:32:08] epitron: It might need special configuration options too
[20:32:10] Silox|: has joined #RubyOnRails
[20:32:10] epochwolf: I'd rather reimplement 10 lines of code than have a 10 line dependency. This ain't node here.
[20:32:11] smathy: Cool, write it up :)
[20:32:16] epitron: Like don't submit forms on certain pages
[20:32:38] epitron: Or don't click next forever
[20:32:43] context: epitron: if you aint using the leftpad gem you aint livin
[20:33:03] context: epochwolf*
[20:33:11] epitron: This is way better than left pad :)
[20:33:16] ekinmur: has joined #RubyOnRails
[20:33:19] context: rightpad ?
[20:33:29] smathy: epitron, you should call your gem qa_monkey
[20:33:34] epitron: It's a spider, mofo
[20:33:49] context: spiderpad ?
[20:33:53] smathy: Not denigrating enough.
[20:33:58] smathy: context++
[20:34:14] epitron: Wind up monkey
[20:34:36] dopie: has joined #RubyOnRails
[20:34:38] kadoppe: has joined #RubyOnRails
[20:34:48] zave: has joined #RubyOnRails
[20:34:48] epitron: Oh yeah, it could also use logic to make it only run if all other tests pass
[20:35:24] epitron: It's going to be at least 50 lines if you do it right
[20:35:25] epochwolf: epitron: Magic Monkey.
[20:35:46] epochwolf: Or cymbal-banging-monkey-toy
[20:36:11] epitron: epochwolf: that's the mascot I was thinking of :)
[20:36:20] epochwolf: https://en.wikipedia.org/wiki/Cymbal-banging_monkey_toy
[20:36:28] epitron: Oh I'm familiar
[20:36:49] epochwolf: I'm linking because there's half a dozen different anmes.
[20:42:00] stannard: has joined #RubyOnRails
[20:43:54] jstransky: has joined #RubyOnRails
[20:43:58] Sn0wy: has joined #RubyOnRails
[20:44:12] baweaver: has joined #RubyOnRails
[20:44:24] crystal77: has joined #RubyOnRails
[20:45:20] PedramT: has joined #RubyOnRails
[20:45:33] crystal77: I've had this Macbook Pro for years now, and my env is so borked. What's the best way to work with Rails? Any program out there to make a virtual sort of sandbox that I can then use rbenv/rvm, and all the other goodies out there? Cause if I try to install those now, it won't work. I don't want to have to resort to Virtualbox...
[20:46:56] jstransky: has joined #RubyOnRails
[20:48:53] Cohedrin_: crystal77 whats wrong with your env?
[20:49:33] arup_r: epochwolf: that I saw, but there are some other errors I need to handle.. which comes from its extensions gem.
[20:49:40] arup_r: anyway thanks :)
[20:50:18] epochwolf: crystal77: or you can clean up the environment.
[20:50:46] malkav: has joined #RubyOnRails
[20:51:00] epochwolf: Worst case, you can clean install OS X and copy the files and apps you need by hand.,
[20:51:24] malkav: hey guys! would really appreciate some help here!
[20:51:25] malkav: http://stackoverflow.com/questions/36516617/app-for-managing-apps-architecture
[20:51:41] Disavowed: has left #RubyOnRails: ()
[20:53:26] epochwolf: Malkav: it would be a good idea to review stackoverflow's rules before posting something like that.
[20:53:46] n008f4g_: has joined #RubyOnRails
[20:55:42] bronson: has joined #RubyOnRails
[20:55:58] stannard: has joined #RubyOnRails
[20:57:16] twilling: has joined #RubyOnRails
[20:57:32] crystal77: epochwolf: so much work though lol
[20:57:45] crystal77: and to redo all my company VPN software, settings, host files, etc.
[21:00:51] siaW: has joined #RubyOnRails
[21:00:57] Sawbones: has joined #RubyOnRails
[21:01:06] siaW: has left #RubyOnRails: ()
[21:01:27] audy: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[21:04:48] jhack: has joined #RubyOnRails
[21:13:56] Cohedrin: has joined #RubyOnRails
[21:17:01] gousuto: has joined #RubyOnRails
[21:20:35] quazimodo: has joined #RubyOnRails
[21:20:38] quazimod1: has joined #RubyOnRails
[21:21:11] diegoaguilar: has joined #RubyOnRails
[21:23:14] arup_r1: has joined #RubyOnRails
[21:24:29] michael_mbp: ugh asset pipeline is kicking me
[21:24:32] manfrin: has joined #RubyOnRails
[21:24:44] michael_mbp: is the manifest declaration for SASS files the same?
[21:25:54] michael_mbp: I've got vendor/assets/bower_components/normalize.css/normalise.css and in my manifest *= require normalize.css/normalize.css
[21:26:36] SteenJobs: has joined #RubyOnRails
[21:26:51] michael_mbp: normally one doesn't specify the extension but that's not working either, error Is a directory @ io_fread - ../vendor/assets/bower_components/normalize.css
[21:30:39] michael_mbp: LOL it works now hmm
[21:30:46] michael_mbp: may have been spring being a pain as usual
[21:30:53] Cache_Money: has joined #RubyOnRails
[21:31:51] stannard: has joined #RubyOnRails
[21:31:56] dopie: does rails 4 compile stuff in vendor dir?
[21:34:52] Cache_Money: Does anyone use Ansible to setup a new Ubuntu server? I would love to reuse it if you've already taken a stab at it
[21:35:34] Begi: has joined #RubyOnRails
[21:36:17] Dimik: has joined #RubyOnRails
[21:36:43] czerasz: has joined #RubyOnRails
[21:37:22] zpe: has joined #RubyOnRails
[21:37:36] gousuto: has left #RubyOnRails: ()
[21:37:45] flashpoint9: has joined #RubyOnRails
[21:38:21] zpe: has joined #RubyOnRails
[21:39:14] sypheren: has joined #RubyOnRails
[21:39:16] zpe: has joined #RubyOnRails
[21:42:23] Sawbones: has joined #RubyOnRails
[21:42:30] Radar: GOOD MORNING
[21:42:40] Radar: Cache_Money: Yes: https://github.com/radar/ansible-rails-app
[21:42:44] fox_mulder_cp: Cache_Money: yes. i set up centos, firewall, ubuntu....
[21:42:59] fox_mulder_cp: Radar: good midnight, sir!
[21:44:15] Cache_Money: Radar: thanks. Do you just manually configure your server (e.g. create deploy user, install firewall, etc.) or do you use Ansible for that as well?
[21:44:56] fox_mulder_cp: Cache_Money: yes. i do it too ))
[21:45:04] Cache_Money: fox_mulder_cp: would you mind sharing what you use?
[21:45:33] fox_mulder_cp: Cache_Money: u intrested in rails only or common server?
[21:46:27] fox_mulder_cp: Cache_Money: for rails see readme here https://github.com/foxmuldercp/blogapp
[21:46:27] Radar: Cache_Money: Everything I do is in that script.
[21:46:37] dopie: Radar: good morning :)
[21:46:38] Cache_Money: I like to use Ubuntu 14.04 running Rails/Ngnix/Passenger/Capistrano/Postgres
[21:46:58] dopie: In Rail 4 is are assests in the vendor dir automatically compiled?
[21:47:41] fox_mulder_cp: for common tasks - i use pure lxc container in ubuntu vm, which based on azure, so i don't need firewall etc
[21:47:53] fox_mulder_cp: only ssh client to run into vm
[21:49:32] fox_mulder_cp: so, my hosting control panel can create docker prepared image based container and push powerdns via it's api and ping ansible playbook for creating application's directory on host server less, than 1 monute
[21:49:54] FailBit: dopie: they are not
[21:50:01] FailBit: you have to require them from your assets in app/assets/
[21:50:22] FailBit: note that any file named application* in your app/assets folder will be automatically precompiled
[21:50:45] FailBit: https://github.com/rails/sprockets-rails/blob/master/lib/sprockets/railtie.rb#L106
[21:50:48] smathy: ...or a some gem does.
[21:50:50] yfeldblum: has joined #RubyOnRails
[21:54:09] flashpoint9: has joined #RubyOnRails
[22:00:43] Cache_Money: has joined #RubyOnRails
[22:01:12] baweaver: has joined #RubyOnRails
[22:02:25] bruno-: has joined #RubyOnRails
[22:03:41] dvinciguerra_: has joined #RubyOnRails
[22:04:50] draig: has joined #RubyOnRails
[22:08:51] baweaver: has joined #RubyOnRails
[22:17:50] Darmani: Hey Radar ^.^
[22:18:34] johnflux_: has joined #RubyOnRails
[22:18:38] johnflux_: has joined #RubyOnRails
[22:19:16] manfrin_: has joined #RubyOnRails
[22:19:40] Radar: Darmani: good morning
[22:20:09] nihv: has joined #RubyOnRails
[22:20:43] d5sx43: has joined #RubyOnRails
[22:21:21] Darmani: Radar: How goes it? d:
[22:21:41] nihv: has left #RubyOnRails: ()
[22:21:43] Radar: Darmani: Well thanks. Just finishing my guide on Elixir's Ecto this morning.
[22:22:25] Darmani: Radar: Haha cool ^^
[22:23:41] d0nn1e: has joined #RubyOnRails
[22:24:19] FailBit: I played around with Phoenix a bit a week ago
[22:24:20] gormandy: has joined #RubyOnRails
[22:24:26] FailBit: I was disappointed at how poor the quality of tirexs was
[22:24:34] FailBit: but everything else was cool
[22:24:51] Guest61894: Any tips on writing rspec tests for a project that uses RabbitMQ?
[22:24:52] YourManCJ: has joined #RubyOnRails
[22:25:00] jaequery: has joined #RubyOnRails
[22:25:26] YourManCJ: quick question, I am using heroku to host my site for development. When I git push to heroku the images do not show on heroku. Any ideas?
[22:26:14] Radar: YourManCJ: Did you install the rails_12factor gem into the production group in your Gemfile?
[22:26:17] jaequery: has joined #RubyOnRails
[22:26:43] Radar: YourManCJ: Which images are not displaying? where are they in your application?
[22:26:56] YourManCJ: they are located in app/assets/images
[22:27:15] IrishGringo: has joined #RubyOnRails
[22:27:25] jaequery: has joined #RubyOnRails
[22:27:53] Guest61894: make sure your gitignore doesn't have that dir in it!
[22:28:16] YourManCJ: nope, not in .gitignore
[22:28:28] Radar: YourManCJ: show us the output when the app deploys to Heroku please
[22:28:31] Radar: YourManCJ: And show us your Gemfile
[22:28:33] Radar: YourManCJ: !gist
[22:28:33] helpa: YourManCJ: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[22:29:41] teaearlgraycold: has joined #RubyOnRails
[22:29:45] DoctorMonocular: has joined #RubyOnRails
[22:31:02] emachnic: has joined #RubyOnRails
[22:31:32] YourManCJ: what is the best way to get my gemfile to gist?
[22:32:04] daivyk: has joined #RubyOnRails
[22:32:04] SeanLazer: has joined #RubyOnRails
[22:32:54] YourManCJ: here is my gem file
[22:32:55] YourManCJ: https://gist.github.com/cjmakes/c17f51a6063211adf4c58a826fc5862a
[22:33:03] edwinvdgraaf: has joined #RubyOnRails
[22:33:25] dopie: has joined #RubyOnRails
[22:35:23] Radar: YourManCJ: And the output from heroku?
[22:35:32] YourManCJ: like the app url?
[22:35:48] Radar: ... the output from heroku. When you run "git push heroku master"?
[22:37:07] YourManCJ: Radar: updated gist
[22:38:05] Radar: YourManCJ: Why is this section duplicated in your Gemfile: https://gist.github.com/cjmakes/c17f51a6063211adf4c58a826fc5862a#file-gemfile-L13-L23
[22:38:19] Darmani: Radar: Chapter 8 is so difficult to wrap my head around... Pundit is complicated it seems like =/
[22:39:11] Radar: Darmani: Which part in particular? Chapter 8 is one of the bigger chapters.
[22:39:15] srinidhi: has joined #RubyOnRails
[22:39:26] YourManCJ: I just noticed that, accident
[22:39:31] Darmani: Radar: The section on Pundit.
[22:40:11] Radar: Darmani: Isn't that the entire chapter?
[22:40:36] Darmani: Oh yeah haha I suppose that's true lol
[22:40:42] fowl: has joined #RubyOnRails
[22:40:59] manfrin_: pundit is the cancan replacement, ye?
[22:41:04] manfrin_: ACLs are gross
[22:41:06] manfrin_: I dont blame you
[22:41:15] fowl: How do I write an irc web bot
[22:41:28] Darmani: Radar: Well more specifically the methods that are involved with the "Roles" model. Like "authorize" and record.roles.exists
[22:41:58] Darmani: I mean I understand what it does but connecting the dots piece by piece is hard for me..
[22:42:09] ChanServ: +b *!*@unaffiliated/fowlmouth
[22:42:10] ChanServ: ChanServ kicked fowl: is banned from this channel
[22:42:34] Radar: Thanks Chanserv :+1:
[22:42:57] Radar: Darmani: Can you explain a bit more?
[22:43:48] Darmani: How do these methods work in tandem? How do they allow (or not allow) users to access (or not access) specific projects?
[22:43:49] S1kx: has joined #RubyOnRails
[22:44:08] Radar: Darmani: Code please
[22:44:13] manfrin_: authorize is checking to see if a user's roles contains the 'role' required
[22:45:02] Darmani: manfrin_: Um okay..
[22:45:35] Darmani: Do you mean through the associations included in the model?
[22:45:36] Radar: This will be much easier to explain with code.
[22:45:47] Darmani: Radar: What code?
[22:45:56] Radar: ACTION bashes head on table
[22:46:05] Radar: Darmani: We've done this before. Like 3 times at least.
[22:46:08] Radar: ACTION asks for code
[22:46:12] Radar: you put the code for the app on github
[22:46:14] Radar: everyone is happy
[22:46:23] Darmani: ACTION sighs
[22:46:34] Darmani: It's just a simple question tho...
[22:46:39] helpa: 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.
[22:46:40] Darmani: I don't want to upload all my shit to Github gain...
[22:46:43] manfrin_: authroize is a method where it asks 'can this user do this action', so it check the user's roles (the association) for the role of the type you're authorizing ('edit posts', for example); if it exists, then then authorized? returns true
[22:46:44] Radar: It's literalllllyyyy rule 0
[22:46:57] Radar: ACTION disconnects because he's getting exasperated.
[22:47:20] Sn0wy: has joined #RubyOnRails
[22:47:23] Darmani: ACTION is sorry Radar
[22:47:29] amgs: has left #RubyOnRails: ()
[22:47:37] Darmani: manfrin_: I see.
[22:48:21] manfrin_: a REALLY SIMPLE access control people do is adding an is_admin flag on users
[22:48:22] Darmani: manfrin_: Okay that makes sense.
[22:48:36] manfrin_: and then when you hit the admin panel, you have code to check user.is_admin == true?
[22:48:40] manfrin_: or user.is_admin?
[22:48:59] manfrin_: so this is taking a step further by making it an associated role, rather than a column
[22:49:00] Darmani: manfrin_: Yes I've established that within my application but the next step is using Pundit to allow different types of authorization.
[22:49:18] manfrin_: right, I'm using that as an example to explain pundit
[22:49:26] Darmani: manfrin_: Oh I see.
[22:49:29] manfrin_: so now instead of a column, imagine we use a join table
[22:49:33] manfrin_: called, say, Admins
[22:49:47] manfrin_: an admin is a user of they have an associated Admin association
[22:50:01] manfrin_: is_admin? just checks for user.admin.exists
[22:50:07] manfrin_: that make sense?
[22:50:14] manfrin_: so last step
[22:50:24] manfrin_: instead of checking for admin, you want to check for anything
[22:50:33] manfrin_: so say, admin, owner, post_owner, moderator, whatever
[22:50:56] manfrin_: so now instead of having is_admin? is_owner? is_post_owner? etc everywhere
[22:51:02] manfrin_: you have one authorized? method
[22:51:17] manfrin_: which checks to see if the user.roles includes the 'type' of action you want to check
[22:51:50] manfrin_: so in your comments controller, you wanna make sure someone is a moderator before they can delete a post
[22:52:15] manfrin_: so you'd do something like user.authorized?(:delete_post) (or however pundit's syntax looks, I've never used it)
[22:52:26] manfrin_: and pundit would check user.roles for a :delete_post type
[22:52:48] manfrin_: (also caveat, I am speaking very generally as to how I assume pundit does it, I havent actually used pundit)
[22:52:55] manfrin_: (but I have used other acl stuff)
[22:53:12] Darmani: manfrin_: Still, that's very helpful to understand the Gist of it all.
[22:53:34] manfrin_: you can take it a step even further, too
[22:53:50] manfrin_: where you have a list of resources (posts, comments, etc) and actions (view, read, edit, delete, create)
[22:54:03] manfrin_: and mix-and-match
[22:54:18] manfrin_: often these will be called 'permissions', and a 'role' would be a group of persmissions
[22:54:28] Darmani: ACTION has a question
[22:54:45] manfrin_: so a moderator role would have permissions of (read, edit, delete, create); whereas a role of user would just have (read, edit,create)
[22:54:49] manfrin_: yes Darmani
[22:55:50] Darmani: manfrin_: ummm. Hang on let me think really quick lol
[22:56:49] manfrin_: one tricky part of ACL stuff is that you sometimes have different tiers of permissions -- groups, individual permissions, etc; so a user can have permissions, but also have groups (which have their own permissions) -- authorizing means checking both the user's permissions AND the permissions of the users groups
[22:56:57] Darmani: So authorize checks to see if the user has the permissions within the specific project, and the association within the "Roles" model connects the role with the Project.
[22:57:01] Darmani: Is that correct?
[22:57:10] manfrin_: ACLs are tough to understand because they are like a pyramid of complexity, each step adding extra dependencies
[22:57:32] manfrin_: I think so Darmani -- I dont actually know how Pundit does it specifically
[22:57:43] manfrin_: you can check the code
[22:57:50] Darmani: Right right but is that how it works with ACL's typically?
[22:58:03] manfrin_: usually it's like:
[22:58:30] manfrin_: user-> permissions, group->permissions, roles->permissions, user->roles, group->roles
[22:58:35] manfrin_: it's a very big web
[22:58:59] manfrin_: but in the end you're just checking to see if a user has permissions (or roles; I dont know if pundit uses 'roles' as a group or a specific permission)
[22:59:04] Darmani: Not an attractive one either... Lol
[22:59:37] manfrin_: even though it's super out dated
[22:59:41] manfrin_: I'd watch the railscast on cancan
[23:00:01] manfrin_: pundit is the spiritual successor to cancan; and Ryan Bates (who made railscasts) wrote cancan
[23:00:19] manfrin_: http://railscasts.com/episodes/385-authorization-from-scratch-part-1
[23:00:24] Darmani: manfrin_: Will do man. Thank you for taking the time to explain stuff to me ^.^
[23:00:31] manfrin_: it's $9 a month, but he's been on hiatus for like 2 years and it only bills you once
[23:00:37] manfrin_: ACL is rough
[23:00:50] manfrin_: http://railscasts.com/episodes/192-authorization-with-cancan
[23:00:58] Darmani: Haha it's just another step in becoming proficient in Rails I guess =p
[23:01:52] Darmani: manfrin_: Alright, back to studying. Thanks again.
[23:01:54] FailBit: my authorization framework is too slow
[23:01:57] YourManCJ: I still cannot get my images working on heroku
[23:01:57] manfrin_: railscasts was probably the creme-du-la-creme of screencast sites
[23:02:00] bruno-: has joined #RubyOnRails
[23:02:01] manfrin_: but he hasnt updated in nearly 3 years
[23:02:11] manfrin_: FailBit gotta use caching
[23:02:19] manfrin_: especially if you have multi table lookups
[23:02:25] FailBit: caching is only slightly slower than my authorization framework
[23:02:33] manfrin_: or write sql to pull permissions from a bunch of joins directly
[23:02:48] YourManCJ: what is the proper way to set images as background in scss using the rails assets pipline?
[23:02:49] FailBit: I'm not doing complicated SQL
[23:03:01] FailBit: but taking 0.5ms to check authorization is a bit unnecessary
[23:03:16] manfrin_: is 1/2000th a second
[23:03:29] manfrin_: 500ms you mean?
[23:03:38] FailBit: I mean 1/2000th of a second
[23:03:51] jaequery: has joined #RubyOnRails
[23:04:09] manfrin_: thats lightning fast
[23:04:44] FailBit: I've been profiling my app and this is the only thing I can do to get modest speed gains out of it
[23:04:59] FailBit: the rest is all time spent concatenating strings it seems
[23:05:52] FailBit: >inb4 ruby isn't the right language for you
[23:06:27] hinbody: has joined #RubyOnRails
[23:07:06] flashpoint9: has joined #RubyOnRails
[23:07:40] manfrin_: I think you got your timing wrong if you think .5ms is long
[23:07:46] manfrin_: .5ms is lightning
[23:07:58] manfrin_: in any language
[23:08:09] FailBit: .5ms per check
[23:08:18] manfrin_: per check of what
[23:08:22] FailBit: if i check privileges 10 times (for whatever reason) that's a bit more problematic
[23:08:33] manfrin_: why would you be checking 10 times
[23:08:35] manfrin_: that's an n+1
[23:08:42] FailBit: I need to refactor this view
[23:09:05] manfrin_: if you ever see more than 1 of any kind of lookup, you're doing something wrong
[23:09:29] nettoweb: hey guys, If I want to chahnge a gem I need to rewrite the structure in config/initializar folder?
[23:09:46] manfrin_: i dont know what that question means nettoweb
[23:10:00] FailBit: manfrin_, this code was written almost 5 years ago by an amateur rails dev
[23:10:02] zpe: has joined #RubyOnRails
[23:10:14] nettoweb: manfrin_ I'd like to change the transaction def of this gem: https://github.com/eventick/pagseguro-transparente/blob/e6f53d207326eab09d1c7d9565148f50eec04c52/lib/pagseguro/query.rb
[23:10:15] FailBit: the legacy of mongodb lives on even though we have since changed over to postgres masterrace
[23:10:23] FailBit: in the form of retarded n+1 queries everywhere
[23:10:24] manfrin_: right, but your .5ms permission lookup isn't the problem, it's that your code has an n+1 in it
[23:10:45] manfrin_: nettoweb do not name functions transaction
[23:10:50] manfrin_: special word in rails
[23:10:55] manfrin_: you WILL encounter issues
[23:10:58] nettoweb: manfrin_ sorry?
[23:11:12] manfrin_: a transaction is a method that activerecord provides models in rails
[23:11:21] manfrin_: to build transactional statements
[23:11:23] smathy: ...a class method.
[23:11:29] nettoweb: manfrin_ it's a 3rd party gem, I want to change some method from this gem in my rails app
[23:11:30] manfrin_: naming a method 'transaction' is asking for problems
[23:11:44] nettoweb: Im not the developer of this gem
[23:12:07] smathy: nettoweb, yes, you can change it in an initializer.
[23:12:51] manfrin_: smathy transaction is also an instance method
[23:13:00] nettoweb: smathy Is there some guidelines to achieve this? I've never done this before..
[23:14:04] smathy: nettoweb, copy/paste and change :)
[23:14:33] smathy: nettoweb, there are more tricks if you need to change a module, but this is a class - you should be able to just change it.
[23:14:41] _Tariq: has joined #RubyOnRails
[23:17:33] YourManCJ: So I cannot load assets that are used in scss but I can in erb. Any ideas? I am using the sass-rails gem and using images-path in my scss
[23:18:15] DLSteve: has joined #RubyOnRails
[23:18:17] smathy: YourManCJ, !code
[23:18:17] helpa: YourManCJ: 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.
[23:19:02] htmldrum: has joined #RubyOnRails
[23:19:09] YourManCJ: gemfile https://gist.github.com/cjmakes/c17f51a6063211adf4c58a826fc5862a
[23:19:30] ur5us: has joined #RubyOnRails
[23:20:25] Sn0wy: has joined #RubyOnRails
[23:21:19] YourManCJ: smathy: updated gist for relevant lines of scss file
[23:21:23] aloneintheworld: has joined #RubyOnRails
[23:21:59] YourManCJ: works locally but not on heorku
[23:22:11] YourManCJ: I suspect something with asset complication
[23:25:11] emachnic: has joined #RubyOnRails
[23:25:22] jcm: has joined #RubyOnRails
[23:26:10] smathy: YourManCJ, !gist-usage for next time
[23:26:10] helpa: YourManCJ: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[23:26:46] smathy: YourManCJ, so where is truck.png?
[23:26:58] smathy: YourManCJ, ...and what's the URL of your heroku app?
[23:27:12] YourManCJ: https://secure-falls-24975.herokuapp.com/
[23:27:33] YourManCJ: smathy: and truck should be in assets/images/truck.png
[23:28:24] Sawbones: has joined #RubyOnRails
[23:28:29] baweaver: has joined #RubyOnRails
[23:28:29] smathy: YourManCJ, I mean in your local, where is it.
[23:28:30] petor: has joined #RubyOnRails
[23:28:42] YourManCJ: app/assets/images/truck.png
[23:30:57] YourManCJ: I am thinking heroku is compiling the assets and giving them a digest appended to the name but sass is not getting that and is still looking for the original file name
[23:31:13] YourManCJ: because the erb assigned images work fine
[23:31:30] manfrin_: YourManCJ https://devcenter.heroku.com/articles/rails-4-asset-pipeline
[23:32:34] smathy: YourManCJ, and what file do you have those #mobile_pantry etc entries in?
[23:32:59] YourManCJ: a stylesheet stored in app/assetes/styles/static_pages
[23:33:22] smathy: YourManCJ, read what I asked again please.
[23:33:25] SteenJobs: has joined #RubyOnRails
[23:33:48] YourManCJ: oh sorry, in a view under the static pages controller
[23:34:12] RahulT: has joined #RubyOnRails
[23:34:13] smathy: YourManCJ, no, I mean what filename contains the text.
[23:34:23] smathy: "a stylesheet" isn't good enough.
[23:34:43] jhack: has joined #RubyOnRails
[23:34:47] smathy: YourManCJ, I want the full path/filename from your app's root directory, like you answered before re truck.png
[23:35:03] YourManCJ: the images are assigned in the app/assets/stylesheets/home.scss.css stylesheet
[23:36:12] smathy: YourManCJ, so the code you're showing in that gist is inside app/assets/stylesheets/home.scss.css ?
[23:36:28] smathy: YourManCJ, ok, that's the problem.
[23:36:35] smathy: The filename should be either home.scss or home.css.scss
[23:36:53] smathy: The css on the end means it's not being processed as sass.
[23:36:56] YourManCJ: shit, sorry I messed up the file, it actually is home.css.scss
[23:37:09] smathy: Sigh. We'll get there.
[23:37:14] smathy: You're certain this time?
[23:37:48] smathy: YourManCJ, ok, and what is your application CSS file named?
[23:38:21] YourManCJ: app/assets/stylesheets/application.css.scss
[23:38:38] codelahoma: has joined #RubyOnRails
[23:38:46] smathy: YourManCJ, ok, and add the contents of that to your gist. Use that filename this time as per gist-usage.
[23:43:07] flashpoint9: has joined #RubyOnRails
[23:43:09] twilling: has joined #RubyOnRails
[23:43:33] smathy: YourManCJ, so, let's try again, what's the full pathname to that home file?
[23:44:06] smathy: YourManCJ, ...but look, just remove these lines: https://gist.github.com/cjmakes/c17f51a6063211adf4c58a826fc5862a#file-application-css-scss-L13-L14
[23:44:31] scottopell: has joined #RubyOnRails
[23:45:15] scottopell: Is there a best practices for including css frameworks? Like is it better to manually download the assets and put it in the asset pipeline or use a gem that handles everything for you?
[23:45:19] smathy: YourManCJ, I don't really understand why the second entry isn't working, I'd expect it to, so maybe that won't fix this - but start there.
[23:45:34] MrPunkin: has joined #RubyOnRails
[23:45:38] MrPunkin: has left #RubyOnRails: ()
[23:45:52] smathy: scottopell, either is fine, depends what you want your upgrading process to be (and if you like the upgrade frequency of whatever gem it is).
[23:45:52] YourManCJ: removed still nothing
[23:46:12] smathy: YourManCJ, nope, your page didn't change.
[23:46:21] YourManCJ: no change in the page
[23:46:33] scottopell: smathy: thanks!
[23:46:40] smathy: YourManCJ, right, so either you didn't remove it, or didn't push it properly to heroku.
[23:48:06] YourManCJ: I did remove it, I did push it, no fatal errors on pushing. I am also confused now
[23:48:38] smathy: YourManCJ, ok, so for some reason your heroku app isn't updating. This might explain this behavior.
[23:48:57] YourManCJ: that would make sense
[23:48:58] smathy: YourManCJ, change something else that you can observe, add a comment to your layout file or something.
[23:49:09] smathy: YourManCJ, ...just to confirm that it's not updating.
[23:49:19] smathy: ...and then go complain to heroku.
[23:50:00] diegoaguilar: has joined #RubyOnRails
[23:50:29] YourManCJ: well shit....It updated....
[23:50:43] YourManCJ: still no images, but the test in a html file worked
[23:51:00] daytime: has joined #RubyOnRails
[23:51:39] smathy: YourManCJ, what did you add? I don't see any change.
[23:51:56] AmiMoench: has joined #RubyOnRails
[23:51:57] YourManCJ: sorry already removed, added test to home page in a header
[23:52:10] YourManCJ: so the css is not updating but the html is
[23:52:15] Ropeney: has joined #RubyOnRails
[23:52:27] YourManCJ: probably something to do with css being an asset and html not being an asset
[23:52:28] smathy: Ok, so it must just be that your assets aren't being recompiled.
[23:53:06] owenjones: has joined #RubyOnRails
[23:53:12] smathy: Well sort of yes, the assets have the be compiled and yours aren't being.
[23:53:17] smathy: *have to be