1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Cached the class_path and changed a variable name (kudos to @britto!)

This commit is contained in:
Rodrigo Flores 2012-05-02 14:49:33 -03:00
parent 67f2074c81
commit 34a64070ca

View file

@ -27,10 +27,12 @@ module ActiveRecord
attr_accessible :email, :password, :password_confirmation, :remember_me
CONTENT
indent_size = class_name.to_s.split("::").size - 1
content = content.split("\n").map { |line| " " * indent_size + line}.join("\n")
class_path = class_name.to_s.split("::")
inject_into_class(model_path, class_name.to_s.split("::").last, content) if model_exists?
indent_depth = class_path.size - 1
content = content.split("\n").map { |line| " " * indent_depth + line } .join("\n")
inject_into_class(model_path, class_path.last, content) if model_exists?
end
def migration_data