lib/referehencible.rb in referehencible-0.2.0 vs lib/referehencible.rb in referehencible-0.3.0

- old
+ new

@@ -27,11 +27,11 @@ end private define_method(:generate_guid) do |reference_attribute| - read_attribute(reference_attribute) || write_attribute(reference_attribute, SecureRandom.hex(16)) + read_attribute(reference_attribute) || write_attribute(reference_attribute, Referehencible.reference_number) end define_singleton_method(:unknown_reference_object) do return new unless respond_to?(:as_null_object) @@ -40,7 +40,11 @@ end end def self.included(base) base.extend ClassMethods + end + + def self.reference_number + SecureRandom.hex(16) end end