Hello,
i am trying to fix the code for fixtures in rails because it is buggy
and internal variable names are confusing, could somebody please explain
to me what is the intended purpose of Fixture and Fixtures classes
respectively?

For example, why do we need both `Fixtures.initialize`and
`Fixture.initialize`? They both "initialize" a single fixture, and in
fact `Fixture.initialize` does nothing but set up two instance
variables, and it is not called anywhere in fixtures.rb. (Maybe i'll
try to remove it and run tests, to see what happens.)

I am also considering to propose changing some fixtures API, like to
make the (undocumented?) class attribute
`TestFixtures::fixture_table_names` to hold a Hash of `"fixture_name" =>
:table_name`, similarly to `TestFixtures::fixture_class_names` holding
the Hash of `"fixture_name" => FixtureModelClass` (i would also propose
to rename). Currently `TestFixtures::fixture_table_names` holds an
Array. I am also trying to fix the meaning of `fixture_name`, which
before was sometimes used interchangeably with `table_name`: i want it
to be in the form `"admin/users"` instead of `:admin_users`, like the
form in which `fixtures` method accepts them.

So before making changes, i would like to understand what the classes
Fixtures, Fixture, TestFixtures, are exactly supposed to do, and why to
have so many. What is `Fixture.initialize` for?

Alexey.

--
Posted via http://www.ruby-forum.com/.

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

Search Discussions

  • Alexey Muranov at Dec 27, 2011 at 10:14 am
    I've figured out that `Fixture` is for a single row.

    --
    Posted via http://www.ruby-forum.com/.

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedDec 25, '11 at 12:24p
activeDec 27, '11 at 10:14a
posts2
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Alexey Muranov: 2 posts

People

Translate

site design / logo © 2021 Grokbase