dm-predefined 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.md +4 -0
- data/dm-predefined.gemspec +2 -2
- data/lib/dm-predefined/predefined.rb +1 -3
- data/lib/dm-predefined/version.rb +1 -1
- data/spec/integration/predefined_spec.rb +4 -0
- metadata +3 -3
data/ChangeLog.md
CHANGED
data/dm-predefined.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dm-predefined}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Postmodern"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-04-01}
|
13
13
|
s.description = %q{A DataMapper plugin for adding predefined resources to Models.}
|
14
14
|
s.email = %q{postmodern.mod3@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -81,8 +81,6 @@ module DataMapper
|
|
81
81
|
|
82
82
|
protected
|
83
83
|
|
84
|
-
@@predefined_attributes = {}
|
85
|
-
|
86
84
|
#
|
87
85
|
# All pre-defined resources of the model.
|
88
86
|
#
|
@@ -90,7 +88,7 @@ module DataMapper
|
|
90
88
|
# The Hash of pre-defined resources and their attributes.
|
91
89
|
#
|
92
90
|
def predefined_attributes
|
93
|
-
|
91
|
+
@predefined_attributes ||= {}
|
94
92
|
end
|
95
93
|
|
96
94
|
#
|
@@ -7,6 +7,10 @@ if (HAS_SQLITE3 || HAS_MYSQL || HAS_POSTGRES)
|
|
7
7
|
TestModel.auto_migrate!
|
8
8
|
end
|
9
9
|
|
10
|
+
it "should define the @predefined_attributes instance variable" do
|
11
|
+
TestModel.instance_variables.should include('@predefined_attributes')
|
12
|
+
end
|
13
|
+
|
10
14
|
it "should provide the names of all predefined resources of a Model" do
|
11
15
|
TestModel.predefined_names.should =~ [:test1, :test2]
|
12
16
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 3
|
9
|
+
version: 0.2.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Postmodern
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-04-01 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|