merb_datamapper 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +0 -1
- data/Rakefile +1 -1
- data/lib/merb/orms/data_mapper/database.yml.sample +3 -0
- data/lib/merb/session/data_mapper_session.rb +0 -7
- data/lib/merb_datamapper.rb +20 -2
- data/lib/merb_datamapper/version.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- metadata +2 -3
- data/lib/merb/orms/data_mapper/resource.rb +0 -12
data/Manifest.txt
CHANGED
@@ -17,7 +17,6 @@ lib/generators/templates/views/new.html.erb
|
|
17
17
|
lib/generators/templates/views/show.html.erb
|
18
18
|
lib/merb/orms/data_mapper/connection.rb
|
19
19
|
lib/merb/orms/data_mapper/database.yml.sample
|
20
|
-
lib/merb/orms/data_mapper/resource.rb
|
21
20
|
lib/merb/session/data_mapper_session.rb
|
22
21
|
lib/merb_datamapper.rb
|
23
22
|
lib/merb_datamapper/merbtasks.rb
|
data/Rakefile
CHANGED
@@ -45,7 +45,7 @@ end
|
|
45
45
|
desc 'Run specifications'
|
46
46
|
Spec::Rake::SpecTask.new(:spec) do |t|
|
47
47
|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
|
48
|
-
t.spec_files = Pathname.glob(
|
48
|
+
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
|
49
49
|
|
50
50
|
begin
|
51
51
|
t.rcov = ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true
|
data/lib/merb_datamapper.rb
CHANGED
@@ -26,13 +26,31 @@ if defined?(Merb::Plugins)
|
|
26
26
|
require File.dirname(__FILE__) / "merb" / "session" / "data_mapper_session"
|
27
27
|
end
|
28
28
|
|
29
|
-
#
|
30
|
-
|
29
|
+
# take advantage of the fact #id returns the key of the model, unless #id is a property
|
30
|
+
Merb::Router.root_behavior = Merb::Router.root_behavior.identify(DataMapper::Resource => :id)
|
31
31
|
|
32
32
|
Merb.logger.debug "Merb::Orms::DataMapper::Connect complete"
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
class Merb::Orms::DataMapper::Associations < Merb::BootLoader
|
37
|
+
after LoadClasses
|
38
|
+
|
39
|
+
def self.run
|
40
|
+
Merb.logger.debug 'Merb::Orms::DataMapper::Associations block.'
|
41
|
+
|
42
|
+
# make sure all relationships are initialized after loading
|
43
|
+
descendants = DataMapper::Resource.descendants.dup
|
44
|
+
descendants.each do |model|
|
45
|
+
descendants.merge(model.descendants) if model.respond_to?(:descendants)
|
46
|
+
end
|
47
|
+
descendants.each do |model|
|
48
|
+
model.relationships.each_value { |r| r.child_key }
|
49
|
+
end
|
50
|
+
|
51
|
+
Merb.logger.debug 'Merb::Orms::DataMapper::Associations complete'
|
52
|
+
end
|
53
|
+
end
|
36
54
|
|
37
55
|
generators = File.join(File.dirname(__FILE__), 'generators')
|
38
56
|
Merb.add_generators generators / 'data_mapper_model'
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: merb_datamapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Toy
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-10-07 00:00:00 +03:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -93,7 +93,6 @@ files:
|
|
93
93
|
- lib/generators/templates/views/show.html.erb
|
94
94
|
- lib/merb/orms/data_mapper/connection.rb
|
95
95
|
- lib/merb/orms/data_mapper/database.yml.sample
|
96
|
-
- lib/merb/orms/data_mapper/resource.rb
|
97
96
|
- lib/merb/session/data_mapper_session.rb
|
98
97
|
- lib/merb_datamapper.rb
|
99
98
|
- lib/merb_datamapper/merbtasks.rb
|