status_quo 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
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
- update_attribute :status, '#{status}'
26
+ (status = '#{status}') and save
28
27
  end
29
28
  )
30
29
  end
@@ -1,3 +1,3 @@
1
1
  module StatusQuo
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/status_quo.rb CHANGED
@@ -4,7 +4,7 @@ require 'rails/generators/migration'
4
4
 
5
5
  class StatusDistance < Rails::Railtie
6
6
 
7
- initializer 'activerecord-postgres-hstore' do
7
+ initializer 'status_quo' do
8
8
  ActiveSupport.on_load :active_record do
9
9
  require "status_quo/status_quo"
10
10
  end
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: 29
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
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-05-13 00:00:00 -03:00
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