bsm-models 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bsm/model/editable.rb +3 -2
- metadata +8 -8
data/lib/bsm/model/editable.rb
CHANGED
@@ -2,7 +2,8 @@ module Bsm::Model::Editable
|
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
4
|
included do
|
5
|
-
validate
|
5
|
+
validate :must_be_editable, :on => :update
|
6
|
+
attr_accessor :force_editable
|
6
7
|
end
|
7
8
|
|
8
9
|
def editable?
|
@@ -10,7 +11,7 @@ module Bsm::Model::Editable
|
|
10
11
|
end
|
11
12
|
|
12
13
|
def immutable?
|
13
|
-
!editable?
|
14
|
+
!force_editable && !editable?
|
14
15
|
end
|
15
16
|
|
16
17
|
protected
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bsm-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-12-
|
12
|
+
date: 2011-12-12 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: abstract
|
16
|
-
requirement: &
|
16
|
+
requirement: &14176240 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *14176240
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activerecord
|
27
|
-
requirement: &
|
27
|
+
requirement: &14171180 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -35,10 +35,10 @@ dependencies:
|
|
35
35
|
version: 3.2.0
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *14171180
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: railties
|
41
|
-
requirement: &
|
41
|
+
requirement: &14162900 !ruby/object:Gem::Requirement
|
42
42
|
none: false
|
43
43
|
requirements:
|
44
44
|
- - ! '>='
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
version: 3.2.0
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
|
-
version_requirements: *
|
52
|
+
version_requirements: *14162900
|
53
53
|
description: ''
|
54
54
|
email: dimitrij@blacksquaremedia.com
|
55
55
|
executables: []
|