fdcart 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fdcart/version.rb +1 -1
- data/lib/fdcart.rb +4 -6
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df19f6c67dba1d352401c7a3cf601038c654e43b332f660ef4aca3b3ded60c1a
|
4
|
+
data.tar.gz: 7d397b3e28a7a64387d85044f3118e285f7de97bfc8c80911b5cc7c4a26ac350
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15c02d4b67acfc77f44c5b8a4fefc101f5da6061406a56976fb5591df11f852ea02fa862eee071d26ebded7c1f4ea8ba4ced78e6a4efb266b44ac7025044443c
|
7
|
+
data.tar.gz: 64ee23cdf04564c2ef3d2a671dafaaa219eab73e037d1a82a1fc2646ae50432efc6e9ff936a1a292f551f5d2cffb5ff9c19fa7ef1bedd50d2fb746bd8149c739
|
data/lib/fdcart/version.rb
CHANGED
data/lib/fdcart.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
class Fdcart
|
2
2
|
require 'models/cart'
|
3
|
-
attr_reader :cart
|
4
3
|
def initialize(owner)
|
5
4
|
@owner = owner
|
6
|
-
@cart = nil
|
7
5
|
end
|
8
6
|
def add(part, count, *extra)
|
9
7
|
cart = nil
|
@@ -15,7 +13,7 @@ class Fdcart
|
|
15
13
|
extra.each do |val|
|
16
14
|
if val
|
17
15
|
if !val[:externo].blank?
|
18
|
-
cart[:
|
16
|
+
cart[:externo] = val[:externo]
|
19
17
|
elsif val.is_a?(Almacen)
|
20
18
|
cart[:part_owner] = val
|
21
19
|
elsif val.is_a?(PluginVentaPrecio)
|
@@ -33,15 +31,15 @@ class Fdcart
|
|
33
31
|
end
|
34
32
|
|
35
33
|
def remove(id)
|
36
|
-
|
34
|
+
Cart.find(id)&.destroy
|
37
35
|
end
|
38
36
|
|
39
37
|
def get
|
40
|
-
|
38
|
+
Cart.where(owner: @owner)
|
41
39
|
end
|
42
40
|
|
43
41
|
def get_by_ids(ids: [])
|
44
|
-
|
42
|
+
get.where(:_id.in => ids)
|
45
43
|
end
|
46
44
|
def get_by_belongs_ids(ids: [])
|
47
45
|
Cart.where(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fdcart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- afuenteposadilla
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: mongoid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '7.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '7.1'
|
41
41
|
description: Description of Fdcart.
|
42
42
|
email:
|
43
43
|
- adrian@fuenteposadilla.es
|