-
Notifications
You must be signed in to change notification settings - Fork 22
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 #4 from myabc/activerecord-5.0
Support for Active Record 5
- Loading branch information
Showing
15 changed files
with
48 additions
and
24 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
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
2 changes: 1 addition & 1 deletion
2
gemfiles/activerecord-4.2/Gemfile.base → gemfiles/activerecord-5.0/Gemfile.base
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
eval File.read File.expand_path('../../Gemfile.base', __FILE__) | ||
|
||
gem "activerecord", "~> 4.2.6" | ||
gem "activerecord", ">= 5.0.0.beta1", "< 5.1" |
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
File renamed without changes.
File renamed without changes.
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
9 changes: 9 additions & 0 deletions
9
lib/schema_plus/indexes/active_record/connection_adapters/postgresql_adapter.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module SchemaPlus::Indexes | ||
module ActiveRecord | ||
module ConnectionAdapters | ||
module PostgresqlAdapter | ||
include ::SchemaPlus::Indexes::RemoveIfExists | ||
end | ||
end | ||
end | ||
end |
9 changes: 9 additions & 0 deletions
9
lib/schema_plus/indexes/active_record/connection_adapters/sqlite3_adapter.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module SchemaPlus::Indexes | ||
module ActiveRecord | ||
module ConnectionAdapters | ||
module Sqlite3Adapter | ||
include ::SchemaPlus::Indexes::RemoveIfExists | ||
end | ||
end | ||
end | ||
end |
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,13 @@ | ||
module SchemaPlus::Indexes | ||
module RemoveIfExists | ||
# Extends rails' remove_index to include this options: | ||
# :if_exists | ||
def remove_index(table_name, *args) | ||
options = args.extract_options! | ||
if_exists = options.delete(:if_exists) | ||
args << options if options.any? | ||
return if if_exists && !index_name_exists?(table_name, options[:name] || index_name(table_name, *args), false) | ||
super table_name, *args | ||
end | ||
end | ||
end |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
ruby: | ||
- 2.1.5 | ||
- 2.3.1 | ||
activerecord: | ||
- 4.2 | ||
- 5.0 | ||
db: | ||
- mysql2 | ||
- sqlite3 | ||
|
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