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
@@ -10,7 +10,7 @@ class <%= class_name %> < Application
|
|
10
10
|
|
11
11
|
def show(id)
|
12
12
|
@<%= ivar %> = <%= klass %>[id]
|
13
|
-
raise
|
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
|
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
|
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
|
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
|
-
|
9
|
-
@_fingerprint = Marshal.dump(
|
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
|
-
|
16
|
-
set_cookie(_session_id_key,
|
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.
|
7
|
-
date: 2007-11-
|
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
|