lockdown 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +3 -0
- data/lib/lockdown/system.rb +2 -8
- data/lib/lockdown/version.rb +1 -1
- data/lib/lockdown/view.rb +3 -3
- metadata +1 -1
data/History.txt
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
== 0.4.6 2008-05-08
|
2
|
+
* Fixed: link_to destroy/show conditionals were in wrong order and therefore not working.
|
3
|
+
|
1
4
|
== 0.4.5 2008-05-08
|
2
5
|
* Rubyforge having an issue with the gem, I'm getting 404 errors trying to install 0.4.4 so I'm deploying a new version. no code changes.
|
3
6
|
|
data/lib/lockdown/system.rb
CHANGED
@@ -317,7 +317,6 @@ module Lockdown
|
|
317
317
|
# We'll see how it works...
|
318
318
|
#
|
319
319
|
def sync_with_db
|
320
|
-
return unless database_configured?
|
321
320
|
# Create permissions not found in the database
|
322
321
|
get_permissions.each do |key|
|
323
322
|
next if permission_assigned_automatically?(key)
|
@@ -359,13 +358,8 @@ module Lockdown
|
|
359
358
|
end
|
360
359
|
end
|
361
360
|
end
|
362
|
-
|
363
|
-
|
364
|
-
def database_configured?
|
365
|
-
return unless const_defined?("Permission") && const_defined?("UserGroup")
|
366
|
-
|
367
|
-
Lockdown.database_table_exists?(Permission) &&
|
368
|
-
Lockdown.database_table_exists?(UserGroup)
|
361
|
+
rescue Exception => e
|
362
|
+
puts ">> Lockdown sync failed: #{e}"
|
369
363
|
end
|
370
364
|
end # class block
|
371
365
|
end # System class
|
data/lib/lockdown/version.rb
CHANGED
data/lib/lockdown/view.rb
CHANGED
@@ -63,10 +63,10 @@ module Lockdown
|
|
63
63
|
private
|
64
64
|
|
65
65
|
def test_path(url, html_options)
|
66
|
-
if
|
67
|
-
url += "/show"
|
68
|
-
elsif html_options.is_a?(Hash) && html_options[:method] == :delete
|
66
|
+
if html_options.is_a?(Hash) && html_options[:method] == :delete
|
69
67
|
url += "/destroy"
|
68
|
+
elsif url.split("/").last =~ /\A\d+\z/
|
69
|
+
url += "/show"
|
70
70
|
end
|
71
71
|
url
|
72
72
|
end
|