merb_activerecord 0.9.13 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -3,7 +3,6 @@ require 'rake/gempackagetask'
3
3
  require "extlib"
4
4
  require 'merb-core/tasks/merb_rake_helper'
5
5
  require "spec/rake/spectask"
6
- require "#{File.dirname(__FILE__)}" / ".." / "version"
7
6
 
8
7
  ##############################################################################
9
8
  # Package && release
@@ -18,7 +17,7 @@ GEM_EMAIL = "canadaduane@gmail.com"
18
17
 
19
18
  GEM_NAME = "merb_activerecord"
20
19
  PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
21
- GEM_VERSION = (Merb::MORE_VERSION rescue "0.9.9") + PKG_BUILD
20
+ GEM_VERSION = ("1.0.0") + PKG_BUILD
22
21
 
23
22
  RELEASE_NAME = "REL #{GEM_VERSION}"
24
23
 
@@ -55,10 +55,10 @@ class <%= class_name %> < Application
55
55
  @<%= singular_model %> = <%= model_class_name %>.find_by_id(params[:id])
56
56
  raise NotFound unless @<%= singular_model %>
57
57
  if @<%= singular_model %>.destroy
58
- redirect url(:<%= (modules.collect{|m| m.downcase} << singular_model).join("_") %>s)
58
+ redirect url(:<%= (modules.collect{|m| m.downcase} << plural_model).join("_") %>)
59
59
  else
60
60
  raise BadRequest
61
61
  end
62
62
  end
63
63
 
64
- end
64
+ end
@@ -0,0 +1,6 @@
1
+ # This is the default behavior for ActiveRecord when used
2
+ # in conjunction with ActionPack's request handling cycle.
3
+ # TODO write test
4
+ Merb::Controller.after do
5
+ ActiveRecord::Base.clear_active_connections!
6
+ end
@@ -60,7 +60,6 @@ module Merb
60
60
 
61
61
  Thread.new{ loop{ sleep(60*60); ::ActiveRecord::Base.verify_active_connections! } }
62
62
 
63
- ::ActiveRecord::Base.verification_timeout = 14400
64
63
  ::ActiveRecord::Base.logger = Merb.logger
65
64
  ::ActiveRecord::Base.configurations = configurations
66
65
  ::ActiveRecord::Base.establish_connection config
@@ -2,11 +2,11 @@ if defined?(Merb::Plugins)
2
2
 
3
3
  dependency "activerecord"
4
4
 
5
+ require File.join(File.dirname(__FILE__) / "merb" / "orms" / "active_record" / "cleanup" )
5
6
  require File.join(File.dirname(__FILE__) / "merb" / "orms" / "active_record" / "connection")
6
7
  Merb::Plugins.add_rakefiles(File.join(File.dirname(__FILE__) / "active_record" / "merbtasks"))
7
8
 
8
9
  class Merb::Orms::ActiveRecord::Connect < Merb::BootLoader
9
-
10
10
  after BeforeAppLoads
11
11
 
12
12
  def self.run
@@ -22,6 +22,16 @@ if defined?(Merb::Plugins)
22
22
 
23
23
  end
24
24
 
25
+ class Merb::Orms::ActiveRecord::DisconnectBeforeFork < Merb::BootLoader
26
+ after AfterAppLoads
27
+
28
+ def self.run
29
+ Merb.logger.debug "Disconnecting database connection before forking."
30
+ ::ActiveRecord::Base.connection.disconnect!
31
+ end
32
+
33
+ end
34
+
25
35
  generators = File.join(File.dirname(__FILE__), 'generators')
26
36
  Merb.add_generators generators / :migration
27
37
  Merb.add_generators generators / :model
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merb_activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.13
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Duane Johnson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-03 00:00:00 -08:00
12
+ date: 2009-01-26 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -71,6 +71,7 @@ files:
71
71
  - lib/merb
72
72
  - lib/merb/orms
73
73
  - lib/merb/orms/active_record
74
+ - lib/merb/orms/active_record/cleanup.rb
74
75
  - lib/merb/orms/active_record/connection.rb
75
76
  - lib/merb/orms/active_record/database.yml.sample
76
77
  - lib/merb/session