var onDone = function() {...
var onFail = function() {...
var params = {...
var url = ... $.ajax({ type: 'put', url: url, contentType: 'application/json; charset...
This method won't throw an error: def a_method raise ensure return :something end it will in fact return...
datetime = DateTime.now date = datetime.to_date #or Date.today will assert: datetime.is_a? Date == true datetime.is_a? DateTime == true datetime.instance_of...
require 'ruby-prof' # you don't need this if you have ruby-prof in your Gemfile You can set one...
The object returned by has_defaults apparently is the same between multiple object creations. Consider this scenario:
When simply checking equality or truthiness then Instead of: it "should have role set to admin" do @user.role.should eql('admin...
One of the main source of bugs and complexity in the code is when a functional method (that we expect...
Whenever you make a migration to add a foreign key, you should also add an index for it
Regularly, but at least before merging your feature branches, rebase them to get rid of "fix typo" and "wip" commits...
Reading the current time Don't use Time.now as it's broken when using time zones. \ Instead, use Time.current, DateTime.current...
It's a good pratice to chain several named scopes like: Property.listable.for_2_or_more_guests.best_10_properties Now, to make the lesson more...
No results found in other decks.