{"action":"created","issue":{"url":"https://api.github.com/repos/theforeman/foreman_discovery/issues/233","labels_url":"https://api.github.com/repos/theforeman/foreman_discovery/issues/233/labels{/name}","comments_url":"https://api.github.com/repos/theforeman/foreman_discovery/issues/233/comments","events_url":"https://api.github.com/repos/theforeman/foreman_discovery/issues/233/events","html_url":"https://github.com/theforeman/foreman_discovery/pull/233","id":118011967,"number":233,"title":"Fixes #12548 - Allow discovery_rule to be mass assigned","user":{"login":"dLobatog","id":598891,"avatar_url":"https://avatars.githubusercontent.com/u/598891?v=3","gravatar_id":"","url":"https://api.github.com/users/dLobatog","html_url":"https://github.com/dLobatog","followers_url":"https://api.github.com/users/dLobatog/followers","following_url":"https://api.github.com/users/dLobatog/following{/other_user}","gists_url":"https://api.github.com/users/dLobatog/gists{/gist_id}","starred_url":"https://api.github.com/users/dLobatog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dLobatog/subscriptions","organizations_url":"https://api.github.com/users/dLobatog/orgs","repos_url":"https://api.github.com/users/dLobatog/repos","events_url":"https://api.github.com/users/dLobatog/events{/privacy}","received_events_url":"https://api.github.com/users/dLobatog/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/theforeman/foreman_discovery/labels/Needs%20testing","name":"Needs testing","color":"207de5"},{"url":"https://api.github.com/repos/theforeman/foreman_discovery/labels/Not%20yet%20reviewed","name":"Not yet reviewed","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-20T10:37:25Z","updated_at":"2015-12-01T13:24:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman_discovery/pulls/233","html_url":"https://github.com/theforeman/foreman_discovery/pull/233","diff_url":"https://github.com/theforeman/foreman_discovery/pull/233.diff","patch_url":"https://github.com/theforeman/foreman_discovery/pull/233.patch"},"body":"As part of projects.theforeman.org/projects/foreman/issues/7568 , the\r\nHost and Hostgroup models will become mass-assignment protected.\r\nIn that case, we have to whitelist the attributes that come from\r\ndiscovery that are mass assigned. A few tests use it and will fail\r\notherwise."},"comment":{"url":"https://api.github.com/repos/theforeman/foreman_discovery/issues/comments/160967633","html_url":"https://github.com/theforeman/foreman_discovery/pull/233#issuecomment-160967633","issue_url":"https://api.github.com/repos/theforeman/foreman_discovery/issues/233","id":160967633,"user":{"login":"lzap","id":49752,"avatar_url":"https://avatars.githubusercontent.com/u/49752?v=3","gravatar_id":"","url":"https://api.github.com/users/lzap","html_url":"https://github.com/lzap","followers_url":"https://api.github.com/users/lzap/followers","following_url":"https://api.github.com/users/lzap/following{/other_user}","gists_url":"https://api.github.com/users/lzap/gists{/gist_id}","starred_url":"https://api.github.com/users/lzap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzap/subscriptions","organizations_url":"https://api.github.com/users/lzap/orgs","repos_url":"https://api.github.com/users/lzap/repos","events_url":"https://api.github.com/users/lzap/events{/privacy}","received_events_url":"https://api.github.com/users/lzap/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T13:24:04Z","updated_at":"2015-12-01T13:24:04Z","body":"Ok one more please:\r\n\r\n```diff\r\ndiff --git a/app/models/discovery_rule.rb b/app/models/discovery_rule.rb\r\nindex 8cdb3fd..e18c20e 100644\r\n--- a/app/models/discovery_rule.rb\r\n+++ b/app/models/discovery_rule.rb\r\n@@ -4,6 +4,8 @@ class DiscoveryRule < ActiveRecord::Base\r\n   friendly_id :name\r\n   include Parameterizable::ByIdName\r\n   include Taxonomix\r\n \r\n+  attr_accessible :name, :priority, :search, :enabled, :hostgroup, :hostgroup_id, :max_count, :hostname\r\n \r\n   validates :name, :presence => true, :uniqueness => true,\r\n     :format => { :with => /\\A(\\S+)\\Z/, :message => N_(\"can't contain white spaces.\") }\r\n;;;"}}