Page 1 of 1
[18:36:46] creyes: Hi I have a Task which has_many subTasks. All are viewed in tree-form on one page like a todo list. The Task has a progress bar, I'd like to update the progress bar when a subTask gets created/completed.
[18:37:07] creyes: My question is, should I store a completed_percentage in the Task table that updates when a subTask is completed?
[17:06:07] creyes: Radar: If you're around, I have a multitenancy question. Does your 2nd book cover query'ing across instances in a multi-tenant application?
[03:52:20] creyes: I've been generating graphs with morrisjs... Now I want to send them as weekly reports in an email. From what I can tell, most email clients (gmail) don't support js so is there a way I can turn those into an image/css to send?
[01:13:13] creyes: I want to graph how many records existed on a certain day. That number changes, so the graph should increase linearly. (yesterday there were 10, today there are 17) - what's the best way to achieve that?
[02:01:20] creyes: How can I get build my model so I can get the count of records at a certain date? If I wanted to graph posts over time for example (yesterday there were 10, today there are 17)
[05:33:53] creyes: Hi everyone, had this discussion about Stored vs Calculated values a few days ago
[05:35:08] creyes: I ended up going with a calculated value. But I want to (using morrisjs) graph that when that calculated value reaches 100% at a certain date.
[05:38:32] creyes: I think what I need to do is write a model method that, when the calculated values reaches 100, sets a "completed_at" datetime in a field in the db
[05:52:42] creyes: Gist for my previous question https://gist.github.com/das3in/d4d86ae8b6f30294cc78
[06:00:56] creyes: Radar: hmmm. does the parent (goal) get updated every time a child (milestone) is updated?
[23:32:06] creyes: I have an object with a completed field defaulting to false. I want to set it to true if a button is pressed. Is the only way to do this with a form and hidden field around the button?
[23:39:36] creyes: Radar: even though it looks like it's basically the same. Just creates a form. Just in jQuery mindset where I can attach inputs to anything form or not
[23:40:59] creyes: Radar: it doesn't really have anything to do with "intent" on it not being a form. Just trying to understand what's going on / how things are done
[20:01:49] creyes: Writing some easy goal-tracking stuff and have a modeling question. Goals have milestones, when all the milestones are done the goal is completed. Should "completed?" be a function on the model or an attribute in the db?
[20:04:02] creyes: Hmm, either way there has to be a function though yeah? cause I have to write a "def completed?" to calculate it, or a "def set_completed" when all the @milestones are done
[20:04:59] creyes: If I'm rendering all completed goals will there be a noticable performance differences between querying stored vs caluclated?
[20:10:16] creyes: mustmodify: do you have any good resources for reading up on stored vs calculated values? My google skills are failing me
[20:15:52] creyes: mustmodify: hmm ok that makes sense. Store a "completed_at" variable in the db for Milestone, calculate "completed" for Goals based on stored value of milestone.
[20:16:24] creyes: mustmodify: but if I'm doing something like "Goals.where(completed?: true)" wouldn't that render slowing cause it has to calculate all of them?
[05:46:21] creyes: Hi everyone, I'm getting an 'undefined method humanize' error and I've never seen it before/not sure what it means. https://gist.github.com/das3in/972e3841ec3d89868b29
[05:59:34] creyes: rvanlieshout: right that's why it was throwing an error yeah? when there is a valid title stringit works fine
[22:26:50] creyes: I'm building an app that needs to assign a user a number of forms to fill out every week, and then track the progress of the completion of those forms. My idea is to create a "packet" that has_many "forms" - then every week make a new packet that generates X blank forms for the user and then measure their completion. I'm looking for "on monday user.packet.build"
[22:30:22] creyes: rhizome: I have a function that will build 4 blank forms for a user. I need a way to make that run every week
[22:47:54] creyes: fox_mulder_cp: Usually yea but I want them to be able to submit forms with blank fields. They have a week to complete it, so then I just count the fields, count how many are empty and return a % in the dashboard. The form validation part is not my concern
[04:29:25] creyes: Is there a rails helper method to find out how long ago something was done? I'm trying to check if a form was completed within the last 7 days.
[04:30:50] creyes: quazimodo: I mean it saves all the form inputs (like a survey). And the form has a created_at so I know how long ago it was created.
[04:31:32] creyes: quazimodo: not trying to list that. I want to change a background color if time_ago < 7 days
[23:26:36] creyes: https://gist.github.com/das3in/f18eb8eab27f066ddeff - I want the y-axis in the morris.js graph to be the length of the object I'm passing to it... not sure how to format that
[23:46:38] creyes: Ok updated my gist. https://gist.github.com/das3in/f18eb8eab27f066ddeff The graph keeps returning the value of "2" for every day when it should be "0" for every day except "1" - my problem is in date-format-matching
[06:12:37] creyes: Hi everyone! can someone eli5 the interaction between Rolify and CanCanCan? Is it just that Rolify defines the roles in the User model and CanCanCan uses those roles to control access?
[03:05:09] creyes: Hi I'm trying to associate user_profiles with users in my rails app. I'd like to use an integer/enum based solution for roles [:admin, :student, :teacher] - what's the best way to associate something like a "TeacherProfile" table with "user.teacher?" while also doing "StudentProfile" with "user.student?"
[18:42:18] creyes: If I want to track user login info, (#of logins, login locations etc) should I store that stuff in a separate table? user has_one :login_info ?
[18:46:40] creyes: tbuehlmann: Well I want to store everytime they log in. I want to be able to do plot all their logins on a graph
[18:47:59] creyes: Ok cool. I'm using pg so I was thinking I could maybe just store lon/lat coords in a json field in the profile table
[18:52:58] creyes: http://stackoverflow.com/questions/6592038/change-the-name-of-the-id-parameter-in-routing-resources-for-rails
[18:55:17] creyes: isn't it even easier than that SO post? resources :posts, param: :post_name should work I think
[19:50:26] creyes: I'm struggling A LOT with auth design. I like this answer http://stackoverflow.com/questions/24479839/multiple-types-of-users-on-ruby-on-rails but I need each different type of user to also have a different type of profile that asks for different things.
[00:11:31] creyes: Radar: still new to some of the basic Rails things (auth confuses the f*** out of me) but your multitenancy books are really well written
[00:29:07] creyes: Here's a rough thought. I have a survey app that is doing a lot of stuff with the User model. I want to completely overhaul the authentication/authorization - best way to do it? Clone the app and manually remove all devise things?
[00:34:06] creyes: Radar: well I was talking with VeryBewitching and realized that everything I did was terrible, and it'd probably be easier to start the ath stuff over
[00:34:57] creyes: I only have 1 user model, it's associated with survey replies and also is how people log in. I added profiel data to the user model. I started exploring options when I wanted to make an admin dashboard and realized I made lots of mistakes
[19:55:06] creyes: front-end question: Using chartkick to render graphs. I'd have a list of users, I'd like to click on the user and have the graph update to only show their data. What's the best way to do this without re-query'ing the server everytime
[19:57:15] creyes: rhizome: I thought about that. But i'm not sure how to (using erb) extract pieces of that data. I can visualize how to do that with Angular... but not just in rails
[23:31:41] creyes: Hey everyone. I have some questions about best practices w/storing user data. Example app: Doctor, patient, assistant accounts are needed. I want to use Devise. I understand I can add a "role" or "admin" boolean field to the user model. But what if I want to store patient data? height weight etc. Does that go in a different model or the user model?
[23:34:02] creyes: VeryBewitching: right this is where I get confused. So I there a User model, a Patient model and a Dr model? and then Dr and Patient inherit from User?
[23:35:08] creyes: VeryBewitching: Right but if I do that, do I just add "height, weight, gender" fields to the Patient model? cause then I'd be using the user models for stuff besides authentication
[23:36:39] creyes: VeryBewitching: ah I see. So patient has_one :patient_profile, :dependent => destroy and store everything in the :patient_profile model
[23:37:32] creyes: VeryBewitching: Yeah auth just seems unnecessarily convoluted but I see why separation is important. Kinda why I'm asking around for opinions so I don't do it imporperly
[23:43:06] creyes: VeryBewitching: other related question: Rolify/Cancancan seem to provide role-based authorization for Devise apps. Are those unnecessary if I'm just spinning up different user models?
[23:44:27] creyes: VeryBewitching: (medical thing was just an example) but yeah say there's an Assistant who manages appointments between Patient and Doctor
[23:47:04] creyes: VeryBewitching: gotcha. That makes sense. For some reason I read the cancancan/pundit docs as "give access to x part of site" but didn't think of it as "restricts who can modify what data"