Sha256: d184b69f3f21480b69ce06b35104bae1c9bafdab1b227b2e534ffe3917c2f696

Contents?: true

Size: 520 Bytes

Versions: 30

Compression:

Stored size: 520 Bytes

Contents

module Rubix
  module Associations

    module BelongsToHost

      def host= h
        return unless h
        @host    = h
        @host_id = h.id
      end

      def host
        return @host if @host
        return unless @host_id
        @host = Host.find(:id => @host_id)
      end

      def host_id= hid
        return unless hid
        @host_id = hid
      end

      def host_id
        return @host_id if @host_id
        return unless @host
        @host_id = @host.id
      end

    end
  end
end

      

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rubix-0.5.14 lib/rubix/associations/belongs_to_host.rb
rubix-0.5.13 lib/rubix/associations/belongs_to_host.rb
rubix-0.5.9 lib/rubix/associations/belongs_to_host.rb
rubix-0.5.8 lib/rubix/associations/belongs_to_host.rb
rubix-0.5.7 lib/rubix/associations/belongs_to_host.rb
rubix-0.5.6 lib/rubix/associations/belongs_to_host.rb
rubix-0.5.5 lib/rubix/associations/belongs_to_host.rb
rubix-0.5.4 lib/rubix/associations/belongs_to_host.rb
rubix-0.5.3 lib/rubix/associations/belongs_to_host.rb
rubix-0.5.2 lib/rubix/associations/belongs_to_host.rb
rubix-0.5.1 lib/rubix/associations/belongs_to_host.rb
rubix-0.5.0 lib/rubix/associations/belongs_to_host.rb
rubix-0.4.3 lib/rubix/associations/belongs_to_host.rb
rubix-0.4.2 lib/rubix/associations/belongs_to_host.rb
rubix-0.4.1 lib/rubix/associations/belongs_to_host.rb
rubix-0.4.0 lib/rubix/associations/belongs_to_host.rb
rubix-0.3.1 lib/rubix/associations/belongs_to_host.rb
rubix-0.3.0 lib/rubix/associations/belongs_to_host.rb
rubix-0.2.1 lib/rubix/associations/belongs_to_host.rb
rubix-0.2.0 lib/rubix/associations/belongs_to_host.rb