Revision 52ffd457
Added by David Davis over 10 years ago
app/models/katello/content_view_repository.rb | ||
---|---|---|
# NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
|
||
# have received a copy of GPLv2 along with this software; if not, see
|
||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||
|
||
module Katello
|
||
class ContentViewRepository < Katello::Model
|
||
self.include_root_in_json = false
|
||
class ContentViewRepository < Katello::Model
|
||
self.include_root_in_json = false
|
||
|
||
belongs_to :content_view, :inverse_of => :content_view_repositories,
|
||
:class_name => "Katello::ContentView"
|
||
belongs_to :repository, :inverse_of => :content_view_repositories,
|
||
:class_name => "Katello::Repository"
|
||
end
|
||
belongs_to :content_view, :inverse_of => :content_view_repositories,
|
||
:class_name => "Katello::ContentView"
|
||
belongs_to :repository, :inverse_of => :content_view_repositories,
|
||
:class_name => "Katello::Repository"
|
||
|
||
validate :content_view_composite
|
||
|
||
private
|
||
|
||
def content_view_composite
|
||
if content_view.composite?
|
||
errors.add(:base, _("Cannot add repositories to a composite content view"))
|
||
end
|
||
end
|
||
end
|
||
end
|
Also available in: Unified diff
Content Views: Adding in composite content views