我的用户模型中有一堆调用,这些调用是在用户创建(成功写入数据库)之后触发的。现在我注意到它们似乎不再被触发了。
before_create :generate_access_token
after_commit :logging, on: :create
after_commit :send_welcome_email, :create_settings, on: :create
我刚刚添加了日志记录方法,如果方法被触发,它只会输出一条消息,但它没有显示在日志中。
def logging
puts "xoxoxo logging user #{self.id} xoxoxo"
end
我在Heroku上使用Ruby 2.1.2和Rails 3.2.21。
我怎样才能让他们再次工作?
这是User._commit_callbacks
[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:logging, @filter=:logging, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=362>, #<ActiveSupport::Callbacks::Callback:0x007fce8a697ea8 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:logging, @filter=:logging, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=362>, #<ActiveSupport::Callbacks::Callback:0x007fce8a697ea8 ...>, #<ActiveSupport::Callbacks::Callback:0x007fce8a696f58 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[...], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:create_settings, @filter=:create_settings, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=370>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:send_welcome_email, @filter=:send_welcome_email, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=366>, #<ActiveSupport::Callbacks::Callback:0x007fce8a696f58 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:logging, @filter=:logging, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=362>, #<ActiveSupport::Callbacks::Callback:0x007fce8a697ea8 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[...], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:send_welcome_email, @filter=:send_welcome_email, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=366>, #<ActiveSupport::Callbacks::Callback:0x007fce8a696f58 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:create_settings, @filter=:create_settings, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=370>, #<ActiveSupport::Callbacks::Callback:0x007fce8a6957e8 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:logging, @filter=:logging, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=362>, #<ActiveSupport::Callbacks::Callback:0x007fce8a697ea8 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:logging, @filter=:logging, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=362>, #<ActiveSupport::Callbacks::Callback:0x007fce8a697ea8 ...>, #<ActiveSupport::Callbacks::Callback:0x007fce8a696f58 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[...], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:create_settings, @filter=:create_settings, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=370>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:send_welcome_email, @filter=:send_welcome_email, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=366>, #<ActiveSupport::Callbacks::Callback:0x007fce8a696f58 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:logging, @filter=:logging, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=362>, #<ActiveSupport::Callbacks::Callback:0x007fce8a697ea8 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[...], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:send_welcome_email, @filter=:send_welcome_email, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=366>, #<ActiveSupport::Callbacks::Callback:0x007fce8a696f58 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:create_settings, @filter=:create_settings, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=370>, #<ActiveSupport::Callbacks::Callback:0x007fce8a69bf80 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:logging, @filter=:logging, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=362>, #<ActiveSupport::Callbacks::Callback:0x007fce8a697ea8 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:logging, @filter=:logging, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=362>, #<ActiveSupport::Callbacks::Callback:0x007fce8a697ea8 ...>, #<ActiveSupport::Callbacks::Callback:0x007fce8a696f58 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[...], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:create_settings, @filter=:create_settings, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=370>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:send_welcome_email, @filter=:send_welcome_email, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=366>, #<ActiveSupport::Callbacks::Callback:0x007fce8a696f58 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:logging, @filter=:logging, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=362>, #<ActiveSupport::Callbacks::Callback:0x007fce8a697ea8 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[...], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:send_welcome_email, @filter=:send_welcome_email, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=366>, #<ActiveSupport::Callbacks::Callback:0x007fce8a696f58 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:create_settings, @filter=:create_settings, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=370>, #<ActiveSupport::Callbacks::Callback:0x007fce8a6957e8 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:logging, @filter=:logging, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=362>, #<ActiveSupport::Callbacks::Callback:0x007fce8a697ea8 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:logging, @filter=:logging, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=362>, #<ActiveSupport::Callbacks::Callback:0x007fce8a697ea8 ...>, #<ActiveSupport::Callbacks::Callback:0x007fce8a696f58 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[...], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:create_settings, @filter=:create_settings, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=370>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:send_welcome_email, @filter=:send_welcome_email, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=366>, #<ActiveSupport::Callbacks::Callback:0x007fce8a696f58 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[#<ActiveSupport::Callbacks::Callback:0x007fce8a691738 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:logging, @filter=:logging, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=362>, #<ActiveSupport::Callbacks::Callback:0x007fce8a697ea8 @klass=User(id: integer, gender: string, name: string, email: string, fb_id: integer, fb_token: text, created_at: datetime, updated_at: datetime, interested_in: text, last_login: datetime, access_token: string, access_token_expires: datetime, last_refreshed_friends_at: datetime, dob: date, fofs_available: boolean, updating_graph: boolean, last_daily_picks_seen_at: datetime, limitless_daily_picks: boolean, dps_limit: integer), @kind=:after, @chain=[...], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:send_welcome_email, @filter=:send_welcome_email, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=366>, #<ActiveSupport::Callbacks::Callback:0x007fce8a696f58 ...>], @per_key={:if=>[], :unless=>[]}, @options={:on=>:create, :if=>["transaction_include_action?(:create)"], :unless=>[]}, @raw_filter=:create_settings, @filter=:create_settings, @compiled_options="true && (transaction_include_action?(:create))", @callback_id=370>]
这是在最后一位用户上运行它们的结果:
irb(main):002:0> User.last.run_callbacks :commit
User Load (30.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
=> true
答案 0 :(得分:0)
最后想出来了:
我已将所有方法合并到一个after_commit调用中并修复了失败的调用。