Sha256: ccddfa5f90294ec0fe651a99cac6e559c72e0a5a1257b476572e53b3a92af056

Contents?: true

Size: 339 Bytes

Versions: 10

Compression:

Stored size: 339 Bytes

Contents

module CFoundry::V2::Helper
  def to_many_support(plural)
    singular = plural.to_s.sub(/s$/, "").to_sym

    alias_method :"remove_#{singular}_without_support", :"remove_#{singular}"
    define_method(:"remove_#{singular}") do |x|
      result = self.__send__("remove_#{singular}_without_support", x)
      result.nil?
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
new_cfoundry-4.9.4 lib/cfoundry/v2/helper.rb
new_cfoundry-4.9.3 lib/cfoundry/v2/helper.rb
ncfoundry-4.9.4 lib/cfoundry/v2/helper.rb
ncfoundry-4.9.3 lib/cfoundry/v2/helper.rb
ncfoundry-4.9.2 lib/cfoundry/v2/helper.rb
new_cfoundry-4.9.2 lib/cfoundry/v2/helper.rb
new_cfoundry-4.9.1 lib/cfoundry/v2/helper.rb
new_cfoundry-4.9.0 lib/cfoundry/v2/helper.rb
new_cfoundry-4.8.3 lib/cfoundry/v2/helper.rb
new_cfoundry-4.8.2 lib/cfoundry/v2/helper.rb