I’m attemping to initialize an active resource class; however I’m getting an uninitialized constant error. I’m using rails 4.2 and the 4.0 active resource gem. Yes, I’m typing in the correct class name.
If anyone cares, the file was not being autoloaded because it was erroneously named. I camel cased it.
Why do I have to write application_results[“app_name”] to get the first result for that particular “app_name”? Why doesn’t the code I wrote allow me to access it like this application_results[“app_name”] … https://gist.github.com/saturday/64daae33bd3050885b7c45a03fc410b4
Hey rails super people. I’ve got the following model that requires all kinds of preprocessing in order to get the data I want, but only for one use case. Most other use cases could use the model as a typical mapping to the db. Right now I’ve set up all of said builder methods as class methods. Is there a better way to do this? It currently returns a hash, but I’m concerned it should return an active record model instance inste
I’m using devise’s confirmable module, and I’ve set it up so that when a user is created, they receive the confirmation email and are asked to enter a password after clicking the confirmation link. The weird thing is that the devise confirmable mailer is sending the raw token instead of the digested token. Also, I’m definitely using the @token variable in the mailer view as everything I’ve read on google suggests.
Does anyone know of a good algorithm for equally distributing the items of a large array to the items of a smaller array? For example, I have a patients array, and a clinicians array. I want to assign patients to clinicians so that each clinician has an equal number of patients, up until the last clinician.
I have a users table. Any user can be have a role of patient, or clinician. I ned to associate clinicians to their respective patients. How should that association be set up for rails? Right now I have a clinician_patients table, but I’m having some issues with two columns acting as a foreign key to users.
Right. The problem is I have a users table and a user_roles table that is used to set up a user as a patient or a clinician, but I need to associate clinicians to their respective patients. You’re suggesting I split this up entirely by removing the user_roles table, right?