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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c35c2157fdbfbecf1d5712db85511797a0486ae7150abfad4e676a4ae54f7385
4
- data.tar.gz: aaf5c60b0532b80c83f2f86eaf7db61a13b8b286b55c097d440f2d7404422ab3
3
+ metadata.gz: df19f6c67dba1d352401c7a3cf601038c654e43b332f660ef4aca3b3ded60c1a
4
+ data.tar.gz: 7d397b3e28a7a64387d85044f3118e285f7de97bfc8c80911b5cc7c4a26ac350
5
5
  SHA512:
6
- metadata.gz: cdcc1d9f365e90e91e7bc50aa651fbe300d2dfdcd40e1a2c637ba1f1366f8964bda51893f43e927a632b1fcff7deab44b548fdfb221be6c17f2d3e91d0badfda
7
- data.tar.gz: c0a4acc55b86b5e2916a062ec63129302d891eff24f728a6a61d75aa414871dab14abb889861ccb944d59b71a351a5d8e2f66a7a557db1fddd5247a3f6a818a1
6
+ metadata.gz: 15c02d4b67acfc77f44c5b8a4fefc101f5da6061406a56976fb5591df11f852ea02fa862eee071d26ebded7c1f4ea8ba4ced78e6a4efb266b44ac7025044443c
7
+ data.tar.gz: 64ee23cdf04564c2ef3d2a671dafaaa219eab73e037d1a82a1fc2646ae50432efc6e9ff936a1a292f551f5d2cffb5ff9c19fa7ef1bedd50d2fb746bd8149c739
@@ -1,3 +1,3 @@
1
1
  class Fdcart
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
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[:proveedor_externo] = val[:externo]
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
- @cart.find(id)&.destroy
34
+ Cart.find(id)&.destroy
37
35
  end
38
36
 
39
37
  def get
40
- @cart = Cart.where(owner: @owner)
38
+ Cart.where(owner: @owner)
41
39
  end
42
40
 
43
41
  def get_by_ids(ids: [])
44
- @cart.where(:_id.in => ids)
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.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
- - AdrianFP
7
+ - afuenteposadilla
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-09 00:00:00.000000000 Z
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: '0'
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: '0'
40
+ version: '7.1'
41
41
  description: Description of Fdcart.
42
42
  email:
43
43
  - adrian@fuenteposadilla.es