[katello-devel] update to lazy_accessor

Tom McKay thomasmckay at redhat.com
Wed Jan 4 14:35:15 UTC 2012


With the assistance of Justin and Partha, I changed several methods in LazyAccessor:

prepopulate now calls self.lazy_attributes instead of self.class.lazy_attributes
lazy_attributes now calls superclass.lazy_attributes, if it exists

The result is that classes like MarketingProduct, which extends Product, properly get their lazy_accessors defined correctly.


    def lazy_attributes
      attrs = (self.class.superclass.respond_to? :lazy_attributes) ? self.class.superclass.lazy_attributes : []
      attrs += (self.class.lazy_attributes || [])
      attrs.uniq
    end




More information about the katello-devel mailing list