Skip to content

Instantly share code, notes, and snippets.

@tbcooney
Created April 1, 2020 15:38
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 tbcooney/0960ce928808b1cad2e7c095ebc626cb to your computer and use it in GitHub Desktop.
Save tbcooney/0960ce928808b1cad2e7c095ebc626cb to your computer and use it in GitHub Desktop.
taylorcooney@Taylors-MacBook-Air:~/Code/openunit$ ⚡
bundle exec rails c
Running via Spring preloader in process 90646
Loading development environment (Rails 6.0.2.2)
irb(main):001:0> ActiveRecord::Base.connection.select_value("SEL
ECT users.unconfirmed_email FROM users")
/Users/taylorcooney/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activemodel-6.0.2.2/lib/active_model/type/integer.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/taylorcooney/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activemodel-6.0.2.2/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here
/Users/taylorcooney/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-6.0.2.2/lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb:12: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/taylorcooney/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activemodel-6.0.2.2/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here
/Users/taylorcooney/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/marginalia-1.8.0/lib/marginalia.rb:94: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/taylorcooney/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-6.0.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:645: warning: The called method `execute_and_clear_without_marginalia' is defined here
(1.4ms) SELECT users.unconfirmed_email FROM users /*application:OpenUnit*/
Traceback (most recent call last):
1: from (irb):1
ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR: column users.unconfirmed_email does not exist)
LINE 1: SELECT users.unconfirmed_email FROM users /*application:Open...
^
irb(main):002:0> ActiveRecord::Base.connection.select_value("SEL
ECT users.email FROM users")
(1.4ms) SELECT users.email FROM users /*application:OpenUnit*/
Traceback (most recent call last):
2: from (irb):1
1: from (irb):2:in `rescue in irb_binding'
ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR: column users.email does not exist)
LINE 1: SELECT users.email FROM users /*application:OpenUnit*/
^
irb(main):003:0> ActiveRecord::Base.connection.select_value("SELECT users.first_name FROM users")
(1.5ms) SELECT users.first_name FROM users /*application:OpenUnit*/
Traceback (most recent call last):
2: from (irb):2
1: from (irb):3:in `rescue in irb_binding'
ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR: column users.first_name does not exist)
LINE 1: SELECT users.first_name FROM users /*application:OpenUnit*/
^
irb(main):004:0> ActiveRecord::Base.connection.select_value("SELECT users.id FROM users")
(6.5ms) SELECT users.id FROM users /*application:OpenUnit*/
=> 13
irb(main):005:0> ActiveRecord::Base.connection.select_value("SELECT users.created_at FROM users")
(2.2ms) SELECT users.created_at FROM users /*application:OpenUnit*/
=> 2020-03-26 00:51:59.715603 UTC
irb(main):006:0> ActiveRecord::Base.connection.select_value("SELECT users.unconfirmed_email FROM users")
(2.4ms) SELECT users.unconfirmed_email FROM users /*application:OpenUnit*/
Traceback (most recent call last):
1: from (irb):6
ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR: column users.unconfirmed_email does not exist)
LINE 1: SELECT users.unconfirmed_email FROM users /*application:Open...
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment