forum app
Authentication through http-header Authentication
| => #<ActiveRecord::Associations::HasOneAssociation:0x000000011ca70810 | |
| @association_scope=nil, | |
| @disable_joins=false, | |
| @loaded=true, | |
| @owner=#<Poll:0x000000011c9b7658 id: 1, multiple: true, created_at: 2023-04-23 15:42:11.863742 UTC, updated_at: 2023-04-23 15:42:11.863742 UTC>, | |
| @reflection= | |
| #<ActiveRecord::Reflection::HasOneReflection:0x000000011e490510 | |
| @active_record=Poll(id: integer, multiple: boolean, created_at: datetime, updated_at: datetime), | |
| @class_name="Post", | |
| @foreign_key="poll_id", |
| => #<ActiveRecord::Associations::HasOneAssociation:0x000000011ca70810 | |
| @association_scope=nil, | |
| @disable_joins=false, | |
| @loaded=true, | |
| @owner=#<Poll:0x000000011c9b7658 id: 1, multiple: true, created_at: 2023-04-23 15:42:11.863742 UTC, updated_at: 2023-04-23 15:42:11.863742 UTC>, | |
| @reflection= | |
| #<ActiveRecord::Reflection::HasOneReflection:0x000000011e490510 | |
| @active_record=Poll(id: integer, multiple: boolean, created_at: datetime, updated_at: datetime), | |
| @class_name="Post", | |
| @foreign_key="poll_id", |
| begin | |
| require "bundler/inline" | |
| rescue LoadError => e | |
| $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
| raise e | |
| end | |
| gemfile(true) do | |
| source "https://rubygems.org" | |
| gem "rails", "7.0.4.2" |
| # User attributes name surname | |
| class User < ApplicationRecord | |
| end | |
| class Guest | |
| def name | |
| 'test' | |
| end | |
| end |
| module M | |
| def test | |
| end | |
| module B | |
| def hard_test | |
| puts "hey, bro" | |
| end | |
| end | |
| end |
| ApplicationRecord.transaction do | |
| user.update(name: "test_user") | |
| order.update(user_id: user.id) | |
| CalculatePayoutJob.perform_later(user, order) | |
| raise ActiveRecord::Rollback if order.errors.present? | |
| end |
| create database tmp_db1; | |
| \c tmp_db1; | |
| CREATE TABLE users ( | |
| id integer, | |
| email varchar(255) | |
| ); | |
| CREATE TABLE stats ( | |
| id integer, |
| CREATE TABLE orders ( | |
| id integer, | |
| name varchar(255), | |
| address varchar(255) | |
| ); | |
| CREATE TABLE order_items ( | |
| id integer, | |
| price integer, |
| CREATE TABLE tmp4(tmp_id integer); | |
| insert into tmp4 (tmp_id) values (1), (2), (null); | |
| select count(order_id <> 1) from (values (null),(1),(2)) t(order_id); | |
| count | |
| ------- | |
| 2 | |
| select count(*) from tmp4 where tmp_id <> 1; | |
| count |