Comments (2)
Hi. If you can give a minimal example to reproduce this error, we could take a look.
from active_type.
Oooops, sorry to too late reply.
table info
corners
- id
- status
displays
- id
- corner_id
Our model code is
class Corner
has_many :displays, inverse_of: :corner, foreign_key: :corner_id
def change_status
self.status = 10 # For simple
end
end
class Display
belongs_to :corner, inverse_of: :displays, foreign_key: :corner_id
after_save :update_corner_status
private
def update_corner_status
corner.change_status
corner.save!
end
end
class DisplayForm < ActiveType::Record[Display] # for callbacks via submit form
end
code to raise error
corner = load_corner
display = ActiveType.cast(corner.displays.build, DisplayForm)
display.save!
If lack of code, please mention me!
from active_type.
Related Issues (20)
- Ruby 3 breaks change_association HOT 3
- active_type 1.4.0 introduced a bug when extending a record in level 2
- 1.9.0 update breaks usage with Authlogic HOT 1
- ActiveType is loosing its changed_association starting with version 1.8.0 HOT 2
- Issues around ActiveType.cast and the association cache HOT 5
- Rails 7 Support HOT 1
- Deprecation warning in Rails 7
- Deprecation warning in Rails 7.0 (Time#to_s(:db))
- NestedAttributes::Association#add_errors_to_parent version check HOT 1
- Rails 7.0.3 - serializable_hash
- Enums require a `<name>_for_database` method to be defined in Rails 6 HOT 1
- `change_assocation` with only a scope proc fails with an error HOT 1
- Methods on ActiveRecord::AttributeMethods::Dirty cause MutationAfterCastError HOT 1
- `cast` function in `ActiveRecord::Base` not copying attributes with `attr_accessor` HOT 3
- Lose attribute values when using AR' accepts_nested_attributes_for HOT 3
- Rails 7.1: "Called finish on a transaction that hasn't started" HOT 1
- Casting drops the `strict_loading` state of an ActiveRecord object HOT 2
- Can´t access the attributes of the original record object after casting via `#attributes`
- Default values are sharing the same object instances HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from active_type.