spree_clean 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Versionfile +1 -0
- data/app/assets/javascripts/admin/spree_clean.js +0 -1
- data/app/controllers/spree/admin/clean_data_controller.rb +2 -2
- data/app/views/spree/admin/clean_data/show.html.erb +31 -31
- data/app/views/spree/admin/shared/_configurations_menu.html.erb +1 -1
- data/config/locales/en.yml +7 -5
- data/config/routes.rb +1 -1
- data/spree_clean.gemspec +2 -2
- metadata +4 -4
data/Versionfile
CHANGED
@@ -5,7 +5,7 @@ module Spree
|
|
5
5
|
params[:resources].each_key do |resource|
|
6
6
|
case resource
|
7
7
|
when "user"
|
8
|
-
Spree
|
8
|
+
Spree.user_class.where('id NOT IN (SELECT user_id FROM spree_roles_users)').delete_all
|
9
9
|
when "address"
|
10
10
|
Spree::Address.delete_all
|
11
11
|
else
|
@@ -13,7 +13,7 @@ module Spree
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
flash[:
|
16
|
+
flash[:success] = "Selected data has been successfully deleted"
|
17
17
|
redirect_to admin_clean_data_path
|
18
18
|
end
|
19
19
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<%= render :partial => 'spree/admin/shared/configuration_menu' %>
|
2
2
|
|
3
3
|
<% content_for :page_title do %>
|
4
|
-
<%= t(:clean_data) %>
|
4
|
+
<%= Spree.t(:clean_data) %>
|
5
5
|
<% end %>
|
6
6
|
|
7
|
-
<p class="warning"><strong><%= t :clean_data_warning %></strong></p>
|
7
|
+
<p class="warning"><strong><%= Spree.t :clean_data_warning %></strong></p>
|
8
8
|
|
9
9
|
<p>
|
10
10
|
<a href="#select_all">Select All</a> |
|
@@ -17,89 +17,89 @@
|
|
17
17
|
<%= form_tag admin_destroy_data_path, :method => :delete do %>
|
18
18
|
<p data-hook="resources-list" class="resources-list">
|
19
19
|
<%= check_box_tag 'resources[address]', '1', true %>
|
20
|
-
<%= label_tag 'resources[address]', t(:addresses) %>
|
20
|
+
<%= label_tag 'resources[address]', Spree.t(:addresses) %>
|
21
21
|
<br />
|
22
22
|
<%= check_box_tag 'resources[adjustment]', '1', true %>
|
23
|
-
<%= label_tag 'resources[adjustment]', t(:adjustments) %>
|
23
|
+
<%= label_tag 'resources[adjustment]', Spree.t(:adjustments) %>
|
24
24
|
<br />
|
25
25
|
<%= check_box_tag 'resources[asset]', '1', true %>
|
26
|
-
<%= label_tag 'resources[asset]', t(:assets) %>
|
26
|
+
<%= label_tag 'resources[asset]', Spree.t(:assets) %>
|
27
27
|
<br />
|
28
28
|
<%= check_box_tag 'resources[calculator]', '1', true %>
|
29
|
-
<%= label_tag 'resources[calculator]', t(:calculators) %>
|
29
|
+
<%= label_tag 'resources[calculator]', Spree.t(:calculators) %>
|
30
30
|
<br />
|
31
31
|
<%= check_box_tag 'resources[country]', '1', false %>
|
32
|
-
<%= label_tag 'resources[country]', t(:countries) %>
|
32
|
+
<%= label_tag 'resources[country]', Spree.t(:countries) %>
|
33
33
|
<br />
|
34
34
|
<%= check_box_tag 'resources[line_item]', '1', true %>
|
35
|
-
<%= label_tag 'resources[line_item]', t(:line_items) %>
|
35
|
+
<%= label_tag 'resources[line_item]', Spree.t(:line_items) %>
|
36
36
|
<br />
|
37
37
|
<%= check_box_tag 'resources[option_type]', '1', true %>
|
38
|
-
<%= label_tag 'resources[option_type]', t(:option_types) %>
|
38
|
+
<%= label_tag 'resources[option_type]', Spree.t(:option_types) %>
|
39
39
|
<br />
|
40
40
|
<%= check_box_tag 'resources[option_value]', '1', true %>
|
41
|
-
<%= label_tag 'resources[option_value]', t(:option_values) %>
|
41
|
+
<%= label_tag 'resources[option_value]', Spree.t(:option_values) %>
|
42
42
|
<br />
|
43
43
|
<%= check_box_tag 'resources[order]', '1', true %>
|
44
|
-
<%= label_tag 'resources[order]', t(:orders) %>
|
44
|
+
<%= label_tag 'resources[order]', Spree.t(:orders) %>
|
45
45
|
<br />
|
46
46
|
<%= check_box_tag 'resources[payment_method]', '1', true %>
|
47
|
-
<%= label_tag 'resources[payment_method]', t(:payment_methods) %>
|
47
|
+
<%= label_tag 'resources[payment_method]', Spree.t(:payment_methods) %>
|
48
48
|
<br />
|
49
49
|
<%= check_box_tag 'resources[product_option_type]', '1', true %>
|
50
|
-
<%= label_tag 'resources[product_option_type]', t(:product_option_types) %>
|
50
|
+
<%= label_tag 'resources[product_option_type]', Spree.t(:product_option_types) %>
|
51
51
|
<br />
|
52
52
|
<%= check_box_tag 'resources[product_property]', '1', true %>
|
53
|
-
<%= label_tag 'resources[product_property]', t(:product_properties) %>
|
53
|
+
<%= label_tag 'resources[product_property]', Spree.t(:product_properties) %>
|
54
54
|
<br />
|
55
55
|
<%= check_box_tag 'resources[product]', '1', true %>
|
56
|
-
<%= label_tag 'resources[product]', t(:products) %>
|
56
|
+
<%= label_tag 'resources[product]', Spree.t(:products) %>
|
57
57
|
<br />
|
58
58
|
<%= check_box_tag 'resources[property]', '1', true %>
|
59
|
-
<%= label_tag 'resources[property]', t(:properties) %>
|
59
|
+
<%= label_tag 'resources[property]', Spree.t(:properties) %>
|
60
60
|
<br />
|
61
61
|
<%= check_box_tag 'resources[prototype]', '1', true %>
|
62
|
-
<%= label_tag 'resources[prototype]', t(:prototypes) %>
|
62
|
+
<%= label_tag 'resources[prototype]', Spree.t(:prototypes) %>
|
63
63
|
<br />
|
64
64
|
<%= check_box_tag 'resources[shipment]', '1', true %>
|
65
|
-
<%= label_tag 'resources[shipment]', t(:shipments) %>
|
65
|
+
<%= label_tag 'resources[shipment]', Spree.t(:shipments) %>
|
66
66
|
<br />
|
67
67
|
<%= check_box_tag 'resources[shipping_category]', '1', true %>
|
68
|
-
<%= label_tag 'resources[shipping_category]', t(:shipping_categories) %>
|
68
|
+
<%= label_tag 'resources[shipping_category]', Spree.t(:shipping_categories) %>
|
69
69
|
<br />
|
70
70
|
<%= check_box_tag 'resources[shipping_method]', '1', true %>
|
71
|
-
<%= label_tag 'resources[shipping_method]', t(:shipping_methods) %>
|
71
|
+
<%= label_tag 'resources[shipping_method]', Spree.t(:shipping_methods) %>
|
72
72
|
<br />
|
73
73
|
<%= check_box_tag 'resources[state]', '1', false %>
|
74
|
-
<%= label_tag 'resources[state]', t(:states) %>
|
74
|
+
<%= label_tag 'resources[state]', Spree.t(:states) %>
|
75
75
|
<br />
|
76
76
|
<%= check_box_tag 'resources[tax_category]', '1', true %>
|
77
|
-
<%= label_tag 'resources[tax_category]', t(:tax_categories) %>
|
77
|
+
<%= label_tag 'resources[tax_category]', Spree.t(:tax_categories) %>
|
78
78
|
<br />
|
79
79
|
<%= check_box_tag 'resources[tax_rate]', '1', true %>
|
80
|
-
<%= label_tag 'resources[tax_rate]', t(:tax_rates) %>
|
80
|
+
<%= label_tag 'resources[tax_rate]', Spree.t(:tax_rates) %>
|
81
81
|
<br />
|
82
82
|
<%= check_box_tag 'resources[taxonomy]', '1', true %>
|
83
|
-
<%= label_tag 'resources[taxonomy]', t(:taxonomies) %>
|
83
|
+
<%= label_tag 'resources[taxonomy]', Spree.t(:taxonomies) %>
|
84
84
|
<br />
|
85
85
|
<%= check_box_tag 'resources[taxon]', '1', true %>
|
86
|
-
<%= label_tag 'resources[taxon]', t(:taxons) %>
|
86
|
+
<%= label_tag 'resources[taxon]', Spree.t(:taxons) %>
|
87
87
|
<br />
|
88
88
|
<%= check_box_tag 'resources[user]', '1', true %>
|
89
|
-
<%= label_tag 'resources[user]', t(:users) %>
|
89
|
+
<%= label_tag 'resources[user]', Spree.t(:users) %>
|
90
90
|
<br />
|
91
91
|
<%= check_box_tag 'resources[variant]', '1', true %>
|
92
|
-
<%= label_tag 'resources[variant]', t(:variants) %>
|
92
|
+
<%= label_tag 'resources[variant]', Spree.t(:variants) %>
|
93
93
|
<br />
|
94
94
|
<%= check_box_tag 'resources[zone_member]', '1', false %>
|
95
|
-
<%= label_tag 'resources[zone_member]', t(:zone_members) %>
|
95
|
+
<%= label_tag 'resources[zone_member]', Spree.t(:zone_members) %>
|
96
96
|
<br />
|
97
97
|
<%= check_box_tag 'resources[zone]', '1', false %>
|
98
|
-
<%= label_tag 'resources[zone]', t(:zones) %>
|
98
|
+
<%= label_tag 'resources[zone]', Spree.t(:zones) %>
|
99
99
|
</p>
|
100
100
|
|
101
101
|
<p class="form-buttons" data-hook="buttons">
|
102
|
-
<%= submit_tag t(:destroy_data), :confirm => "#{t(:confirm_delete_data)}" %>
|
103
|
-
<%= t(:or) %> <%= link_to t(:cancel), edit_admin_general_settings_path %>
|
102
|
+
<%= submit_tag Spree.t(:destroy_data), :confirm => "#{Spree.t(:confirm_delete_data)}" %>
|
103
|
+
<%= Spree.t(:or) %> <%= link_to Spree.t(:cancel), edit_admin_general_settings_path %>
|
104
104
|
</p>
|
105
105
|
<% end %>
|
@@ -1 +1 @@
|
|
1
|
-
<%= configurations_sidebar_menu_item t(:clean_data), admin_clean_data_path %>
|
1
|
+
<%= configurations_sidebar_menu_item Spree.t(:clean_data), admin_clean_data_path %>
|
data/config/locales/en.yml
CHANGED
@@ -2,8 +2,10 @@
|
|
2
2
|
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
3
3
|
|
4
4
|
en:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
spree:
|
6
|
+
clean_data: "Clean Data"
|
7
|
+
clean_data_description: "Bulk delete data from your application."
|
8
|
+
clean_data_warning: "Warning: Any actions taken on this page will permanently delete data from the application. Use with caution!"
|
9
|
+
confirm_delete_data: "Are you sure you wish to continue? This operation cannot be undone."
|
10
|
+
destroy_data: "Destroy Data"
|
11
|
+
product_scopes_label: "Product Scopes"
|
data/config/routes.rb
CHANGED
data/spree_clean.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.name = 'spree_clean'
|
6
|
-
s.version = '1.0.
|
6
|
+
s.version = '1.0.7'
|
7
7
|
s.summary = 'Delete data via the Spree admin'
|
8
8
|
s.description = 'Spree Extension that facilitates mass deletion of application data'
|
9
9
|
s.required_ruby_version = '>= 1.8.7'
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.require_path = 'lib'
|
17
17
|
s.requirements << 'none'
|
18
18
|
|
19
|
-
s.add_dependency 'spree_core', '~>
|
19
|
+
s.add_dependency 'spree_core', '~> 2.0.0'
|
20
20
|
|
21
21
|
s.add_development_dependency 'capybara', '1.0.1'
|
22
22
|
s.add_development_dependency 'factory_girl'
|
metadata
CHANGED
@@ -2,21 +2,21 @@
|
|
2
2
|
name: spree_clean
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- John Dyer
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
version_requirements: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.0
|
20
20
|
none: false
|
21
21
|
name: spree_core
|
22
22
|
type: :runtime
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version:
|
28
|
+
version: 2.0.0
|
29
29
|
none: false
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
version_requirements: !ruby/object:Gem::Requirement
|