merb_datamapper 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rake/gempackagetask'
3
3
 
4
4
  PLUGIN = "merb_datamapper"
5
5
  NAME = "merb_datamapper"
6
- VERSION = "0.4.3"
6
+ VERSION = "0.4.4"
7
7
  AUTHOR = "Jason Toy"
8
8
  EMAIL = "jtoy@rubynow.com"
9
9
  HOMEPAGE = "http://merbivore.com"
@@ -10,7 +10,7 @@ class <%= class_name %> < Application
10
10
 
11
11
  def show(id)
12
12
  @<%= ivar %> = <%= klass %>[id]
13
- raise BadRequest unless @<%= ivar %>
13
+ raise NotFound unless @<%= ivar %>
14
14
  render @<%= ivar %>
15
15
  end
16
16
 
@@ -32,13 +32,13 @@ class <%= class_name %> < Application
32
32
  def edit(id)
33
33
  only_provides :html
34
34
  @<%= ivar %> = <%= klass %>[id]
35
- raise BadRequest unless @<%= ivar %>
35
+ raise NotFound unless @<%= ivar %>
36
36
  render
37
37
  end
38
38
 
39
39
  def update(id, <%= ivar %>)
40
40
  @<%= ivar %> = <%= klass %>[id]
41
- raise BadRequest unless @<%= ivar %>
41
+ raise NotFound unless @<%= ivar %>
42
42
  if @<%= ivar %>.update_attributes(<%= ivar %>)
43
43
  redirect url(:<%= ivar %>, @<%= ivar %>)
44
44
  else
@@ -48,7 +48,7 @@ class <%= class_name %> < Application
48
48
 
49
49
  def destroy(id)
50
50
  @<%= ivar %> = <%= klass %>[id]
51
- raise BadRequest unless @<%= ivar %>
51
+ raise NotFound unless @<%= ivar %>
52
52
  if @<%= ivar %>.destroy!
53
53
  redirect url(:<%= ivar.pluralize %>)
54
54
  else
@@ -5,15 +5,15 @@ module Merb
5
5
  def setup_session
6
6
  MERB_LOGGER.info("Setting up session")
7
7
  before = cookies[_session_id_key]
8
- @_session, cookies[_session_id_key] = Merb::DataMapperSession.persist(cookies[_session_id_key])
9
- @_fingerprint = Marshal.dump(@_session.data).hash
8
+ request.session, cookies[_session_id_key] = Merb::DataMapperSession.persist(cookies[_session_id_key])
9
+ @_fingerprint = Marshal.dump(request.session.data).hash
10
10
  @_new_cookie = cookies[_session_id_key] != before
11
11
  end
12
12
 
13
13
  def finalize_session
14
14
  MERB_LOGGER.info("Finalize session")
15
- @_session.save if @_fingerprint != Marshal.dump(@_session.data).hash
16
- set_cookie(_session_id_key, @_session.session_id, _session_expiry) if (@_new_cookie || @_session.needs_new_cookie)
15
+ request.session.save if @_fingerprint != Marshal.dump(request.session.data).hash
16
+ set_cookie(_session_id_key, request.session.session_id, _session_expiry) if (@_new_cookie || request.session.needs_new_cookie)
17
17
  end
18
18
  end
19
19
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: merb_datamapper
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.4.3
7
- date: 2007-11-08 00:00:00 -06:00
6
+ version: 0.4.4
7
+ date: 2007-11-12 00:00:00 -06:00
8
8
  summary: Merb plugin that provides DataMapper support for Merb
9
9
  require_paths:
10
10
  - lib