creyes

Activity Graph

Page 1 of 1

2016-07-07

[21:59:31] creyes: has joined #RubyOnRails
[22:17:29] creyes: Quit: Page closed

2016-06-30

[18:35:22] creyes: has joined #RubyOnRails
[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?
[21:00:21] creyes: Quit: Page closed

2016-02-19

[17:04:12] creyes: has joined #RubyOnRails
[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?
[17:14:16] creyes: Quit: Page closed

2016-02-09

[04:18:24] creyes: has joined #RubyOnRails
[04:24:57] creyes: Ping timeout: 252 seconds

2016-02-03

[03:49:21] creyes: has joined #RubyOnRails
[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?
[04:58:33] creyes: Ping timeout: 252 seconds
[18:33:25] creyes: has joined #RubyOnRails
[20:44:43] creyes: Quit: Page closed

2016-01-28

[01:11:03] creyes: has joined #RubyOnRails
[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)
[02:55:45] creyes: Quit: Page closed

2016-01-27

[05:33:32] creyes: has joined #RubyOnRails
[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:38:48] creyes: how can I write a function like that that's constantly checking?
[05:52:42] creyes: Gist for my previous question https://gist.github.com/das3in/d4d86ae8b6f30294cc78
[06:00:13] creyes: Radar: oh right
[06:00:56] creyes: Radar: hmmm. does the parent (goal) get updated every time a child (milestone) is updated?
[06:11:51] creyes: Ping timeout: 252 seconds

2016-01-25

[03:01:44] creyes: Quit: Page closed
[07:21:27] creyes: has joined #RubyOnRails
[07:28:12] creyes: Quit: Page closed

2016-01-24

[23:29:39] creyes: has joined #RubyOnRails
[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:37:53] creyes: Radar: I guess what I'm asking is... can I only update values through a form?
[23:38:54] creyes: Radar: perfect that's exactly what I was looking for.
[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
[23:41:35] creyes: Radar: thanks though, this is helpful

2016-01-22

[20:00:16] creyes: has joined #RubyOnRails
[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?
[22:35:00] creyes: Quit: Page closed

2016-01-08

[05:45:47] creyes: has joined #RubyOnRails
[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:49:50] creyes: rvanlieshout: no just a string field in the question
[05:56:49] creyes: actually that wasn't it, it was that the title was nil
[05:56:54] creyes: so it couldn't humanize nil
[05:57:41] creyes: thanks though rvanlieshout
[05:59:34] creyes: rvanlieshout: right that's why it was throwing an error yeah? when there is a valid title stringit works fine
[05:59:39] creyes: exactly as it is
[09:40:01] creyes: Ping timeout: 252 seconds

2016-01-07

[22:24:52] creyes: has joined #RubyOnRails
[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:27:04] creyes: What's the best way to achieve that
[22:28:58] creyes: rhizome: I actually have most of the app built, I need scheduling done
[22:29:20] creyes: rhizome: form completion I'm just checking the entry string is blank or not
[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
[22:48:03] creyes: fox_mulder_cp: its a scheduler to build blank forms weekly
[22:54:45] creyes: Quit: Page closed

2015-12-16

[01:40:52] creyes: Quit: Connection closed for inactivity

2015-12-13

[10:25:13] creyes: Ping timeout: 250 seconds
[10:50:32] creyes: has joined #RubyOnRails

2015-12-09

[01:32:07] creyes: has joined #RubyOnRails

2015-12-08

[04:28:37] creyes: has joined #RubyOnRails
[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
[04:39:23] creyes: quazimodo: ahhhhh ik new it
[04:39:29] creyes: quazimodo: thanks a ton
[04:52:42] creyes: Ping timeout: 252 seconds
[23:23:08] creyes: has joined #RubyOnRails
[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
[23:53:19] creyes: Quit: Page closed

2015-11-17

[06:11:33] creyes: has joined #RubyOnRails
[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?
[06:31:11] creyes: Quit: Page closed

2015-11-11

[03:01:43] creyes: has joined #RubyOnRails
[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?"
[03:20:20] creyes: any insight into my above different users -> different profiles question?
[05:53:39] creyes: Ping timeout: 246 seconds

2015-11-05

[18:39:27] creyes: has joined #RubyOnRails
[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:48:21] creyes: but a separate LoginInfo table seems better
[18:48:43] creyes: Was just going to grab them from the browser
[18:50:31] creyes: or use something like this https://github.com/alexreisner/geocoder
[18:52:21] creyes: In the routes.rb bvbrandon
[18:52:26] creyes: oh or that
[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
[18:56:07] creyes: oh lol. I'm still pretty new I've only worked with rails 4. :p
[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.
[20:05:49] creyes: Quit: Page closed

2015-11-04

[00:05:54] creyes: Radar: newfound respect. Not that I didn't before, but you're the man
[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:33:06] creyes: my connection dropped, if someone answered could they please repost
[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
[00:37:31] creyes: VeryBewitching: nope. woudl like to someday though
[03:45:03] creyes: Quit: Page closed
[18:34:23] creyes: has joined #RubyOnRails
[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:11:06] creyes: Quit: Page closed

2015-11-03

[23:28:34] creyes: has joined #RubyOnRails
[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:32:48] creyes: VeryBewitching: so then I associate a "patient" model with 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:37:47] creyes: VeryBewitching: /learn it imporperly
[23:40:04] creyes: VeryBewitching: makes sense. Thanks for the chat
[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:44:46] creyes: VeryBewitching: that's when those gems become useful?
[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"
[23:47:16] creyes: VeryBewitching: In that case yeah authorization makes sense
[23:58:39] creyes: make stuff -> put on github -> become hireable
[23:59:13] creyes: I was joking. The right answer is buy Radar 's books

2013-01-17

[18:55:32] creyes: Could someone help me (new) with how to structure my models