rails/rails — pull request #13540 by timsly (2013-12-30 15:21:25+00:00)
Title: involve sti_name and find_sti_class in subclass_from_attrs method

This is needed when parent class override `find_sti_class` and `sti_name` methods

```ruby
class Identity < ActiveRecord::Base
self.inheritance_column = :provider

class << self
def find_sti_class(type_name)
ActiveSupport::Dependencies.constantize "Identity::#{type_name.titleize}"
end

def sti_name
name.demodulize.downcase
end
end
end

class Identity::Facebook < Identity
end

class Identity::Twitter < Identity
end
```

Without this fix `Identity.new provider: 'facebook'` raises "ActiveRecord::SubclassNotFound: Invalid single-table inheritance type: facebook is not a subclass of Identity" error