Skip to content
Browse files

Removed email optional config setting. Auth.net needs it, I think.

  • Loading branch information...
1 parent 9633600 commit d52c5c3b41b95164ca70373a92e8b26b73eaa788 Matt Fordham committed
View
BIN app/.DS_Store
Binary file not shown.
View
10 app/models/contact_info.rb
@@ -2,11 +2,8 @@ class ContactInfo < ActiveRecord::Base
belongs_to :subscription, :dependent => :destroy
validates_presence_of :first_name, :last_name
-
- with_options :if => :require_email? do |contact_info|
- contact_info.validates_format_of :email, :with => ::Authlogic::Regex.email
- contact_info.validates_presence_of :email
- end
+ validates_format_of :email, :with => ::Authlogic::Regex.email
+ validates_presence_of :email
with_options :if => :require_billing_address? do |contact_info|
contact_info.validates_presence_of :address
@@ -58,9 +55,6 @@ def to_hash
:phone_number => phone_number}
end
- def require_email?
- Saasaparilla::CONFIG["require_email"] == true
- end
def require_billing_address?
Saasaparilla::CONFIG["require_billing_address"] == true
View
3 app/views/saasaparilla/subscription/_contact_info_form.html.haml
@@ -1,7 +1,6 @@
= f.input :first_name
= f.input :last_name
-- if @subscription.contact_info.require_email?
- = f.input :email
+= f.input :email
- if @subscription.contact_info.require_billing_address?
= f.input :address
= f.input :city
View
5 app/views/saasaparilla/subscription/show.html.haml
@@ -23,9 +23,8 @@
%p
= "#{@subscription.contact_info.first_name} #{@subscription.contact_info.last_name}"
%br
- - if @subscription.contact_info.require_email?
- = @subscription.contact_info.email
- %br
+ = @subscription.contact_info.email
+ %br
- if @subscription.contact_info.require_billing_address?
= @subscription.contact_info.address
%br
View
3 lib/generators/saasaparilla/install/templates/saasaparilla.yml
@@ -8,7 +8,6 @@ development:
authorization: cancan
require_billing_address: true
require_phone_number: true
- require_email: true
test:
grace_period: 10
@@ -20,7 +19,6 @@ test:
authorization: none
require_billing_address: true
require_phone_number: true
- require_email: true
production:
grace_period: 10
@@ -32,4 +30,3 @@ production:
authorization: cancan
require_billing_address: true
require_phone_number: true
- require_email: true
View
3 spec/dummy/config/saasaparilla.yml
@@ -8,7 +8,6 @@ development:
authorization: none
require_billing_address: false
require_phone_number: false
- require_email: false
test:
grace_period: 10
@@ -20,7 +19,6 @@ test:
authorization: none
require_billing_address: true
require_phone_number: true
- require_email: true
production:
grace_period: 10
@@ -32,4 +30,3 @@ production:
authorization: cancan
require_billing_address: false
require_phone_number: false
- require_email: false

0 comments on commit d52c5c3

Please sign in to comment.
Something went wrong with that request. Please try again.