Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

create permalink in before_validation callback

git-svn-id: http://svn.techno-weenie.net/projects/plugins/permalink_fu@2728 567b1171-46fb-0310-a4c9-b4bef9110e78
  • Loading branch information...
commit dbf223dec56df4cdde950b42ec7daba956077fdd 1 parent ed3e711
technoweenie authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/permalink_fu.rb
View
2  lib/permalink_fu.rb
@@ -16,7 +16,7 @@ def escape(str)
def has_permalink(attr_name, permalink_field = nil)
permalink_field ||= 'permalink'
- after_validation { |record| record.send("#{permalink_field}=", PermalinkFu.escape(record.send(attr_name).to_s)) if record.send(permalink_field).to_s.empty? }
+ before_validation { |record| record.send("#{permalink_field}=", PermalinkFu.escape(record.send(attr_name).to_s)) if record.send(permalink_field).to_s.empty? }
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.