Sha256: 84e47c706e90ff3f5012102225e20bc0c77888faa55f01c647dac150462830ee

Contents?: true

Size: 446 Bytes

Versions: 16

Compression:

Stored size: 446 Bytes

Contents

require 'sunrise/config/base'

module Sunrise
  module Config
    class Association < Base
    
      def resource_name
        @resource_name ||= (@config_options[:class_name] || name)
      end
    
      def model
        @model ||= Utils.lookup(resource_name.to_s.camelize)
      end
    
      # Compare relation by model_type
      def is_this?(model_type)
        name.to_s.downcase == model_type.to_s.downcase
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sunrise-cms-0.5.1 lib/sunrise/config/association.rb
sunrise-cms-0.5.0 lib/sunrise/config/association.rb
sunrise-cms-0.5.0.rc5 lib/sunrise/config/association.rb
sunrise-cms-0.5.0.rc4 lib/sunrise/config/association.rb
sunrise-cms-0.5.0.rc3 lib/sunrise/config/association.rb
sunrise-cms-0.5.0.rc2 lib/sunrise/config/association.rb
sunrise-cms-0.5.0.rc1 lib/sunrise/config/association.rb
sunrise-cms-0.4.2 lib/sunrise/config/association.rb
sunrise-cms-0.4.1 lib/sunrise/config/association.rb
sunrise-cms-0.4.0 lib/sunrise/config/association.rb
sunrise-cms-0.3.3 lib/sunrise/config/association.rb
sunrise-cms-0.3.2 lib/sunrise/config/association.rb
sunrise-cms-0.3.1 lib/sunrise/config/association.rb
sunrise-cms-0.3.0 lib/sunrise/config/association.rb
sunrise-cms-0.3.0.rc2 lib/sunrise/config/association.rb
sunrise-cms-0.3.0.rc lib/sunrise/config/association.rb