module CFoundry::V2::Helper

Public Instance Methods

to_many_support(plural) click to toggle source
# File lib/cfoundry/v2/helper.rb, line 2
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