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:
parent
67f2074c81
commit
34a64070ca
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue