mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-09 23:45:21 +02:00
Cleanup 1
This commit is contained in:
parent
69159fdc86
commit
c598ee7691
12 changed files with 2 additions and 90 deletions
|
@ -8,11 +8,6 @@ class ApplicationController < ActionController::Base
|
|||
before_action :set_default_chat
|
||||
|
||||
private
|
||||
def stream_redirect_back_or_to(path)
|
||||
redirect_target_url = request.referer || path
|
||||
render turbo_stream: turbo_stream.action(:redirect, redirect_target_url)
|
||||
end
|
||||
|
||||
def require_upgrade?
|
||||
return false if self_hosted?
|
||||
return false unless Current.session
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
class Rule::ActionsController < ApplicationController
|
||||
before_action :set_rule
|
||||
before_action :set_action, only: [ :update, :destroy ]
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_rule
|
||||
@rule = Current.family.rules.find(params[:rule_id])
|
||||
end
|
||||
|
||||
def set_action
|
||||
@action = @rule.actions.find(params[:id])
|
||||
end
|
||||
|
||||
def action_params
|
||||
params.require(:action).permit(:action_type)
|
||||
end
|
||||
end
|
|
@ -1,27 +0,0 @@
|
|||
class Rule::TriggersController < ApplicationController
|
||||
before_action :set_rule
|
||||
before_action :set_trigger, only: [ :update, :destroy ]
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_rule
|
||||
@rule = Current.family.rules.find(params[:rule_id])
|
||||
end
|
||||
|
||||
def set_trigger
|
||||
@trigger = @rule.triggers.find(params[:id])
|
||||
end
|
||||
|
||||
def trigger_params
|
||||
params.require(:trigger).permit(:trigger_type)
|
||||
end
|
||||
end
|
|
@ -11,18 +11,6 @@ class RulesController < ApplicationController
|
|||
def new
|
||||
@rule = Current.family.rules.build(
|
||||
resource_type: params[:resource_type] || "transaction",
|
||||
conditions: [
|
||||
Rule::Condition.new(
|
||||
condition_type: params[:condition_type] || "transaction_name",
|
||||
value: params[:condition_value]
|
||||
)
|
||||
],
|
||||
actions: [
|
||||
Rule::Action.new(
|
||||
action_type: params[:action_type] || "set_transaction_category",
|
||||
value: params[:action_value]
|
||||
)
|
||||
]
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -33,8 +33,6 @@ export default class extends Controller {
|
|||
this.effectiveDateInputTarget.value = "";
|
||||
}
|
||||
|
||||
enableEffectiveDate() {}
|
||||
|
||||
#appendTemplate(templateEl, listEl) {
|
||||
const html = templateEl.innerHTML.replaceAll(
|
||||
"IDX_PLACEHOLDER",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class RuleJob < ApplicationJob
|
||||
queue_as :default
|
||||
queue_as :medium_priority
|
||||
|
||||
def perform(rule, ignore_attribute_locks: false)
|
||||
rule.apply(ignore_attribute_locks: ignore_attribute_locks)
|
||||
|
|
|
@ -85,7 +85,6 @@ class Entry < ApplicationRecord
|
|||
entry.update! bulk_attributes
|
||||
|
||||
entry.lock_saved_attributes!
|
||||
entry.entryable.lock_saved_attributes!
|
||||
entry.entryable.lock!(:tag_ids) if entry.transaction? && entry.transaction.tags.any?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,4 +2,5 @@ class ProviderMerchant < Merchant
|
|||
enum :source, { plaid: "plaid", synth: "synth", ai: "ai" }
|
||||
|
||||
validates :name, uniqueness: { scope: [ :source ] }
|
||||
validates :source, presence: true
|
||||
end
|
||||
|
|
|
@ -23,10 +23,6 @@ class Rule < ApplicationRecord
|
|||
registry.condition_filters
|
||||
end
|
||||
|
||||
def title
|
||||
"Test title"
|
||||
end
|
||||
|
||||
def registry
|
||||
@registry ||= case resource_type
|
||||
when "transaction"
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<%= turbo_frame_tag "new_condition" do %>
|
||||
<%= fields_for @rule do |f| %>
|
||||
<%= f.fields_for :conditions do |cf| %>
|
||||
<%= render "rule/conditions/condition_group", form: cf %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -1 +0,0 @@
|
|||
<p>Placeholder: rules#show</p>
|
|
@ -152,9 +152,6 @@ Rails.application.routes.draw do
|
|||
collection do
|
||||
delete :destroy_all
|
||||
end
|
||||
|
||||
resources :triggers, only: :new
|
||||
resources :actions, only: :new
|
||||
end
|
||||
|
||||
# Convenience routes for polymorphic paths
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue