Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

All right, added some anonymous fixtures to the app

  • Loading branch information...
commit 968c0b4ec2719d07c4e5d292d3e52be6e4ab5dd6 1 parent e940f94
Eric Mill konklone authored
1  .gitignore
View
@@ -1,3 +1,2 @@
/config/database.yml
/*.sqlite3
-/data
31 fixtures/accounts.yml
View
@@ -0,0 +1,31 @@
+---
+- name: Net Worth
+ created_at: 2010-02-14 22:15:08 -05:00
+ updated_at: 2010-02-14 22:16:46 -05:00
+ account_type: worth
+ id: 1
+ user_id: 1
+- name: Checking
+ created_at: 2010-02-14 22:15:28 -05:00
+ updated_at: 2010-02-15 02:23:29 -05:00
+ account_type: assets
+ id: 2
+ user_id: 1
+- name: Savings
+ created_at: 2010-02-15 01:55:05 -05:00
+ updated_at: 2010-02-15 02:23:40 -05:00
+ account_type: assets
+ id: 3
+ user_id: 1
+- name: Credit Card
+ created_at: 2010-02-15 01:55:20 -05:00
+ updated_at: 2010-02-15 02:23:49 -05:00
+ account_type: debt
+ id: 4
+ user_id: 1
+- name: Student Loans
+ created_at: 2010-02-15 01:57:24 -05:00
+ updated_at: 2010-02-15 02:23:55 -05:00
+ account_type: debt
+ id: 5
+ user_id: 1
148 fixtures/days.yml
View
@@ -0,0 +1,148 @@
+---
+- created_at: 2010-02-14 23:10:19 -05:00
+ updated_at: 2010-02-14 23:10:19 -05:00
+ account_id:
+ id: 1
+ user_id: 1
+ date_of: 2010-02-14
+ balance: 200000
+- created_at: 2010-02-15 02:44:20 -05:00
+ updated_at: 2010-02-15 02:44:20 -05:00
+ account_id: 2
+ id: 3
+ user_id: 1
+ date_of: 2010-02-12
+ balance: 100000
+- created_at: 2010-02-15 02:44:33 -05:00
+ updated_at: 2010-02-15 02:44:33 -05:00
+ account_id: 2
+ id: 4
+ user_id: 1
+ date_of: 2010-02-13
+ balance: 200000
+- created_at: 2010-02-15 02:44:40 -05:00
+ updated_at: 2010-02-15 02:44:40 -05:00
+ account_id: 2
+ id: 5
+ user_id: 1
+ date_of: 2010-02-14
+ balance: 400000
+- created_at: 2010-02-15 02:44:48 -05:00
+ updated_at: 2010-02-15 02:44:48 -05:00
+ account_id: 2
+ id: 6
+ user_id: 1
+ date_of: 2010-02-15
+ balance: 300000
+- created_at: 2010-02-15 02:45:14 -05:00
+ updated_at: 2010-02-15 02:45:14 -05:00
+ account_id: 3
+ id: 7
+ user_id: 1
+ date_of: 2010-02-12
+ balance: 0
+- created_at: 2010-02-15 02:45:26 -05:00
+ updated_at: 2010-02-15 02:45:26 -05:00
+ account_id: 3
+ id: 8
+ user_id: 1
+ date_of: 2010-02-13
+ balance: 50000
+- created_at: 2010-02-15 02:45:33 -05:00
+ updated_at: 2010-02-15 02:45:33 -05:00
+ account_id: 3
+ id: 9
+ user_id: 1
+ date_of: 2010-02-14
+ balance: 100000
+- created_at: 2010-02-15 02:45:38 -05:00
+ updated_at: 2010-02-15 02:45:38 -05:00
+ account_id: 3
+ id: 10
+ user_id: 1
+ date_of: 2010-02-15
+ balance: 150000
+- created_at: 2010-02-15 02:45:50 -05:00
+ updated_at: 2010-02-15 02:45:50 -05:00
+ account_id: 4
+ id: 11
+ user_id: 1
+ date_of: 2010-02-12
+ balance: -300000
+- created_at: 2010-02-15 02:49:12 -05:00
+ updated_at: 2010-02-15 02:49:12 -05:00
+ account_id: 4
+ id: 12
+ user_id: 1
+ date_of: 2010-02-13
+ balance: -200000
+- created_at: 2010-02-15 02:49:17 -05:00
+ updated_at: 2010-02-15 02:49:17 -05:00
+ account_id: 4
+ id: 13
+ user_id: 1
+ date_of: 2010-02-14
+ balance: -300000
+- created_at: 2010-02-15 02:49:19 -05:00
+ updated_at: 2010-02-15 02:49:19 -05:00
+ account_id: 4
+ id: 14
+ user_id: 1
+ date_of: 2010-02-15
+ balance: -300000
+- created_at: 2010-02-15 02:49:32 -05:00
+ updated_at: 2010-02-15 02:49:32 -05:00
+ account_id: 5
+ id: 15
+ user_id: 1
+ date_of: 2010-02-12
+ balance: -2000000
+- created_at: 2010-02-15 02:49:42 -05:00
+ updated_at: 2010-02-15 02:49:42 -05:00
+ account_id: 5
+ id: 16
+ user_id: 1
+ date_of: 2010-02-13
+ balance: -1900000
+- created_at: 2010-02-15 02:49:49 -05:00
+ updated_at: 2010-02-15 02:49:49 -05:00
+ account_id: 5
+ id: 17
+ user_id: 1
+ date_of: 2010-02-14
+ balance: -1800000
+- created_at: 2010-02-15 02:49:54 -05:00
+ updated_at: 2010-02-15 02:49:54 -05:00
+ account_id: 5
+ id: 18
+ user_id: 1
+ date_of: 2010-02-15
+ balance: -800000
+- created_at: 2010-02-15 03:04:25 -05:00
+ updated_at: 2010-02-15 03:04:25 -05:00
+ account_id: 1
+ id: 19
+ user_id: 1
+ date_of: 2010-02-12
+ balance: -2200000
+- created_at: 2010-02-15 03:04:42 -05:00
+ updated_at: 2010-02-15 03:04:42 -05:00
+ account_id: 1
+ id: 20
+ user_id: 1
+ date_of: 2010-02-13
+ balance: -1850000
+- created_at: 2010-02-15 03:05:00 -05:00
+ updated_at: 2010-02-15 03:05:00 -05:00
+ account_id: 1
+ id: 21
+ user_id: 1
+ date_of: 2010-02-14
+ balance: -1600000
+- created_at: 2010-02-15 03:06:57 -05:00
+ updated_at: 2010-02-15 03:06:57 -05:00
+ account_id: 1
+ id: 22
+ user_id: 1
+ date_of: 2010-02-15
+ balance: -650000
6 fixtures/users.yml
View
@@ -0,0 +1,6 @@
+---
+- name: Jericho Jones
+ created_at: 2010-02-14 22:04:46 -05:00
+ updated_at: 2010-02-14 22:04:46 -05:00
+ id: 1
+ email: jericho@example.com
5 models.rb
View
@@ -6,7 +6,7 @@ class Day < ActiveRecord::Base
end
class Account < ActiveRecord::Base
- TYPES = %w( worth balance )
+ TYPES = %w( worth assets debt )
belongs_to :user
has_many :days
@@ -15,8 +15,9 @@ class Account < ActiveRecord::Base
validates_presence_of :user_id
validates_inclusion_of :account_type, :in => TYPES
+
def needs_name
- account_type == 'balance'
+ account_type != 'worth'
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.