Module AWS::Record::AbstractBase::ClassMethods
In: lib/aws/record/abstract_base.rb

Methods

Public Instance methods

@return [Hash<String,Attribute>] Returns a hash of all of the

  configured attributes for this class.
domain_name(name = nil)

Alias for shard_name

@private

@return [Boolean] Returns true if this class is configured to

  perform optimistic locking.

Adds a scoped finder to this class.

  class Book < AWS::Record::Model
    scope :top_10, order(:popularity, :desc).limit(10)
  end

  Book.top_10.to_a
  #=> [#<Book...>, #<Book...>]

  Book.top_10.first
  #=> #<Book...>

You can also provide a block that accepts params for the scoped finder. This block should return a scope.

  class Book < AWS::Record::Model
    scope :by_author, lambda {|name| where(:author => name) }
  end

  # top 10 books by the author 'John Doe'
  Book.by_author('John Doe').top_10

@param [Symbol] name The name of the scope. Scope names should be

  method-safe and should not conflict with any other class methods.

@param [Scope] scope

set_domain_name(name)

Alias for set_shard_name

Allows you to override the default shard name for this class. The shard name defaults to the class name. @param [String] name

Returns the name of the shard this class will persist records into by default.

@param [String] name Defaults to the name of this class. @return [String] Returns the full prefixed domain name for this class.

shard_name=(name)

Alias for set_shard_name

[Validate]