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

5 commits

Author SHA1 Message Date
Ryuta Kamizono
307d50292d Should not fail if mangling enum names collision
Just skip defining mangling enum methods in that case.

Fixes #40804.
2021-01-01 15:03:15 +09:00
Sammy Larbi
f43f56e16e Ensure HABTM relationships produce valid class names (Fixes #17119) 2014-11-09 11:56:07 -06:00
Godfrey Chan
41554319f8 Fixed STI classes not defining an attribute method if there is a
conflicting private method defined on its ancestors.

The problem is that `method_defined_within?(name, klass, superklass)`
only works correclty when `klass` and `superklass` are both `Class`es.

If both `klass` and `superklass` are both `Class`es, they share the
same inheritance chain, so if a method is defined on `klass` but not
`superklass`, this method must be introduced at some point between
`klass` and `superklass`.

This does not work when `superklass` is a `Module`. A `Module`'s
inheritance chain contains just itself. So if a method is defined on
`klass` but not on `superklass`, the method could still be defined
somewhere upstream, e.g. in `Object`.

This fix works by avoiding calling `method_defined_within?` with a
module while still fufilling the requirement (checking that the
method is defined withing `superclass` but not is not a generated
attribute method).

4d8ee288 is likely an attempted partial fix for this problem. This
unrolls that fix and properly check the `superclass` as intended.

Fixes #11569.
2014-02-23 11:00:55 -08:00
David Heinemeier Hansson
2bf223051e Added compatibility with camelCase column names for dynamic finders #533 [Dee.Zsombor]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1263 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-30 15:49:28 +00:00
David Heinemeier Hansson
0f4cba7b86 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@388 5ecf4fe2-1ee6-0310-87b1-e25e094e27de 2005-01-11 00:53:04 +00:00