Sha256: ecbea0d14500f6d0020344923a067c2a02ddd124578df2dd14821af8d4799354

Contents?: true

Size: 1009 Bytes

Versions: 5

Compression:

Stored size: 1009 Bytes

Contents

class Make < RestfulResource::Base
  resource_path "makes"
  has_many :models
end

class Model < RestfulResource::Base
  has_one :make
  resource_path "groups/:group_id/makes/:make_slug/models"
end

class Dealer < RestfulResource::Base
  include RestfulResource::RailsValidations

  resource_path "dealers"
end

class BaseA < RestfulResource::Base
end

class BaseB < RestfulResource::Base
end

class TestA < BaseA
  self.resource_path "testa"
end

class TestB < BaseB
  self.resource_path "testb"
end

class ModelWithRedirections < RestfulResource::Base
  include RestfulResource::Redirections

  resource_path 'model_with_redirections'
end

module ComplicatedModule
  class Parent < BaseA
    resource_path "parent"
    has_many :children
    has_many :other_things
    has_many :missing

    def is_parent?
      true
    end
  end

  class Child < BaseA
    resource_path 'parents/:parent_id/children'
    has_one :parent

    def full_name
      "#{self.first_name} #{self.second_name}"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
restful_resource-2.3.0 spec/fixtures.rb
restful_resource-2.2.8 spec/fixtures.rb
restful_resource-2.2.7 spec/fixtures.rb
restful_resource-2.2.6 spec/fixtures.rb
restful_resource-2.2.5 spec/fixtures.rb