bscf-core 0.4.6 → 0.4.7

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: 2c6e2053e54d2b2ae6e952231cf581d58fb6f1e84676c9eb189f78c4ae4b33ab
4
- data.tar.gz: 331bc05bbc374e9071df5a295cd331de880fd96a9f40c93b18bbfcfb07b79c4c
3
+ metadata.gz: 8cf47c7e66d0f00820cfd5175bb4d0dcaf7059018bf48f22a60b41014d7042ff
4
+ data.tar.gz: f688c46d920deba1e26a836ebabe17277591dd67b9b1bd4d3bbc0c415ece887a
5
5
  SHA512:
6
- metadata.gz: b537681b9c1e6139ea892b6ee0b257f9ad1b275242de7dab8900be18a91856fe086160d35bc9c77cfc183c1a92356fa51751ff32c71bf22c3b59b583723ee142
7
- data.tar.gz: 3f4b626c0da8627935484f5e399a2468ae5badaf2dbcf8dc3e6d90726d42f9fedc3d0aef22ed5e92b5398a0ab4dcc75f8009bbf59188c936610e50f3383ee3c6
6
+ metadata.gz: dc807f5982ce22a1ee9d952331707fe9a11e4d6295d507d0a8695971b0f8d3d12467e96069754d12a5ac54cd01c05210032d423ce2066e92d5fbeecb6e8be656
7
+ data.tar.gz: 3c1f6a338140d61b4942767f4cc54fbb67cdb69195b9847d7fba5d28f5d63ab015031243a122fd319fbf572221a6ccd1fc5673262b0606cb41f3487dcd0fc011
@@ -11,7 +11,7 @@ module Bscf
11
11
  validates :latitude, :longitude, presence: true, if: :requires_coordinates?
12
12
 
13
13
  def coordinates
14
- [latitude.to_f, longitude.to_f] if latitude.present? && longitude.present?
14
+ [ latitude.to_f, longitude.to_f ] if latitude.present? && longitude.present?
15
15
  end
16
16
 
17
17
  def full_address
@@ -1,14 +1,13 @@
1
1
  module Bscf
2
2
  module Core
3
3
  class BusinessDocument < ApplicationRecord
4
- belongs_to :business
4
+ belongs_to :user
5
5
  has_one_attached :file
6
6
 
7
7
  before_validation :format_document_name
8
8
 
9
9
  validates :document_number, presence: true
10
10
  validates :document_name, presence: true
11
- validates :business_id, presence: true
12
11
  validates :verified_at, presence: true, if: :is_verified?
13
12
  validates :file, presence: true
14
13
  validate :block_executable_files
@@ -0,0 +1,7 @@
1
+ class RenameBusinessIdToUserIdInBscfCoreBusinessDocuments < ActiveRecord::Migration[8.0]
2
+ def change
3
+ remove_foreign_key :bscf_core_business_documents, column: :business_id
4
+ rename_column :bscf_core_business_documents, :business_id, :user_id
5
+ add_foreign_key :bscf_core_business_documents, :bscf_core_users, column: :user_id
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  module Bscf
2
2
  module Core
3
- VERSION = "0.4.6"
3
+ VERSION = "0.4.7"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  FactoryBot.define do
2
2
  factory :business_document, class: 'Bscf::Core::BusinessDocument' do
3
- association :business, factory: :business
3
+ user
4
4
  document_number { "DOC-#{SecureRandom.hex(4).upcase}" }
5
5
  document_name { "Business License" }
6
6
  document_description { "Official business license document" }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bscf-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Asrat
@@ -359,6 +359,7 @@ files:
359
359
  - db/migrate/20250616145522_add_position_to_delivery_order_items.rb
360
360
  - db/migrate/20250623113112_add_drop_off_adress_to_orders.rb
361
361
  - db/migrate/20250623115615_remove_dropoff_address_from_delivery_orders.rb
362
+ - db/migrate/20250624062746_rename_business_id_to_user_id_in_bscf_core_business_documents.rb
362
363
  - lib/bscf/core.rb
363
364
  - lib/bscf/core/engine.rb
364
365
  - lib/bscf/core/version.rb