-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 #1611 from jhawthorn/shipping_method_display_on
Replace ShippingMethod#display_on with ShippingMethod#available_to_users
- Loading branch information
Showing
9 changed files
with
98 additions
and
20 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
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
20 changes: 20 additions & 0 deletions
20
...rate/20161123154034_add_available_to_users_and_remove_display_on_from_shipping_methods.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,20 @@ | ||
class AddAvailableToUsersAndRemoveDisplayOnFromShippingMethods < ActiveRecord::Migration[5.0] | ||
def up | ||
add_column(:spree_shipping_methods, :available_to_users, :boolean, default: true) | ||
execute("UPDATE spree_shipping_methods "\ | ||
"SET available_to_users=#{quoted_false} "\ | ||
"WHERE display_on='back_end'") | ||
remove_column(:spree_shipping_methods, :display_on) | ||
end | ||
|
||
def down | ||
add_column(:spree_shipping_methods, :display_on, :string) | ||
execute("UPDATE spree_shipping_methods "\ | ||
"SET display_on='both' "\ | ||
"WHERE (available_to_users=#{quoted_true}") | ||
execute("UPDATE spree_shipping_methods "\ | ||
"SET display_on='back_end' "\ | ||
"WHERE (available_to_users=#{quoted_false})") | ||
remove_column(:spree_shipping_methods, :available_to_users) | ||
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