Sha256: bd5687cbc8ee423e31f7fd31cca721175db85d29785a30c4db827fbeef5d2c3f

Contents?: true

Size: 602 Bytes

Versions: 41

Compression:

Stored size: 602 Bytes

Contents

# Monkey path inherited_resources
#
#
# Pull request https://github.com/josevalim/inherited_resources/pull/237
module InheritedResources::BaseHelpers
  private

  def resource_params
    @resource_params ||=
      build_resource_params
  end

  def build_resource_params
    rparams = [whitelisted_params || params[resource_request_name] || params[resource_instance_name] || {}]
    rparams << as_role if role_given?
    rparams
  end

  def whitelisted_params
    whitelist_method = :"#{ resource_request_name }_params"
    respond_to?(whitelist_method, true) && self.send(whitelist_method)
  end
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
social_stream-2.0.0.beta2 base/lib/inherited_resources/social_stream.rb
social_stream-base-2.0.0.beta2 lib/inherited_resources/social_stream.rb
social_stream-2.0.0.beta1 base/lib/inherited_resources/social_stream.rb
social_stream-base-2.0.0.beta1 lib/inherited_resources/social_stream.rb
social_stream-1.1.7 base/lib/inherited_resources/social_stream.rb
social_stream-base-1.1.6 lib/inherited_resources/social_stream.rb
social_stream-1.1.6 base/lib/inherited_resources/social_stream.rb
social_stream-base-1.1.5 lib/inherited_resources/social_stream.rb
social_stream-1.1.5 base/lib/inherited_resources/social_stream.rb
social_stream-base-1.1.4 lib/inherited_resources/social_stream.rb
social_stream-1.1.4 base/lib/inherited_resources/social_stream.rb
social_stream-1.1.3 base/lib/inherited_resources/social_stream.rb
social_stream-base-1.1.3 lib/inherited_resources/social_stream.rb
social_stream-1.1.2 base/lib/inherited_resources/social_stream.rb
social_stream-base-1.1.2 lib/inherited_resources/social_stream.rb
social_stream-1.1.1 base/lib/inherited_resources/social_stream.rb
social_stream-base-1.1.1 lib/inherited_resources/social_stream.rb
social_stream-1.1.0 base/lib/inherited_resources/social_stream.rb
social_stream-base-1.1.0 lib/inherited_resources/social_stream.rb
social_stream-1.0.1 base/lib/inherited_resources/social_stream.rb