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
section.details dl { | |
$modal-detail-header-color: $blue !default; | |
$modal-detail-header-weight: 100 !default; | |
$modal-detail-body-bg-color: #FFF !default; | |
$modal-detail-body-padding: rem-calc(10) !default; | |
dt { | |
color: $modal-detail-header-color; | |
font-weight: $modal-detail-header-weight; |
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
module GuidConcern | |
extend ActiveSupport::Concern | |
included do | |
before_validation :set_guid!, on: :create, if: :has_guid_concern? | |
validate :guid_concern_validator, if: :has_guid_concern? | |
end | |
module ClassMethods | |
def displayed_with_guid(options={}) |
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
= field_set_tag do | |
= f.input :title, placeholder: 'Friendly Name', required: true, disabled: (f.object.title.present?) | |
= field_set_tag 'IP Address Range' do | |
= f.input :starts_with, placeholder: 'IPv4 Address', required: true, as: :string | |
= f.input :ends_with, placeholder: 'IPv4 Address', required: true, as: :string | |
= field_set_tag 'Assessment Scope' do | |
= f.association :assessment_scope, collection: @account.assessment_scopes, required: true |
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
require 'rails_helper' | |
RSpec.describe 'Domains Requests' do | |
describe 'GET /api/domains/{id}' do | |
it 'responds with the requested domain' do | |
domain = FactoryGirl.create(:domain) | |
get api_domain_path(domain) |
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
class DomainSerializer | |
attributes :id, :name | |
# Override publicly-exposed ID to actually be GUID | |
def id | |
self.guid | |
end | |
end | |
class RecordSerializer |
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
module ScopeConcern | |
extend ActiveSupport::Concern | |
included do | |
superclass.send(:define_singleton_method, "#{self.model_name.demodulize.underscore}_records") do | |
where(type: "#{self.class.name}") | |
end | |
end | |
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
{ | |
"type": "object", | |
"required": ["domains"], | |
"properties": { | |
"domains" : { | |
"type": "array", | |
"items": { | |
"type" : "object", | |
"required" : [ | |
"created_at", |
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
{ | |
"id": "http://jsonapi.org/schema#", | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"title": "JSON API Schema", | |
"description": "This is a schema for responses in the JSON API format. For more, see http://jsonapi.org", | |
"type": "object", | |
"resources":{ | |
"type": "array", | |
"items": { | |
"type": "object", |
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
def current_user=(val) | |
session[:signed_token] = @user | |
@user = User.find(....) | |
@user.signing_token = session[:signed_token] | |
end | |
class User | |
#... |
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
{ | |
user: { | |
# .. existing stuff from update | |
permissions: { | |
'dns_manager': [], | |
'ctms': [], | |
'registrar': [] | |
} | |
} | |
} |
OlderNewer