Sha256: 0887927316191d3a9801e19bfc95858bdc963b867c4c190a6298b4938efc7632

Contents?: true

Size: 276 Bytes

Versions: 36

Compression:

Stored size: 276 Bytes

Contents

module Spyke
  module Associations
    class HasOne < Association
      def initialize(*args)
        super
        @options.reverse_merge!(uri: "#{parent.class.model_name.plural}/:#{foreign_key}/#{@name}")
        @params[foreign_key] = parent.id
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
spyke-7.2.2 lib/spyke/associations/has_one.rb
spyke-7.1.1 lib/spyke/associations/has_one.rb
spyke-7.1.0 lib/spyke/associations/has_one.rb
spyke-7.0.0 lib/spyke/associations/has_one.rb
spyke-6.1.3 lib/spyke/associations/has_one.rb
spyke-6.1.2 lib/spyke/associations/has_one.rb
spyke-6.1.1 lib/spyke/associations/has_one.rb
spyke-6.1.0 lib/spyke/associations/has_one.rb
spyke-6.0.0 lib/spyke/associations/has_one.rb
spyke-5.4.3 lib/spyke/associations/has_one.rb
spyke-5.4.2 lib/spyke/associations/has_one.rb
spyke-5.4.1 lib/spyke/associations/has_one.rb
spyke-5.4.0 lib/spyke/associations/has_one.rb
spyke-5.3.4 lib/spyke/associations/has_one.rb
spyke-5.3.3 lib/spyke/associations/has_one.rb
spyke-5.3.2 lib/spyke/associations/has_one.rb
spyke-5.3.1 lib/spyke/associations/has_one.rb
spyke-5.3.0 lib/spyke/associations/has_one.rb
spyke-5.2.0 lib/spyke/associations/has_one.rb
spyke-5.1.0 lib/spyke/associations/has_one.rb