Fix broken migrations caused by #290 #323

Merged
merged 2 commits into from Oct 23, 2012

Conversation

Projects
None yet
8 participants
Contributor

james2m commented Jul 12, 2012

Hi Ben,

I've fixed #318 and #322 which were caused by #290 raising an exception on !db_setup? which meant migrations were never run. I've partially restored your original code to check whether the table exists.

It would be good to get this in as it's hindering people setting up new projects with Authlogic.

J.

james2m added some commits Jul 11, 2012

Fixes #318 and fixes #322 broken migrations caused by #290.
Signed-off-by: James McCarthy <james2mccarthy@gmail.com>

Thanks for fixing this James. It would be great to get this merged as soon as possible, we had to jump though some hoops to work around it.

Cloning the fixed branch does not work. Why can't you merge the fix into master. It seems like it's taking an act of God to get this fixed.

Contributor

james2m commented Jul 21, 2012

I've used this branch to work around the issue on two projects.

What error messages are you getting?

James

On 20 Jul 2012, at 21:27, ctilley83
reply@reply.github.com
wrote:

Cloning the fixed branch does not work. Why can't you merge the fix into master. It seems like it's taking an act of God to get this fixed.


Reply to this email directly or view it on GitHub:
#323 (comment)

I fixed it. There is a typo in the comment you made.

On Jul 20, 2012, at 9:26 PM, James McCarthy wrote:

I've used this branch to work around the issue on two projects.

What error messages are you getting?

James

On 20 Jul 2012, at 21:27, ctilley83
reply@reply.github.com
wrote:

Cloning the fixed branch does not work. Why can't you merge the fix into master. It seems like it's taking an act of God to get this fixed.


Reply to this email directly or view it on GitHub:
#323 (comment)


Reply to this email directly or view it on GitHub:
#323 (comment)

Contributor

james2m commented Jul 21, 2012

Can you tell me what the typo is and I'll fix it.

maletor commented Jul 30, 2012

+5

+1

timols commented Sep 15, 2012

+1

binarylogic added a commit that referenced this pull request Oct 23, 2012

Merge pull request #323 from james2m/fix-migrations
Fix broken migrations caused by #290

@binarylogic binarylogic merged commit beaabc5 into binarylogic:master Oct 23, 2012

This fix has a small caveat. If you have User.create in your seeder (db/seeds.rb), this won't be doable anymore:

$ rake db:drop
$ rake db:setup

It gets you this error:

undefined method 'password=' for #<User:....>

This is because acts_as_authentic has return unless table_exists? which stops it from creating the password= method.

...actually, forget that: that bug has existed since 2 years ago.#88

Contributor

james2m commented Dec 17, 2012

@rstacruz That explains something I've never got round to investigating. It's only a problem if you run your seeds in the same session as your migrations right? e.g.

$ rake db:migrate db:seed

@james2m Yes, which Rails does by default with:

$ rake db:setup

...which is simply an alias for db:create db:schema:load db:seed.

@james2m james2m deleted the james2m:fix-migrations branch Dec 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment