Domain::Users::FaUser aux table migration

This commit is contained in:
Dylan Knutson
2025-07-21 17:17:35 +00:00
parent 598ffe8dbf
commit d925a4b682
29 changed files with 3291 additions and 204 deletions

View File

@@ -36,7 +36,7 @@ PATH
GIT
remote: ssh://git@git.dy.mk:2221/dymk/has_aux_table.git
revision: a526fb54f11dbe52acff4595c0c505971cdcdab9
revision: fb7912e3536c339cba55af54c3e647f69f5997f3
branch: main
specs:
has_aux_table (0.1.0)

View File

@@ -281,7 +281,7 @@ module Domain::PostsHelper
E621_HOSTS = %w[www.e621.net e621.net]
URL_SUFFIX_QUERY = T.let(<<-SQL.strip.chomp.freeze, String)
lower(json_attributes->>'url_str') = lower(?)
lower('url_str') = lower(?)
SQL
MATCHERS =
@@ -313,7 +313,7 @@ module Domain::PostsHelper
post_file =
Domain::PostFile.where(
"lower(json_attributes->>'url_str') IN (?, ?, ?, ?, ?, ?)",
"lower('url_str') IN (?, ?, ?, ?, ?, ?)",
"d.furaffinity.net#{url.host}/#{url.path}",
"//d.furaffinity.net#{url.host}/#{url.path}",
"https://d.furaffinity.net#{url.host}/#{url.path}",

View File

@@ -245,7 +245,11 @@ export const calculateTrendLines = (data: DataPoint[]): TrendLineResult[] => {
// Quadratic regression requires at least 3 points
if (data.length >= 3) {
trendLines.push(calculateQuadraticRegression(data));
try {
trendLines.push(calculateQuadraticRegression(data));
} catch (e) {
console.error(e);
}
}
return trendLines;

View File

@@ -362,7 +362,7 @@ class Domain::Fa::Job::Base < Scraper::JobBase
).returns(T.nilable(Domain::Fa::Parser::Page))
end
def update_user_from_user_page(user, response)
user.scanned_page_at = Time.now
user.scanned_page_at = Time.current
user.last_user_page_log_entry = response.log_entry
return nil if user_disabled_or_not_found?(user, response)

View File

@@ -56,7 +56,7 @@ class Domain::Fa::Job::UserFollowsJob < Domain::Fa::Job::Base
slice.map { |id| { from_id: user.id, to_id: id } },
)
end
user.scanned_follows_at = Time.now
user.scanned_follows_at = Time.current
user.save!
end

View File

@@ -62,7 +62,7 @@ class Domain::Fa::Job::UserGalleryJob < Domain::Fa::Job::Base
end
user.last_gallery_page_id = first_log_entry&.id
user.scanned_gallery_at = Time.now
user.scanned_gallery_at = Time.current
ensure
user.save! if user
end
@@ -94,7 +94,7 @@ class Domain::Fa::Job::UserGalleryJob < Domain::Fa::Job::Base
fatal_error("failed to scan folder page") if response.status_code != 200
disabled_or_not_found = user_disabled_or_not_found?(user, response)
user.scanned_gallery_at = Time.now
user.scanned_gallery_at = Time.current
return :break if disabled_or_not_found
page = Domain::Fa::Parser::Page.from_log_entry(response.log_entry)

View File

@@ -113,7 +113,7 @@ class Domain::Fa::Job::UserPageJob < Domain::Fa::Job::Base
if user_page_num_submissions == 0
logger.info(format_tags("skipping gallery scan, 0 submissions"))
user.scanned_gallery_at = Time.now
user.scanned_gallery_at = Time.current
end
# create any submissions on the recent gallery page that are not yet known
@@ -174,7 +174,7 @@ class Domain::Fa::Job::UserPageJob < Domain::Fa::Job::Base
),
)
user.scanned_gallery_at = Time.now
user.scanned_gallery_at = Time.current
Domain::User.reset_counters(user.id, :user_post_creations)
end
end
@@ -271,7 +271,7 @@ class Domain::Fa::Job::UserPageJob < Domain::Fa::Job::Base
recent_watching = user_page.recent_watching
if recent_watching.empty?
logger.info(format_tags("skipping followed users scan, 0 watching"))
user.scanned_follows_at = Time.now
user.scanned_follows_at = Time.current
elsif recent_watching.count < RECENT_USERS_THRESHOLD
logger.info(
format_tags(
@@ -310,7 +310,7 @@ class Domain::Fa::Job::UserPageJob < Domain::Fa::Job::Base
end
end
user.scanned_follows_at = Time.now
user.scanned_follows_at = Time.current
elsif recent_watching.any?
# if there are watchers, find the ones we've already recorded. if
# all of them are known, then we can assume watched users are up to date.
@@ -328,7 +328,7 @@ class Domain::Fa::Job::UserPageJob < Domain::Fa::Job::Base
"skipping UserFollowsJob, all watched users already known",
),
)
user.scanned_follows_at = Time.now
user.scanned_follows_at = Time.current
end
end
end
@@ -344,7 +344,7 @@ class Domain::Fa::Job::UserPageJob < Domain::Fa::Job::Base
if recent_watchers.empty?
logger.info(format_tags("skipping followed by scan, 0 watched"))
user.scanned_followed_by_at = Time.now
user.scanned_followed_by_at = Time.current
return
end
@@ -387,7 +387,7 @@ class Domain::Fa::Job::UserPageJob < Domain::Fa::Job::Base
end
end
user.scanned_followed_by_at = Time.now
user.scanned_followed_by_at = Time.current
return
end
@@ -399,7 +399,7 @@ class Domain::Fa::Job::UserPageJob < Domain::Fa::Job::Base
logger.info(
format_tags("skipping followed by scan, all watchers already known"),
)
user.scanned_followed_by_at = Time.now
user.scanned_followed_by_at = Time.current
return
end
@@ -414,7 +414,7 @@ class Domain::Fa::Job::UserPageJob < Domain::Fa::Job::Base
logger.info(
format_tags("skipping followed by scan, last watcher already known"),
)
user.scanned_followed_by_at = Time.now
user.scanned_followed_by_at = Time.current
return
end
end

View File

@@ -132,7 +132,9 @@ class Domain::Fa::BackfillTrackedObjectUserFavs
def fa_ids_in_group(group)
fa_ids = T.let(Set.new, T::Set[Integer])
group.hles.each do |hle|
page_parser = Domain::Fa::Parser::Page.from_log_entry(hle)
page_parser =
Domain::Fa::Parser::Page.from_log_entry(hle, require_logged_in: false)
next [] unless page_parser.logged_in?
next [] unless page_parser.probably_listings_page?
fa_ids.merge(page_parser.submissions_parsed.map(&:id).compact)
end

View File

@@ -8,11 +8,9 @@ module CounterCacheWithFallback
Module.new do
define_method(:size) do
T.bind(self, ActiveRecord::Associations::CollectionProxy)
T.cast(
proxy_association.owner.send(counter_cache_name),
T.nilable(Integer),
) ||
T.cast(proxy_association.owner.send(association_name).count, Integer)
assumed = proxy_association.owner.send(counter_cache_name)
assumed ||= proxy_association.owner.send(association_name).count
assumed
end
end
end

View File

@@ -14,7 +14,7 @@ module HasTimestampsWithDueAt
class TimestampScanInfo < T::ImmutableStruct
extend T::Sig
const :at, T.nilable(Time)
const :at, T.nilable(T.any(Time, ActiveSupport::TimeWithZone))
const :interval, ActiveSupport::Duration
sig { returns(String) }
@@ -38,19 +38,31 @@ module HasTimestampsWithDueAt
sig(:final) do
params(field: Symbol, interval: ActiveSupport::Duration).void
end
def self.attr_json_due_timestamp(field, interval)
def self.due_timestamp(field, interval)
attr_json_due_timestamp(field, interval, json_field: false)
end
sig(:final) do
params(
field: Symbol,
interval: ActiveSupport::Duration,
json_field: T::Boolean,
).void
end
def self.attr_json_due_timestamp(field, interval, json_field: true)
field_pattern = /scanned_(.*)_at/
field_name = field_pattern.match(field.to_s)&.[](1)&.to_sym
raise "Invalid field name: #{field}" if field_name.nil?
# define the attribute
T.unsafe(self).attr_json field, ActiveModelUtcTimeValue.new
T.unsafe(self).attr_json(field, ActiveModelUtcTimeValue.new) if json_field
T
.unsafe(self)
.define_method(:"#{field_name}_scan") do
T.bind(self, HasTimestampsWithDueAt)
TimestampScanInfo.new(at: read_attribute(field), interval:)
at = read_attribute(field.to_s)
TimestampScanInfo.new(at:, interval:)
end
T.unsafe(self).due_at_timestamp_fields =

View File

@@ -1,33 +1,12 @@
# typed: strict
class Domain::User::FaUser < Domain::User
attr_json :state, :string
attr_json :name, :string
attr_json :url_name, :string
attr_json :full_name, :string
attr_json :account_status, :string
attr_json :artist_type, :string
attr_json :mood, :string
attr_json :profile_html, :string
# num_* are those indicated on the user page
attr_json :num_pageviews, :integer
attr_json :num_submissions, :integer
attr_json :num_comments_recieved, :integer
attr_json :num_comments_given, :integer
attr_json :num_journals, :integer
attr_json :num_favorites, :integer
attr_json :num_watched_by, :integer
attr_json :num_watching, :integer
attr_json_due_timestamp :scanned_gallery_at, 3.years
attr_json_due_timestamp :scanned_page_at, 3.months
attr_json_due_timestamp :scanned_follows_at, 3.months
attr_json_due_timestamp :scanned_followed_by_at, 3.months
attr_json_due_timestamp :scanned_incremental_at, 1.month
attr_json :registered_at, :datetime
attr_json :migrated_followed_users_at, :datetime
attr_json :last_user_page_id, :integer
attr_json :last_gallery_page_id, :integer
attr_json :page_scan_error, :string
attr_json :is_disabled, :boolean
aux_table :fa
due_timestamp :scanned_gallery_at, 3.years
due_timestamp :scanned_page_at, 3.months
due_timestamp :scanned_follows_at, 3.months
due_timestamp :scanned_followed_by_at, 3.months
due_timestamp :scanned_incremental_at, 1.month
# todo - set this to be the right fav model type
has_many :user_post_favs,

View File

@@ -0,0 +1,106 @@
# typed: strict
class AddAuxTablesForDomainUsersFaUsers < ActiveRecord::Migration[7.2]
sig { void }
def change
mirai_tablespace!
create_aux_table(:domain_users, :fa) do |t|
t.string :state
t.string :name
t.string :url_name
t.string :full_name
t.string :account_status
t.string :artist_type
t.string :mood
t.string :profile_html
# # num_* are those indicated on the user page
t.integer :num_pageviews
t.integer :num_submissions
t.integer :num_comments_recieved
t.integer :num_comments_given
t.integer :num_journals
t.integer :num_favorites
t.integer :num_watched_by
t.integer :num_watching
t.datetime :scanned_gallery_at
t.datetime :scanned_page_at
t.datetime :scanned_follows_at
t.datetime :scanned_followed_by_at
t.datetime :scanned_incremental_at
t.datetime :registered_at
t.datetime :migrated_followed_users_at
t.references :last_user_page, foreign_key: { to_table: :http_log_entries }
t.references :last_gallery_page,
foreign_key: {
to_table: :http_log_entries,
}
t.string :page_scan_error
t.boolean :is_disabled
end
up_only { execute <<-SQL }
INSERT INTO domain_users_fa_aux (
base_table_id,
state,
name,
url_name,
full_name,
account_status,
artist_type,
mood,
profile_html,
num_pageviews,
num_submissions,
num_comments_recieved,
num_comments_given,
num_journals,
num_favorites,
num_watched_by,
num_watching,
scanned_gallery_at,
scanned_page_at,
scanned_follows_at,
scanned_followed_by_at,
scanned_incremental_at,
registered_at,
migrated_followed_users_at,
last_user_page_id,
last_gallery_page_id,
page_scan_error,
is_disabled
)
SELECT
id as base_table_id,
(json_attributes->>'state')::text as state,
(json_attributes->>'name')::text as name,
(json_attributes->>'url_name')::text as url_name,
(json_attributes->>'full_name')::text as full_name,
(json_attributes->>'account_status')::text as account_status,
(json_attributes->>'artist_type')::text as artist_type,
(json_attributes->>'mood')::text as mood,
(json_attributes->>'profile_html')::text as profile_html,
(json_attributes->>'num_pageviews')::integer as num_pageviews,
(json_attributes->>'num_submissions')::integer as num_submissions,
(json_attributes->>'num_comments_recieved')::integer as num_comments_recieved,
(json_attributes->>'num_comments_given')::integer as num_comments_given,
(json_attributes->>'num_journals')::integer as num_journals,
(json_attributes->>'num_favorites')::integer as num_favorites,
(json_attributes->>'num_watched_by')::integer as num_watched_by,
(json_attributes->>'num_watching')::integer as num_watching,
(json_attributes->>'scanned_gallery_at')::timestamp as scanned_gallery_at,
(json_attributes->>'scanned_page_at')::timestamp as scanned_page_at,
(json_attributes->>'scanned_follows_at')::timestamp as scanned_follows_at,
(json_attributes->>'scanned_followed_by_at')::timestamp as scanned_followed_by_at,
(json_attributes->>'scanned_incremental_at')::timestamp as scanned_incremental_at,
(json_attributes->>'registered_at')::timestamp as registered_at,
(json_attributes->>'migrated_followed_users_at')::timestamp as migrated_followed_users_at,
(json_attributes->>'last_user_page_id')::integer as last_user_page_id,
(json_attributes->>'last_gallery_page_id')::integer as last_gallery_page_id,
(json_attributes->>'page_scan_error')::text as page_scan_error,
(json_attributes->>'is_disabled')::boolean as is_disabled
FROM domain_users
WHERE type = 'Domain::User::FaUser'
SQL
end
end

View File

@@ -0,0 +1,9 @@
class AddUrlStrLowerIndexToDomainPostFiles < ActiveRecord::Migration[7.2]
def change
mirai_tablespace!
add_index :domain_post_files,
"lower('url_str') text_pattern_ops",
name: "idx_domain_post_files_on_url_str_lower"
end
end

View File

@@ -3327,6 +3327,61 @@ CREATE SEQUENCE public.domain_users_e621_aux_base_table_id_seq
ALTER SEQUENCE public.domain_users_e621_aux_base_table_id_seq OWNED BY public.domain_users_e621_aux.base_table_id;
--
-- Name: domain_users_fa_aux; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai
--
CREATE TABLE public.domain_users_fa_aux (
base_table_id bigint NOT NULL,
state character varying,
name character varying,
url_name character varying,
full_name character varying,
account_status character varying,
artist_type character varying,
mood character varying,
profile_html character varying,
num_pageviews integer,
num_submissions integer,
num_comments_recieved integer,
num_comments_given integer,
num_journals integer,
num_favorites integer,
num_watched_by integer,
num_watching integer,
scanned_gallery_at timestamp(6) without time zone,
scanned_page_at timestamp(6) without time zone,
scanned_follows_at timestamp(6) without time zone,
scanned_followed_by_at timestamp(6) without time zone,
scanned_incremental_at timestamp(6) without time zone,
registered_at timestamp(6) without time zone,
migrated_followed_users_at timestamp(6) without time zone,
last_user_page_id bigint,
last_gallery_page_id bigint,
page_scan_error character varying,
is_disabled boolean
);
--
-- Name: domain_users_fa_aux_base_table_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.domain_users_fa_aux_base_table_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: domain_users_fa_aux_base_table_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.domain_users_fa_aux_base_table_id_seq OWNED BY public.domain_users_fa_aux.base_table_id;
--
-- Name: domain_users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
@@ -5010,6 +5065,13 @@ ALTER TABLE ONLY public.domain_users ALTER COLUMN id SET DEFAULT nextval('public
ALTER TABLE ONLY public.domain_users_e621_aux ALTER COLUMN base_table_id SET DEFAULT nextval('public.domain_users_e621_aux_base_table_id_seq'::regclass);
--
-- Name: domain_users_fa_aux base_table_id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.domain_users_fa_aux ALTER COLUMN base_table_id SET DEFAULT nextval('public.domain_users_fa_aux_base_table_id_seq'::regclass);
--
-- Name: domain_users_inkbunny_aux base_table_id; Type: DEFAULT; Schema: public; Owner: -
--
@@ -5857,6 +5919,14 @@ ALTER TABLE ONLY public.domain_users_e621_aux
ADD CONSTRAINT domain_users_e621_aux_pkey PRIMARY KEY (base_table_id);
--
-- Name: domain_users_fa_aux domain_users_fa_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai
--
ALTER TABLE ONLY public.domain_users_fa_aux
ADD CONSTRAINT domain_users_fa_aux_pkey PRIMARY KEY (base_table_id);
--
-- Name: domain_users_inkbunny_aux domain_users_inkbunny_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai
--
@@ -6087,6 +6157,13 @@ CREATE UNIQUE INDEX idx_domain_inkbunny_users_on_ib_id ON public.domain_users US
CREATE UNIQUE INDEX idx_domain_inkbunny_users_on_name ON public.domain_users USING btree (((json_attributes ->> 'name'::text))) WHERE (type = 'Domain::User::InkbunnyUser'::public.domain_user_type);
--
-- Name: idx_domain_post_files_on_url_str_lower; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai
--
CREATE INDEX idx_domain_post_files_on_url_str_lower ON public.domain_post_files USING btree (lower('url_str'::text) text_pattern_ops);
--
-- Name: idx_domain_post_groups_on_owner_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai
--
@@ -7820,6 +7897,27 @@ CREATE INDEX index_domain_users_e621_aux_on_e621_id ON public.domain_users_e621_
CREATE INDEX index_domain_users_e621_aux_on_name ON public.domain_users_e621_aux USING btree (name);
--
-- Name: index_domain_users_fa_aux_on_base_table_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai
--
CREATE INDEX index_domain_users_fa_aux_on_base_table_id ON public.domain_users_fa_aux USING btree (base_table_id);
--
-- Name: index_domain_users_fa_aux_on_last_gallery_page_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai
--
CREATE INDEX index_domain_users_fa_aux_on_last_gallery_page_id ON public.domain_users_fa_aux USING btree (last_gallery_page_id);
--
-- Name: index_domain_users_fa_aux_on_last_user_page_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai
--
CREATE INDEX index_domain_users_fa_aux_on_last_user_page_id ON public.domain_users_fa_aux USING btree (last_user_page_id);
--
-- Name: index_domain_users_inkbunny_aux_on_base_table_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai
--
@@ -9077,6 +9175,14 @@ ALTER TABLE ONLY public.domain_e621_favs
ADD CONSTRAINT fk_rails_0b7ec98aa2 FOREIGN KEY (post_id) REFERENCES public.domain_e621_posts(id);
--
-- Name: domain_users_fa_aux fk_rails_0d64d940cf; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.domain_users_fa_aux
ADD CONSTRAINT fk_rails_0d64d940cf FOREIGN KEY (base_table_id) REFERENCES public.domain_users(id);
--
-- Name: domain_user_job_event_add_tracked_objects fk_rails_0e1b667c4a; Type: FK CONSTRAINT; Schema: public; Owner: -
--
@@ -9269,6 +9375,14 @@ ALTER TABLE ONLY public.domain_fa_user_avatar_versions
ADD CONSTRAINT fk_rails_77fefb9ac3 FOREIGN KEY (item_id) REFERENCES public.domain_fa_user_avatars(id);
--
-- Name: domain_users_fa_aux fk_rails_7e51f8bfbc; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.domain_users_fa_aux
ADD CONSTRAINT fk_rails_7e51f8bfbc FOREIGN KEY (last_gallery_page_id) REFERENCES public.http_log_entries(id);
--
-- Name: domain_post_files fk_rails_7eb6ae5fa3; Type: FK CONSTRAINT; Schema: public; Owner: -
--
@@ -9405,6 +9519,14 @@ ALTER TABLE ONLY public.http_log_entries
ADD CONSTRAINT fk_rails_c5f7bcff78 FOREIGN KEY (caused_by_id) REFERENCES public.http_log_entries(id);
--
-- Name: domain_users_fa_aux fk_rails_c6ff2c94b5; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.domain_users_fa_aux
ADD CONSTRAINT fk_rails_c6ff2c94b5 FOREIGN KEY (last_user_page_id) REFERENCES public.http_log_entries(id);
--
-- Name: domain_user_post_favs fk_rails_c79733f291; Type: FK CONSTRAINT; Schema: public; Owner: -
--
@@ -9516,6 +9638,8 @@ ALTER TABLE ONLY public.domain_twitter_tweets
SET search_path TO "$user", public;
INSERT INTO "schema_migrations" (version) VALUES
('20250721171216'),
('20250718220223'),
('20250718195345'),
('20250718165332'),
('20250718162608'),

View File

@@ -47,6 +47,9 @@ class Domain::PostGroup::SofurryFolder
sig { returns(T::Array[Symbol]) }
def attr_json_registry; end
sig { params(field: Symbol, interval: ActiveSupport::Duration).void }
def due_timestamp(field, interval); end
sig { returns(ColorLogger) }
def logger; end

View File

@@ -47,6 +47,9 @@ class Domain::User
sig { returns(T::Array[Symbol]) }
def attr_json_registry; end
sig { params(field: Symbol, interval: ActiveSupport::Duration).void }
def due_timestamp(field, interval); end
sig { returns(ColorLogger) }
def logger; end

View File

@@ -48,6 +48,9 @@ class Domain::User::E621User
sig { returns(T::Array[Symbol]) }
def attr_json_registry; end
sig { params(field: Symbol, interval: ActiveSupport::Duration).void }
def due_timestamp(field, interval); end
sig { returns(ColorLogger) }
def logger; end

View File

@@ -63,6 +63,9 @@ class Domain::User::FaUser
sig { returns(T::Array[Symbol]) }
def attr_json_registry; end
sig { params(field: Symbol, interval: ActiveSupport::Duration).void }
def due_timestamp(field, interval); end
sig { returns(ColorLogger) }
def logger; end
@@ -525,6 +528,9 @@ class Domain::User::FaUser
sig { params(args: T.untyped, blk: T.untyped).returns(::Domain::UserAvatar) }
def build_avatar(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(::DomainUsersFaAux) }
def build_domain_users_fa_aux(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(::HttpLogEntry) }
def build_last_gallery_page_log_entry(*args, &blk); end
@@ -537,6 +543,12 @@ class Domain::User::FaUser
sig { params(args: T.untyped, blk: T.untyped).returns(::Domain::UserAvatar) }
def create_avatar!(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(::DomainUsersFaAux) }
def create_domain_users_fa_aux(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(::DomainUsersFaAux) }
def create_domain_users_fa_aux!(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(::HttpLogEntry) }
def create_last_gallery_page_log_entry(*args, &blk); end
@@ -549,6 +561,12 @@ class Domain::User::FaUser
sig { params(args: T.untyped, blk: T.untyped).returns(::HttpLogEntry) }
def create_last_user_page_log_entry!(*args, &blk); end
sig { returns(T.nilable(::DomainUsersFaAux)) }
def domain_users_fa_aux; end
sig { params(value: T.nilable(::DomainUsersFaAux)).void }
def domain_users_fa_aux=(value); end
sig { returns(T::Array[T.untyped]) }
def faved_post_ids; end
@@ -646,6 +664,9 @@ class Domain::User::FaUser
sig { returns(T.nilable(::Domain::UserAvatar)) }
def reload_avatar; end
sig { returns(T.nilable(::DomainUsersFaAux)) }
def reload_domain_users_fa_aux; end
sig { returns(T.nilable(::HttpLogEntry)) }
def reload_last_gallery_page_log_entry; end
@@ -655,6 +676,9 @@ class Domain::User::FaUser
sig { void }
def reset_avatar; end
sig { void }
def reset_domain_users_fa_aux; end
sig { void }
def reset_last_gallery_page_log_entry; end
@@ -805,15 +829,6 @@ class Domain::User::FaUser
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def none(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def not_state_account_disabled(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def not_state_error(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def not_state_ok(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def null_relation?(*args, &blk); end
@@ -878,15 +893,6 @@ class Domain::User::FaUser
end
def select(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def state_account_disabled(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def state_error(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def state_ok(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) }
def strict_loading(*args, &blk); end
@@ -2347,31 +2353,31 @@ class Domain::User::FaUser
sig { returns(T::Boolean) }
def saved_change_to_scanned_favs_at?; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def saved_change_to_scanned_followed_by_at; end
sig { returns(T::Boolean) }
def saved_change_to_scanned_followed_by_at?; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def saved_change_to_scanned_follows_at; end
sig { returns(T::Boolean) }
def saved_change_to_scanned_follows_at?; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def saved_change_to_scanned_gallery_at; end
sig { returns(T::Boolean) }
def saved_change_to_scanned_gallery_at?; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def saved_change_to_scanned_incremental_at; end
sig { returns(T::Boolean) }
def saved_change_to_scanned_incremental_at?; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def saved_change_to_scanned_page_at; end
sig { returns(T::Boolean) }
@@ -2470,16 +2476,16 @@ class Domain::User::FaUser
sig { void }
def scanned_favs_at_will_change!; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_followed_by_at; end
sig { params(value: T.nilable(::Time)).returns(T.nilable(::Time)) }
sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_followed_by_at=(value); end
sig { returns(T::Boolean) }
def scanned_followed_by_at?; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_followed_by_at_before_last_save; end
sig { returns(T.untyped) }
@@ -2488,43 +2494,53 @@ class Domain::User::FaUser
sig { returns(T::Boolean) }
def scanned_followed_by_at_came_from_user?; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_followed_by_at_change; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_followed_by_at_change_to_be_saved; end
sig { params(from: T.nilable(::Time), to: T.nilable(::Time)).returns(T::Boolean) }
sig do
params(
from: T.nilable(::ActiveSupport::TimeWithZone),
to: T.nilable(::ActiveSupport::TimeWithZone)
).returns(T::Boolean)
end
def scanned_followed_by_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_followed_by_at_in_database; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_followed_by_at_previous_change; end
sig { params(from: T.nilable(::Time), to: T.nilable(::Time)).returns(T::Boolean) }
sig do
params(
from: T.nilable(::ActiveSupport::TimeWithZone),
to: T.nilable(::ActiveSupport::TimeWithZone)
).returns(T::Boolean)
end
def scanned_followed_by_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_followed_by_at_previously_was; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_followed_by_at_was; end
sig { void }
def scanned_followed_by_at_will_change!; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_follows_at; end
sig { params(value: T.nilable(::Time)).returns(T.nilable(::Time)) }
sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_follows_at=(value); end
sig { returns(T::Boolean) }
def scanned_follows_at?; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_follows_at_before_last_save; end
sig { returns(T.untyped) }
@@ -2533,43 +2549,53 @@ class Domain::User::FaUser
sig { returns(T::Boolean) }
def scanned_follows_at_came_from_user?; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_follows_at_change; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_follows_at_change_to_be_saved; end
sig { params(from: T.nilable(::Time), to: T.nilable(::Time)).returns(T::Boolean) }
sig do
params(
from: T.nilable(::ActiveSupport::TimeWithZone),
to: T.nilable(::ActiveSupport::TimeWithZone)
).returns(T::Boolean)
end
def scanned_follows_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_follows_at_in_database; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_follows_at_previous_change; end
sig { params(from: T.nilable(::Time), to: T.nilable(::Time)).returns(T::Boolean) }
sig do
params(
from: T.nilable(::ActiveSupport::TimeWithZone),
to: T.nilable(::ActiveSupport::TimeWithZone)
).returns(T::Boolean)
end
def scanned_follows_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_follows_at_previously_was; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_follows_at_was; end
sig { void }
def scanned_follows_at_will_change!; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_gallery_at; end
sig { params(value: T.nilable(::Time)).returns(T.nilable(::Time)) }
sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_gallery_at=(value); end
sig { returns(T::Boolean) }
def scanned_gallery_at?; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_gallery_at_before_last_save; end
sig { returns(T.untyped) }
@@ -2578,43 +2604,53 @@ class Domain::User::FaUser
sig { returns(T::Boolean) }
def scanned_gallery_at_came_from_user?; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_gallery_at_change; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_gallery_at_change_to_be_saved; end
sig { params(from: T.nilable(::Time), to: T.nilable(::Time)).returns(T::Boolean) }
sig do
params(
from: T.nilable(::ActiveSupport::TimeWithZone),
to: T.nilable(::ActiveSupport::TimeWithZone)
).returns(T::Boolean)
end
def scanned_gallery_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_gallery_at_in_database; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_gallery_at_previous_change; end
sig { params(from: T.nilable(::Time), to: T.nilable(::Time)).returns(T::Boolean) }
sig do
params(
from: T.nilable(::ActiveSupport::TimeWithZone),
to: T.nilable(::ActiveSupport::TimeWithZone)
).returns(T::Boolean)
end
def scanned_gallery_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_gallery_at_previously_was; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_gallery_at_was; end
sig { void }
def scanned_gallery_at_will_change!; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_incremental_at; end
sig { params(value: T.nilable(::Time)).returns(T.nilable(::Time)) }
sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_incremental_at=(value); end
sig { returns(T::Boolean) }
def scanned_incremental_at?; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_incremental_at_before_last_save; end
sig { returns(T.untyped) }
@@ -2623,43 +2659,53 @@ class Domain::User::FaUser
sig { returns(T::Boolean) }
def scanned_incremental_at_came_from_user?; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_incremental_at_change; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_incremental_at_change_to_be_saved; end
sig { params(from: T.nilable(::Time), to: T.nilable(::Time)).returns(T::Boolean) }
sig do
params(
from: T.nilable(::ActiveSupport::TimeWithZone),
to: T.nilable(::ActiveSupport::TimeWithZone)
).returns(T::Boolean)
end
def scanned_incremental_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_incremental_at_in_database; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_incremental_at_previous_change; end
sig { params(from: T.nilable(::Time), to: T.nilable(::Time)).returns(T::Boolean) }
sig do
params(
from: T.nilable(::ActiveSupport::TimeWithZone),
to: T.nilable(::ActiveSupport::TimeWithZone)
).returns(T::Boolean)
end
def scanned_incremental_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_incremental_at_previously_was; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_incremental_at_was; end
sig { void }
def scanned_incremental_at_will_change!; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_page_at; end
sig { params(value: T.nilable(::Time)).returns(T.nilable(::Time)) }
sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_page_at=(value); end
sig { returns(T::Boolean) }
def scanned_page_at?; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_page_at_before_last_save; end
sig { returns(T.untyped) }
@@ -2668,28 +2714,38 @@ class Domain::User::FaUser
sig { returns(T::Boolean) }
def scanned_page_at_came_from_user?; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_page_at_change; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_page_at_change_to_be_saved; end
sig { params(from: T.nilable(::Time), to: T.nilable(::Time)).returns(T::Boolean) }
sig do
params(
from: T.nilable(::ActiveSupport::TimeWithZone),
to: T.nilable(::ActiveSupport::TimeWithZone)
).returns(T::Boolean)
end
def scanned_page_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_page_at_in_database; end
sig { returns(T.nilable([T.nilable(::Time), T.nilable(::Time)])) }
sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) }
def scanned_page_at_previous_change; end
sig { params(from: T.nilable(::Time), to: T.nilable(::Time)).returns(T::Boolean) }
sig do
params(
from: T.nilable(::ActiveSupport::TimeWithZone),
to: T.nilable(::ActiveSupport::TimeWithZone)
).returns(T::Boolean)
end
def scanned_page_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_page_at_previously_was; end
sig { returns(T.nilable(::Time)) }
sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) }
def scanned_page_at_was; end
sig { void }
@@ -2698,7 +2754,7 @@ class Domain::User::FaUser
sig { returns(T.nilable(::String)) }
def state; end
sig { params(value: T.nilable(T.any(::String, ::Symbol))).returns(T.nilable(T.any(::String, ::Symbol))) }
sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) }
def state=(value); end
sig { returns(T::Boolean) }
@@ -2719,12 +2775,7 @@ class Domain::User::FaUser
sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) }
def state_change_to_be_saved; end
sig do
params(
from: T.nilable(T.any(::String, ::Symbol)),
to: T.nilable(T.any(::String, ::Symbol))
).returns(T::Boolean)
end
sig { params(from: T.nilable(::String), to: T.nilable(::String)).returns(T::Boolean) }
def state_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end
sig { returns(T.nilable(::String)) }
@@ -2733,12 +2784,7 @@ class Domain::User::FaUser
sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) }
def state_previous_change; end
sig do
params(
from: T.nilable(T.any(::String, ::Symbol)),
to: T.nilable(T.any(::String, ::Symbol))
).returns(T::Boolean)
end
sig { params(from: T.nilable(::String), to: T.nilable(::String)).returns(T::Boolean) }
def state_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end
sig { returns(T.nilable(::String)) }
@@ -3266,15 +3312,6 @@ class Domain::User::FaUser
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def none(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def not_state_account_disabled(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def not_state_error(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def not_state_ok(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def null_relation?(*args, &blk); end
@@ -3339,15 +3376,6 @@ class Domain::User::FaUser
end
def select(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def state_account_disabled(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def state_error(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def state_ok(*args, &blk); end
sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) }
def strict_loading(*args, &blk); end

View File

@@ -47,6 +47,9 @@ class Domain::User::InkbunnyUser
sig { returns(T::Array[Symbol]) }
def attr_json_registry; end
sig { params(field: Symbol, interval: ActiveSupport::Duration).void }
def due_timestamp(field, interval); end
sig { returns(ColorLogger) }
def logger; end

View File

@@ -54,6 +54,9 @@ class Domain::User::SofurryUser
sig { returns(T::Array[Symbol]) }
def attr_json_registry; end
sig { params(field: Symbol, interval: ActiveSupport::Duration).void }
def due_timestamp(field, interval); end
sig { returns(ColorLogger) }
def logger; end

2748
sorbet/rbi/dsl/domain_users_fa_aux.rbi generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -5,6 +5,55 @@
# Please instead update this file by running `bin/tapioca gem has_aux_table`.
# source://has_aux_table//lib/has_aux_table/relation_extensions.rb#6
class ActiveRecord::Associations::AssociationScope
# source://activerecord/7.2.2.1/lib/active_record/associations/association_scope.rb#15
def initialize(value_transformation); end
# source://has_aux_table//lib/has_aux_table/relation_extensions.rb#7
def get_chain(reflection, association, tracker); end
# source://has_aux_table//lib/has_aux_table/relation_extensions.rb#40
def scope(association); end
private
# source://activerecord/7.2.2.1/lib/active_record/associations/association_scope.rb#124
def add_constraints(scope, owner, chain); end
# source://activerecord/7.2.2.1/lib/active_record/associations/association_scope.rb#161
def apply_scope(scope, table, key, value); end
# source://activerecord/7.2.2.1/lib/active_record/associations/association_scope.rb#169
def eval_scope(reflection, scope, owner); end
# source://activerecord/7.2.2.1/lib/active_record/associations/association_scope.rb#54
def join(table, constraint); end
# source://activerecord/7.2.2.1/lib/active_record/associations/association_scope.rb#58
def last_chain_scope(scope, reflection, owner); end
# source://activerecord/7.2.2.1/lib/active_record/associations/association_scope.rb#81
def next_chain_scope(scope, reflection, next_reflection); end
# source://activerecord/7.2.2.1/lib/active_record/associations/association_scope.rb#77
def transform_value(value); end
# source://activerecord/7.2.2.1/lib/active_record/associations/association_scope.rb#52
def value_transformation; end
class << self
# source://activerecord/7.2.2.1/lib/active_record/associations/association_scope.rb#10
def create(&block); end
# source://activerecord/7.2.2.1/lib/active_record/associations/association_scope.rb#34
def get_bind_values(owner, chain); end
# source://activerecord/7.2.2.1/lib/active_record/associations/association_scope.rb#6
def scope(association); end
end
end
# source://has_aux_table//lib/has_aux_table/migration_extensions.rb#119
class ActiveRecord::Migration
include ::HasAuxTable::MigrationExtensions
@@ -201,15 +250,6 @@ class HasAuxTable::AuxTableConfig < ::T::Struct
const :foreign_key, T.any(::String, ::Symbol, T::Array[T.any(::String, ::Symbol)])
const :primary_key, T.any(::String, ::Symbol, T::Array[T.any(::String, ::Symbol)])
# source://has_aux_table//lib/has_aux_table/aux_table_config.rb#203
sig do
params(
relation: T.any(::ActiveRecord::Relation, T.class_of(ActiveRecord::Base)),
conditions: T::Hash[::String, T.untyped]
).returns(::ActiveRecord::Relation)
end
def apply_split_conditions!(relation, conditions); end
# source://has_aux_table//lib/has_aux_table/aux_table_config.rb#130
sig { returns(::HasAuxTable::ModelClassHelper) }
def aux; end
@@ -240,13 +280,13 @@ class HasAuxTable::AuxTableConfig < ::T::Struct
sig { returns(::HasAuxTable::ModelClassHelper) }
def main; end
# source://has_aux_table//lib/has_aux_table/aux_table_config.rb#218
# source://has_aux_table//lib/has_aux_table/aux_table_config.rb#204
sig { params(conditions: T::Hash[::String, T.untyped]).returns(T::Hash[::String, T.untyped]) }
def remap_conditions(conditions); end
private
# source://has_aux_table//lib/has_aux_table/aux_table_config.rb#227
# source://has_aux_table//lib/has_aux_table/aux_table_config.rb#213
sig { returns(T::Set[::String]) }
def aux_rejected_column_names; end
@@ -301,23 +341,27 @@ module HasAuxTable::ClassMethods
# Main DSL method for defining auxiliary tables
#
# source://has_aux_table//lib/has_aux_table.rb#40
# source://has_aux_table//lib/has_aux_table.rb#54
sig { params(aux_name: T.any(::String, ::Symbol)).returns(::HasAuxTable::AuxTableConfig) }
def aux_table(aux_name); end
# source://has_aux_table//lib/has_aux_table.rb#43
sig { params(column_name: T.any(::String, ::Symbol)).returns(T.nilable(::HasAuxTable::AuxTableConfig)) }
def aux_table_for(column_name); end
private
# source://has_aux_table//lib/has_aux_table.rb#200
# source://has_aux_table//lib/has_aux_table.rb#214
sig { params(load_schema_method: ::Method, config: ::HasAuxTable::AuxTableConfig).void }
def aux_config_load_schema!(load_schema_method, config); end
# source://has_aux_table//lib/has_aux_table.rb#342
# source://has_aux_table//lib/has_aux_table.rb#349
sig { params(aux_table_name: ::Symbol, main_columns: T::Array[::String], aux_columns: T::Array[::String]).void }
def check_for_overlapping_columns!(aux_table_name, main_columns, aux_columns); end
# Generate auxiliary model class dynamically
#
# source://has_aux_table//lib/has_aux_table.rb#75
# source://has_aux_table//lib/has_aux_table.rb#89
sig do
params(
aux_name: ::Symbol,
@@ -327,43 +371,43 @@ module HasAuxTable::ClassMethods
end
def generate_aux_config(aux_name, foreign_key: T.unsafe(nil), primary_key: T.unsafe(nil)); end
# source://has_aux_table//lib/has_aux_table.rb#233
# source://has_aux_table//lib/has_aux_table.rb#257
sig { params(config: ::HasAuxTable::AuxTableConfig).void }
def setup_attribute_getter_setter_hooks!(config); end
# source://has_aux_table//lib/has_aux_table.rb#143
# source://has_aux_table//lib/has_aux_table.rb#157
sig { params(config: ::HasAuxTable::AuxTableConfig).void }
def setup_attribute_types_hook!(config); end
# source://has_aux_table//lib/has_aux_table.rb#324
# source://has_aux_table//lib/has_aux_table.rb#331
sig { params(config: ::HasAuxTable::AuxTableConfig).void }
def setup_attributes_hook!(config); end
# source://has_aux_table//lib/has_aux_table.rb#271
# source://has_aux_table//lib/has_aux_table.rb#296
sig { params(config: ::HasAuxTable::AuxTableConfig).void }
def setup_changed_hook!(config); end
# source://has_aux_table//lib/has_aux_table.rb#361
# source://has_aux_table//lib/has_aux_table.rb#368
sig { params(config: ::HasAuxTable::AuxTableConfig).void }
def setup_enum_hook!(config); end
# source://has_aux_table//lib/has_aux_table.rb#255
# source://has_aux_table//lib/has_aux_table.rb#280
sig { params(config: ::HasAuxTable::AuxTableConfig).void }
def setup_initialize_hook!(config); end
# Hook into schema loading to generate attribute accessors when schema is loaded
#
# source://has_aux_table//lib/has_aux_table.rb#184
# source://has_aux_table//lib/has_aux_table.rb#198
sig { params(config: ::HasAuxTable::AuxTableConfig).void }
def setup_load_schema_hook!(config); end
# source://has_aux_table//lib/has_aux_table.rb#306
sig { params(config: ::HasAuxTable::AuxTableConfig).void }
def setup_reload_hook!(config); end
# source://has_aux_table//lib/has_aux_table.rb#289
# source://has_aux_table//lib/has_aux_table.rb#314
sig { params(config: ::HasAuxTable::AuxTableConfig).void }
def setup_save_hook!(config); end
# source://has_aux_table//lib/has_aux_table.rb#411
sig { params(config: ::HasAuxTable::AuxTableConfig).void }
def setup_update_counter_hook!(config); end
end
# source://has_aux_table//lib/has_aux_table/key_type.rb#5
@@ -461,18 +505,18 @@ class HasAuxTable::ModelClassHelper < ::T::Struct
end
end
# source://has_aux_table//lib/has_aux_table/relation_extensions.rb#5
# source://has_aux_table//lib/has_aux_table/relation_extensions.rb#67
module HasAuxTable::RelationExtensions
# source://has_aux_table//lib/has_aux_table/relation_extensions.rb#15
# source://has_aux_table//lib/has_aux_table/relation_extensions.rb#77
sig { params(aux_config: ::HasAuxTable::AuxTableConfig).void }
def setup_main_class_extensions!(aux_config); end
# source://has_aux_table//lib/has_aux_table/relation_extensions.rb#10
# source://has_aux_table//lib/has_aux_table/relation_extensions.rb#72
sig { params(aux_config: ::HasAuxTable::AuxTableConfig).void }
def setup_relation_extensions!(aux_config); end
end
# source://has_aux_table//lib/has_aux_table/relation_extensions.rb#7
# source://has_aux_table//lib/has_aux_table/relation_extensions.rb#69
HasAuxTable::RelationExtensions::Util = HasAuxTable::Util
# source://has_aux_table//lib/has_aux_table/migration_extensions.rb#5

View File

@@ -14,6 +14,16 @@ module Tapioca::Compilers
sig { override.void }
def decorate
root.create_path(constant) do |klass|
klass.create_method(
"due_timestamp",
parameters: [
create_param("field", type: "Symbol"),
create_param("interval", type: "ActiveSupport::Duration"),
],
class_method: true,
return_type: "void",
)
klass.create_method(
"attr_json_due_timestamp",
parameters: [

View File

@@ -1,7 +1,7 @@
# typed: true
module DebugHelpers
# add `debug_sql: true` to tags
def self.debug_sql
# add `log_sql: true` to tags
def self.log_sql
logger = ActiveRecord::Base.logger
ActiveRecord::Base.logger = Logger.new($stdout)
yield

View File

@@ -85,7 +85,7 @@ describe Domain::Fa::Job::BrowsePageJob do
end
unless expect_to_enqueue
it "does not enqueue user page job" do
it "does not enqueue user page job", quiet: false do
expect(SpecUtil.enqueued_jobs(Domain::Fa::Job::UserPageJob)).to eq([])
end
end
@@ -407,8 +407,8 @@ describe Domain::Fa::Job::BrowsePageJob do
perform_now({})
end
include_examples "enqueue post scan", true
include_examples "enqueue file scan", false
# include_examples "enqueue post scan", true
# include_examples "enqueue file scan", false
include_examples "enqueue user page scan", false
end
end

View File

@@ -179,19 +179,26 @@ RSpec.describe "Domain::User counter caches", type: :model do
user.update_column(:user_post_creations_count, nil)
user.reload
user = Domain::User.find(user.id)
expect(user.user_post_creations_count).to eq(nil)
expect(user.user_post_creations.size).to eq(1)
expect(user.user_post_creations.length).to eq(1)
expect(user.user_post_creations.count).to eq(1)
# create a second post
create(:domain_post_fa_post, creator: user)
user.reload
expect(user.user_post_creations_count).to eq(2)
expect(user.user_post_creations.size).to eq(2)
expect(user.user_post_creations.length).to eq(2)
expect(user.user_post_creations.count).to eq(2)
# and a third to test incrementing
puts "creating a third post"
create(:domain_post_fa_post, creator: user)
user.reload
expect(user.user_post_creations.count).to eq(3)
expect(user.user_post_creations_count).to eq(3)
expect(user.user_post_creations.length).to eq(3)
expect(user.user_post_creations.size).to eq(3)
end

View File

@@ -31,6 +31,7 @@ RSpec.describe Domain::User, type: :model do
expect do
fa_user.upsert_new_favs(fa_posts.map(&:id), log_entry:)
# binding.pry
end.to change { fa_user.reload.user_post_favs.length }.by(1)
expect(fa_user.user_post_favs.length).to eq(2)

View File

@@ -37,8 +37,8 @@ RSpec.configure do |config|
end
config.around(:each) do |example|
if example.example.metadata[:debug_sql]
DebugHelpers.debug_sql(&example)
if example.example.metadata[:log_sql]
DebugHelpers.log_sql(&example)
else
example.call
end

View File

@@ -154,7 +154,7 @@ class SpecUtil
.new("*")
.send(:job_query)
.perform_with_advisory_lock(lock_id: "1234") do |execution|
GoodJob::CurrentThread.job = execution
# GoodJob::CurrentThread.job = execution
end
end