bigbang_engine 0.8.0 → 0.9.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 +4 -4
- data/lib/bigbang_engine/support.rb +0 -4
- data/lib/bigbang_engine/support/version.rb +1 -1
- metadata +1 -10
- data/bigbang_engine-0.1.0.gem +0 -0
- data/bigbang_engine-0.2.0.gem +0 -0
- data/bigbang_engine-0.6.0.gem +0 -0
- data/bigbang_engine-0.7.0.gem +0 -0
- data/lib/bigbang_engine/support/concerns/fund_concern.rb +0 -4
- data/lib/bigbang_engine/support/concerns/fund_concern/associations.rb +0 -46
- data/lib/bigbang_engine/support/concerns/fund_concern/callbacks.rb +0 -44
- data/lib/bigbang_engine/support/concerns/fund_concern/delegators.rb +0 -19
- data/lib/bigbang_engine/support/concerns/fund_concern/scopes.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4329f62d5e4f0f927fc8a12ac73d22e8a16a659c
|
4
|
+
data.tar.gz: 0f75617865f0c252d28ebeaa722ed206874878a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2faa60ff09fd112b37e1cdfedfc6ea54e85119789c5e392be6b16f253aace12c1198f104660cdece4363f75e930e81a3ef7715a5356944e26d60f2839b2b027f
|
7
|
+
data.tar.gz: 0b1308ebf5bcf283b29fb5f9df24b3e0234d9faba44ecd613553e49d38e5dcf5eef69a23060f484c34523b5cbeee30729a561e30f258e32fcbe4ad256457c038
|
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.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vitor Vidotto
|
@@ -79,19 +79,10 @@ files:
|
|
79
79
|
- Gemfile
|
80
80
|
- README.md
|
81
81
|
- Rakefile
|
82
|
-
- bigbang_engine-0.1.0.gem
|
83
|
-
- bigbang_engine-0.2.0.gem
|
84
|
-
- bigbang_engine-0.6.0.gem
|
85
|
-
- bigbang_engine-0.7.0.gem
|
86
82
|
- bigbang_engine.gemspec
|
87
83
|
- bin/console
|
88
84
|
- bin/setup
|
89
85
|
- lib/bigbang_engine/support.rb
|
90
|
-
- lib/bigbang_engine/support/concerns/fund_concern.rb
|
91
|
-
- lib/bigbang_engine/support/concerns/fund_concern/associations.rb
|
92
|
-
- lib/bigbang_engine/support/concerns/fund_concern/callbacks.rb
|
93
|
-
- lib/bigbang_engine/support/concerns/fund_concern/delegators.rb
|
94
|
-
- lib/bigbang_engine/support/concerns/fund_concern/scopes.rb
|
95
86
|
- lib/bigbang_engine/support/version.rb
|
96
87
|
homepage: https://bitbucket.org/guideinvestimentos/
|
97
88
|
licenses: []
|
data/bigbang_engine-0.1.0.gem
DELETED
Binary file
|
data/bigbang_engine-0.2.0.gem
DELETED
Binary file
|
data/bigbang_engine-0.6.0.gem
DELETED
Binary file
|
data/bigbang_engine-0.7.0.gem
DELETED
Binary file
|
@@ -1,46 +0,0 @@
|
|
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
|
13
|
-
|
14
|
-
has_many :attachments
|
15
|
-
|
16
|
-
has_one :promotional_material,
|
17
|
-
-> { where(attachable_foreign_key: :promotional_material) },
|
18
|
-
as: :attachable, class_name: 'Attachment', dependent: :destroy
|
19
|
-
|
20
|
-
has_one :regulation, -> { where(attachable_foreign_key: :regulation) },
|
21
|
-
as: :attachable, class_name: 'Attachment', dependent: :destroy
|
22
|
-
|
23
|
-
has_one :sheet_complementary_form, -> { where(attachable_foreign_key: :sheet_complementary_form) },
|
24
|
-
as: :attachable, class_name: 'Attachment', dependent: :destroy
|
25
|
-
|
26
|
-
has_one :sheet_essential, -> { where(attachable_foreign_key: :sheet_essential) },
|
27
|
-
as: :attachable, class_name: 'Attachment', dependent: :destroy
|
28
|
-
|
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
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
@@ -1,44 +0,0 @@
|
|
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
|
10
|
-
|
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
|
16
|
-
end
|
17
|
-
|
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
|
28
|
-
|
29
|
-
def after_save_asset
|
30
|
-
set_status
|
31
|
-
end
|
32
|
-
|
33
|
-
def after_destroy_asset
|
34
|
-
set_status
|
35
|
-
end
|
36
|
-
|
37
|
-
def set_status
|
38
|
-
manager.status = manager.balances.actives.empty? ? :inactive : :active
|
39
|
-
manager.save!
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,19 +0,0 @@
|
|
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
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,32 +0,0 @@
|
|
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
|
-
}
|
10
|
-
|
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
|
-
}
|
20
|
-
|
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
|
-
}
|
25
|
-
|
26
|
-
private
|
27
|
-
scope :with_info, -> { joins(:info) }
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|