lib/jaysus/base.rb in jaysus-0.1.3 vs lib/jaysus/base.rb in jaysus-0.1.4
- old
+ new
@@ -126,11 +126,11 @@
set_attributes(set_attrs)
end
def attributes
out = {}
- self.class.model_base.attributes.each do |attribute|
+ (self.class.model_base.attributes + self.class.attributes).each do |attribute|
out[attribute.to_s] = send(attribute)
end
out
end
@@ -171,10 +171,10 @@
end
def to_json
{}.tap do |outer_hash|
outer_hash[self.class.store_file_dir_name.singularize] = {}.tap do |inner_hash|
- self.class.model_base.attributes.each do |attribute|
+ (self.class.model_base.attributes + self.class.attributes).each do |attribute|
if self.send(attribute).present?
inner_hash[attribute] = self.send(attribute)
end
end
end
\ No newline at end of file