On Dec 28, 1:27 am, Alexey <[email protected]> wrote:
> I am fixing bugs in fixtures.rb, and would like to propose some API
> and internal code changes.
>
> 4. Standardize the fixture name in the form "admin/users" (rather
> than :admin_users) and use it as fixtures's identifier, instead of
> table name?
>
> It seems that originally the idea was to use the table name as the
> unique identifier of the collections of fixtures intended to fill that
> table, but now this seems all messed up, variable names like
> `fixture_name`, `table_name`, `fixture_path` are used with different
> contents and sometimes interchangeably.
> Since the method `fixtures` accept their names in the form `"admin/
> users"`, i propose to use this short path to the fixture file as the
> name and identifier of the collection of fixtures, and use
> `fixture_name` only in this sense.
> The table name should be defined in the associated model, or by a new
> method `set_fixture_tables` analogous to `set_fixture_classes`, and
> only when there is no associated model, or the associated model does
> not respond to `table_name` method and the table name was not set with
> `set_fixture_tables`, should the table name be inferred from fixture
> name by substitution `tr('/','_')`.
>

Just to illustrate what i am talking about, here is a line from
fixtures.rb (around #807):

```
raise StandardError, "No fixture with name '#{fixture}' found for
table '#{fixture_name}'"
```

Alexey.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to