Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove :null => false condition on reference to parent model in trans…
…lation table migration to fix refinery/refinerycms#2450
- Loading branch information
f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried jury-rigging this commit to my app to try and fix the "Mysql2::Error: Column 'refinery_page_id' cannot be null" error and it doesn't seem to make any difference. Still getting the same error when I run the rake db:setup or attempt to add pages.
f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also remember that it's a migration so you'll have to re-migrate your database. Don't use
rake db:setup
but userake db:{drop,create,migrate}
thenrake db:seed
f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alrighty, tried that. The database dropped and created fine, but the seed failed, same error. I'm going to look at the stack trace I've got and see if I can figure anything out that might help resolve the issue. If I come up with anything I'll let you know.
f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... I tried it and it worked. I made the change and switched the dependency in the refinery Gemfile to depend on my local instance of globalize. I tried it with and without the change, each time re-creating the db, migrating and running
rake db:seed
and it failed without the change, worked with it.f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@parndt you'd better confirm that this works before releasing 3.0.1.
f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shioyama agreed.
f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got to head home, but I'll leave you with these- hope they help. It's probably a problem on my end, but I'm not quite sure- everything in the install checks out and I'm able to generate a new Refinery app just fine- just when I get to the point where I need to actually bolt on the database bad things happen.
My Gemfile: http://pastebin.com/MFddWzur
My output from rake db:{drop,create,migrate}: http://pastebin.com/J4TH2p0G
My output from rake db:seed --trace: http://pastebin.com/erGaG8wz
f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaveahamLincoln Just putting globalize in the Gemfile of your refinery app won't work because refinery itself depends on globalize3. You have to actually clone refinery, swap
globalize3
for the branch ofglobalize
here in the Gemfile of that cloned repo, and then change your Gemfile to depend on that local repo (withpath:
). I'm pretty sure that's why the fix wasn't working for you.f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's correct. I've created a branch on Refinery called
2-1-globalize
which has these changes (and failing tests):Bundle, try again.
f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried running bundle on that branch and I got a dependency conflict:
f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shioyama that's quite the conflict
f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, I don't see that conflict but it looks like Travis does.
f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK Deleting my Gemfile.lock means I can reproduce the bundler error.. joy!
f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI i still getting the error, in my gemfile:
I commented the line:
#gem 'refinerycms', '~> 2.1.0'
I added:
gem 'globalize', :github => 'globalize/globalize', :branch => 'fix_refinery_db_seed'
gem 'refinerycms', :github => 'refinery/refinerycms', :branch => '2-1-globalize'
I deleted the gem.lock
I ran bundle install
I remove the database and then I ran rake db:migrate
...Now I am getting a different error:
NoMethodError in Refinery::Admin::PagesController#create
undefined method `to_slug' for nil:NilClass
...any help on that??
f2fd6e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing :null saved me. Thank you!!!