relation_scope 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +3 -0
- data/README.rdoc +6 -7
- data/VERSION +1 -1
- data/lib/relation_scope.rb +1 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
data/README.rdoc
CHANGED
@@ -4,19 +4,18 @@ This plugin just for rails version 2.3.x with named scope module.
|
|
4
4
|
Include name scope methods: where, joins, includes, selects, order, limit, offset, group, having
|
5
5
|
|
6
6
|
|
7
|
-
==
|
8
|
-
|
9
|
-
User.order('created_at DESC').where(:name => 'test').limit(2) ...
|
7
|
+
== Installation
|
10
8
|
|
9
|
+
gem install relation_scope
|
11
10
|
|
12
|
-
== Install
|
13
11
|
|
14
|
-
|
12
|
+
== Usage
|
15
13
|
|
16
|
-
|
14
|
+
User.order('created_at DESC').where(:name => 'test').limit(2)
|
15
|
+
User.joins(:roles).selects('distinct users.*')
|
17
16
|
|
18
17
|
|
19
|
-
==
|
18
|
+
== License
|
20
19
|
|
21
20
|
|
22
21
|
Copyright (c) 2011 [liangwenke8@gmail.com], released under the MIT license
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/lib/relation_scope.rb
CHANGED
@@ -9,7 +9,7 @@ module RelationScope
|
|
9
9
|
}
|
10
10
|
named_scope :joins, lambda { |joins| { :joins => joins } }
|
11
11
|
named_scope :includes, lambda { |includes| { :include => includes } }
|
12
|
-
named_scope :selects,
|
12
|
+
named_scope :selects, lambda { |select| { :select => select } }
|
13
13
|
named_scope :order, lambda { |order| { :order => order } }
|
14
14
|
named_scope :limit, lambda { |limit| { :limit => limit } }
|
15
15
|
named_scope :offset, lambda { |offset| { :offset => offset } }
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: relation_scope
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- LiangWenKe
|
@@ -14,7 +14,7 @@ date: 2011-03-23 00:00:00 +08:00
|
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|
17
|
-
description: This gem
|
17
|
+
description: This gem support some very nice named scope methods as rails 3 activerecord relation.
|
18
18
|
email: liangwenke8@gmail.com
|
19
19
|
executables: []
|
20
20
|
|
@@ -58,6 +58,6 @@ rubyforge_project: relation_scope
|
|
58
58
|
rubygems_version: 1.6.2
|
59
59
|
signing_key:
|
60
60
|
specification_version: 3
|
61
|
-
summary:
|
61
|
+
summary: Support very nice named scope methods for rails 2.2.x, 2.3.x
|
62
62
|
test_files: []
|
63
63
|
|