Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Last version is failing #7

Closed
maxguzenski opened this Issue · 4 comments

3 participants

Maximiliano Guzenski Elad Ossadon Michael Grosser
Maximiliano Guzenski
# with test_after_commit 0.0.1 below line create a friendship correctly
# with test_after_commit 0.1.0 it is returning nill

request = friend.friendships.create(friend_id: id, status: 'pending')

I use ruby 2.0, rails 3.2 and rspec last version

Elad Ossadon
elado commented

+1

Took me a bit to understand this gem is my problem... It screws up has_many association creation.

Michael Grosser
Owner

A failing test-case would be very helpful!

Elad Ossadon
elado commented

Sample app:

rails new test_after_commit
cd test_after_commit
echo "gem 'test_after_commit'" >> Gemfile
bundle
rails g model user name
rails g model authentication user:belongs_to
echo "class User; has_many :authentications; end" >> app/models/user.rb
rake db:migrate
rails c

In console:

u = User.create!
u.authentications.create! # => nil !!

# however,
a = u.authentications.new
a.save!
a.id # => the id
Michael Grosser grosser closed this
Michael Grosser
Owner

0.1.1 should fix that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.