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
| class ClockConverter | |
| NOON_MIDNIGHT_TABLE = { "midnight" => 0, "midnight" => 2400, "noon" => 1200 } | |
| def run | |
| hello_message | |
| get_time_to_convert | |
| convert_if_valid_input | |
| end | |
| private |
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 ready_to_publish? | |
| missing_fields = [] | |
| required_fields = | |
| ["state", | |
| "city", | |
| "company_name", | |
| "email_address", | |
| "phone_number", | |
| "description", |
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
| require 'spec_helper' | |
| describe Project do | |
| let!(:user) { FactoryGirl.create(:user) } | |
| let!(:plan) { FactoryGirl.create(:plan_with_subscription, user: user) } | |
| it "has a valid factory" do | |
| FactoryGirl.create(:project, user: user). should be_valid | |
| end |
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 approve | |
| @project = Project.find(params[:id]) | |
| @project.update_status_with("approved") | |
| redirect_to admin_path | |
| end | |
| def deny | |
| @project = Project.find(params[:id]) | |
| @project.update_status_with("not_approved") | |
| redirect_to admin_path |
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
| describe "Updating a project" do | |
| it "should update profile with new information" do | |
| FactoryGirl.create(:project, user: entrepreneur) | |
| visit user_path(entrepreneur) | |
| click_link "Edit" | |
| #fill in project details | |
| fill_in 'project_company_name', with: "Jay's Cookies" | |
| fill_in 'project_contact_name', with: "Jay Z" |
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
| source 'https://rubygems.org' | |
| gem 'rails', '4.0.0' | |
| gem 'better_errors' | |
| gem 'binding_of_caller' | |
| gem 'bootstrap-sass' | |
| gem 'carrierwave' | |
| gem 'coffee-rails' | |
| gem 'devise' | |
| gem 'factory_girl_rails' |
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
| source 'https://rubygems.org' | |
| ruby '2.0.0' | |
| gem 'rails', '4.0.0' | |
| gem 'bootstrap-sass' | |
| gem 'carrierwave' | |
| gem 'coffee-rails' | |
| gem 'devise' | |
| gem 'factory_girl_rails' |
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 home | |
| if signed_in? | |
| if current_user.active_subscription? | |
| load_signed_in_page | |
| else | |
| redirect_to plans_path | |
| end | |
| else | |
| render 'signed_out_home' | |
| end |
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
| class Subscription < ActiveRecord::Base | |
| attr_accessor :stripe_card_token | |
| attr_accessor :plan_id | |
| belongs_to :plan | |
| belongs_to :user | |
| def save_with_payment | |
| customer = Stripe::Customer.create email: user.email, plan: plan_id, card: stripe_card_token |
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
| <%= s3_uploader_form | |
| callback_url: uploads_url, | |
| id: "s3_uploader", | |
| callback_param: "upload[direct_upload_url]", | |
| expiration: 24.hours.from_now.utc.iso8601, | |
| max_file_size: 100.megabytes do %> | |
| <div id="file_field_container"> | |
| <div class="wrapper"> | |
| <%= file_field_tag :file, multiple: true, class: "btn btn-primary" %> |