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 AccountsController < ApplicationController | |
| protect_from_forgery except: :webhook | |
| skip_before_action :require_login, only: [:new, :create] | |
| def index | |
| end | |
| def new | |
| @account = Account.new | |
| @account.admin = Employee.new |
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 FundTransaction < ActiveRecord::Base | |
| belongs_to :fund_record_form2 | |
| validates_presence_of :reason_for_transaction | |
| # def initialize(current_balance) | |
| # super | |
| # @current_balance || 0.0 | |
| # end | |
| attr_accessor :deposit_amount, :withdrawal_amount |
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 BankAccount | |
| attr_accessor :name, :balance | |
| def initialize(options={}) | |
| @name = options[:name] | |
| @transactions = [] | |
| @balance = 0 | |
| end | |
| def withdraw(amount) |
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 Employee < ActiveRecord::Base | |
| belongs_to :account | |
| validates :account_uid, presence: true | |
| 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 Account < ActiveRecord::Base | |
| has_one :admin, class_name: 'Employee', foreign_key: :account_id, dependent: :destroy | |
| accepts_nested_attributes_for :admin, allow_destroy: true | |
| 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 new | |
| @account = Account.new | |
| @account.admin = Employee.new | |
| @admin = @account.admin | |
| @admin.is_admin = true | |
| @admin.build_address | |
| @admin.build_primary_phone | |
| @admin.build_secondary_phone | |
| @admin.build_primary_fax | |
| 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
| <%= form_for @survey, method: :post, class: "form-horizontal" do |f| %> | |
| <div class="row"> | |
| <div class="panel panel-default col-md-12"> | |
| <% SurveyQuestion.all.map do |question| %> | |
| <p> | |
| <b><%= question.title %>:</b><br> | |
| <%= question.description %> | |
| </p> | |
| <div class="row"> | |
| <div class="panel panel-default col-md-12"> |
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.2.0' | |
| gem 'pg' | |
| gem 'sass-rails', '~> 5.0' | |
| gem 'uglifier', '>= 1.3.0' | |
| gem 'coffee-rails', '~> 4.1.0' | |
| gem 'jquery-rails' | |
| gem 'jquery-ui-rails' | |
| gem 'twitter-bootstrap-rails' | |
| gem 'font-awesome-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
| FactoryGirl.define do | |
| factory :employee do | |
| association :resident, factory: :resident | |
| first_name { "bill" } | |
| last_name { "clinton" } | |
| email { "[email protected]" } | |
| password { "12345678" } | |
| dob { "1967-05-04" } | |
| gender { "Male"} | |
| 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
| FactoryGirl.define do | |
| factory :resident do | |
| association :employee, factory: :employee | |
| end | |
| factory :invalid_resident, parent: :resident do | |
| end | |
| end |