-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Production clone #117
Production clone #117
Conversation
…' for clarity and consistency
… overwrite' methods
…serve view and process donation
…rform-recurring-donation-transaction
…rform-recurring-donation-transaction
…ion model and serve/check form params against these constants (instead of string literals)
added test for when stripe charge fails (recurring_donation record should not be created)
…ad practice to use class variables)
…-> create recurring donation and regular donation record; fail -> neither created)
… into production-clone
@@ -237,6 +239,10 @@ def includes_donation? | |||
end | |||
end | |||
|
|||
def add_recurring_donation() | |||
@recurring_donation = @donation.build_recurring_donation(amount: 0, account_code_id: @donation.account_code_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [115/80]
@@ -237,6 +239,10 @@ | |||
end | |||
end | |||
|
|||
def add_recurring_donation() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/DefWithParentheses: Omit the parentheses in defs when the method doesn't accept any arguments.
@@ -5,11 +5,13 @@ | |||
has_many :items, :autosave => true, :dependent => :destroy | |||
has_many :vouchers, :autosave => true, :dependent => :destroy | |||
has_many :donations, :autosave => true, :dependent => :destroy | |||
has_many :recurring_donations, :autosave => true, :dependent => :destroy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
@@ -47,6 +47,14 @@ | |||
= text_field_tag 'donation', @amount, :type => :number, :class => 'text-right form-control form-control-sm' | |||
.input-group-append | |||
%span.input-group-text.form-control-sm .00 | |||
- if Option.allow_recurring_donations | |||
.form-group.form-row{id:"donation_frequency_radio"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hash attribute should start with one space after the opening brace
Hash attribute should end with one space before the closing brace
= radio_button_tag :donation_frequency, Donation::ONE_TIME_DONATION, Option.default_donation_frequency == Donation::ONE_TIME_DONATION, class: 'form-control', id: Donation::ONE_TIME_DONATION | ||
= label_tag :donation_frequency, Donation::ONE_TIME_DONATION, class: 'form-control', for: Donation::ONE_TIME_DONATION | ||
= radio_button_tag :donation_frequency, Donation::RECURRING_DONATION, Option.default_donation_frequency == Donation::RECURRING_DONATION, class: 'form-control', id: Donation::RECURRING_DONATION | ||
= label_tag :donation_frequency, Donation::RECURRING_DONATION, class: 'form-control', for: Donation::RECURRING_DONATION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [133/80]
@@ -233,6 +236,7 @@ | |||
add_index "orders", ["processed_by_id"], name: "index_orders_on_processed_by_id", using: :btree | |||
add_index "orders", ["purchaser_id"], name: "index_orders_on_purchaser_id", using: :btree | |||
add_index "orders", ["ticket_sales_import_id"], name: "index_orders_on_ticket_sales_import_id", using: :btree | |||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/Syntax: unexpected token tLSHFT
t.string "state" | ||
======= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/Syntax: unexpected token tEQQ
@@ -98,7 +98,10 @@ | |||
t.string "seat" | |||
t.datetime "sold_on" | |||
t.integer "recurring_donation_id" | |||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/Syntax: unexpected token tLSHFT
@@ -1,7 +1,7 @@ | |||
class AddRecurringDonationOptionsToOptionsTable < ActiveRecord::Migration | |||
def change | |||
add_column :options, :allow_recurring_donations, :boolean, default: false | |||
add_column :options, :default_donation_type, :string, default: "one" | |||
add_column :options, :default_donation_frequency, :string, default: "One Time" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Metrics/LineLength: Line is too long. [82/80]
@order.add_donation(build(:donation, :amount => 17)) | ||
end | ||
it 'should add recurring donation' do | ||
@order.add_recurring_donation() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/MethodCallWithoutArgsParentheses: Do not use parentheses for method calls with no arguments.
No description provided.