公告 新的通知功能上线 - 基于 notifications 这个 Rails Engine gem

huacnlee for Ruby China · March 29, 2016 · Last by msl12 replied at April 16, 2016 · 9697 hits

刚刚上线了新的通知系统,采用独立的 gem 提供的功能,以便简化内部的实现。 同时目的也可以正好验证通知功能 Rails Engine。

关于旧数据迁移

Ruby China 之前的通知表已经有接近 100 万条数据了,太多老数据我就没迁移了,只保留了 2016-01-01 之后的通知。

新的实现细节

新的实现,可以参考这个 PR: https://github.com/ruby-china/ruby-china/pull/594


如果你也想在你的项目里面实现类似的功能,可以用:

https://github.com/rails-engine/notifications

从此以后,大家再也不用考虑应用里面的通知中心怎么实现了,用这个就可以了。

求过段时间把表 new_notifications 名字改回来。me 是处女座 哈哈

7 Floor has deleted

总之不开心,https://ruby-china.org/topics/29421 这个问题都不解决的,呜呜呜呜呜呜

干得漂亮

我们刚实现了基于 websocket 的 push notification…… 请问 Ruby-China 的 push 是如何实现的?

好高产。。。

未读消息的查询没有了 😢

#16 楼 @_kaichen 截图看看你的消息列表什么样的?是有未读的在第二页么?

#17 楼 @huacnlee 我记得以前是有个全部和未读的 Tab 可以查询未读的,现在拿掉了吗?

#18 楼 @_kaichen 恩,新实现的 Gem 还没那个 Controller 的功能,所以暂时去掉了

积累了 1000 多条通知没有看,这下清爽了 :plus1:

猴赛雷👍

不过不知道为什么在我的 shell 里运行这句代码时:

rails g notifications:install

会出现这个:

Adding Homeland initializer (config/initializers/notifications.rb)...
      create  config/initializers/notifications.rb
Adding model (notification.rb)...
      create  app/models/notification.rb
Error: Command 'notifications:install:migrations' not recognized
Did you mean: `$ rake notifications:install:migrations` ?

Usage: rails COMMAND [ARGS]

The most common rails commands are:
 generate    Generate new code (short-cut alias: "g")
 console     Start the Rails console (short-cut alias: "c")
 server      Start the Rails server (short-cut alias: "s")
 dbconsole   Start a console for the database specified in config/database.yml
             (short-cut alias: "db")
 new         Create a new Rails application. "rails new my_app" creates a
             new application called MyApp in "./my_app"

In addition to those, there are:
 destroy      Undo code generated with "generate" (short-cut alias: "d")
 plugin new   Generates skeleton for developing a Rails plugin
 runner       Run a piece of code in the application environment (short-cut alias: "r")

All commands can be run with -h (or --help) for more information.
You need to Sign in before reply, if you don't have an account, please Sign up first.