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
ActiveAdmin.register Coupon do | |
menu label: proc { current_user.admin? ? 'Coupons' : 'My coupons' } | |
actions :all, except: [:destroy] | |
permit_params :name, :coupon_type, :picture, :note, :for_deleting, :business_owner_id | |
# ===== scopes ===== | |
scope_to :current_user, if: proc { current_user.business_owner? } | |
scope :all, default: true do |coupons| | |
coupons | |
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
# run with | |
# chef-apply chef-rundeck.rb | |
require 'chef' | |
require 'chef/node' | |
require 'chef/mixin/xml_escape' | |
require 'chef/rest' | |
require 'chef/role' | |
require 'chef/environment' | |
require 'chef/data_bag' |
OlderNewer