snf_core 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82a78e7e7fe7830d277d702448478779473aca40829b30e3d74c1554ba3d4dc1
|
4
|
+
data.tar.gz: 457974a653a89f8e649a44c848bc107981698075695b752e048765f2ace3c212
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81c6afc9efc9aaefe702dc110f275604cadd9bef719442c35079aec3b95c49b87be3c2899f6ccd3e929970b3bbec71010a65fa4487fdc36d36b4a5ff3a84558d
|
7
|
+
data.tar.gz: 0c1cdbc7d820f8a591b0a3abab4b07d14eb7de4f7d9e892eab375e23c76bdc418df70fdb486800b19b08e35cf2839197cb9161f76f0872bfec814d3e0845f5df
|
@@ -3,19 +3,19 @@ module SnfCore
|
|
3
3
|
belongs_to :store
|
4
4
|
belongs_to :product
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
enum :status, {
|
7
|
+
available: 0,
|
8
|
+
unavailable: 1
|
9
9
|
}
|
10
|
+
|
11
|
+
validates :status, presence: true
|
12
|
+
|
10
13
|
validates :base_price, presence: true, numericality: {
|
11
14
|
greater_than_or_equal_to: 0
|
12
15
|
}
|
13
16
|
|
14
17
|
validate :unique_store_product_combination
|
15
18
|
|
16
|
-
scope :out_of_stock, -> { where(stock_quantity: 0) }
|
17
|
-
scope :in_stock, -> { where("stock_quantity > 0") }
|
18
|
-
|
19
19
|
private
|
20
20
|
|
21
21
|
def unique_store_product_combination
|
data/lib/snf_core/engine.rb
CHANGED
@@ -10,7 +10,9 @@ module SnfCore
|
|
10
10
|
end
|
11
11
|
|
12
12
|
initializer "snf_core.factories", after: "factory_bot.set_factory_paths" do
|
13
|
-
|
13
|
+
spec_path = File.expand_path("../../spec", root)
|
14
|
+
FactoryBot.definition_file_paths << spec_path if defined?(FactoryBot)
|
15
|
+
FactoryBot.find_definitions if defined?(FactoryBot)
|
14
16
|
end
|
15
17
|
|
16
18
|
initializer :append_migrations do |app|
|
data/lib/snf_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snf_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Asrat
|
@@ -312,15 +312,16 @@ files:
|
|
312
312
|
- db/migrate/20250226192104_create_snf_core_groups.rb
|
313
313
|
- db/migrate/20250226193938_create_snf_core_customer_groups.rb
|
314
314
|
- db/migrate/20250227075048_create_snf_core_wallets.rb
|
315
|
+
- db/migrate/20250227102833_modify_store_inventories.rb
|
315
316
|
- lib/snf_core.rb
|
316
317
|
- lib/snf_core/engine.rb
|
317
318
|
- lib/snf_core/version.rb
|
318
319
|
- lib/tasks/snf_core_tasks.rake
|
319
|
-
homepage: https://
|
320
|
+
homepage: https://mksaddis.com/
|
320
321
|
licenses:
|
321
322
|
- MIT
|
322
323
|
metadata:
|
323
|
-
homepage_uri: https://
|
324
|
+
homepage_uri: https://mksaddis.com/
|
324
325
|
source_code_uri: https://github.com/BITS-DEVSEC
|
325
326
|
changelog_uri: https://github.com/BITS-DEVSEC
|
326
327
|
rdoc_options: []
|