Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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