This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
runquery = Student.joins(:user) | |
runquery = runquery.where(users: {first_name: params[:first_name]}) if params[:first_name].present? | |
runquery = runquery.where(users: {last_name: params[:last_name]}) if params[:last_name].present? | |
runquery = runquery.where(users: {loginable_id: params[:id]}) if params[:id].present? | |
runquery = runquery.where(program: params[:program]) if params[:program].present? | |
runquery = runquery.where(users: {social_security_no: '000000000'}) if params[:social_security_no] == 'no_social' # '000000000' || '' || '0' | |
runquery = runquery.select('students.*, students.id as sid, users.*') | |
@query = runquery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'daemons' | |
Daemons.run('notify_batch.rb') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Processing by StudentsController#index as HTML | |
DEPRECATION WARNING: Relation#all is deprecated. If you want to eager-load a relation, you can call #load (e.g. `Post.where(published: true).load`). If you want to get an array of records from a relation, you can call #to_a (e.g. `Post.where(published: true).to_a`). (called from index at /Users/travis.glover/RubymineProjects/eminence/app/controllers/students_controller.rb:82) | |
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."loginable_type" = 'Student' | |
Student Load (0.2ms) SELECT "students".* FROM "students" WHERE "students"."id" IN (1, 3, 51, 71, 74, 75, 76, 77, 78, 79, 80) | |
DEPRECATION WARNING: Relation#all is deprecated. If you want to eager-load a relation, you can call #load (e.g. `Post.where(published: true).load`). If you want to get an array of records from a relation, you can call #to_a (e.g. `Post.where(published: true).to_a`). (called from index at /Users/travis.glover/RubymineProjects/eminence/app/controllers/students_controller.rb:8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before_filter :fetch_user, only: :update | |
before_filter :activate, only: :update | |
def update | |
@student.update(student_params) | |
@user.update(user_params) | |
if @student.update(student_params) && @user.update(user_params) | |
redirect_to students_path, notice: "Student has been updated." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rb-inotify' | |
require 'json' | |
require 'rest_client' | |
require 'crack' | |
require 'active_support/all' | |
#0 Notifier Start | |
notified = INotify::Notifier.new | |
#1 File is placed within the folder (by Epitomax) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
con = Student.joins(:user) | |
con = con.where("discharge_date < admission_date OR discharge_date IS NULL") | |
con = con.where(users: {loginable_type: 'Student'}).all.map { |u| [u.user.full_name, u.id] }.uniq | |
@users_array_id = con |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ArgumentError at /drug_assessments | |
Direction should be :asc or :desc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CounselorsController < ApplicationController | |
before_filter :authenticate_user! | |
before_filter :find_counselor_by_id, only: [:show, :edit, :update, :destroy, :toggle_active_on, :toggle_active_off] | |
load_and_authorize_resource | |
def create | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<div class ='well' style="float:left;"> | |
<% if can? :manage , :all %> | |
<%= simple_form_for(students_path, method: 'get', html: { class: 'form-horizontal', style: 'margin-bottom:-5px;', autocomplete: 'on' }) do %> | |
<br><br> | |
<%= @current %> | |
<br><br> | |
<%= select_tag 'active', options_for_select('True'=>'true', 'False'=>'false'), { prompt: 'Active', style: 'margin:5px 0px 5px 0px;'} %> | |
<%= submit_tag 'Submit', :class => 'btn btn-primary', style: 'margin:5px 0px 5px 0px;' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Survey < ActiveRecord::Base | |
has_many :survey_users | |
has_many :users, through: :survey_users | |
end |
OlderNewer