znamenica/dneslov

View on GitHub
app/models/links/icon_link.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
class IconLink < Link
   belongs_to :info, polymorphic: true

   has_many :descriptions, as: :describable, dependent: :destroy

   accepts_nested_attributes_for :descriptions, reject_if: :all_blank, allow_destroy: true

   validates :url, uri: { allow_redirect: true }
   validates :descriptions, associated: true, allow_nil: true
end