bigbang_engine 0.2.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: 67b76f06d2731d490ee8c1f6c76d9b5837e4c7cf
4
- data.tar.gz: d4bcfb091eac879c710dcd8572161f6d10ee8937
3
+ metadata.gz: 4a38ff75a2a80e6b21e2c82757fdbb2e14f430e1
4
+ data.tar.gz: 62261e8ddd249a1903de19ddfee436a9bd2d835a
5
5
  SHA512:
6
- metadata.gz: bf3b8e498f84357642a9295a7922bc9efb5cd09a4213b596622bc27300737b38781c8f9898fdc89fdc43b34c39c72a8052651c53f716e66b222f70d3b8260dc4
7
- data.tar.gz: 131165e5761a92bf42235726976de71925031cace6ede2f8ae899bd511eaabc5187ecc22e52c335f099774abeac4de6f1e4e6be59baff4fe84a1d15e3c22ed54
6
+ metadata.gz: f9a303b31d488bfdf268161388cfe5293bec25b563cdf051703eda505595816caa51836263221eed9a847c2359045566bd3ad1d8d1a4d34cb0ccd1928614c42e
7
+ data.tar.gz: aa461e295f495ff0a371a8dcebf61b75b35d8836210697a969f17946e433ca877347ad1cdc2493fac92fa15627bbc2df1faeba06913b187424695a25aede2443
Binary file
Binary file
@@ -1,11 +1,12 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'bigbang_engine/version'
4
+ require 'bigbang_engine/support/version'
5
+
5
6
 
6
7
  Gem::Specification.new do |spec|
7
8
  spec.name = "bigbang_engine"
8
- spec.version = BigbangEngine::VERSION
9
+ spec.version = BigbangEngine::Support::VERSION
9
10
  spec.authors = ["Vitor Vidotto"]
10
11
  spec.email = ["vvidotto@bip.b.br"]
11
12
 
@@ -13,15 +14,6 @@ Gem::Specification.new do |spec|
13
14
  spec.description = %q{Extraction of part of the intelligence behind BigBang}
14
15
  spec.homepage = "https://bitbucket.org/guideinvestimentos/"
15
16
 
16
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
- # to allow pushing to a single host or delete this section to allow pushing to any host.
18
- # if spec.respond_to?(:metadata)
19
- # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
20
- # else
21
- # raise "RubyGems 2.0 or newer is required to protect against " \
22
- # "public gem pushes."
23
- # end
24
-
25
17
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
26
18
  f.match(%r{^(test|spec|features)/})
27
19
  end
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "bigbang_engine"
4
+ require "bigbang_engine/support"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -1,2 +1,2 @@
1
1
 
2
- require 'central/support/concerns/fund_concern'
2
+ require 'bigbang_engine/support/concerns/fund_concern'
@@ -1,44 +1,46 @@
1
- module Concerns
2
- module Fund
3
- module Associations
4
- extend ActiveSupport::Concern
5
- included do
6
- belongs_to :administrator
7
- belongs_to :manager
8
- belongs_to :asset_strategy
9
- belongs_to :asset_sub_strategy
10
- belongs_to :client
11
- belongs_to :rebate_group
1
+ module BigbangEngine
2
+ module Support
3
+ module FundConcern
4
+ module Associations
5
+ extend ActiveSupport::Concern
6
+ included do
7
+ belongs_to :administrator
8
+ belongs_to :manager
9
+ belongs_to :asset_strategy
10
+ belongs_to :asset_sub_strategy
11
+ belongs_to :client
12
+ belongs_to :rebate_group
12
13
 
13
- has_many :attachments
14
+ has_many :attachments
14
15
 
15
- has_one :promotional_material,
16
- -> { where(attachable_foreign_key: :promotional_material) },
17
- as: :attachable, class_name: 'Attachment', dependent: :destroy
16
+ has_one :promotional_material,
17
+ -> { where(attachable_foreign_key: :promotional_material) },
18
+ as: :attachable, class_name: 'Attachment', dependent: :destroy
18
19
 
19
- has_one :regulation, -> { where(attachable_foreign_key: :regulation) },
20
- as: :attachable, class_name: 'Attachment', dependent: :destroy
20
+ has_one :regulation, -> { where(attachable_foreign_key: :regulation) },
21
+ as: :attachable, class_name: 'Attachment', dependent: :destroy
21
22
 
22
- has_one :sheet_complementary_form, -> { where(attachable_foreign_key: :sheet_complementary_form) },
23
- as: :attachable, class_name: 'Attachment', dependent: :destroy
23
+ has_one :sheet_complementary_form, -> { where(attachable_foreign_key: :sheet_complementary_form) },
24
+ as: :attachable, class_name: 'Attachment', dependent: :destroy
24
25
 
25
- has_one :sheet_essential, -> { where(attachable_foreign_key: :sheet_essential) },
26
- as: :attachable, class_name: 'Attachment', dependent: :destroy
26
+ has_one :sheet_essential, -> { where(attachable_foreign_key: :sheet_essential) },
27
+ as: :attachable, class_name: 'Attachment', dependent: :destroy
27
28
 
28
- has_many :documents, class_name: "Documentation", as: Fund
29
- has_many :bank_accounts, as: :accountable, dependent: :destroy
30
- has_many :shares, dependent: :destroy
31
- has_one :info, dependent: :destroy, class_name: "FundInfo"
32
- has_one :transactions_info, class_name: "FundTransactionsInfo"
33
- has_one :monthly_fund_sheet
34
- accepts_nested_attributes_for :promotional_material, allow_destroy: true
35
- accepts_nested_attributes_for :regulation, allow_destroy: true
36
- accepts_nested_attributes_for :sheet_essential, allow_destroy: true
37
- accepts_nested_attributes_for :sheet_complementary_form, allow_destroy: true
38
- accepts_nested_attributes_for :bank_accounts, allow_destroy: true
39
- accepts_nested_attributes_for :info, allow_destroy: true
40
- accepts_nested_attributes_for :transactions_info, allow_destroy: true
29
+ has_many :documents, class_name: "Documentation", as: Fund
30
+ has_many :bank_accounts, as: :accountable, dependent: :destroy
31
+ has_many :shares, dependent: :destroy
32
+ has_one :info, dependent: :destroy, class_name: "FundInfo"
33
+ has_one :transactions_info, class_name: "FundTransactionsInfo"
34
+ has_one :monthly_fund_sheet
35
+ accepts_nested_attributes_for :promotional_material, allow_destroy: true
36
+ accepts_nested_attributes_for :regulation, allow_destroy: true
37
+ accepts_nested_attributes_for :sheet_essential, allow_destroy: true
38
+ accepts_nested_attributes_for :sheet_complementary_form, allow_destroy: true
39
+ accepts_nested_attributes_for :bank_accounts, allow_destroy: true
40
+ accepts_nested_attributes_for :info, allow_destroy: true
41
+ accepts_nested_attributes_for :transactions_info, allow_destroy: true
42
+ end
41
43
  end
42
44
  end
43
45
  end
44
- end
46
+ end
@@ -1,41 +1,43 @@
1
- module Concerns
2
- module Fund
3
- module Callbacks
4
- extend ActiveSupport::Concern
5
- included do
6
- before_save :update_client_attributes
7
- before_validation :reject_attachments
8
- end
1
+ module BigbangEngine
2
+ module Support
3
+ module FundConcern
4
+ module Callbacks
5
+ extend ActiveSupport::Concern
6
+ included do
7
+ before_save :update_client_attributes
8
+ before_validation :reject_attachments
9
+ end
9
10
 
10
- def update_client_attributes
11
- if client
12
- client.update_attribute(:name, name) if name_changed?
13
- client.update_attribute(:document, cnpj) if cnpj_changed?
11
+ def update_client_attributes
12
+ if client
13
+ client.update_attribute(:name, name) if name_changed?
14
+ client.update_attribute(:document, cnpj) if cnpj_changed?
15
+ end
14
16
  end
15
- end
16
17
 
17
- def reject_attachments
18
- self.promotional_material = nil if promotional_material &&
19
- promotional_material.file_file_name.blank?
20
- self.regulation = nil if regulation && regulation.file_file_name.blank?
21
- self.sheet_complementary_form = nil if sheet_complementary_form &&
22
- sheet_complementary_form.file_file_name.blank?
23
- self.sheet_essential = nil if sheet_essential &&
24
- sheet_essential.file_file_name.blank?
25
- true
26
- end
18
+ def reject_attachments
19
+ self.promotional_material = nil if promotional_material &&
20
+ promotional_material.file_file_name.blank?
21
+ self.regulation = nil if regulation && regulation.file_file_name.blank?
22
+ self.sheet_complementary_form = nil if sheet_complementary_form &&
23
+ sheet_complementary_form.file_file_name.blank?
24
+ self.sheet_essential = nil if sheet_essential &&
25
+ sheet_essential.file_file_name.blank?
26
+ true
27
+ end
27
28
 
28
- def after_save_asset
29
- set_status
30
- end
29
+ def after_save_asset
30
+ set_status
31
+ end
31
32
 
32
- def after_destroy_asset
33
- set_status
34
- end
33
+ def after_destroy_asset
34
+ set_status
35
+ end
35
36
 
36
- def set_status
37
- manager.status = manager.balances.actives.empty? ? :inactive : :active
38
- manager.save!
37
+ def set_status
38
+ manager.status = manager.balances.actives.empty? ? :inactive : :active
39
+ manager.save!
40
+ end
39
41
  end
40
42
  end
41
43
  end
@@ -1,16 +1,18 @@
1
- module Concerns
2
- module Fund
3
- module Delegators
4
- extend ActiveSupport::Concern
5
- included do
6
- delegate :double_count, to: :manager, allow_nil: true
7
- delegate :bmark, to: :asset_strategy
8
- delegate :name, to: :administrator, prefix: true, allow_nil: true
9
- delegate :name, to: :manager, prefix: true, allow_nil: true
10
- delegate :email, to: :manager, prefix: true, allow_nil: true
11
- delegate :adm_fee_calculation_type,
12
- to: :rebate_group, allow_nil: true
13
- delegate :share_treshold, to: :asset_sub_strategy, allow_nil: true
1
+ module BigbangEngine
2
+ module Support
3
+ module FundConcern
4
+ module Delegators
5
+ extend ActiveSupport::Concern
6
+ included do
7
+ delegate :double_count, to: :manager, allow_nil: true
8
+ delegate :bmark, to: :asset_strategy
9
+ delegate :name, to: :administrator, prefix: true, allow_nil: true
10
+ delegate :name, to: :manager, prefix: true, allow_nil: true
11
+ delegate :email, to: :manager, prefix: true, allow_nil: true
12
+ delegate :adm_fee_calculation_type,
13
+ to: :rebate_group, allow_nil: true
14
+ delegate :share_treshold, to: :asset_sub_strategy, allow_nil: true
15
+ end
14
16
  end
15
17
  end
16
18
  end
@@ -1,29 +1,31 @@
1
- module Concerns
2
- module Fund
3
- module Scopes
4
- extend ActiveSupport::Concern
5
- included do
6
- scope :double_count, ->(flag) {
7
- joins(:manager).where("managers.double_count = #{flag}")
8
- }
1
+ module BigbangEngine
2
+ module Support
3
+ module FundConcern
4
+ module Scopes
5
+ extend ActiveSupport::Concern
6
+ included do
7
+ scope :double_count, ->(flag) {
8
+ joins(:manager).where("managers.double_count = #{flag}")
9
+ }
9
10
 
10
- scope :to_website,
11
- -> { with_info.where("show_on_website = 1").by_name }
12
- scope :share_gaps,
13
- -> { with_info.where("fund_infos.terminated = 0").by_name }
14
- scope :with_transactions, -> { joins(:transactions).uniq }
15
- scope :with_sheets, -> {
16
- with_info.where.not(fund_infos: {sheet_id: nil}).
17
- by_name.pluck(:name, :id)
18
- }
11
+ scope :to_website,
12
+ -> { with_info.where("show_on_website = 1").by_name }
13
+ scope :share_gaps,
14
+ -> { with_info.where("fund_infos.terminated = 0").by_name }
15
+ scope :with_transactions, -> { joins(:transactions).uniq }
16
+ scope :with_sheets, -> {
17
+ with_info.where.not(fund_infos: {sheet_id: nil}).
18
+ by_name.pluck(:name, :id)
19
+ }
19
20
 
20
- scope :exclusive_funds, -> {
21
- with_info.includes(:asset, :client).where(
22
- "fund_infos.exclusive = 1 AND client_id IS NOT NULL").map(&:asset)
23
- }
21
+ scope :exclusive_funds, -> {
22
+ with_info.includes(:asset, :client).where(
23
+ "fund_infos.exclusive = 1 AND client_id IS NOT NULL").map(&:asset)
24
+ }
24
25
 
25
- private
26
- scope :with_info, -> { joins(:info) }
26
+ private
27
+ scope :with_info, -> { joins(:info) }
28
+ end
27
29
  end
28
30
  end
29
31
  end
@@ -0,0 +1,5 @@
1
+ module BigbangEngine
2
+ module Support
3
+ VERSION = "0.3.1"
4
+ end
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigbang_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitor Vidotto
@@ -65,16 +65,17 @@ files:
65
65
  - Gemfile
66
66
  - README.md
67
67
  - Rakefile
68
+ - bigbang_engine-0.1.0.gem
69
+ - bigbang_engine-0.2.0.gem
68
70
  - bigbang_engine.gemspec
69
71
  - bin/console
70
72
  - bin/setup
71
- - lib/bigbang_engine.rb
72
73
  - lib/bigbang_engine/support.rb
73
74
  - lib/bigbang_engine/support/concerns/fund_concern/associations.rb
74
75
  - lib/bigbang_engine/support/concerns/fund_concern/callbacks.rb
75
76
  - lib/bigbang_engine/support/concerns/fund_concern/delegators.rb
76
77
  - lib/bigbang_engine/support/concerns/fund_concern/scopes.rb
77
- - lib/bigbang_engine/version.rb
78
+ - lib/bigbang_engine/support/version.rb
78
79
  homepage: https://bitbucket.org/guideinvestimentos/
79
80
  licenses: []
80
81
  metadata: {}
@@ -1,5 +0,0 @@
1
- require "bigbang_engine/version"
2
-
3
- module BigbangEngine
4
- # Your code goes here...
5
- end
@@ -1,3 +0,0 @@
1
- module BigbangEngine
2
- VERSION = "0.2.0"
3
- end