Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING: Can't mass-assign protected attributes for SOA and domain #15

Open
netman2k opened this issue Nov 1, 2016 · 0 comments
Open

Comments

@netman2k
Copy link

netman2k commented Nov 1, 2016

I have been trying to use GloboDns for my site. but I found that there were some warnings during run importer script.

the warnings were:

WARNING: Can't mass-assign protected attributes for Domain: importing
	lib/globo_dns/importer.rb:223:in `import'
WARNING: Can't mass-assign protected attributes for SOA: importing
	app/models/soa.rb:61:in `initialize'
	lib/globo_dns/importer.rb:223:in `import'

and I fixed these by adding :importing symbol to the attr_accessible as below:

[globodns@globodns globodns]$ git diff app/models/soa.rb 
diff --git a/app/models/soa.rb b/app/models/soa.rb
index ea3db33..5e0670a 100644
--- a/app/models/soa.rb
+++ b/app/models/soa.rb
@@ -38,7 +38,7 @@ class SOA < Record
     before_validation :set_content
     after_initialize  :update_convenience_accessors
 
-    attr_accessible  :domain_id, :type, :name, :ttl, :prio, :content, *ACCESSIBLE_SOA_FIELDS
+    attr_accessible  :domain_id, :type, :name, :ttl, :prio, :content, *ACCESSIBLE_SOA_FIELDS, :importing
 
     # this allows us to have these convenience attributes act like any other
     # column in terms of validations
[globodns@globodns globodns]$ git diff app/models/domain.rb 
diff --git a/app/models/domain.rb b/app/models/domain.rb
index 6b2de9e..4531e5b 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -41,7 +41,7 @@ class Domain < ActiveRecord::Base
 
     attr_accessor :importing
     attr_accessible :user_id, :name, :master, :last_check, :notified_serial, :account, :ttl, :notes, :authority_type, :addressing_t
-    :primary_ns, :contact, :refresh, :retry, :expire, :minimum
+    :primary_ns, :contact, :refresh, :retry, :expire, :minimum, :importing
 
     audited :protect => false
     has_associated_audits

I appreciated if you apply these on the codes of the develop branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants