-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
I have two models Partner and Order. Partner has_many orders.
So in Partner relation I declared before_add callback.
So it works in normal way, but also if we calling methods like this
Unable to find source-code formatter for language: order. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
.partner
it's called too.
class Partner
field :order_index, type: Integer, default: 0
has_many :orders, before_add: :inc_order_index
private
def inc_order_index
self.inc(order_index: 1)
end
end
class Order
belongs_to :partner
end
only place when order_index is changed is in this callback.
Do you have some ideas what's happen wrong?