Sha256: 005033ca1222e840165a9127bb8a651f8864e17ca173b8df45e1e64d115de49a

Contents?: true

Size: 338 Bytes

Versions: 18

Compression:

Stored size: 338 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, resource_id: proc {resource_id}

  def resource_id
    123456789
  end
end

@service = Service.new(id: 123)

inspect_rest_model(@service)

Version data entries

18 entries across 18 versions & 1 rubygems

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