Displaying 4 results from an estimated 4 matches for "enumrecord".
2005 Aug 16
1
Defining model classes for enumerations
...ve several tables for enumerations. They all have the same content:
id, name, position. I''d like to avoid the tedious work of defining a
class for each one explicitly. Not least, in order to avoid clutter in
the model directory.
Here''s what I''ve come up with:
class EnumRecord < ActiveRecord::Base
def self.define_enums(*enums)
enums.each do |spec|
if spec.kind_of?(Hash)
class_name = spec[:class_name].to_s
raise ArgumentError, ''An enum specification must contain
a :class_name'' if class_name.empty?
order...
2017 Jun 08
1
How to update the root hints for bind DLZ
The RootDNSServers zone is special in a number of ways. It has no SOA
record for instance, and so there's a lot of special casing around it.
Looking on a Windows DC, dnscmd /enumzones lists dot as a zone and
dnscmd /enumrecords . returns the root servers (as well as ..RootHints
it seems). None of this is our choice of convention unfortunately, but
it should be fairly simple to make the client tools have aliases for these.
In terms of listing a name during enumeration of zones, the fact Windows
lists . somehow, but I don...
2005 Aug 19
13
Enumerations (again): Comments please
...specification must
contain a :class_name'' if class_name.empty?
class_name = class_name.to_sym
else
class_name = spec.to_sym
spec = { :class_name => class_name }
end
@@enumeration_specs[class_name] = spec
end
end
class EnumRecord < ActiveRecord::Base
@@all = nil
def self.reset
@@all = nil
end
protected
def after_initialize
freeze
end
end
def self.define_if_enumeration(const_id)
spec = @@enumeration_specs[const_id]
return nil unless spec
order...
2017 Jun 07
3
How to update the root hints for bind DLZ
It looks like the original intention in our code was to be able to
add/modify records with the "." zone. Trying it, there seems to be other
issues with using it. I'm not entirely sure if this alias is valid
against Windows or for which calls.
I just hacked a patch (see attached) to see if I could add or modify
another name server.
samba-tool dns add $DC_SERVER . @ NS testing