lib/ampere/model.rb in ampere-1.0.0 vs lib/ampere/model.rb in ampere-1.1.0
- old
+ new
@@ -147,14 +147,13 @@
update_attribute(k, v)
end
end
### Class methods
-
module ClassMethods
# Returns an array of all the records that have been stored.
def all
- Ampere.connection.keys("#{to_s.downcase}.*").map{|m| find m}
+ Ampere::Collection.new(self, Ampere.connection.keys("#{to_s.downcase}.*"))
end
# Declares a belongs_to relationship to another model.
def belongs_to(field_name, options = {})
has_one field_name, options