mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
yaml fallback for changelogs
This commit is contained in:
parent
bda757f343
commit
f09270737f
@ -508,7 +508,10 @@ class ContentController < ApplicationController
|
||||
@attribute_field = AttributeField.find_by(id: params[:field_id].to_i)
|
||||
attribute_value = @attribute_field.attribute_values.order('created_at desc').find_or_initialize_by(entity_params)
|
||||
attribute_value.user_id ||= current_user.id
|
||||
attribute_value.value = field_params.fetch('value', '').to_i
|
||||
|
||||
new_universe_id = field_params.fetch('value', nil).to_i
|
||||
new_universe_id = nil if new_universe_id == 0
|
||||
attribute_value.value = new_universe_id
|
||||
attribute_value.save!
|
||||
|
||||
@content = entity_params.fetch('entity_type').constantize.find_by(
|
||||
|
||||
@ -40,6 +40,7 @@ module HasChangelog
|
||||
before_update do
|
||||
if self.is_a?(Attribute)
|
||||
# todo how to get current_user?
|
||||
|
||||
ContentChangeEvent.create(
|
||||
user: find_current_user,
|
||||
changed_fields: changes,
|
||||
|
||||
@ -59,6 +59,10 @@ Rails.application.configure do
|
||||
# routes, locales, etc. This feature depends on the listen gem.
|
||||
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
||||
|
||||
# Whitelist HashWithIndifferentAccess/TimeWithZone for changelog serialization
|
||||
# config.active_record.yaml_column_permitted_classes = [HashWithIndifferentAccess, ActiveSupport::TimeWithZone, Time]
|
||||
config.active_record.use_yaml_unsafe_load = true
|
||||
|
||||
# Set test-mode Stripe API key
|
||||
Stripe.api_key = "sk_test_v37uWbseyPct6PpsfjTa3y1l"
|
||||
config.stripe_publishable_key = 'pk_test_eXI4iyJ2gR9UOGJyJERvDlHF'
|
||||
|
||||
@ -91,6 +91,10 @@ Rails.application.configure do
|
||||
# Do not dump schema after migrations.
|
||||
config.active_record.dump_schema_after_migration = false
|
||||
|
||||
# Whitelist HashWithIndifferentAccess/TimeWithZone for changelog serialization
|
||||
# config.active_record.yaml_column_permitted_classes = [HashWithIndifferentAccess, ActiveSupport::TimeWithZone, Time]
|
||||
config.active_record.use_yaml_unsafe_load = true
|
||||
|
||||
# Devise default url options
|
||||
config.action_mailer.default_url_options = { host: 'www.notebook.ai' }
|
||||
config.active_job.default_url_options = { host: 'www.notebook.ai' }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user