status_quo 0.0.1 → 0.0.3
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 +30 -0
- data/lib/status_quo/status_quo.rb +1 -2
- data/lib/status_quo/version.rb +1 -1
- data/lib/status_quo.rb +1 -1
- metadata +5 -4
data/README
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
StatusQuo
|
3
|
+
|
4
|
+
The f*cking simple status management solution
|
5
|
+
|
6
|
+
Usage:
|
7
|
+
status :foo, :bar, :baz
|
8
|
+
|
9
|
+
Ok! Now you got...
|
10
|
+
scopes:
|
11
|
+
Klass.foo, Klass.bar & Klass.baz
|
12
|
+
booleans:
|
13
|
+
inst.foo?, inst.bar? & inst.baz?
|
14
|
+
bangs:
|
15
|
+
inst.foo!, inst.bar! & inst.baz!
|
16
|
+
|
17
|
+
Too abstract? Too nilbie? Read this:
|
18
|
+
|
19
|
+
rails g model User name:string status:string
|
20
|
+
|
21
|
+
class User < ActiveRecord::Base
|
22
|
+
status :pending, :approved
|
23
|
+
end
|
24
|
+
|
25
|
+
User.pending # returns all pending users
|
26
|
+
User.approved # returns all pending users
|
27
|
+
|
28
|
+
User.find(1).pending? # returns if the user is pending
|
29
|
+
|
30
|
+
User.find(2).approved! # approves the user
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
# StatusQuo
|
3
2
|
#
|
4
3
|
# The f*cking simple status management solution
|
@@ -24,7 +23,7 @@ module StatusQuo
|
|
24
23
|
self.status == '#{status}'
|
25
24
|
end
|
26
25
|
def #{status}!
|
27
|
-
|
26
|
+
(status = '#{status}') and save
|
28
27
|
end
|
29
28
|
)
|
30
29
|
end
|
data/lib/status_quo/version.rb
CHANGED
data/lib/status_quo.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: status_quo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Juan Maiz
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-19 00:00:00 -03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -31,6 +31,7 @@ extra_rdoc_files: []
|
|
31
31
|
files:
|
32
32
|
- .gitignore
|
33
33
|
- Gemfile
|
34
|
+
- README
|
34
35
|
- Rakefile
|
35
36
|
- lib/status_quo.rb
|
36
37
|
- lib/status_quo/status_quo.rb
|