-
Notifications
You must be signed in to change notification settings - Fork 9
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 #2 from dabroz/escape-column-name
Bugfix: escaped_sortable_position_column for raw SQL queries
- Loading branch information
Showing
15 changed files
with
132 additions
and
17 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
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 @@ | ||
class OrderThing < ActiveRecord::Base | ||
acts_as_sortable do |config| | ||
config[:position_column] = :order | ||
end | ||
end |
11 changes: 11 additions & 0 deletions
11
spec/dummy-3.2/db/migrate/20150408101403_create_order_things.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,11 @@ | ||
class CreateOrderThings < ActiveRecord::Migration | ||
def change | ||
create_table :order_things do |t| | ||
t.integer :order, :null => false | ||
|
||
t.timestamps null: false | ||
end | ||
|
||
add_index :order_things, [:order] | ||
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,5 @@ | ||
class OrderThing < ActiveRecord::Base | ||
acts_as_sortable do |config| | ||
config[:position_column] = :order | ||
end | ||
end |
11 changes: 11 additions & 0 deletions
11
spec/dummy-4.0/db/migrate/20150408101403_create_order_things.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,11 @@ | ||
class CreateOrderThings < ActiveRecord::Migration | ||
def change | ||
create_table :order_things do |t| | ||
t.integer :order, :null => false | ||
|
||
t.timestamps null: false | ||
end | ||
|
||
add_index :order_things, [:order] | ||
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,5 @@ | ||
class OrderThing < ActiveRecord::Base | ||
acts_as_sortable do |config| | ||
config[:position_column] = :order | ||
end | ||
end |
11 changes: 11 additions & 0 deletions
11
spec/dummy-4.1/db/migrate/20150408101403_create_order_things.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,11 @@ | ||
class CreateOrderThings < ActiveRecord::Migration | ||
def change | ||
create_table :order_things do |t| | ||
t.integer :order, :null => false | ||
|
||
t.timestamps null: false | ||
end | ||
|
||
add_index :order_things, [:order] | ||
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,5 @@ | ||
class OrderThing < ActiveRecord::Base | ||
acts_as_sortable do |config| | ||
config[:position_column] = :order | ||
end | ||
end |
11 changes: 11 additions & 0 deletions
11
spec/dummy-4.2/db/migrate/20150408101403_create_order_things.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,11 @@ | ||
class CreateOrderThings < ActiveRecord::Migration | ||
def change | ||
create_table :order_things do |t| | ||
t.integer :order, :null => false | ||
|
||
t.timestamps null: false | ||
end | ||
|
||
add_index :order_things, [:order] | ||
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,6 @@ | ||
require 'spec_helper' | ||
|
||
# test for model with position column named `orded` (which can cause problems with raw SQL queries) | ||
describe OrderThing do | ||
it_behaves_like 'activerecord-sortable', position_column: :order | ||
end |