bsm_models 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/bsm/model/abstract.rb +8 -3
  2. metadata +88 -42
@@ -4,12 +4,17 @@ module Bsm::Model::Abstract
4
4
  included do
5
5
  validate :must_not_be_abstract
6
6
 
7
+ define_method :must_not_be_abstract do
8
+ errors.add :base, :abstract if abstract_model_instance?
9
+ end
10
+
7
11
  class_eval <<-END_EVAL
8
- def must_not_be_abstract
9
- errors.add :base, :abstract unless self.class < ::#{self.name}
12
+ def abstract_model_instance?
13
+ self.class >= ::#{self.name}
10
14
  end
11
15
  END_EVAL
12
- protected :must_not_be_abstract
16
+
17
+ protected :must_not_be_abstract, :abstract_model_instance?
13
18
  end
14
19
 
15
20
  end
metadata CHANGED
@@ -1,61 +1,93 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: bsm_models
3
- version: !ruby/object:Gem::Version
4
- version: 0.2.6
3
+ version: !ruby/object:Gem::Version
4
+ hash: 25
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 7
10
+ version: 0.2.7
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Dimitrij Denissenko
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-09-23 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2011-09-29 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: abstract
16
- requirement: &21452760 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
22
32
  type: :runtime
23
- prerelease: false
24
- version_requirements: *21452760
25
- - !ruby/object:Gem::Dependency
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
26
35
  name: activerecord
27
- requirement: &21452200 !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
28
38
  none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ hash: 7
43
+ segments:
44
+ - 3
45
+ - 0
46
+ - 0
32
47
  version: 3.0.0
33
48
  - - <=
34
- - !ruby/object:Gem::Version
49
+ - !ruby/object:Gem::Version
50
+ hash: 15
51
+ segments:
52
+ - 3
53
+ - 2
54
+ - 0
35
55
  version: 3.2.0
36
56
  type: :runtime
37
- prerelease: false
38
- version_requirements: *21452200
39
- - !ruby/object:Gem::Dependency
57
+ version_requirements: *id002
58
+ - !ruby/object:Gem::Dependency
40
59
  name: railties
41
- requirement: &21451420 !ruby/object:Gem::Requirement
60
+ prerelease: false
61
+ requirement: &id003 !ruby/object:Gem::Requirement
42
62
  none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ hash: 7
67
+ segments:
68
+ - 3
69
+ - 0
70
+ - 0
46
71
  version: 3.0.0
47
72
  - - <=
48
- - !ruby/object:Gem::Version
73
+ - !ruby/object:Gem::Version
74
+ hash: 15
75
+ segments:
76
+ - 3
77
+ - 2
78
+ - 0
49
79
  version: 3.2.0
50
80
  type: :runtime
51
- prerelease: false
52
- version_requirements: *21451420
53
- description: ''
81
+ version_requirements: *id003
82
+ description: ""
54
83
  email: dimitrij@blacksquaremedia.com
55
84
  executables: []
85
+
56
86
  extensions: []
87
+
57
88
  extra_rdoc_files: []
58
- files:
89
+
90
+ files:
59
91
  - lib/bsm/model/abstract.rb
60
92
  - lib/bsm/model/locale/en.yml
61
93
  - lib/bsm/model/deletable.rb
@@ -65,26 +97,40 @@ files:
65
97
  - lib/bsm_models.rb
66
98
  homepage: https://github.com/bsm/models
67
99
  licenses: []
100
+
68
101
  post_install_message:
69
102
  rdoc_options: []
70
- require_paths:
103
+
104
+ require_paths:
71
105
  - lib
72
- required_ruby_version: !ruby/object:Gem::Requirement
106
+ required_ruby_version: !ruby/object:Gem::Requirement
73
107
  none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ hash: 57
112
+ segments:
113
+ - 1
114
+ - 8
115
+ - 7
77
116
  version: 1.8.7
78
- required_rubygems_version: !ruby/object:Gem::Requirement
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
118
  none: false
80
- requirements:
81
- - - ! '>='
82
- - !ruby/object:Gem::Version
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ hash: 23
123
+ segments:
124
+ - 1
125
+ - 3
126
+ - 6
83
127
  version: 1.3.6
84
128
  requirements: []
129
+
85
130
  rubyforge_project:
86
- rubygems_version: 1.8.10
131
+ rubygems_version: 1.8.5
87
132
  signing_key:
88
133
  specification_version: 3
89
134
  summary: BSM's very custom model extensions
90
135
  test_files: []
136
+