« Back to channel list

#RubyOnRails - 23 September 2017

« Back 1 day Forward 1 day »
[00:00:37] jrabe: has joined #RubyOnRails
[00:01:05] hfp_work: has joined #RubyOnRails
[00:12:24] s2013: has joined #RubyOnRails
[00:18:10] cagomez: has joined #RubyOnRails
[00:18:20] cagomez: has joined #RubyOnRails
[00:21:00] cagomez: has joined #RubyOnRails
[00:24:06] wethu: has joined #RubyOnRails
[00:54:47] bronson: has joined #RubyOnRails
[01:08:04] FCser: has joined #RubyOnRails
[01:37:26] cagomez: has joined #RubyOnRails
[01:52:56] cagomez: has joined #RubyOnRails
[01:57:50] Jameser: has joined #RubyOnRails
[02:02:16] cagomez: has joined #RubyOnRails
[02:09:36] irishfromua: has joined #RubyOnRails
[02:11:34] quazimodo: has joined #RubyOnRails
[02:17:25] orbyt_: has joined #RubyOnRails
[02:20:01] cagmz_: has joined #RubyOnRails
[02:23:10] andrewray: has joined #RubyOnRails
[02:23:35] cagmez__: has joined #RubyOnRails
[02:27:56] gambl0re: has joined #RubyOnRails
[02:30:17] DarkBushido: has joined #RubyOnRails
[02:51:00] jphase: has joined #RubyOnRails
[02:56:30] gambl0re: has joined #RubyOnRails
[03:04:51] cagomez: has joined #RubyOnRails
[03:09:12] wethu: has joined #RubyOnRails
[03:17:15] bronson: has joined #RubyOnRails
[03:18:32] Chernobuk: has joined #RubyOnRails
[03:27:02] atrius: has joined #RubyOnRails
[03:46:07] cagomez: has joined #RubyOnRails
[04:41:36] wethu: has joined #RubyOnRails
[04:46:48] jphase: has joined #RubyOnRails
[05:07:08] pwnd_nsfw: has joined #RubyOnRails
[05:12:36] srinidhi: has joined #RubyOnRails
[05:32:56] irishfromua: has joined #RubyOnRails
[05:51:06] Saukk: has joined #RubyOnRails
[06:09:08] ^mtkd: has joined #RubyOnRails
[06:18:01] jphase: has joined #RubyOnRails
[06:18:24] tamouse__: has joined #RubyOnRails
[06:43:32] FastJack: has joined #RubyOnRails
[07:25:40] mostlybadfly: has joined #RubyOnRails
[07:40:08] timdotrb: has joined #RubyOnRails
[07:40:12] timdotrb: Evening, all
[07:41:29] timdotrb: I’m getting an error trying to query a model via: Model.find_by_slug(slug).select(:updated_at), NoMethodError: private method `select’. I am using both mysql and mongoid.. I’ve set my orm to active_record in my application.rb but I think mongoid is somehow messing with my queries?
[07:42:39] tbuehlmann: timdotrb: find_by_slug returns nil or an instance of Model
[07:42:54] timdotrb: Yea, it appears as thought I had them in the wrong order
[07:43:08] tbuehlmann: try switching the order of #find_by_slug and #select and see what happens
[07:43:16] timdotrb: tbuehlmann: yep, ty.
[07:43:28] timdotrb: Getting a similar error for .pluck
[07:43:41] timdotrb: Is it because of the find_by_X?
[07:43:58] bronson: has joined #RubyOnRails
[07:44:40] tbuehlmann: select and pluck work on relations, not instances of your model
[07:47:25] conta: has joined #RubyOnRails
[08:12:04] Radar: has joined #RubyOnRails
[08:12:30] lxsameer: has joined #RubyOnRails
[08:13:15] kapil___: has joined #RubyOnRails
[08:14:01] kapil___: Hello I want to start with react. please suggest which gem is better. thanks
[08:17:17] dionysus69: has joined #RubyOnRails
[08:39:13] jphase: has joined #RubyOnRails
[08:43:46] bronson: has joined #RubyOnRails
[08:49:46] bruno-: has joined #RubyOnRails
[09:10:58] mtkd: has joined #RubyOnRails
[09:11:44] mikecmpbll: has joined #RubyOnRails
[09:23:33] Ergo: has joined #RubyOnRails
[09:25:51] marr: has joined #RubyOnRails
[09:55:53] xco: has joined #RubyOnRails
[09:56:20] xco: hi. i my rails app i’m having “no implicit conversion of nil into String” on @start = Time.parse(params[:start])
[09:56:30] xco: will doing this be the best thing to do here
[09:56:45] xco: @start = Time.parse(params[:start]) if params[:start]
[09:58:04] skapshikar: has joined #RubyOnRails
[10:00:39] tbuehlmann: xco: depends on what you want to achieve. what's that start time?
[10:03:19] xco: tbuehlmann: i’m just picking the params a users submits from a drop down
[10:04:16] tbuehlmann: does it go into a model of some kind?
[10:09:03] tbuehlmann: please don't provide _too_ much information :p
[10:09:34] tbuehlmann: you could check for a present value using if, but maybe the controller isn't the right place for it
[10:10:58] xco: that variable has nothing to do with a model, where would be the place for it then if not in the controller?
[10:12:19] tbuehlmann: maybe you're missing a model, or a form object, or something like this. maybe I still don't know what that value is doing at all
[10:16:37] srinidhi: has joined #RubyOnRails
[10:20:54] cagomez: has joined #RubyOnRails
[10:29:59] beilabs: has joined #RubyOnRails
[10:34:41] wethu: has joined #RubyOnRails
[10:39:29] beilabs: has joined #RubyOnRails
[10:41:36] netzfisch: has joined #RubyOnRails
[10:45:05] bronson: has joined #RubyOnRails
[10:48:49] Tempesta: has joined #RubyOnRails
[10:59:43] wethu: has joined #RubyOnRails
[11:25:50] dionysus69: has joined #RubyOnRails
[11:27:33] AzaToth: has joined #RubyOnRails
[11:28:42] arBmind: has joined #RubyOnRails
[11:31:40] netzfisch: has joined #RubyOnRails
[11:37:13] xco: has joined #RubyOnRails
[11:41:29] beilabs_: has joined #RubyOnRails
[11:42:02] my123: has joined #RubyOnRails
[11:52:30] ShalokShalom_: has joined #RubyOnRails
[12:07:59] apparition: has joined #RubyOnRails
[12:20:00] raunicolae: has joined #RubyOnRails
[12:20:09] raunicolae: has left #RubyOnRails: ()
[12:25:17] cagomez: has joined #RubyOnRails
[12:46:16] bronson: has joined #RubyOnRails
[12:56:10] cagomez: has joined #RubyOnRails
[12:56:24] beilabs: has joined #RubyOnRails
[13:00:08] marienz: has joined #RubyOnRails
[13:08:48] rgr: has joined #RubyOnRails
[13:11:58] netzfisch: has joined #RubyOnRails
[13:15:14] moei: has joined #RubyOnRails
[13:21:08] rgr: has joined #RubyOnRails
[13:27:15] cagomez: has joined #RubyOnRails
[13:44:19] patientplatypus: has joined #RubyOnRails
[13:44:33] patientplatypus: i have this rails question https://hastebin.com/ojetimudin.rails
[13:44:39] patientplatypus: any help would be very much appreciated - i am completely new to rails so its pretty easy
[13:44:58] tbuehlmann: patientplatypus: hey! what you already have in place is a concept named "validations" and people tend to place them in the model
[13:45:34] patientplatypus: ok - can you tell me how to do the model way and the way that im doing it currently?
[13:45:57] tbuehlmann: sure. when you try to save a user and the validations fail, the user is not saved to the database and user.errors includes the errors so you can display them in the view
[13:46:30] tbuehlmann: let's start with the email. if it's supposed to be unique across users, try this in your User class: `validates :email, uniqueness: true`
[13:47:34] patientplatypus: hmmm....what if i want uniqueness of the combination of email and name
[13:48:03] tbuehlmann: that would be `validates :email, uniqueness: {scope: [:name]}`
[13:48:47] tbuehlmann: here's a nice guide: http://guides.rubyonrails.org/active_record_validations.html
[13:49:31] patientplatypus: ok that seems right...cool. So two more questions - 1) how do i do this by searching the User model and if statements, and 2) how do you print variables to console?
[13:50:33] raunicolae: has joined #RubyOnRails
[13:50:35] tbuehlmann: 2) you can call "puts variable"
[13:50:46] raunicolae: has left #RubyOnRails: ()
[13:50:53] tbuehlmann: not sure what you mean with 1), can you elaborate?
[13:52:11] patientplatypus: sure - in the hastebin i linked to I want to take the the params that I passed to the server, search the available records in User model, and only add a new record based on whether the variable name is unique. The wrong way to do it for sure, but knowing this pattern may be useful elsewhere. It is linked as an example in the hastebin above
[13:53:16] jphase: has joined #RubyOnRails
[13:55:03] patientplatypus: puts params[:name]
[13:55:09] patientplatypus: does not appear to work
[13:55:18] tbuehlmann: you would do something like this: https://gist.github.com/tbuehlmann/07baa8d82bff4994c20193411ab5150a
[13:56:00] tbuehlmann: you can also try puts params first, maybe params[:name] is just not set and you just don't see it
[13:57:35] patientplatypus: tbuehlmann - that may not be quite what I'm getting at. this tells me if the user is saved or not. definitely useful, but i would like to know how to search the collection of users for unique passwords from the controller and output whether the password is unique or not. is this possible?
[13:58:21] patientplatypus: search all users in usermodel for entries that dont have THIS password
[13:58:25] tbuehlmann: um, quite possible, but I don't see how that's useful
[13:58:49] patientplatypus: well...i would like to know how to search a model from the params i pass in the controller. That i think is useful
[13:59:26] tbuehlmann: searching models in general works like User.where(name: 'some name'), whicht returns a relation
[13:59:31] matthewd: patientplatypus: `User.find params[:email]` won't do what you think it will
[14:00:05] patientplatypus: ah? matthewd why not? should i be using User.where(name: 'some name') as suggested instead?
[14:00:36] matthewd: Possibly.. or find_by_name, maybe
[14:00:58] matthewd: But `find` takes an ID; it can't tell that you're passing a name/email/whatever
[14:02:24] patientplatypus: name_in_users = User.where(name: params[:name])
[14:02:24] patientplatypus: puts name_in_users
[14:02:33] patientplatypus: is what i just tried -
[14:02:53] matthewd: You probably do want `p` rather than `puts` there, btw
[14:02:55] patientplatypus: it gives no errors but also does not print output (it should)
[14:03:15] matthewd: You're using strings so far, but it'll work with any value
[14:04:21] matthewd: Note that `where` returns a relation (a set of records), not just a single record -- so it might return an empty list, but never nil
[14:05:33] defsdoor: has joined #RubyOnRails
[14:05:50] patientplatypus: having trouble reading the output correctly. thanks guys i think i got it for the moment
[14:36:20] workmad3: has joined #RubyOnRails
[14:39:35] andrewray: has joined #RubyOnRails
[14:44:42] jphase: has joined #RubyOnRails
[14:47:11] bronson: has joined #RubyOnRails
[14:48:52] banisterfiend: has joined #RubyOnRails
[14:57:01] patientplatypus: ok i have another question - i am trying to follow along here (http://guides.rubyonrails.org/association_basics.html) for a basic one to many association.
[14:57:34] patientplatypus: i have the following: @post = @user.posts.create(post_params) in my create section of my post controller. Unfortunately I am getting the following error:
[14:57:51] patientplatypus: NoMethodError (undefined method `posts' for nil:NilClass):
[14:58:33] patientplatypus: so the compiler does not understand what I mean by @user.posts - it doesn't see posts even though i am following the example. Does anyone see what I am doing wrong?
[15:00:14] tbuehlmann: @user is not set. how do you set it?
[15:02:53] patientplatypus: sorry here is the whole question in a hastebin
[15:02:54] patientplatypus: https://hastebin.com/awasayopuh.rails
[15:04:36] tbuehlmann: you call @user.posts.create(...) but never define @user, that's why it's nil
[15:04:38] patientplatypus: @tbuehlmann i would set it by a curl command to set a user and get a token? this is part of where i am confused on how a one to many relationship should work - how does it know what user is currently 'active' so it can put the post in that users bucket. in the examples ive seen online there does not appear to be a way to set the user you want to associate with that post in the controller.
[15:05:10] patientplatypus: how should i be defining @user?
[15:05:51] tbuehlmann: you could send an user_id with the title and body
[15:06:16] tbuehlmann: then use the commented line 30 instead of 31
[15:07:15] patientplatypus: wait, can i specify that the user_id is a unique email like we were talking about earlier?
[15:07:17] netzfisch: has joined #RubyOnRails
[15:07:37] patientplatypus: i need a way of setting the key between the users and the posts
[15:08:35] tbuehlmann: well, I assume your posts table has an user_id column, referencing the user
[15:09:23] tbuehlmann: how do you know which post belongs to which user then?
[15:10:14] patientplatypus: but say that I DO have this column....im still unsure how to set the column to the right user
[15:10:28] patientplatypus: (also ill put in this column and rerun my migrations doy)
[15:11:56] tbuehlmann: I don't know your usecase. so, shall every user (of the API) be able to create posts for others users? or are users only supposed to create posts for themselves?
[15:14:00] patientplatypus: well it will be a blog, in this case it will be that a user can only post for themselves, but each post will have a comments model (to be made) that will allow every user to write to every post
[15:15:21] tbuehlmann: okay, then you need some kind of authentication for your users. so when one of them tries to create a post, the user needs to be authenticated and the post will automatically tied to the creating user
[15:16:39] patientplatypus: i think i have the authentication done with tokens
[15:16:49] patientplatypus: thats not a big deals
[15:19:12] tbuehlmann: great, then what you need is a before_action method that is called before the actual create method from your posts controller. it would find the user to the corresponding token and set an @user variable
[15:19:31] tbuehlmann: know what I mean?
[15:20:11] cagmz_: has joined #RubyOnRails
[15:22:51] patientplatypus: like this tbuehlmann? https://hastebin.com/mapepugevu.rails
[15:23:47] rfoust: has joined #RubyOnRails
[15:23:50] xibalba: has joined #RubyOnRails
[15:26:12] tbuehlmann: kind of, yeah. just a sec
[15:28:07] tbuehlmann: start with something like this: https://gist.github.com/tbuehlmann/e1e82dbebfe8a50b00b193373d9e13a6
[15:29:17] banisterfiend: has joined #RubyOnRails
[15:29:49] raunicolae: has joined #RubyOnRails
[15:30:04] raunicolae: has left #RubyOnRails: ()
[15:32:05] orbyt_: has joined #RubyOnRails
[15:35:38] banisterfiend: has joined #RubyOnRails
[15:49:14] s2013: has joined #RubyOnRails
[15:49:17] patientplatypus: https://gist.github.com/patientplatypus/dc64c5d6d4d0657dea50ad35bc92c580
[15:49:46] patientplatypus: do you see what I'm doing wrong here? im getting undefined local variable 'user', but i think im following your pattern
[15:50:04] patientplatypus: NameError (undefined local variable or method `user' for #<PostsController:0x007fc4be6de310>):
[15:57:11] fryguy: line 19 should be @user I think
[15:57:38] xibalba: has joined #RubyOnRails
[16:02:17] srinidhi: has joined #RubyOnRails
[16:07:53] patientplatypus: has joined #RubyOnRails
[16:08:17] patientplatypus: ok so what's the difference between @user and user? That solved that problem, but now i have another
[16:08:31] patientplatypus: NoMethodError (undefined method `posts' for nil:NilClass):
[16:08:32] patientplatypus: app/controllers/posts_controller.rb:19:in `create'
[16:09:22] patientplatypus: so if i look here:
[16:09:23] patientplatypus: http://guides.rubyonrails.org/association_basics.html
[16:09:35] patientplatypus: they have @book = @author.books.create(published_at: Time.now)
[16:09:47] patientplatypus: and i now have (on line 19)
[16:09:52] dionysus70: has joined #RubyOnRails
[16:09:56] patientplatypus: @post = @user.posts.create(post_params)
[16:10:09] patientplatypus: but it says that the method posts is not defined.
[16:10:27] patientplatypus: why would this be? where am i supposed to define it?
[16:11:22] patientplatypus: https://gist.github.com/patientplatypus/dc64c5d6d4d0657dea50ad35bc92c580
[16:11:26] patientplatypus: updated with question
[16:12:37] patientplatypus: compare this with https://gist.github.com/tbuehlmann/e1e82dbebfe8a50b00b193373d9e13a6 that tbeulhmann sent and it is very similar with the .posts method
[16:15:35] patientplatypus: https://stackoverflow.com/questions/31296944/undefined-method-posts-for-nilnilclass says that this is becasuse @user is nil and therefore .posts is being called on an undefined value
[16:18:26] orbyt_: has joined #RubyOnRails
[16:20:08] gambl0re: has joined #RubyOnRails
[16:21:54] patientplatypus: how do i pass parameters to a method in a before_action?
[16:36:17] patientplatypus: is there anyone here?
[16:37:01] tbuehlmann: what about my suggestion?
[16:40:01] patientplatypus: the issue is that while that might work it doesn't differentiate between the token authentication and the find method - so if it ever breaks i dont know if its the tokens or the find that is breaking. Also, i want to try and keep them separated in development so that i dont have to keep logging in while i post
[16:40:31] patientplatypus: also also, i think i understand your way but my way should work and the fact that it continues not to is incredibly confusing to me
[16:40:50] patientplatypus: https://gist.github.com/patientplatypus/dc64c5d6d4d0657dea50ad35bc92c580
[16:41:48] patientplatypus: it is like less than half a dozen lines of code - this should be something easy to solve!
[16:45:55] patientplatypus: updated public gist https://gist.github.com/patientplatypus/dc64c5d6d4d0657dea50ad35bc92c580
[16:48:14] tbuehlmann: you should use the current_user method instead of @user
[16:48:31] bronson: has joined #RubyOnRails
[16:48:44] patientplatypus: ok...but why am i getting the error that I'm getting - I don't understand
[16:48:47] coder2000: has joined #RubyOnRails
[16:49:17] FastJack: has joined #RubyOnRails
[16:49:44] tbuehlmann: well, you should remove the before_action :find_user now
[16:50:15] tbuehlmann: you don't need it and it contains a syntax error
[16:50:56] patientplatypus: whats the syntax error and why dont i need it?
[16:51:27] patientplatypus: i need to search all users and assign to @user before i can assign to @post no?
[16:52:14] tbuehlmann: you don't need @user, because you now have the current_user method
[16:52:43] patientplatypus: ....i dont want to use current user
[16:52:44] tbuehlmann: and the syntax error comes from `User.find_by :email params[:user_email]`, which should've been `User.find_by email: params[:user_email]`
[16:52:47] patientplatypus: i want to use @user
[16:54:26] patientplatypus: because i want to be able to search the User database - there will be times where I want to find a user as supplied by email that is NOT the current user
[16:55:05] patientplatypus: also because i should be able to search the fricking user database....i mean this should be a thing i can do!
[16:56:16] tbuehlmann: not sure I understand what the problem is
[16:56:29] havenwood: an impatient platypus
[16:56:50] havenwood: ACTION regrets typing and goes in search of coffee
[16:57:39] patientplatypus: the problem is that i cant specify a user email in a post request, and search the User database for the user that is tied to that email, and then make a post that is tied to that user
[16:58:00] patientplatypus: i should be able to do this
[16:58:27] patientplatypus: i dont just want to use the current user
[16:58:31] havenwood: patientplatypus: User.find_by(email: 'blarg@blarg.blarg').posts.create(post_stuff: 'yerp')
[16:59:15] patientplatypus: havenwood is there a reason that my before_action and methods are not working?
[16:59:30] patientplatypus: i was breaking that into steps, but i thought that should work as well
[16:59:36] patientplatypus: let me try your method one sec
[16:59:39] fryguy: you are misusing before_action
[16:59:43] havenwood: I'll get some coffee and look. Seems tbuehlmann said above there was a syntax error. Did you fix that? Have you gisted latest code?
[17:01:44] patientplatypus: havenwood here is the latest gist https://gist.github.com/patientplatypus/dc64c5d6d4d0657dea50ad35bc92c580
[17:01:52] patientplatypus: the fixes ended up giving the same error
[17:02:01] patientplatypus: i will also post my repo momentarily
[17:05:21] armyriad: has joined #RubyOnRails
[17:10:57] elcontrastador: has joined #RubyOnRails
[17:11:15] patientplatypus: havenwood it appears that your solution does not work .... updated the repo with the comments (see the posts controller section) https://gist.github.com/patientplatypus/dc64c5d6d4d0657dea50ad35bc92c580
[17:11:20] patientplatypus: uploading repo now
[17:12:22] andrewray: has left #RubyOnRails: ()
[17:13:01] patientplatypus: https://github.com/patientplatypus/rubytrial
[17:13:11] patientplatypus: if anyone has any ideas please let me know, i am lost
[17:13:49] havenwood: patientplatypus: same issue in that gist that tbuehlmann told you about
[17:14:06] havenwood: User.find_by WRONG---> :email
[17:15:18] uks: has joined #RubyOnRails
[17:18:59] havenwood: patientplatypus: colon on the wrong side of `email`, look up Ruby 1.9 Hash syntax for Symbols
[17:19:43] patientplatypus: So this is what tbuehlmann wrote:
[17:19:43] patientplatypus: and the syntax error comes from `User.find_by :email params[:user_email]`, which should've been `User.find_by email: params[:user_email]`
[17:19:44] patientplatypus: From https://gist.github.com/patientplatypus/dc64c5d6d4d0657dea50ad35bc92c580 on line 57 of my post_controller I have
[17:19:46] patientplatypus: @user = User.find_by email: params[:user_email]
[17:19:48] patientplatypus: If there is something wrong havenwood, please tell me I followed what tbuehlmann suggested however!
[17:20:31] havenwood: patientplatypus: Is Errorsfromterminal.txt not current?
[17:20:54] unreal: has joined #RubyOnRails
[17:21:07] patientplatypus: oh maybe not let me rerun and update one sec, sorry
[17:22:53] patientplatypus: ok now it should be up to date https://gist.github.com/patientplatypus/dc64c5d6d4d0657dea50ad35bc92c580
[17:23:14] havenwood: patientplatypus: you forgot a comma
[17:23:38] havenwood: patientplatypus: before_action :find_userINSERT_A_COMMA_HERE except: []
[17:23:48] havenwood: patientplatypus: #before_action is a method
[17:23:58] havenwood: patientplatypus: `:find_user` is the first argument
[17:24:21] havenwood: patientplatypus: `except: []` is the second argument
[17:25:04] patientplatypus: "exception": "#<NoMethodError: undefined method `before_action' for #<Class:0x007ff38739fe18>\nDid you mean? before_commit>"
[17:27:38] havenwood: patientplatypus: I just scanned your gist, but trying to use controller methods in your model?
[17:28:17] havenwood: Learning Ruby syntax would help easily spot the syntax errors. Learning Rails would inform what's going on with the before_* stuff.
[17:29:11] havenwood: patientplatypus: Show the before_* in the Active Record Callbacks docs that you're trying to use.
[17:29:22] patientplatypus: havenwood, i dont think i do that anywhere to my knowledge
[17:29:41] havenwood: patientplatypus: No, what I'm saying is that you're using a method for controllers in your model.
[17:29:59] havenwood: patientplatypus: The reason I point you to the Model docs is that method is nowhere to be found.
[17:30:08] havenwood: (It'll be in the Controller docs.)
[17:30:08] patientplatypus: i understand what you meant, i dont see where that is the case
[17:30:16] havenwood: patientplatypus: Show me.
[17:30:19] havenwood: http://api.rubyonrails.org/v5.1/classes/ActiveRecord/Callbacks.html
[17:30:30] patientplatypus: sorry lets slow down
[17:30:44] havenwood: patientplatypus: What method are you using? Is it available in the model?
[17:31:06] havenwood: If you don't know Ruby you'll really need to cling to the docs.
[17:31:13] patientplatypus: i meant to say that i do not see where it is the case that i use a method for controllers in my model. Can you tell me specifically where you see that i am doing that?
[17:31:39] patientplatypus: second, before_action is, to my understanding, simply a lifecycle hook. why it is not working is very confusing to me
[17:31:40] havenwood: patientplatypus: Show me #before_action in the docs...
[17:31:46] havenwood: Where is it???
[17:31:57] havenwood: Action Controller Overview. And you're not in a controller.
[17:32:01] havenwood: Read the docs!!!
[17:32:09] havenwood: http://guides.rubyonrails.org/action_controller_overview.html
[17:32:20] patientplatypus: umm...yes i am? all of this is taking place in the posts controller....
[17:32:56] havenwood: So your postmodel.rb with `Post ApplicationRecord` is a controller?
[17:33:08] havenwood: patientplatypus: https://gist.githubusercontent.com/patientplatypus/dc64c5d6d4d0657dea50ad35bc92c580/raw/d925aaa3561e010dae210a6df910f0c8b2216fef/postmodel.rb
[17:33:20] havenwood: patientplatypus: That's a *very* suspicious controller.
[17:33:38] havenwood: (It's a model.)
[17:33:39] patientplatypus: well thats clearly wrong
[17:33:47] patientplatypus: alright let me fix that
[17:40:36] beilabs: has joined #RubyOnRails
[17:43:10] patientplatypus: i hate to say it
[17:43:14] patientplatypus: but its still broken
[17:44:51] bruno-: has joined #RubyOnRails
[17:45:33] patientplatypus: https://gist.github.com/patientplatypus/dc64c5d6d4d0657dea50ad35bc92c580
[17:46:01] patientplatypus: NoMethodError (undefined method `posts' for nil:NilClass):
[17:46:33] gusrub: has joined #RubyOnRails
[17:47:24] patientplatypus: NoMethodError (undefined method `posts' for nil:NilClass):
[17:47:30] patientplatypus: https://github.com/patientplatypus/rubytrial
[17:53:16] CassioAlmeidas: has joined #RubyOnRails
[17:58:10] patientplatypus: havenwood are you still there?
[18:10:30] ShalokShalom_: has joined #RubyOnRails
[18:13:54] jottr: has joined #RubyOnRails
[18:17:36] Axsuul: has joined #RubyOnRails
[18:20:15] CassioAlmeidas: has left #RubyOnRails: ()
[18:32:58] dviola: has joined #RubyOnRails
[18:49:46] bronson: has joined #RubyOnRails
[18:55:02] dviola: has joined #RubyOnRails
[19:10:52] netzfisch: has joined #RubyOnRails
[19:28:03] jphase: has joined #RubyOnRails
[19:41:58] psychoslave: has joined #RubyOnRails
[20:08:01] xaviergmail: has joined #RubyOnRails
[20:08:51] sonOfRa: has joined #RubyOnRails
[20:30:18] biox: has joined #RubyOnRails
[20:42:29] sagax: has joined #RubyOnRails
[20:44:10] banisterfiend: has joined #RubyOnRails
[20:47:13] jottr: has joined #RubyOnRails
[20:50:21] bronson: has joined #RubyOnRails
[20:58:36] jphase: has joined #RubyOnRails
[21:02:24] timdotrb: has joined #RubyOnRails
[21:02:29] timdotrb: Afternoon, all
[21:03:32] timdotrb: I’m getting a large amount of data from an API and storing it in Mongo. I have a couple instances where the data I receive is too large for Mongo to store in a single document.. Was wondering if anyone had any suggestions on how to solve that issue?
[21:03:50] timdotrb: Would a different nosql db solution be better (something with a document size >16MB?)
[21:10:05] patientplatypus: has joined #RubyOnRails
[21:10:07] patientplatypus: https://gist.github.com/patientplatypus/af24c425da672a9fd09b783e9e52a103
[21:10:18] patientplatypus: another issue im having if anyone has any ideas
[21:13:46] arBmind: has joined #RubyOnRails
[21:17:16] quazimodo: has joined #RubyOnRails
[21:19:21] havenwood: patientplatypus: use `include` inside the class rather than outside it
[21:19:33] patientplatypus: havenwood doing that now and still no joy
[21:20:42] patientplatypus: https://gist.github.com/patientplatypus/af24c425da672a9fd09b783e9e52a103
[21:24:08] patientplatypus: do you have any ideas
[21:25:50] netzfisch: has joined #RubyOnRails
[21:31:02] bruno-: has joined #RubyOnRails
[21:42:55] kn-928: has joined #RubyOnRails
[21:50:16] jottr: has joined #RubyOnRails
[21:52:45] beilabs: has joined #RubyOnRails
[21:55:50] Rodya_: has joined #RubyOnRails
[22:45:57] jphase: has joined #RubyOnRails
[22:52:13] bronson: has joined #RubyOnRails
[22:55:06] jphase: has joined #RubyOnRails
[23:29:56] beilabs: has joined #RubyOnRails
[23:40:23] hive-mind: has joined #RubyOnRails
[23:59:05] gambl0re: has joined #RubyOnRails