Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Ruby Gems
/
var
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Abraham Rodriguez
2016-01-11 17:59:11 -0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c4c9b57b490a5fe977dd0c47138f3d0de27346e6
c4c9b57b
1 parent
b7df3e51
Add manual payment and payment at as a new attribute
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletions
lib/generators/var_model/templates/var_model.rb
lib/var.rb
lib/var/version.rb
lib/generators/var_model/templates/var_model.rb
View file @
c4c9b57
...
...
@@ -3,6 +3,7 @@ class AddVarStatusTo<%=@model_name.pluralize.camelize%> < ActiveRecord::Migratio
add_column :<%=
@model_name
.
pluralize
.
underscore
%>, :var_status, :string, default: 'pending'
add_column :<%=@model_name.pluralize.underscore%>
,
:var_barcode_url
,
:string
add_column
:<
%=
@model_name
.
pluralize
.
underscore
%>, :var_barcode, :string
add_column :<%=@model_name.pluralize.underscore%>
,
:var_payment
,
:datetime
add_column
:<
%=
@model_name
.
pluralize
.
underscore
%>, :var_payment_expires_at, :datetime
add_column :<%=@model_name.pluralize.underscore%>
,
:var_id
,
:string
add_column
:<
%=
@model_name
.
pluralize
.
underscore
%>, :var_service, :string
...
...
lib/var.rb
View file @
c4c9b57
...
...
@@ -113,6 +113,12 @@ module ActsAsChargeable
var_payment_expires_at:
Time
.
at
(
method
.
expires_at
))
end
def
manual_charge
self
.
update_columns
(
var_service:
'manual'
,
var_status:
'paid'
,
var_payment_at:
Time
.
zone
.
now
)
# TODO: Create a new table with transaction
end
# def charge_with_paypal(options)
# if(!options.include? :card)
# error_message = "Paypal needs a card sent as a third paramater"
...
...
lib/var/version.rb
View file @
c4c9b57
# Var Version
module
Var
VERSION
=
'0.2.1
1
'
VERSION
=
'0.2.1
2
'
end
...
...
Please
register
or
login
to post a comment