-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set MYSQL version to 5 (5.7 current). Added past events in db:seed. #76
Conversation
@anantshri @abhisek please review. |
@abhisek @anantshri please review. |
you mentioned 5.7 but added 5.5 rest all looks good to me. |
Actually I kept only mysql5 (which currently is 5.7) instead of mysql5.5. ".5" is removed from yml files. |
Ah my bad, not sure what i was thinking i read the commits inverse. LGTM 👍 |
docker-compose-app.yml
Outdated
@@ -1,7 +1,7 @@ | |||
version: '2' | |||
services: | |||
db: | |||
image: mysql:5.5 | |||
image: mysql:5 |
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.
Explicitly set the minor version for MySQL
@@ -147,7 +148,7 @@ def to_param | |||
# ActiveRecord :on_create | |||
def slugify! | |||
self.slug = "#{self.chapter.name} #{self.name.parameterize} #{self.id}".parameterize | |||
self.save() | |||
#self.save() |
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.
Why?
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 had to explicitly call event.save and wanted to have slug before save.
Line 112 in 5a06db4
e.save(:validate => false) |
@abhisek PR Updated. |
@@ -147,7 +148,7 @@ def to_param | |||
# ActiveRecord :on_create | |||
def slugify! | |||
self.slug = "#{self.chapter.name} #{self.name.parameterize} #{self.id}".parameterize |
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.
self.id
is available only after DB persistence. It will not be available in before_create
@@ -36,7 +36,8 @@ class Event < ActiveRecord::Base | |||
has_many :event_registrations, :dependent => :destroy | |||
|
|||
before_create :set_automatic_values! # Defaults | |||
after_create :slugify! | |||
#after_create :slugify! | |||
before_create :slugify! |
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.
Breaks self.id
reference in slugify
Abandoning this. Will separate this into 2 PRs. |
#68
Changed MYSQL container version to 5 in (5.7 current) only in non-production environments. Requires a
'docker-compose build
andmysql_upgrade
to DB to work correctly.#70
Added past event data in seed.rb, but to get everything working, I have to change
event.slugify!
fromafter_create
tobefore_create
and commentsave()
.