the_force 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/the_force/rails_support.rb +20 -0
- data/test/unit/test_rails_support.rb +8 -0
- metadata +8 -5
data/Rakefile
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
module TheForce
|
2
|
+
module ActiveRecordSupport
|
3
|
+
module InstanceMethods
|
4
|
+
def collect_column(column_name, conditions = {})
|
5
|
+
collection = []
|
6
|
+
column_name = column_name.to_s
|
7
|
+
|
8
|
+
self.find_each(:select => column_name, :conditions => conditions) do |record|
|
9
|
+
collection << record.attributes[column_name]
|
10
|
+
end
|
11
|
+
|
12
|
+
collection
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
class Object
|
19
|
+
include TheForce::ActiveRecordSupport::InstanceMethods
|
20
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: the_force
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Ziegler
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-02 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- lib/the_force/keep_trying.rb
|
36
36
|
- lib/the_force/memoize.rb
|
37
37
|
- lib/the_force/object_support.rb
|
38
|
+
- lib/the_force/rails_support.rb
|
38
39
|
- lib/the_force/remote_includes.rb
|
39
40
|
- lib/the_force/thread_pool.rb
|
40
41
|
- lib/the_force/timer.rb
|
@@ -43,6 +44,7 @@ files:
|
|
43
44
|
- test/unit/test_keep_trying.rb
|
44
45
|
- test/unit/test_memoize.rb
|
45
46
|
- test/unit/test_object_support.rb
|
47
|
+
- test/unit/test_rails_support.rb
|
46
48
|
has_rdoc: true
|
47
49
|
homepage: http://www.symbolforce.com
|
48
50
|
licenses: []
|
@@ -83,3 +85,4 @@ test_files:
|
|
83
85
|
- test/unit/test_keep_trying.rb
|
84
86
|
- test/unit/test_memoize.rb
|
85
87
|
- test/unit/test_object_support.rb
|
88
|
+
- test/unit/test_rails_support.rb
|