1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class ChatTeamTopic < ActiveRecord::Base
  acts_as_paranoid

  ...

  class << self
    alias_method :orig_delete_all, :delete_all

    def delete_all(conditions = nil)
      clear_notifications(conditions) if conditions.present?
      orig_delete_all(conditions)
    end

    def clear_notifications(conditions)
      ...
    end
  end

  ...

end

在ActiveAdmin下自定义filter

rails4之后,之前的`model`里加入`search_methods :filter_name`的做法已经失效,需修改为:``` ruby class PromoCode (ids) { with_tags(ids) } def self. …… Continue reading

Mac上搭建Phonegap环境

Published on October 02, 2014

Rails遗留程序里最常犯的错误(译)

Published on July 23, 2014