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
# customer.rb | |
class Customer < ActiveRecord::Base | |
validates_presence_of :first_name | |
end | |
# customer_test.rb | |
require 'test_helper' | |
class CustomerTest < ActiveSupport::TestCase | |
should_validate_presence_of :first_name | |
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
# .gitignore for rails projects | |
config/database.yml | |
*~ | |
*.cache | |
*.log | |
*.pid | |
tmp/**/* | |
.DS\_Store | |
db/cstore/** |
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
/* @override http://localhost:3000/stylesheets/formtastic_changes.css */ | |
form.formtastic > li { | |
list-style: none; | |
margin: 0 0 1em 0; | |
} | |
form.formtastic > li > label { | |
display: block; | |
} |
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
// | |
// <input type="text" class="autocomplete-off" /> | |
// | |
$(function(){ | |
$('.autocomplete-off').attr('autocomplete', 'off'); | |
}); |
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
# posts_controller_test.rb | |
require 'test_helper' | |
class PostsControllerTest < ActionController::TestCase | |
context "on GET to :index" do | |
setup do | |
@first_post = Factory(:post, :title => "My first post") | |
@second_post = Factory(:post, :title => "My second post") | |
get :index |
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
/* as described on: http://perishablepress.com/press/2009/12/06/new-clearfix-hack/ */ | |
/* new clearfix */ | |
.clearfix:after { | |
visibility: hidden; | |
display: block; | |
font-size: 0; | |
content: " "; | |
clear: both; | |
height: 0; | |
} |
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
// trims given array recursively from empty values | |
function array_trim($array) { | |
foreach ($array as $key => $value): | |
if(is_array($value)) { | |
$array[$key] = array_trim($value); | |
if(!count($array[$key])) unset($array[$key]); | |
} else { | |
if (empty($value)) unset($array[$key]); | |
} | |
endforeach; |
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
/** | |
* @brief Splits an address string containing a street, number and number addition | |
* | |
* @param $streetStr string An address string containing a street, number (optional) and number addition (optional) | |
* | |
* @return array Data array with the following keys: street, number and numberAddition. | |
*/ | |
private function split_street($streetStr) { | |
$aMatch = array(); |
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
# football | |
sm_home_win: | |
name: "1" | |
pick_type_category: sm | |
position: 1 | |
sm_away_win: | |
name: "2" | |
pick_type_category: sm |
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
→ rspec spec/models/profile_match_spec.rb | |
F* | |
Pending: | |
ProfileMatch.match matches all motives | |
# cant spec query chain | |
# ./spec/models/profile_match_spec.rb:46 | |
Failures: | |
1) ProfileMatch.match matches against all companies |
OlderNewer