mirror of https://github.com/fspc/BikeShed-1.git
Browse Source
Added credit_conversions table so conversions can change over time Added default credit conversion fixture Added User#transaction_logs Added User#total_credits (earned minus spent) Added User#total_credits_spent (through transaction_logs) Added User#total_earned_credits (complicated query which finds the conversion rate for a log depending on its created_at date)eperez-timeinput
Jason Denney
12 years ago
6 changed files with 67 additions and 6 deletions
@ -0,0 +1,3 @@ |
|||||
|
class CreditConversion < ActiveRecord::Base |
||||
|
attr_accessible :conversion |
||||
|
end |
@ -0,0 +1,8 @@ |
|||||
|
class CreateCreditConversions < ActiveRecord::Migration |
||||
|
def change |
||||
|
create_table(:credit_conversions) do |t| |
||||
|
t.integer :conversion, :default => 1 |
||||
|
t.timestamps |
||||
|
end |
||||
|
end |
||||
|
end |
@ -0,0 +1,3 @@ |
|||||
|
conversion: |
||||
|
id: 1 |
||||
|
conversion: 10 |
Loading…
Reference in new issue