Skip to content

Instantly share code, notes, and snippets.

@dLobatog
Created July 24, 2019 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dLobatog/fb1bc3109e171af52d997233823f51c1 to your computer and use it in GitHub Desktop.
Save dLobatog/fb1bc3109e171af52d997233823f51c1 to your computer and use it in GitHub Desktop.
irb(main):033:0> host = parser.save_host
=> #<Host id: "747db4fd-8221-40f2-bb7c-776fc4671cbb", name: "5.example.com", created_at: nil, updated_at: nil, account_id: "bbc76fb9-de55-490b-903d-ec39d22bf0c7">
irb(main):034:0> host.valid?
=> false
irb(main):035:0> host.errors
=> #<ActiveModel::Errors:0x000000000a5aac30 @base=#<Host id: "747db4fd-8221-40f2-bb7c-776fc4671cbb", name: "5.example.com", created_at: nil, updated_at: nil, account_id: "bbc76fb9-de55-490b-903d-ec39d22bf0c7">, @messages={:profiles=>["is invalid"]}, @details={:profiles=>[{:error=>:invalid}]}>
irb(main):036:0> host.profiles
=> #<ActiveRecord::Associations::CollectionProxy [#<Profile id: "aaf30659-f12b-46c4-8c1e-589dbab528d9", name: "PCI-DSS v3 Control Baseline for Red Hat Enterprise...", ref_id: "xccdf_org.ssgproject.content_profile_pci-dss", policy_id: nil, created_at: "2019-07-09 08:32:34", updated_at: "2019-07-09 08:32:34", description: "This guide presents a catalog of security-relevant...", account_id: "bbc76fb9-de55-490b-903d-ec39d22bf0c7", slug: "xccdf_org-ssgproject-content_profile_pci-dss-fa6be...", compliance_threshold: 100.0, business_objective_id: nil>]>
irb(main):037:0> host.profiles.first.valid?
=> false
irb(main):038:0> host.profiles.first.errors
=> #<ActiveModel::Errors:0x000000000a496150 @base=#<Profile id: "aaf30659-f12b-46c4-8c1e-589dbab528d9", name: "PCI-DSS v3 Control Baseline for Red Hat Enterprise...", ref_id: "xccdf_org.ssgproject.content_profile_pci-dss", policy_id: nil, created_at: "2019-07-09 08:32:34", updated_at: "2019-07-09 08:32:34", description: "This guide presents a catalog of security-relevant...", account_id: "bbc76fb9-de55-490b-903d-ec39d22bf0c7", slug: "xccdf_org-ssgproject-content_profile_pci-dss-fa6be...", compliance_threshold: 100.0, business_objective_id: nil>, @messages={:ref_id=>["has already been taken"]}, @details={:ref_id=>[{:error=>:taken, :value=>"xccdf_org.ssgproject.content_profile_pci-dss"}]}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment