instance method arel_table

Ruby on Rails 4.0.13

Since v4.0.13 Last seen in v4.0.13

Signature

arel_table()

Returns an instance of Arel::Table loaded with the current table name.

class Post < ActiveRecord::Base
  scope :published_and_commented, -> { published.and(self.arel_table[:comments_count].gt(0)) }
end
Source
# File activerecord/lib/active_record/core.rb, line 134
      def arel_table
        @arel_table ||= Arel::Table.new(table_name, arel_engine)
      end

Defined in activerecord/lib/active_record/core.rb line 134 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Core::ClassMethods

Type at least 2 characters to search.

↑↓ navigate · open · esc close