lib/restpack_serializer/serializable.rb in restpack_serializer-0.5.5 vs lib/restpack_serializer/serializable.rb in restpack_serializer-0.5.6

- old
+ new

@@ -87,11 +87,11 @@ def include_attribute?(name) self.send("include_#{name}?".to_sym) end module ClassMethods - attr_accessor :model_class, :key + attr_accessor :model_class, :href_prefix, :key def array_as_json(models, context = {}) new.as_json(models, context) end @@ -107,9 +107,13 @@ } end def model_class @model_class || self.name.chomp('Serializer').constantize + end + + def href_prefix + @href_prefix || RestPack::Serializer.config.href_prefix end def key (@key || self.model_class.send(:table_name)).to_sym end