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
if @messages = Message.all ## need to test for nil | |
@messages_in_last_week = messages_last_week ## move this out to a method | |
else | |
@messages_in_last_week = false | |
end | |
def messages_last_week | |
@messages_in_last_week = @messages.select { |m| m.created_at <= 7.days.ago } | |
@messages_in_last_week = false if @messages_in_last_week.empty? | |
## bugs happen if the variable gets assigned [] in one place and false in another |
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 Team | |
include Mongoid::Document | |
has_and_belongs_to_many :captains, class_name: 'User', inverse_of: :team_captained, autosave: true | |
has_and_belongs_to_many :members, class_name: 'User', inverse_of: :team_joined, autosave: true | |
references_one :owner, class_name: "User", autosave: true |
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
def parse_date(date) | |
begin | |
if date_in_numeric_format? date | |
Time.new (date / 1e6).to_int | |
else | |
DateTime.parse date | |
end | |
rescue => e | |
puts e.to_s + " " + date.to_s + " class: " + date.class.to_s | |
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
source 'http://rubygems.org' | |
gem 'rails', '3.1.3' | |
gem 'mysql2' | |
gem 'sass' | |
gem 'text' | |
gem 'docsplit' | |
gem 'pdf-reader' | |
gem 'bcrypt-ruby' | |
gem 'haml' |
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
"<html><head></head><body></body></html>" |
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 'rubygems' | |
require 'spork' | |
require 'rspec' | |
require 'capybara/rspec' | |
Spork.prefork do | |
# Loading more in this block will cause your tests to run faster. However, | |
# if you change any configuration or code from libraries loaded here, you'll | |
# need to restart spork for it take effect. |
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
1 | |
12 | |
13 | |
14 | |
15 | |
16 | |
require 'spec_helper' |
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 'spec_helper' | |
require 'selenium-webdriver' | |
describe "User Requests" do | |
context "not logged_in" do | |
let(:user){ Factory :user } | |
describe "GET#/user/:id/edit" do |
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
def self.existing_claim_with_same_insurance_provider_claim_id_and_insurance_provider insurance_provider_claim_id,insurance_provider | |
claims = Claim.where( :insurance_provider_claim_id => insurance_provider_claim_id.to_s ).entries | |
if claims.present? | |
claims.each do |claim| | |
return claim if claim.insurance_provider === insurance_provider | |
end | |
end | |
false | |
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
opts={} | |
@insurance_provider ||= InsuranceProvider.find_by_name(UNITED_HEALTH_NAME) | |
claim = self.existing_claim_with_same_insurance_provider_claim_id_and_insurance_provider( insurance_provider_claim_id,@insurance_provider ) | |
atts = self.merge_columns_with_attrs( atts, claim ) if claim | |
OlderNewer