midiskirt 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/midiskirt/version.rb +1 -1
- data/lib/midiskirt.rb +9 -2
- data/test/test_helper.rb +5 -0
- data/test/unit/midiskirt_test.rb +4 -0
- metadata +7 -7
data/lib/midiskirt/version.rb
CHANGED
data/lib/midiskirt.rb
CHANGED
@@ -71,8 +71,15 @@ class Midiskirt
|
|
71
71
|
|
72
72
|
klass.new do |record|
|
73
73
|
attributes.each do |name, value|
|
74
|
-
|
75
|
-
|
74
|
+
# Call proc if value is proc or use copy of existent value if
|
75
|
+
# it can be duplicated
|
76
|
+
value = if value.kind_of?(Proc)
|
77
|
+
value.call(record)
|
78
|
+
else
|
79
|
+
value.duplicable? ? value.dup : value
|
80
|
+
end
|
81
|
+
|
82
|
+
record.send(:"#{name}=", value)
|
76
83
|
end
|
77
84
|
end
|
78
85
|
end
|
data/test/test_helper.rb
CHANGED
@@ -51,6 +51,11 @@ Midiskirt.define :guest, :class => :user do |f|
|
|
51
51
|
f.settings DefaultSettings
|
52
52
|
end
|
53
53
|
|
54
|
+
Midiskirt.define :tenant, :class => :user do |f|
|
55
|
+
f.login "tenant"
|
56
|
+
f.settings { DefaultSettings }
|
57
|
+
end
|
58
|
+
|
54
59
|
Midiskirt.define :unbeatable do |f|
|
55
60
|
f.locked false
|
56
61
|
f.state :enabled
|
data/test/unit/midiskirt_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: midiskirt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ date: 2012-03-20 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
17
|
-
requirement: &
|
17
|
+
requirement: &70299044510760 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 1.0.0
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70299044510760
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rake
|
28
|
-
requirement: &
|
28
|
+
requirement: &70299044509760 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70299044509760
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: activesupport
|
39
|
-
requirement: &
|
39
|
+
requirement: &70299044508940 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
version: '2.2'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *70299044508940
|
48
48
|
description: Test::Unit begot MiniTest; factory_girl begot Miniskirt, Miniskirt begets
|
49
49
|
Midiskirt
|
50
50
|
email:
|