spree_account_recurring 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -18,7 +18,7 @@ For older version of Spree
18
18
 
19
19
  ```ruby
20
20
  # Spree 2.1.x
21
- gem 'spree_account_recurring', '1.0.1'
21
+ gem 'spree_account_recurring', '1.0.4'
22
22
  ```
23
23
 
24
24
 
@@ -10,6 +10,8 @@ module Spree
10
10
  has_many :plans
11
11
  attr_readonly :type
12
12
  validates :type, :name, presence: true
13
+ validates :type, uniqueness: { message: 'of provider recurring already exists' }
14
+
13
15
  scope :active, -> { undeleted.where(active: true) }
14
16
 
15
17
  def self.display_name
@@ -23,5 +25,9 @@ module Spree
23
25
  def default_plan
24
26
  plans.default
25
27
  end
28
+
29
+ def has_preferred_keys?
30
+ preferred_secret_key.present? && preferred_public_key.present?
31
+ end
26
32
  end
27
33
  end
@@ -16,7 +16,9 @@
16
16
  <fieldset class="no-border-top">
17
17
  <%= render :partial => 'form', :locals => { :f => f } %>
18
18
  <div data-hook="buttons" class="filter-actions actions">
19
- <%= button_link_to Spree.t(:manage_plans), admin_recurring_plans_url(@recurring) %>
19
+ <% if @recurring.has_preferred_keys? %>
20
+ <%= button_link_to Spree.t(:manage_plans), admin_recurring_plans_url(@recurring) %>
21
+ <% end %>
20
22
  <%= button Spree.t('actions.update'), 'icon-refresh' %>
21
23
  </div>
22
24
  </fieldset>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_account_recurring
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 1
10
- version: 1.1.1
9
+ - 2
10
+ version: 1.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Priyank Gupta
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2014-04-09 00:00:00 Z
18
+ date: 2014-04-25 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: spree_core