Skip to content

Instantly share code, notes, and snippets.

def has_coords_for_client?(client)
client_area_location = client_are_location_for_client(client)
return true if self.has_coords? || (client_area_location.has_coords? if client_area_location)
return false
end
def client_area_location_for_client(client)
client_area_locations = client_area_locations.where(:id => client.id)
client_area_locations.first if client_area_locations
end
@libryder
libryder / rspec-syntax-cheat-sheet.rb
Created July 21, 2012 03:19 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")