This file contains hidden or 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
| #file: app/themes/blue/mixins/blue_users_controller_mixin.rb | |
| module BlueUsersControllerMixin | |
| def blue_show | |
| #themed_show method here | |
| end | |
| end | |
| # app/controllers/users_controller.rb |
This file contains hidden or 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 SearchDateRange < ActiveRecord::Base | |
| validates_presence_of :name | |
| validates_presence_of :sort_order | |
| def range_start_end | |
| time = Time.zone.now | |
| case self.name | |
| when 'Today' | |
| [time.beginning_of_day, time.end_of_day] |
This file contains hidden or 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 SearchReport < ActiveRecord::Base | |
| belongs_to :user | |
| belongs_to :report, :polymorphic => true | |
| end | |
| class User < ActiveRecord::Base | |
| ... | |
| has_many :search_reports |
This file contains hidden or 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
| SELECT leads.id, | |
| (SELECT COUNT(*) FROM searches WHERE lead_id = leads.id) AS searches_count, | |
| (SELECT COUNT(*) FROM rental_searches WHERE lead_id = leads.id) AS rental_searches_count, | |
| COALESCE((searches_count + rental_searches_count), 0) as total | |
| FROM leads | |
| WHERE leads.id = 35 | |
| # Unknown column 'searches_count' in 'field list' |
This file contains hidden or 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
| #!/bin/sh -e | |
| # chkconfig: 345 99 1 | |
| # description: Tomcat6 service | |
| # processname: java | |
| # Get LSB functions | |
| . /lib/lsb/init-functions | |
| export JAVA_HOME=/usr | |
| export TOMCAT_USER=solr |
This file contains hidden or 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 FollowsController < ApplicationController | |
| def create | |
| @user = User.find(params[:user_id]) | |
| current_user.follow(@user) | |
| end | |
| def destroy | |
| @user = User.find(params[:user_id]) | |
| current_user.stop_following(@user) |
This file contains hidden or 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 FollowsController < ApplicationController | |
| def create | |
| @followable = find_followable | |
| @follower = find_follower | |
| @follower.follow(@followable) | |
| redirect_to (@followable) | |
| end | |
| def destroy |
This file contains hidden or 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
| check process sequoia_dj2_delayed_job_0 | |
| with pidfile /home/deploy/rails/sequoia/shared/pids/delayed_job.0.pid | |
| start program = "/home/deploy/rails/sequoia/shared/delayed_job_runner.sh start production 0" | |
| as uid deploy and gid deploy | |
| stop program = "/home/deploy/rails/sequoia/shared/delayed_job_runner.sh stop production 0" | |
| as uid deploy and gid deploy | |
| check process sequoia_dj2_delayed_job_1 | |
| with pidfile /home/deploy/rails/sequoia/shared/pids/delayed_job.1.pid | |
| start program = "/home/deploy/rails/sequoia/shared/delayed_job_runner.sh start production 1" |
This file contains hidden or 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 'spec_helper' | |
| inputs = [:path, :hash, :file, :tempfile, :stringio] | |
| outputs = [:path, :file, :tempfile, :stringio, :nil] | |
| def get_input(input_type, file_name = 'fields.pdf') | |
| case input_type | |
| when :path | |
| path_to_pdf(file_name) | |
| when :hash |
This file contains hidden or 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
| module Sunspot | |
| module SessionProxy | |
| class NamespacedSessionProxy | |
| class MultipleConnectionsError < StandardError | |
| def initialize | |
| super("Can not perform operations against multiple namespaced (connections)") | |
| end | |
| end | |
| class NotImplementedError < StandardError | |
| def initialize |