Skip to content

Commit

Permalink
[MNOE-406] Added logic to load delisted apps if already in dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
MAhsenArif committed Feb 1, 2018
1 parent 7058687 commit bac6619
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ end
# json.connector_version app_instance.oauth_keys[:version]
# end

app_instance.without_tenant = true
app_instance.app.tap do |a|
json.app_id a.id
json.app_name a.name
Expand Down
7 changes: 6 additions & 1 deletion core/lib/mno_enterprise/concerns/models/app_instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ module MnoEnterprise::Concerns::Models::AppInstance
:owner_type, :terminated_at, :stopped_at, :billing_type, :autostop_at, :autostop_interval,
:next_status, :soa_enabled, :oauth_company, :oauth_keys, :oauth_keys_valid, :free_trial_end_at, :per_user_licence, :active_licences_count

attr_accessor :without_tenant

#==============================================================
# Constants
#==============================================================
Expand All @@ -52,7 +54,6 @@ module MnoEnterprise::Concerns::Models::AppInstance
# Associations
#==============================================================
belongs_to :owner, class_name: 'MnoEnterprise::Organization'
belongs_to :app, class_name: 'MnoEnterprise::App'

# Define connector_stack?, cloud_stack? etc. methods
[:cube, :cloud, :connector].each do |stackname|
Expand All @@ -62,6 +63,10 @@ module MnoEnterprise::Concerns::Models::AppInstance
end

scope :active, -> { where('status.in' => ACTIVE_STATUSES) }

def app
MnoEnterprise::App.find(self.app_id, { unscoped: self.without_tenant })
end
end

#==================================================================
Expand Down

0 comments on commit bac6619

Please sign in to comment.