Compare commits

...

5 Commits

Author SHA1 Message Date
José Valim
04999bdca8 Release v1.4.9 2011-10-20 16:49:26 +02:00
José Valim
3834f36d40 Another attempt to fix the misterious loading helpers bug. 2011-10-18 08:35:19 +02:00
José Valim
c698e44d10 Release v1.4.8. 2011-10-10 14:44:07 +02:00
José Valim
3e1b142392 Update docs and CHANGELOG. 2011-10-10 14:43:52 +02:00
José Valim
49807cf0b7 Try to fix the misterious case where some url helpers are not defined. 2011-10-09 17:14:37 +02:00
4 changed files with 30 additions and 5 deletions

View File

@@ -1,3 +1,16 @@
== 1.4.9
* bug fix
* url helpers were not being set under some circumstances
== 1.4.8
* enhancements
* Add docs for assets pipeline and Heroku
* bug fix
* confirmation_url was not being set under some circumstances
== 1.4.7
* bug fix

View File

@@ -24,17 +24,20 @@ module Devise
end
end
def self.generate_helpers!
mappings = Devise.mappings.values.map(&:used_helpers).flatten.uniq
routes = Devise::URL_HELPERS.slice(*mappings)
def self.generate_helpers!(routes=nil)
routes ||= begin
mappings = Devise.mappings.values.map(&:used_helpers).flatten.uniq
Devise::URL_HELPERS.slice(*mappings)
end
routes.each do |module_name, actions|
[:path, :url].each do |path_or_url|
actions.each do |action|
action = action ? "#{action}_" : ""
method = "#{action}#{module_name}_#{path_or_url}"
class_eval <<-URL_HELPERS, __FILE__, __LINE__ + 1
def #{action}#{module_name}_#{path_or_url}(resource_or_scope, *args)
def #{method}(resource_or_scope, *args)
scope = Devise::Mapping.find_scope!(resource_or_scope)
send("#{action}\#{scope}_#{module_name}_#{path_or_url}", *args)
end
@@ -43,6 +46,8 @@ module Devise
end
end
end
generate_helpers!(Devise::URL_HELPERS)
end
end
end

View File

@@ -1,3 +1,3 @@
module Devise
VERSION = "1.4.7".freeze
VERSION = "1.4.9".freeze
end

View File

@@ -22,4 +22,11 @@ Some setup you must do manually if you haven't yet:
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
4. If you are deploying Rails 3.1 on Heroku, you may want to set:
config.assets.initialize_on_precompile = false
On config/application.rb forcing your application to not access the DB
or load models when precompiling your assets.
===============================================================================