Sha256: 06c0107d6ebc3cf97ae15c1fb5cd9c897c2fab5b6a17f9132cd5626524ca6bee
Contents?: true
Size: 429 Bytes
Versions: 16
Compression:
Stored size: 429 Bytes
Contents
module OrgCommon extend ActiveSupport::Concern included do # class_attribute :org_id_key class << self; attr_accessor :org_id_key; end before_action { @org = Org.find(params[self.class.org_id_key || :org_id]) } before_action only: [:edit,:update,:destroy] do login_required # check_current_user(@record) end end def record_params super.tap{|rtn| rtn[:org_id] ||= @org.id } end end
Version data entries
16 entries across 16 versions & 1 rubygems