random_record 0.0.1 → 0.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/README.rdoc +23 -0
- data/lib/random_record/version.rb +1 -1
- metadata +4 -5
data/README.rdoc
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
= Random Record
|
2
|
+
|
3
|
+
Random Record is a add on for ActiveRecord to give models the abilities to access random records
|
4
|
+
|
5
|
+
== Getting Started
|
6
|
+
|
7
|
+
Random Record is released as a Ruby Gem. The gem is to be installed within a Ruby
|
8
|
+
on Rails 3 application. To install, simply add the following to your Gemfile:
|
9
|
+
|
10
|
+
# Gemfile
|
11
|
+
gem 'random_record'
|
12
|
+
|
13
|
+
After updating your bundle, you can use Random function within any ActiveRecord inherited model
|
14
|
+
|
15
|
+
# app/controllers/users_controller.rb
|
16
|
+
|
17
|
+
def index
|
18
|
+
@users = User.random(5)
|
19
|
+
end
|
20
|
+
|
21
|
+
def show
|
22
|
+
@user = User.random
|
23
|
+
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: random_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Rahul Trikha
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
14
|
-
default_executable:
|
13
|
+
date: 2011-06-02 00:00:00 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: activerecord
|
@@ -36,11 +35,11 @@ extra_rdoc_files: []
|
|
36
35
|
files:
|
37
36
|
- .gitignore
|
38
37
|
- Gemfile
|
38
|
+
- README.rdoc
|
39
39
|
- Rakefile
|
40
40
|
- lib/random_record.rb
|
41
41
|
- lib/random_record/version.rb
|
42
42
|
- random_record.gemspec
|
43
|
-
has_rdoc: true
|
44
43
|
homepage: https://github.com/rahult/random_record
|
45
44
|
licenses: []
|
46
45
|
|
@@ -64,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
63
|
requirements: []
|
65
64
|
|
66
65
|
rubyforge_project: random_record
|
67
|
-
rubygems_version: 1.
|
66
|
+
rubygems_version: 1.8.4
|
68
67
|
signing_key:
|
69
68
|
specification_version: 3
|
70
69
|
summary: Random record for ActiveRecord Models
|