Sha256: 452a726e14150d53e3f9cbeb2507af59448bbd17b8370e994229ba264144b895

Contents?: true

Size: 456 Bytes

Versions: 15

Compression:

Stored size: 456 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc
  module Associations #:nodoc
    class Proxy #:nodoc
      
      def custom_fields_association_name(association_name)
        "#{association_name.to_s.singularize}_custom_fields".to_sym
      end
      
      def custom_fields?(object, association_name)
        object.respond_to?(custom_fields_association_name(association_name))
      end
      
      def klass
        @klass
      end
      
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
custom_fields-1.0.0.beta2 lib/custom_fields/extensions/mongoid/associations/proxy.rb
custom_fields-1.0.0.beta lib/custom_fields/extensions/mongoid/associations/proxy.rb
custom_fields-0.0.0.1 lib/custom_fields/extensions/mongoid/associations/proxy.rb
locomotive_cms-0.0.3.3 vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/proxy.rb
locomotive_cms-0.0.3.1 vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/proxy.rb
locomotive_cms-0.0.2.9 vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/proxy.rb
locomotive_cms-0.0.2.8 vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/proxy.rb
locomotive_cms-0.0.2.7 vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/proxy.rb
locomotive_cms-0.0.2.6 vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/proxy.rb
locomotive_cms-0.0.2.5 vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/proxy.rb
locomotive_cms-0.0.2.4 vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/proxy.rb
locomotive_cms-0.0.2.3 vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/proxy.rb
locomotive_cms-0.0.2.2 vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/proxy.rb
locomotive_cms-0.0.2.1 vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/proxy.rb
locomotive_cms-0.0.2 vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/proxy.rb