mongo_record 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/mongo_record/base.rb +5 -6
- data/mongo-activerecord-ruby.gemspec +4 -4
- metadata +5 -5
data/README.rdoc
CHANGED
@@ -42,7 +42,7 @@ Then install
|
|
42
42
|
|
43
43
|
$ gem install mongo_record
|
44
44
|
|
45
|
-
MongoRecord depends on the Mongo Ruby Driver, version 0.15 or higher.
|
45
|
+
MongoRecord depends on the Mongo Ruby Driver, version 0.15.1 or higher.
|
46
46
|
Installing the MongoRecord gem will also install the Mongo Ruby Driver if you
|
47
47
|
don't have it already.
|
48
48
|
|
data/lib/mongo_record/base.rb
CHANGED
@@ -22,7 +22,7 @@ require 'mongo_record/sql'
|
|
22
22
|
class String
|
23
23
|
# Convert this String to an ObjectID.
|
24
24
|
def to_oid
|
25
|
-
Mongo::ObjectID.legal?(self) ?
|
25
|
+
Mongo::ObjectID.legal?(self) ? Mongo::ObjectID.from_string(self) : self
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -703,20 +703,19 @@ module MongoRecord
|
|
703
703
|
sort_by = []
|
704
704
|
case option
|
705
705
|
when Symbol # Single value
|
706
|
-
sort_by <<
|
706
|
+
sort_by << [option.to_s, 1]
|
707
707
|
when String
|
708
|
-
# TODO order these by building an array of hashes
|
709
708
|
fields = option.split(',')
|
710
709
|
fields.each {|f|
|
711
710
|
name, order = f.split
|
712
711
|
order ||= 'asc'
|
713
|
-
sort_by <<
|
712
|
+
sort_by << [name.to_s, sort_value_from_arg(order)]
|
714
713
|
}
|
715
714
|
when Array # Array of field names; assume ascending sort
|
716
715
|
# TODO order these by building an array of hashes
|
717
|
-
sort_by = option.collect {|o|
|
716
|
+
sort_by = option.collect {|o| [o.to_s, 1]}
|
718
717
|
else # Hash (order of sorts is not guaranteed)
|
719
|
-
sort_by = option.collect {|k, v|
|
718
|
+
sort_by = option.collect {|k, v| [k.to_s, sort_value_from_arg(v)]}
|
720
719
|
end
|
721
720
|
return nil unless sort_by.length > 0
|
722
721
|
sort_by
|
@@ -1,11 +1,11 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'mongo_record'
|
3
|
-
s.version = '0.4.
|
3
|
+
s.version = '0.4.3'
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
|
-
s.summary = 'ActiveRecord-like models for the
|
6
|
-
s.description = 'MongoRecord is an ActiveRecord-like framework for
|
5
|
+
s.summary = 'ActiveRecord-like models for the MongoDB'
|
6
|
+
s.description = 'MongoRecord is an ActiveRecord-like framework for MongoDB. For more information about Mongo, see http://www.mongodb.org.'
|
7
7
|
|
8
|
-
s.add_dependency('mongo', ['>= 0.15'])
|
8
|
+
s.add_dependency('mongo', ['>= 0.15.1'])
|
9
9
|
|
10
10
|
s.require_paths = ['lib']
|
11
11
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Menard
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-10-
|
13
|
+
date: 2009-10-08 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -21,9 +21,9 @@ dependencies:
|
|
21
21
|
requirements:
|
22
22
|
- - ">="
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version:
|
24
|
+
version: 0.15.1
|
25
25
|
version:
|
26
|
-
description: MongoRecord is an ActiveRecord-like framework for
|
26
|
+
description: MongoRecord is an ActiveRecord-like framework for MongoDB. For more information about Mongo, see http://www.mongodb.org.
|
27
27
|
email: mongodb-user@googlegroups.com
|
28
28
|
executables: []
|
29
29
|
|
@@ -72,7 +72,7 @@ rubyforge_project:
|
|
72
72
|
rubygems_version: 1.3.5
|
73
73
|
signing_key:
|
74
74
|
specification_version: 3
|
75
|
-
summary: ActiveRecord-like models for the
|
75
|
+
summary: ActiveRecord-like models for the MongoDB
|
76
76
|
test_files:
|
77
77
|
- tests/address.rb
|
78
78
|
- tests/course.rb
|