Re: [Rails-core] Rename transactional fixtures to something clearer and more descriptive

2015-03-10 Thread Rafael Mendonça França
Seems good to me.

On Fri, Mar 6, 2015 at 4:04 AM Brandon Weiss 
wrote:

> I think the name "transactional fixtures" is a little misleading and
> confusing, because (as far as I can tell) it doesn't really have anything
> to do with fixtures.
>
> This is pretty embarrassing, but I've been using Rails almost since 1.0
> and I had no idea that transactional fixtures were running on my tests. I
> don't use fixtures so I just erroneously assumed that feature didn't work
> for me. I've been using Database Cleaner unnecessarily for like the last
> four years. I know, it seems ridiculous, but I talked to a few other fairly
> savvy Rails users and they had no idea either. I'm beginning to think my
> misunderstanding is fairly common.
>
> Is there any interest in renaming the feature to something clearer and
> more descriptive, like "transactional tests"? E.g. use_transactional_tests.
> If so, I'd be happy to do the work to deprecate the old name, add the new
> name, and rename/update everything where necessary.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-core+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> Visit this group at http://groups.google.com/group/rubyonrails-core.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails-core] Rename transactional fixtures to something clearer and more descriptive

2015-03-10 Thread Brandon Weiss
Awesome! I made a pull request  
:)

On Tuesday, March 10, 2015 at 11:57:49 AM UTC-7, Rafael Mendonça França 
wrote:
>
> Seems good to me.
>
> On Fri, Mar 6, 2015 at 4:04 AM Brandon Weiss  > wrote:
>
>> I think the name "transactional fixtures" is a little misleading and 
>> confusing, because (as far as I can tell) it doesn't really have anything 
>> to do with fixtures.
>>
>> This is pretty embarrassing, but I've been using Rails almost since 1.0 
>> and I had no idea that transactional fixtures were running on my tests. I 
>> don't use fixtures so I just erroneously assumed that feature didn't work 
>> for me. I've been using Database Cleaner unnecessarily for like the last 
>> four years. I know, it seems ridiculous, but I talked to a few other fairly 
>> savvy Rails users and they had no idea either. I'm beginning to think my 
>> misunderstanding is fairly common.
>>
>> Is there any interest in renaming the feature to something clearer and 
>> more descriptive, like "transactional tests"? E.g. 
>> use_transactional_tests. If so, I'd be happy to do the work to deprecate 
>> the old name, add the new name, and rename/update everything where 
>> necessary.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby on Rails: Core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to rubyonrails-co...@googlegroups.com .
>> To post to this group, send email to rubyonra...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/rubyonrails-core.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails-core] How does ActiveRecord::TestFixtures::ClassMethods#run_in_transaction? work?

2015-03-10 Thread Brandon Weiss
Aha! I hadn't thought to look on `TestCase`. Thanks!

On Sunday, March 8, 2015 at 4:37:15 PM UTC-7, Matt jones wrote:
>
>
> On Mar 6, 2015, at 12:59 AM, Brandon Weiss  > wrote:
>
> Here's the method:
>
> def run_in_transaction?
>   use_transactional_fixtures &&
> !self.class.uses_transaction?(method_name)
> end
>
> I'm super confused. What is `method_name`? And where does it come from? 
> It's not a local variable. I can find two instances of `def method_name` in 
> the repo and neither seem to be related. If I try to call the method 
> directly and `use_transactional_fixtures` is false I get `NameError: 
> undefined local variable or method `method_name'`. How is this working 
> normally?
>
>
> `ActiveRecord::TestFixtures` is mixed into the test case class itself. 
> `method_name` is an alias for the `Test::Unit::TestCase#name` method, which 
> the test harness sets up every time an individual test is started up.
>
> The data maintained by `uses_transaction?` and friends is used to tell the 
> fixture system that a particular test uses transactions internally 
> (after_commit hooks, etc) and therefore *shouldn’t* be wrapped with a 
> transaction. You’d specify this by saying `uses_transaction 
> :name_of_test_that_uses_transactions` in your test case.
>
> —Matt Jones
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.