Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Table::name() #5984

Closed
wants to merge 2 commits into from
Closed

Implement Table::name() #5984

wants to merge 2 commits into from

Conversation

AD7six
Copy link
Member

@AD7six AD7six commented Mar 1, 2015

We don't currently have a means to know the table name, accounting for auto-table instances.

The name of a table is _usually_ the class name. However, for automatic
models it's normally derived from the database table the table object is
pointing at.
@markstory
Copy link
Member

How do you see this being used? Does the table name need to be mutable? It seems like the kind of thing that shouldn't be modified.

@AD7six
Copy link
Member Author

AD7six commented Mar 1, 2015

How do you see this being used?

See the discussion in the translate behavior about alias/'model' usage (if the link doesn't work - expand the outdated-diff).

Does the table name need to be mutable?

I don't think so, though I made it so as a separate commit (which I can rebase out) just in case.

@markstory
Copy link
Member

If name() doesn't need to be mutable right now. I would leave it as immutable until a good use case comes up.

@AD7six
Copy link
Member Author

AD7six commented Mar 1, 2015

Ok, I removed the ability to change name.

@lorenzo
Copy link
Member

lorenzo commented Mar 1, 2015

I'm not convinced of the use case for this, wouldn't the problem for the translate behavior be solved by using the registryAlias instead. Having 3 different names for the same object seems like too much for me

@AD7six
Copy link
Member Author

AD7six commented Mar 1, 2015

After discussing with Jose, not merging this and instead implementing it directly in the translate behavior as it's the only known use case. Having name, alias, registryAlias (and sort of related, source), makes things kind of confusing.

I'm sceptical we won't need this - but if/when it proves necessary, we can simply resurrect this PR.

@AD7six AD7six closed this Mar 1, 2015
@AD7six AD7six deleted the 3.0-table-name branch March 1, 2015 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants