-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from sungwoncho/feature/use-rails-engine-for-m…
…igrations Use rails engine for migrations
- Loading branch information
Showing
11 changed files
with
43 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
...riendship/templates/create_friendships.rb → db/migrate/1_create_friendships.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
if ActiveRecord.gem_version >= Gem::Version.new('5.0') | ||
class AddBlockerIdToFriendships < ActiveRecord::Migration[4.2]; end | ||
else | ||
class AddBlockerIdToFriendships < ActiveRecord::Migration; end | ||
end | ||
|
||
AddBlockerIdToFriendships.class_eval do | ||
def self.up | ||
add_column :friendships, :blocker_id, :integer, default: nil | ||
end | ||
|
||
def self.down | ||
remove_column :friendships, :blocker_id | ||
end | ||
end |
8 changes: 7 additions & 1 deletion
8
...ip_update/templates/update_friendships.rb → db/migrate/3_update_friendships.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
lib/generators/has_friendship/templates/add_blocker_id_to_friendships.rb
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
lib/generators/has_friendship_update/has_friendship_update_generator.rb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module HasFriendship | ||
class Engine < ::Rails::Engine | ||
# isolate_namespace HasFriendship | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
spec/has_friendship/has_friendship_generator_update_spec.rb
This file was deleted.
Oops, something went wrong.