In this talk I explain the process through which my team went when rewriting the Checkout process in Shopify. The results strays from the typical way we build Rails application, but the codebase is much simpler and easier to test.
@post end def create @post = Post.create(params[:post].permit(:title, :body)) respond_with @post end def show @post = Post.find(params[:id]) respond_with @post end def index @posts = Post.all respond_with @posts end end
@post end def create @post = Post.create(params[:post].permit(:title, :body)) redirect_to @post end def show @post = Post.find(params[:id]) respond_with @post end def index @posts = Post.all respond_with @posts end end
@post end def create @post = Post.create(params[:post].permit(:title, :body)) respond_with @post end def show @post = Post.find(params[:id]) respond_with @post end def index @posts = Post.all respond_with @posts end end
convenience_store else grab_chocolate go_in_line take_out_wallet count_money if enough_money? hand_money receive_change go_back_home eat_chocolate end end
convenience_store else grab_chocolate go_in_line take_out_wallet count_money if enough_money? hand_money receive_change go_back_home eat_chocolate else go_back_home eat_fruits_instead end end end
= [] @saved_issues = [] if @copy && params[:copy_subtasks].present? @issues.reject! do |issue| @issues.detect {|other| issue.is_descendant_of?(other)} end end
= [] @saved_issues = [] if @copy && params[:copy_subtasks].present? @issues.reject! do |issue| @issues.detect {|other| issue.is_descendant_of?(other)} end end
convenience_store else grab_chocolate go_in_line take_out_wallet count_money if enough_money? hand_money receive_change go_back_home eat_chocolate else go_back_home eat_fruits_instead end end end
convenience_store else grab_chocolate go_in_line take_out_wallet count_money if enough_money? hand_money receive_change go_back_home eat_chocolate else go_back_home eat_fruits_instead end end end
convenience_store else grab_chocolate if payment_form.enough_money? payment_form.pay go_back_home eat_chocolate else go_back_home eat_fruits_instead end end end
convenience_store else grab_chocolate if payment_form.enough_money? payment_form.pay go_back_home eat_chocolate else go_back_home eat_fruits_instead end end end
convenience_store else grab_chocolate if payment_form.enough_money? payment_form.pay go_back_home eat_chocolate else go_back_home eat_fruits_instead end end end
convenience_store else grab_chocolate if payment_form.enough_money? payment_form.pay go_back_home eat_chocolate else go_back_home eat_fruits_instead end end end
convenience_store else grab_chocolate if payment_form.enough_money? payment_form.pay go_back_home eat_chocolate else go_back_home eat_fruits_instead end end end
convenience_store else grab_chocolate if payment_form.enough_money? payment_form.pay go_back_home eat_chocolate else go_back_home eat_fruits_instead end end end