solidus_bling 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/spree/admin/accounts_controller.rb +9 -3
- data/app/models/solidus_bling/account.rb +4 -4
- data/app/models/solidus_bling/payment_method.rb +2 -0
- data/app/models/solidus_bling/seller.rb +3 -0
- data/app/models/solidus_bling/shipping_method.rb +2 -0
- data/app/views/spree/admin/accounts/edit.html.erb +3 -1
- data/lib/solidus_bling/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a1eeddb2480fc6c8c413632d68a9474a8861221a2696d686b855e815cabca27
|
4
|
+
data.tar.gz: 6a9654d237829e34477e9a975c80f66a60dad7756f894f4d9c316b0a416e50ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dc19ff8328d031b59baa44c5cb42fbf9ff9e004f8e751ffe4eb7044a7fac234d0315df516fd519492d6a24f100714ec8e97c76d9f88503a0e356f29c8189ed7
|
7
|
+
data.tar.gz: f82406fc7f2de27d9476ead0d9a4a48873509cfa8aa95312b30c1242503de200421fd2f82385f0f2d2366fcc845193e5a19e328910a4ece17d7d5a2d3d10fca0
|
@@ -18,8 +18,14 @@ module Spree
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def create
|
21
|
-
bling_account = SolidusBling::Account.
|
22
|
-
|
21
|
+
bling_account = SolidusBling::Account.new account_params.merge(name: "Bling")
|
22
|
+
if bling_account.save
|
23
|
+
flash[:success] = "Conta criada com sucesso"
|
24
|
+
redirect_to admin_accounts_path
|
25
|
+
else
|
26
|
+
flash[:error] = bling_account.errors.full_messages.join("\n")
|
27
|
+
redirect_to new_admin_account_path
|
28
|
+
end
|
23
29
|
end
|
24
30
|
|
25
31
|
def edit
|
@@ -27,7 +33,7 @@ module Spree
|
|
27
33
|
@payment_methods = ::Spree::PaymentMethod.all.pluck(:name, :id)
|
28
34
|
@shipping_methods = ::Spree::ShippingMethod.all.pluck(:name, :id)
|
29
35
|
@products_count = @bling_account.products.count
|
30
|
-
@last_update = SolidusBling::Event.where(method: "products_updated").max.created_at
|
36
|
+
@last_update = SolidusBling::Event.where(method: "products_updated").max.try(:created_at)
|
31
37
|
end
|
32
38
|
|
33
39
|
def update
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module SolidusBling
|
2
2
|
class Account < ApplicationRecord
|
3
|
-
has_many :payment_methods
|
4
|
-
has_many :shipping_methods
|
5
|
-
has_many :products
|
6
|
-
has_many :sellers
|
3
|
+
has_many :payment_methods, dependent: :destroy
|
4
|
+
has_many :shipping_methods, dependent: :destroy
|
5
|
+
has_many :products, dependent: :destroy
|
6
|
+
has_many :sellers, dependent: :destroy
|
7
7
|
accepts_nested_attributes_for :payment_methods, :shipping_methods, :sellers
|
8
8
|
end
|
9
9
|
end
|
@@ -3,7 +3,9 @@
|
|
3
3
|
{confirm: "Deseja baixar os produtos?" } %>
|
4
4
|
<span>Produtos baixados: <%= @products_count %></span>
|
5
5
|
<br>
|
6
|
-
|
6
|
+
<% if @last_update.present? %>
|
7
|
+
<span>Ultima atualização: <%= @last_update.strftime("%d/%m/%Y %H:%M") %> </span>
|
8
|
+
<% end %>
|
7
9
|
</div>
|
8
10
|
|
9
11
|
<%= render "form", bling_account: @bling_account, form_url: admin_account_path(@bling_account.id) %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_bling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ulysses-bull
|
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
199
|
- !ruby/object:Gem::Version
|
200
200
|
version: '0'
|
201
201
|
requirements: []
|
202
|
-
rubygems_version: 3.4.
|
202
|
+
rubygems_version: 3.4.19
|
203
203
|
signing_key:
|
204
204
|
specification_version: 4
|
205
205
|
summary: Solidus extension to integrate with the Bling
|