1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

moving controller_name assignment before model name condition

This commit is contained in:
anilmaurya 2014-01-20 14:37:53 +05:30 committed by Rafael Mendonça França
parent bf191318af
commit 41722dd444

View file

@ -15,12 +15,10 @@ module Rails
# Set controller variables on initialization.
def initialize(*args) #:nodoc:
super
if options[:model_name]
controller_name = name
if options[:model_name]
self.name = options[:model_name]
assign_names!(self.name)
else
controller_name = name
end
if name == name.pluralize && name.singularize != name.pluralize && !options[:force_plural]