Sha256: 796160875122e9c3175f0e02d9d72ee32fa6b70e4b0f78b4976bccee588f322b

Contents?: true

Size: 353 Bytes

Versions: 16

Compression:

Stored size: 353 Bytes

Contents

$:.push 'examples'; require 'helper'

class Customer < RestModel
  id field: :customer_id, type: Integer
  has_many :services
end

class Service < RestModel
  id type: Integer
  belongs_to :customer, href: proc {"http://external.service.com/customers/#{customer_id}"}
end

@service = Service.new(id: 123, customer_id: 999)

inspect_rest_model(@service)

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rest_model-0.3.1 examples/belongs_to/href_options.rb
rest_model-0.3.0 examples/belongs_to/href_options.rb
rest_model-0.2.3 examples/belongs_to/href_options.rb
rest_model-0.2.1 examples/belongs_to/href_options.rb
rest_model-0.2.0 examples/belongs_to/href_options.rb
rest_model-0.1.24 examples/belongs_to/href_options.rb
rest_model-0.1.23 examples/belongs_to/href_options.rb
rest_model-0.1.22 examples/belongs_to/href_options.rb
rest_model-0.1.21 examples/belongs_to/href_options.rb
rest_model-0.1.20 examples/belongs_to/href_options.rb
rest_model-0.1.19 examples/belongs_to/href_options.rb
rest_model-0.1.18 examples/belongs_to/href_options.rb
rest_model-0.1.17 examples/belongs_to/href_options.rb
rest_model-0.1.16 examples/belongs_to/href_options.rb
rest_model-0.1.15 examples/belongs_to/href_options.rb
rest_model-0.1.14 examples/belongs_to/href_options.rb