Francesco,
This technique:
class Student < User
def self.model_name
superclass.model_name
end
end
seems to work rather well in general or the use-case you described:
generating URLs for subclass instances as though they were baseclass
instances.
On Thursday, October 10, 2013 10:35:29 AM UTC-4, Francesco Boffa wrote:
>
> Il giorno mercoledì 9 ottobre 2013 13:54:43 UTC+2, Tejas Dinkar ha scritto:
>
>> class Student
>> def self.model_name
>> ActiveModel::Name.new(User) # or superclass.model_name if you are
>> feeling clever
>> end
>> end
>>
>
> Does this have any side effect? If not it makes my proposal totally
> unuseful.
>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.