Module: Katello::SyncManagementHelper

Defined in:
app/helpers/katello/sync_management_helper.rb

Defined Under Namespace

Modules: RepoMethods

Instance Method Summary collapse

Instance Method Details

#any_syncable?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'app/helpers/katello/sync_management_helper.rb', line 27

def any_syncable?
  Product.syncable? && current_organization_object.syncable_content?
end

#id(sets) ⇒ Object



11
12
13
# File 'app/helpers/katello/sync_management_helper.rb', line 11

def id(sets)
  product_id(sets.join("-"))
end

#parent_set_class(sets) ⇒ Object



15
16
17
# File 'app/helpers/katello/sync_management_helper.rb', line 15

def parent_set_class(sets)
  product_child(sets.join("-"))
end

#product_child(prod_id) ⇒ Object



7
8
9
# File 'app/helpers/katello/sync_management_helper.rb', line 7

def product_child(prod_id)
  "child-of-#{product_id(prod_id)}"
end

#product_id(prod_id) ⇒ Object



3
4
5
# File 'app/helpers/katello/sync_management_helper.rb', line 3

def product_id(prod_id)
  "product-#{prod_id}".tr(".", "_") #jquery treetable doesn't support periods
end

#repo_id(repo) ⇒ Object



19
20
21
# File 'app/helpers/katello/sync_management_helper.rb', line 19

def repo_id(repo)
  "repo-#{repo.id}"
end

#repos?(product) ⇒ Boolean

Returns:

  • (Boolean)


93
94
95
96
97
98
99
100
101
# File 'app/helpers/katello/sync_management_helper.rb', line 93

def repos?(product)
  if product[:children].present?
    product[:children].collect do |child|
      repos?(child)
    end
  else
    product[:repos].length > 0
  end
end

#syncable?(product) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/helpers/katello/sync_management_helper.rb', line 23

def syncable?(product)
  product.syncable? && !product.orphaned? && product.syncable_content?
end