Sha256: 894f3e849bf578e8d5558559a0da0f7509eb97792464e70c23252e190fadd38a

Contents?: true

Size: 462 Bytes

Versions: 10

Compression:

Stored size: 462 Bytes

Contents

module Selections
  module BelongsToSelection

    # Helper for belongs_to and accepts all the standard rails options
    #
    #Example
    #   belongs_to_selection :priority
    #
    # by default adds - class_name: "Selection"

    def belongs_to_selection(target, options={})
      belongs_to target, options.merge(:class_name => "Selection")
    end

    ActiveSupport.on_load :active_record do
      extend Selections::BelongsToSelection
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
selections-0.1.13 lib/selections/belongs_to_selection.rb
selections-0.1.12 lib/selections/belongs_to_selection.rb
selections-0.1.11 lib/selections/belongs_to_selection.rb
selections-0.1.7 lib/selections/belongs_to_selection.rb
selections-0.1.6 lib/selections/belongs_to_selection.rb
selections-0.1.5 lib/selections/belongs_to_selection.rb
selections-0.1.4 lib/selections/belongs_to_selection.rb
selections-0.1.3 lib/selections/belongs_to_selection.rb
selections-0.1.2 lib/selections/belongs_to_selection.rb
selections-0.1.1 lib/selections/belongs_to_selection.rb