Skip to content

Instantly share code, notes, and snippets.

View marcamillion's full-sized avatar

Marc Gayle marcamillion

View GitHub Profile
# == Schema Information
# Schema version: 20110330215959
#
# Table name: clients
#
# id :integer not null, primary key
# email :string(255)
# user_id :integer
# created_at :datetime
# updated_at :datetime
def total_used
self.each do |upload|
total_size = upload.image_file_size + total_size
end
end
def num_gecko_users_percent
gecko_users = User.where(:plan_id => [1]).count
all_paid_users = User.where(:plan_id => [1, 2, 3, 4]).count
total = gecko_users / all_paid_users
return total.to_f
end
<ul class="tier1">
<li class="projects"><b>5</b> Projects</li>
<li class="tiertitle">Plan1</li>
<li>5 GB Storage</li>
</ul>
<ul class="tier3">
<li class="projects"><b>10</b> Projects</li>
<li class="tiertitle">Plan2</li>
<li>10 GB Storage</li>
<h1>Payment Result</h1>
<div>Thank you for your payment.</div>
<h2>Transaction Details</h2>
<table>
<tr><td>Amount</td><td>$<%= @result.transaction.amount %></td></tr>
<tr><td>Transaction ID:</td><td><%= @result.transaction.id %></td></tr>
<tr><td>First Name:</td><td><%= h @result.transaction.customer_details.first_name %></td></tr>
2011-04-11T19:22:13+00:00 heroku[router]: GET dev-compv.heroku.com/images/right-arrow.png dyno=web.1 queue=0 wait=0ms service=4ms bytes=626
2011-04-11T19:22:13+00:00 heroku[router]: GET dev-compv.heroku.com/stylesheets/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png dyno=web.1 queue=0 wait=0ms service=4ms bytes=419
2011-04-11T12:22:14-07:00 heroku[nginx]: GET /stylesheets/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png HTTP/1.1 | 217.199.115.217 | 237 | http | 304
2011-04-11T19:25:13+00:00 app[web.1]:
2011-04-11T19:25:13+00:00 app[web.1]:
2011-04-11T19:25:13+00:00 app[web.1]: Started POST "/comments/18" for 217.199.115.217 at Mon Apr 11 12:25:13 -0700 2011
2011-04-11T19:25:13+00:00 heroku[router]: POST dev-compv.heroku.com/comments/18 dyno=web.1 queue=0 wait=0ms service=118ms bytes=4418
2011-04-11T12:25:14-07:00 heroku[nginx]: POST /comments/18 HTTP/1.1 | 217.199.115.217 | 4469 | http | 500
2011-04-11T19:26:13+00:00 heroku[router]: GET dev-compv.heroku.com/javascripts/tipsy/images/tipsy.gif dyno=web.1 que
# == Schema Information
# Schema version: 20110412101615
#
# Table name: plans
#
# id :integer not null, primary key
# name :string(255)
# storage :float
# num_of_projects :integer
# num_of_clients :integer
def after_sign_in_path_for(resource)
if (current_user.has_trial_expired?)
return redirect_to(:settings)
else
#
end
super
end
@marcamillion
marcamillion / new.html.erb
Created April 15, 2011 17:58
new.html.erb
<div class="settings_form">
<h2>Checkout</h2>
<%= form_for :transaction,
:params => @result && @result.params[:transaction],
:errors => @result && @result.errors.for(:transaction),
:builder => ApplicationHelper::BraintreeFormBuilder,
:url => Braintree::TransparentRedirect.url,
:html => {:autocomplete => "off"} do |f| -%>
Started POST "/clients/68" for 127.0.0.1 at 2011-04-21 01:43:14 -0500
Processing by ClientsController#destroy as JS
Parameters: {"id"=>"68"}
User Load (1.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
nil
Completed in 150ms