lib/mls/models/listing.rb in mls-0.2.28 vs lib/mls/models/listing.rb in mls-0.2.29
- old
+ new
@@ -167,10 +167,10 @@
def to_hash
hash = super
hash[:address_attributes] = address.to_hash if address
hash[:agents_attributes] = agents.inject([]) { |acc, x| acc << x.to_hash; acc } if agents
hash[:photo_ids] = photos.map(&:id) if photos
- hash[:videos_attributes] = videos.map(&:to_hash) if videos
+ hash[:videos_attributes] = videos.map(&:to_hash) unless videos.blank?
hash
end
def to_param
"#{address.to_param}/#{id}"