-
Notifications
You must be signed in to change notification settings - Fork 98
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
On destroy friendship callback #43
Changes from all commits
9a3a794
e5fd7b2
8a12cbe
2e577e7
2de1761
dc0e6a3
e8034a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,21 @@ def self.next_migration_number(path) | |
|
||
def create_migration_file | ||
migration_template 'create_friendships.rb', | ||
'db/migrate/create_friendships.rb' | ||
'db/migrate/create_friendships.rb', migration_version: migration_version | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this something required from Rails 5 and onwards? Could you link me to a source? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
migration_template 'add_blocker_id_to_friendships.rb', | ||
'db/migrate/add_blocker_id_to_friendships.rb' | ||
'db/migrate/add_blocker_id_to_friendships.rb', migration_version: migration_version | ||
migration_template '../../has_friendship_update/templates/update_friendships.rb', | ||
'db/migrate/update_friendships.rb' | ||
'db/migrate/update_friendships.rb', migration_version: migration_version | ||
end | ||
|
||
def rails5? | ||
Rails.version.start_with? '5' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method seems not future proof. It will stop working in Rails 6. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
end | ||
|
||
def migration_version | ||
if rails5? | ||
"[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" | ||
end | ||
end | ||
|
||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module HasFriendship | ||
VERSION = "1.1.0" | ||
VERSION = "1.1.1" | ||
end |
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.
any reasons for version constraint?
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.
not sure for this