Merge remote-tracking branch 'origin/master' into i18n

This commit is contained in:
Maikel Linke
2015-10-22 11:03:42 +11:00
3 changed files with 26 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ module Admin
def move_up
EnterpriseGroup.with_isolation_level_serializable do
@enterprise_group = EnterpriseGroup.find_by_permalink params[:enterprise_group_id]
@enterprise_group = find_resource
@enterprise_group.move_higher
end
redirect_to main_app.admin_enterprise_groups_path
@@ -17,7 +17,7 @@ module Admin
def move_down
EnterpriseGroup.with_isolation_level_serializable do
@enterprise_group = EnterpriseGroup.find_by_permalink params[:enterprise_group_id]
@enterprise_group = find_resource
@enterprise_group.move_lower
end
redirect_to main_app.admin_enterprise_groups_path
@@ -34,9 +34,11 @@ module Admin
alias_method_chain :build_resource, :address
# Overriding method on Spree's resource controller,
# so that resources are found using permalink
# so that resources are found using permalink.
# The ! version is important to raise a RecordNotFound error.
def find_resource
EnterpriseGroup.find_by_permalink(params[:id])
permalink = params[:id] || params[:enterprise_group_id]
EnterpriseGroup.find_by_permalink!(permalink)
end
private

View File

@@ -12,7 +12,7 @@ module Admin
end
def load_enterprise
@enterprise = Enterprise.find_by_permalink params[:enterprise_id]
@enterprise = Enterprise.find_by_permalink! params[:enterprise_id]
end
def load_properties

View File

@@ -0,0 +1,19 @@
#!/bin/bash
set -e
source "`dirname $0`/includes.sh"
OFN_COMMIT=$(get_ofn_commit)
if [ "$OFN_COMMIT" = 'OFN_COMMIT_NOT_FOUND' ]; then
OFN_COMMIT=$(git rev-parse $BUILDKITE_COMMIT)
fi
GITHUB_REPO="$(echo $BUILDKITE_REPO | sed 's/git@github.com:\(.*\).git/\1/')"
GITHUB_API_URL="https://api.github.com/repos/$GITHUB_REPO/commits/$OFN_COMMIT/status"
echo "--- Checking environment variables"
require_env_vars OFN_COMMIT BUILDKITE_REPO
echo "--- Checking GitHub status"
echo "Visiting $GITHUB_API_URL"
curl -s "$GITHUB_API_URL" | head -n 2 | grep '^ *"state": "success",$'