Sha256: f5e01b13656f4294220ac1e3f303f4bfe5ebdc554a002623e94cabfae1158468

Contents?: true

Size: 713 Bytes

Versions: 10

Compression:

Stored size: 713 Bytes

Contents

module Para
  module Ext
    module Cancan
      module ControllerResource
        extend ActiveSupport::Concern

        included do
          alias_method_chain :assign_attributes, :parent_missing_management
        end

        # Todo : Document why this extension was added ?
        def assign_attributes_with_parent_missing_management(resource)
          if @options[:singleton] && parent_resource && resource.respond_to?(:"#{ parent_name }=")
            resource.send(:"#{ parent_name }=", parent_resource)
          end

          initial_attributes.each do |attr_name, value|
            resource.send(:"#{ attr_name }=", value)
          end

          resource
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
para-0.6.9 lib/para/ext/cancan.rb
para-0.6.8 lib/para/ext/cancan.rb
para-0.6.7 lib/para/ext/cancan.rb
para-0.6.3 lib/para/ext/cancan.rb
para-0.6.2 lib/para/ext/cancan.rb
para-0.5.4 lib/para/ext/cancan.rb
para-0.5.3 lib/para/ext/cancan.rb
para-0.5.1 lib/para/ext/cancan.rb
para-0.5.0 lib/para/ext/cancan.rb
para-0.4.0 lib/para/ext/cancan.rb