-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1238 from dradis/mappings-manager/add-uploaders
Mappings Manager for Upload Integrations Feature
- Loading branch information
Showing
13 changed files
with
303 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class Mapping < ApplicationRecord | ||
# -- Relationships -------------------------------------------------------- | ||
has_many :mapping_fields, dependent: :destroy | ||
|
||
# -- Callbacks ------------------------------------------------------------ | ||
|
||
# -- Validations ---------------------------------------------------------- | ||
validates :destination, | ||
uniqueness: { scope: [:component, :source], case_sensitive: false } | ||
validates :component, presence: true | ||
validates :source, presence: true | ||
|
||
# -- Scopes --------------------------------------------------------------- | ||
|
||
# -- Class Methods -------------------------------------------------------- | ||
|
||
# -- Instance Methods ----------------------------------------------------- | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
class MappingField < ApplicationRecord | ||
# -- Relationships -------------------------------------------------------- | ||
belongs_to :mapping | ||
|
||
# -- Callbacks ------------------------------------------------------------ | ||
# | ||
# -- Validations ---------------------------------------------------------- | ||
validates :content, presence: true | ||
validates :destination_field, | ||
presence: true, | ||
uniqueness: { scope: [:mapping_id, :source_field], case_sensitive: false } | ||
validates :source_field, presence: true | ||
|
||
# -- Scopes --------------------------------------------------------------- | ||
|
||
# -- Class Methods -------------------------------------------------------- | ||
|
||
# -- Instance Methods ----------------------------------------------------- | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.