Always I am indebted.
Before_save is called when the Xxxxxx model is changed as shown below, but at that time, the controller receives the result is_change value and wants to change the process according to the result. We are here.
#Controller def update Xxxxxx.update (aaa: aaa, yyy: yyy) I want to use the value of # is_change here end # model class Xxxxxx
I tried google, but I couldn't find it well and asked this question.
It doesn't matter if it is a reference site, so I would appreciate it if you could teach me the appropriate method.
Amazon Linux release 2 (Karoo)
Ruby version: 2.6.1
Answer # 1
Time has passed, so I will close it once.
Answer # 2
Why not make a conditional branch after checking if the records are the same?
- ruby on rails - product model test code does not succeed
- ruby on rails - i want to convert the value of a check box from an array to a character string and display it
- ruby on rails 5 - f the value sent in hidden_field is not displayed
- ruby - [rails] i want to find the date difference using the model created_at
- [sqlite, ruby, rails] i want to sort the hash value data obtained from the table as i expected
- ruby - how to get a set of key and value randomly from hash with rails and use it in view
- ruby on rails 5 - child model record not created
- ruby on rails - about the code of the adjacency list model implemented in rails
- ruby on rails - rails associated model is not saved in db
- [ruby on rails] how to write when getting a model nested in multiple stages with includes
- ruby on rails - i can't create a model with rails
- ruby - unable to create rails model (environment: cloud9)
- ruby - when i try to update rails, the empty value is saved
- ruby on rails 5 - how to check the value of before_action with debugger
- ruby on rails - i want to validate only the foreign key on the model side
- ruby on rails - the link between the model created by devise and the model originally created does not work
- ruby on rails - the value of find_by (id :) becomes nil
- ruby on rails - i want to implement a function that returns a line bot stamp
- [ruby on rails] i want to display a parent model that matches the information of the associated child model
- html - i would like to know how to calculate the average of the data
- mysql - i want to sort the data in the parent table by the value that counts the number of child tables and grandchild tables
- ruby - pass the value from the controller in the rails model
- ruby - rails tutorial chapter 13 delete does not work in the test of increasing/decreasing the number of posts with rspec
- ruby - i want to establish the pagination function after separating the rails method
- ruby - activerecord :: recordnotfound shows that the id cannot be found
- ruby - rails i want to search by multiple keywords
- ruby - how to implement the search function
- ruby - for example, how to create a crawler that wants to get information from tabelog
- ruby on rails - how to implement a sort function by the value of the statistical column that aggregates the values of related