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 Task < ActiveRecord::Base | |
| belongs_to :user | |
| belongs_to :location | |
| belongs_to :customer | |
| belongs_to :task_code | |
| validates_presence_of :location_id | |
| validates_presence_of :customer_id | |
| validates_presence_of :job_number | |
| # validates_format_of :job_number, :with => /^[5-9][0-9]{5,100}/ | 
  
    
      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 "#{Rails.root}/vendor/gems/cubeless_base-0.0.4/lib/batch_mailer" | |
| require "#{Rails.root}/app/models/notifier" | |
| # SSJ 11/16/2010 | |
| # | |
| # when using in consule do: require 'spec/mailer_send_helper' | |
| # these methods are not in cubeless, but help in testing ... | |
| class BatchMailer | |
| def self.send_batch_mail(tmail) | |
| users = ["scott.johnson@sabre.com"] | |
| # here(tmail.charset) | 
  
    
      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 Answer < ActiveRecord::Base | |
| stream_to :company | |
| end | 
  
    
      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 'singleton' | |
| class News | |
| include Singleton | |
| # should act as though it has_one :blog | |
| NEWS_BLOG_ID = 10 | |
| def blog | |
| Blog.find(NEWS_BLOG_ID) | |
| end | 
  
    
      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 Sample | |
| # SSJ 10-17-2012 this is a lot like try, but try was not working for me | |
| # also it will try a collection of methods | |
| # but does not take a block or additional parameters to pass to the method | |
| def sample(*keys) | |
| value = "" | |
| keys.each do |key| | |
| if self.respond_to?(key) | |
| value = self.send key | |
| break if value | 
  
    
      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 SiteSearch | |
| extend LocalTire::ActiveModel::Extensions | |
| per_page 10 | |
| search_indexes :profiles, :groups, :blog_posts, :questions, :chats | |
| def self.search(params) | |
| current_page = get_page(params[:page]) | |
| query_string = params[:query] if params.member?(:query) | |
| search_indexes params[:scope] if params.member?(:scope) && params[:scope] != 'all' | 
  
    
      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
    
  
  
    
  | valid_routes = add_segments(current_stops, starting_routes(start), stop) { |current, open_routes, matching_routes| current >= max_stops } | |
| def add_segments(current_stops, routes, stop, matching_routes = [], &block ) | |
| # This method expects a block that receives the parameters current_stops, open_routes and matching_routes | |
| # When the passed block evaluates to true | |
| # it returns all of the routes found matching the start and stop locations | |
| matching_routes << routes.select { |route| route.last_stop == stop } | |
| matching_routes.compress! | 
  
    
      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
    
  
  
    
  | new_ssos = %w(va000123 va000316 va000469 va001190 va001974 va002175 va003344 va003376 va003927 va005733 va006048 va006092 va006186 va007015 va007386 va007526 va008636 va009657 va009667 va010103 va010239 va011367 va011632 va012062 va012345 va012637 va013178 va013235 va013259 va013299 va051200 va005202 va000271 va001092 va002041 va003249 va004225 va005256 va005394 va006165 va007083 va007269 va007415 va007606 va007822 va008375 va008376 va008541 va008573 va008585 va008600 va009097 va009354 va009627 va009983 va010010 va010020 va010026 va010030 va010050 va010056 va010211 va010290 va010392 va010431 va010910 va012015 va012962 va012964 va013319 va014186 va050907 va060769 va080884 va122590 va301922 va339626 va402002 va678910 va689722 va741236 va753780 va812009 va266649 va953068 va955819) | |
| old_ssos = %w(dj000123 dj000316 dj000469 dj001190 dj001975 dj002175 dj003344 dj003376 dj003927 dj005733 dj006048 dj006092 dj006186 dj007015 dj007386 dj007526 dj008636 dj009657 dj009667 dj010103 dj010239 dj011367 dj011632 dj012062 dj01 | 
  
    
      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
    
  
  
    
  | #!/usr/bin/env ruby | |
| require 'test/unit' | |
| # instance_eval sets the current_class to the Eigen Class | |
| # class_eval sets the current_class to the class | |
| # both set self to the receiver | |
| module MyAttr | |
| def my_attr(*args) | |
| args.each do |arg| | |
| class_eval %{ | 
  
    
      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
    
  
  
    
  | #!/usr/bin/env ruby | |
| class Routes | |
| def distance(*segments) | |
| calculate_distance(*segments) | |
| end | |
| private | |
| def calculate_distance(*segments) | |
| puts "Expensive Task" | 
OlderNewer