Looking for feedback on a change to ActiveModel

I’d say it’s unnecessary cluttering to the API, and could collide with someone using model_name in any sort of model already out there.

I think you may be overlooking the way to create your “super simple object”, probably one of these two would work quite fine:

Class.new(OpenStruct) do

def self.model_name

@model_name ||= ActiveModel::Name.new(self)

end

def self.name

“User”

end

end

Class.new(OpenStruct) do

def self.name

“User”

end

extend ActiveModel::Naming

end

Also, I don’t see why you couldn’t just create a real class and extend Naming on it, should work just fine :).