pipa-statelogic 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/Rakefile +1 -1
- data/lib/statelogic/activerecord.rb +1 -3
- metadata +4 -2
data/CHANGELOG
ADDED
data/Rakefile
CHANGED
@@ -15,7 +15,7 @@ end
|
|
15
15
|
|
16
16
|
desc 'Generate documentation for Statelogic.'
|
17
17
|
Rake::RDocTask.new(:rdoc) do |rdoc|
|
18
|
-
files =['README.rdoc', 'MIT-LICENSE', 'lib/**/*.rb']
|
18
|
+
files =['README.rdoc', 'CHANGELOG', 'MIT-LICENSE', 'lib/**/*.rb']
|
19
19
|
rdoc.rdoc_files.add(files)
|
20
20
|
rdoc.main = "README.rdoc" # page to start on
|
21
21
|
rdoc.title = "Statelogic Documentation"
|
@@ -10,8 +10,6 @@ module Statelogic
|
|
10
10
|
DEFAULT_OPTIONS = {:attribute => :state}.freeze
|
11
11
|
|
12
12
|
class StateScopeHelper
|
13
|
-
CALLBACKS = (::ActiveRecord::Callbacks::CALLBACKS +
|
14
|
-
::ActiveRecord::Validations::VALIDATIONS).map(&:to_sym).to_set.freeze
|
15
13
|
MACROS_PATTERN = /\Avalidates_/.freeze
|
16
14
|
|
17
15
|
def initialize(cl, state, config)
|
@@ -30,7 +28,7 @@ module Statelogic
|
|
30
28
|
alias transitions_to validates_transition_to
|
31
29
|
|
32
30
|
def method_missing(method, *args, &block)
|
33
|
-
if
|
31
|
+
if method.to_s =~ MACROS_PATTERN || @class.respond_to?("#{method}_callback_chain")
|
34
32
|
options = args.last
|
35
33
|
args.push(options = {}) unless options.is_a?(Hash)
|
36
34
|
options[:if] = Array(options[:if]).unshift(:"#{@state}?")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pipa-statelogic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Gunko
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-01-
|
12
|
+
date: 2009-01-10 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -29,9 +29,11 @@ extensions: []
|
|
29
29
|
|
30
30
|
extra_rdoc_files:
|
31
31
|
- README.rdoc
|
32
|
+
- CHANGELOG
|
32
33
|
- MIT-LICENSE
|
33
34
|
files:
|
34
35
|
- README.rdoc
|
36
|
+
- CHANGELOG
|
35
37
|
- MIT-LICENSE
|
36
38
|
- Rakefile
|
37
39
|
- lib/statelogic.rb
|