1

I came across a controller in an older set of code (Rails 1.2.3) that had the following in a controller:

class GenericController > ApplicationController
    # filters and such
    model :some_model

Although the name of the model does not match the name of the model, is there any reason to specify this? Or is this something that has disappeared from later versions of Rails?

2 Answers 2

4

This had to do with dependency injection. I don't recall the details.

By now it's just a glorified require, which you don't need because rails auto-requires files for missing constants.

Sign up to request clarification or add additional context in comments.

Comments

1

Yes, that is something that has disappeared in later versions of Rails. There is no need to specify it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.