Methods
Instance Public methods
===(object)
Link
Overwrite the default class equality method to provide support for association proxies.
arel_engine()
Link
Returns the Arel engine.
arel_table()
Link
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
generated_feature_methods()
Link
initialize_generated_modules()
Link
inspect()
Link
Returns a string like 'Post(id:integer, title:string, body:text)'
# File activerecord/lib/active_record/core.rb, line 109 def inspect if self == Base super elsif abstract_class? "#{super}(abstract)" elsif !connected? "#{super} (call '#{super}.connection' to establish a connection)" elsif table_exists? attr_list = columns.map { |c| "#{c.name}: #{c.type}" } * ', ' "#{super}(#{attr_list})" else "#{super}(Table doesn't exist)" end end