Sha256: ee72a22679c2c03a6ff1399d74b9384e95e51f145205e953fb73e6b440140bfc

Contents?: true

Size: 596 Bytes

Versions: 29

Compression:

Stored size: 596 Bytes

Contents

module Rubix
  module Associations

    module BelongsToTemplate

      def template= h
        return unless h
        @template    = h
        @template_id = h.id
      end

      def template
        return @template if @template
        return unless @template_id
        @template = Template.find(:id => @template_id)
      end

      def template_id= tid
        return unless tid
        @template_id = tid
      end

      def template_id
        return @template_id if @template_id
        return unless @template
        @template_id = @template.id
      end

    end
  end
end

      

Version data entries

29 entries across 29 versions & 1 rubygems

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