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
Processing ContactsController#create (for 0.0.0.0 at 2009-03-23 22:17:28) [POST] | |
Parameters: {"action"=>"create", "controller"=>"contacts"} | |
NoMethodError (You have a nil object when you didn't expect it! | |
You might have expected an instance of ActiveRecord::Base. | |
The error occurred while evaluating nil.[]): |
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
def post_contact_json | |
contact = { | |
:contact => { | |
:email => '[email protected]', | |
:verify_email => '[email protected]', | |
:first_name => 'joe', | |
:last_name => 'test', | |
:phone => '919-555-1212', | |
:responses_attributes => { |
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
SetEnv NoAds true |
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
<!--#if expr="!${NoAds}" --> | |
<script src="http://www.example.com/foo.js" type="text/javascript"></script> | |
<!--#endif --> |
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 | |
command = '/usr/bin/passenger-memory-stats' | |
memory_limit = 200 # megabytes | |
def running?(pid) | |
begin | |
return Process.getpgid(pid) != -1 | |
rescue Errno::ESRCH | |
return false |
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
## Copyright 2009 Rex Luther Corporation. | |
## Licensed under the MIT License | |
## http://www.opensource.org/licenses/mit-license.php | |
it "should require a phone number have a valid format" do | |
@contact.phone = '(919) 555-1212' | |
@contact.should be_valid | |
@contact.phone = '919-555-1212' | |
@contact.should be_valid |
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
## Copyright 2009 Rex Luther Corporation. | |
## Licensed under the MIT License | |
## http://www.opensource.org/licenses/mit-license.php | |
def valid_phone | |
return true if phone.blank? | |
phone_formats = [ | |
/^\(\d\d\d\) \d\d\d-\d\d\d\d/, | |
/^\d\d\d\.\d\d\d\.\d\d\d\d/, |
NewerOlder