lib/dynamoid/document.rb in dynamoid-0.0.6 vs lib/dynamoid/document.rb in dynamoid-0.0.7
- old
+ new
@@ -6,16 +6,19 @@
module Document
extend ActiveSupport::Concern
include Dynamoid::Components
attr_accessor :new_record
- alias :persisted? :new_record
alias :new_record? :new_record
def initialize(attrs = {})
@new_record = true
@attributes ||= {}
self.class.attributes.each {|att| write_attribute(att, attrs[att])}
+ end
+
+ def persisted?
+ !new_record?
end
def ==(other)
other.respond_to?(:id) && other.id == self.id
end
\ No newline at end of file