lib/medea/jasonlistproperty.rb in medea-0.6.8 vs lib/medea/jasonlistproperty.rb in medea-0.6.9

- old
+ new

@@ -80,10 +80,10 @@ @state = :prefetch end def remove! member, cascade=false - raise RuntimeError, "You can only remove an item if you are accessing this list from an object." unless @parent.is_a? JasonObject + raise RuntimeError, "You can only remove an item if you are accessing this list from an object (ie, not another list)." unless @parent.is_a? JasonObject raise ArgumentError, "You can only remove #{@type.name} items from this collection!" unless member.is_a? @type raise ArgumentError, "This item (#{member.jason_key}) doesn't exist in the list you're trying to remove it from!" unless self.include? member if @list_type == :value member.jason_parent = nil \ No newline at end of file