<issue_start><issue_comment>Title: Overriding a module method with an association (e.g, has_many) method
username_0: The **_why_** behind what I'm trying to do:

I'm trying to create a module that can be included into any class in order to add additional capabilities to an instance of that class, as usual.
However, the difference is that the new methods added in this module **depend** on the existence of a specific **association** (e.g, `has_many`).

Because I don't want the code to look like magic to other people, I specifically `raise` inside the **module** if the association doesn't exist.

### Steps to reproduce

Here's a reproduction script

https://gist.github.com/username_0/f83dcd9c0d48ec449dd9b4884d8b5d07

### Expected behavior

`model.other_models` should return a relation

### Actual behavior

`model.other_models` raises exception.

### System configuration
**Rails version**: `4.2.5`

**Ruby version**: `2.2.0`

## Notes

I know that there's a way to overcome this, by executing `reflect_on_all_associations(:has_many).find { |assoc| assoc.name == :other_models }` _before_ executing the method inside the module, or in a `included` block or, for example, making the `other_models` method like so:

```ruby
def other_models
  return super if defined? super
  raise
end
```

I'm just wondering if this should be the expected behaviour? I don't know very much about the internals of rails, but I do know that methods like `has_many` are dynamically generated. 

Is there a way to make this work as intended? That is, is there a way to make an association method _override_  a method in an included module?

Thanks!<issue_closed>
<issue_comment>username_1: Please use the mailing list or StackOverflow for questions/help, where a wider community will be able to help you. We reserve the issues tracker for issues only.