Skip to content

Instantly share code, notes, and snippets.

@regedarek
Created November 6, 2012 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save regedarek/4025796 to your computer and use it in GitHub Desktop.
Save regedarek/4025796 to your computer and use it in GitHub Desktop.
>> Subscription.where(user_id: User.last.id)
User Load (1.8ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
#<ActiveRecord::Relation:0x7f7f9ad69c70
@implicit_readonly = nil,
@join_dependency = nil,
@order_clause = nil,
@records = [],
@should_eager_load = nil,
attr_accessor :bind_values = [],
attr_accessor :create_with_value = {},
attr_accessor :default_scoped = true,
attr_accessor :eager_load_values = [],
attr_accessor :extensions = [],
attr_accessor :from_value = nil,
attr_accessor :group_values = [],
attr_accessor :having_values = [],
attr_accessor :includes_values = [],
attr_accessor :joins_values = [],
attr_accessor :limit_value = nil,
attr_accessor :lock_value = nil,
attr_accessor :offset_value = nil,
attr_accessor :order_values = [],
attr_accessor :preload_values = [],
attr_accessor :readonly_value = nil,
attr_accessor :reordering_value = nil,
attr_accessor :reverse_order_value = nil,
attr_accessor :select_values = [],
attr_accessor :uniq_value = nil,
attr_accessor :where_values = [
[0] #<Arel::Nodes::Equality:0x7f7f9ad15f30
attr_accessor :left = {
:relation => #<Arel::Table:0x7f7f9ad6a9e0
attr_accessor :aliases = [],
attr_accessor :engine = class Subscription < ActiveRecord::Base {
:id => :integer,
:user_id => :integer,
:app_id => :integer,
:created_at => :datetime .. :admin => :boolean,
:verified => :boolean,
:email_freq => :integer,
:emails => :boolean
},
attr_accessor :name = "subscriptions",
attr_accessor :table_alias = nil,
attr_reader :columns = nil,
attr_reader :primary_key = nil
>,
:name => :user_id
},
attr_accessor :right = 2064
>
],
attr_reader :arel = #<Arel::SelectManager:0x7f7f9ad14400
@ctx = #<Arel::Nodes::SelectCore:0x7f7f9ad143b0
attr_accessor :groups = [],
attr_accessor :having = nil,
attr_accessor :projections = [
[0] {
:relation => #<Arel::Table:0x7f7f9ad6a9e0
attr_accessor :aliases = [],
attr_accessor :engine = class Subscription < ActiveRecord::Base {
:id => :integer,
:user_id => :integer,
:app_id => :integer,
:created_at => :datetime .. :admin => :boolean,
:verified => :boolean,
:email_freq => :integer,
:emails => :boolean
},
attr_accessor :name = "subscriptions",
attr_accessor :table_alias = nil,
attr_reader :columns = nil,
attr_reader :primary_key = nil
>,
:name => "*"
}
],
attr_accessor :set_quantifier = nil,
attr_accessor :source = #<Arel::Nodes::JoinSource:0x7f7f9ad142e8
attr_accessor :left = #<Arel::Table:0x7f7f9ad6a9e0
attr_accessor :aliases = [],
attr_accessor :engine = class Subscription < ActiveRecord::Base {
:id => :integer,
:user_id => :integer,
:app_id => :integer,
:created_at => :datetime .. :admin => :boolean,
:verified => :boolean,
:email_freq => :integer,
:emails => :boolean
},
attr_accessor :name = "subscriptions",
attr_accessor :table_alias = nil,
attr_reader :columns = nil,
attr_reader :primary_key = nil
>,
attr_accessor :right = []
>,
attr_accessor :top = nil,
attr_accessor :wheres = [
[0] #<Arel::Nodes::And:0x7f7f9ad13f78
attr_reader :children = [
[0] #<Arel::Nodes::Equality:0x7f7f9ad15f30
attr_accessor :left = {
:relation => #<Arel::Table:0x7f7f9ad6a9e0
attr_accessor :aliases = [],
attr_accessor :engine = class Subscription < ActiveRecord::Base {
:id => :integer,
:user_id => :integer,
:app_id => :integer,
:created_at => :datetime .. :admin => :boolean,
:verified => :boolean,
:email_freq => :integer,
:emails => :boolean
},
attr_accessor :name = "subscriptions",
attr_accessor :table_alias = nil,
attr_reader :columns = nil,
attr_reader :primary_key = nil
>,
:name => :user_id
},
attr_accessor :right = 2064
>
]
>
]
>,
attr_reader :ast = #<Arel::Nodes::SelectStatement:0x7f7f9ad143d8
attr_accessor :limit = nil,
attr_accessor :lock = nil,
attr_accessor :offset = nil,
attr_accessor :orders = [],
attr_accessor :with = nil,
attr_reader :cores = [
[0] #<Arel::Nodes::SelectCore:0x7f7f9ad143b0
attr_accessor :groups = [],
attr_accessor :having = nil,
attr_accessor :projections = [
[0] {
:relation => #<Arel::Table:0x7f7f9ad6a9e0
attr_accessor :aliases = [],
attr_accessor :engine = class Subscription < ActiveRecord::Base {
:id => :integer,
:user_id => :integer,
:app_id => :integer,
:created_at => :datetime .. :admin => :boolean,
:verified => :boolean,
:email_freq => :integer,
:emails => :boolean
},
attr_accessor :name = "subscriptions",
attr_accessor :table_alias = nil,
attr_reader :columns = nil,
attr_reader :primary_key = nil
>,
:name => "*"
}
],
attr_accessor :set_quantifier = nil,
attr_accessor :source = #<Arel::Nodes::JoinSource:0x7f7f9ad142e8
attr_accessor :left = #<Arel::Table:0x7f7f9ad6a9e0
attr_accessor :aliases = [],
attr_accessor :engine = class Subscription < ActiveRecord::Base {
:id => :integer,
:user_id => :integer,
:app_id => :integer,
:created_at => :datetime .. :admin => :boolean,
:verified => :boolean,
:email_freq => :integer,
:emails => :boolean
},
attr_accessor :name = "subscriptions",
attr_accessor :table_alias = nil,
attr_reader :columns = nil,
attr_reader :primary_key = nil
>,
attr_accessor :right = []
>,
attr_accessor :top = nil,
attr_accessor :wheres = [
[0] #<Arel::Nodes::And:0x7f7f9ad13f78
attr_reader :children = [
[0] #<Arel::Nodes::Equality:0x7f7f9ad15f30
attr_accessor :left = {
:relation => #<Arel::Table:0x7f7f9ad6a9e0
attr_accessor :aliases = [],
attr_accessor :engine = class Subscription < ActiveRecord::Base {
:id => :integer,
:user_id => :integer,
:app_id => :integer,
:created_at => :datetime .. :admin => :boolean,
:verified => :boolean,
:email_freq => :integer,
:emails => :boolean
},
attr_accessor :name = "subscriptions",
attr_accessor :table_alias = nil,
attr_reader :columns = nil,
attr_reader :primary_key = nil
>,
:name => :user_id
},
attr_accessor :right = 2064
>
]
>
]
>
]
>,
attr_reader :engine = class Subscription < ActiveRecord::Base {
:id => :integer,
:user_id => :integer,
:app_id => :integer,
:created_at => :datetime .. :admin => :boolean,
:verified => :boolean,
:email_freq => :integer,
:emails => :boolean
}
>,
attr_reader :first = nil,
attr_reader :klass = class Subscription < ActiveRecord::Base {
:id => :integer,
:user_id => :integer,
:app_id => :integer,
:created_at => :datetime .. :admin => :boolean,
:verified => :boolean,
:email_freq => :integer,
:emails => :boolean
},
attr_reader :last = nil,
attr_reader :loaded = nil,
attr_reader :scope_for_create = nil,
attr_reader :table = #<Arel::Table:0x7f7f9ad6a9e0
attr_accessor :aliases = [],
attr_accessor :engine = class Subscription < ActiveRecord::Base {
:id => :integer,
:user_id => :integer,
:app_id => :integer,
:created_at => :datetime .. :admin => :boolean,
:verified => :boolean,
:email_freq => :integer,
:emails => :boolean
},
attr_accessor :name = "subscriptions",
attr_accessor :table_alias = nil,
attr_reader :columns = nil,
attr_reader :primary_key = nil
>,
attr_reader :to_sql = nil
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment