telegram_bot_engine 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b3bf5d33786a7847de84d3b85308001301ea88d642d8b8e881341be9bd311d1
4
- data.tar.gz: 71a00b7a640dfd91c79b6080a3295ab6621fc938a05504f94c28f9757a655c59
3
+ metadata.gz: b435eb056de0e35576e718a7b28785871c14a0ac0cb56fb56d865e8422b956f8
4
+ data.tar.gz: 0ba258e22ae682324f4808786f60dd8d9d1239d07e650b507683dbba58cbfece
5
5
  SHA512:
6
- metadata.gz: 4d892f84a28953e2bc78c157ae9169ba3907e0482b15c79ae3068b2d7c43514d3014ee46ca415e33aaaa94c72d1c9470a9e139066ea816c17844711373d7d18f
7
- data.tar.gz: f9154fdc913b4fe766d89a9e5a6fcca88333a192e1e71c233972c0d1335d7641ef0f30fe2554a1ad16e37920c36e5a91b53a3600f7c754f3eb8e74890cd3c2cf
6
+ metadata.gz: 1d9b49c4b5d4a5c41568a22325cdbd6f7139812f3d51506375153994a1b5db761c987c0770363c0ce5d06e1dd132544b6ce64ba46ae744c309b890cdcb10c9b0
7
+ data.tar.gz: 71274793c8366f7fda154c07d93d1b61f4a8df7246034f6a8a629433f7eb77194fc85efe9fc35a492f901577e8391c2141a0f2490e3acf8782444e18817b9516
@@ -6,6 +6,15 @@ module TelegramBotEngine
6
6
  PER_PAGE = 50
7
7
 
8
8
  def index
9
+ unless Event.table_exists?
10
+ @events = []
11
+ @total_count = 0
12
+ @page = 1
13
+ @total_pages = 0
14
+ flash.now[:alert] = "Events table not found. Run: rails telegram_bot_engine:install:migrations && rails db:migrate"
15
+ return
16
+ end
17
+
9
18
  @events = Event.recent
10
19
  @events = @events.by_type(params[:type]) if params[:type].present?
11
20
  @events = @events.by_action(params[:action_name]) if params[:action_name].present?
@@ -15,6 +15,7 @@ module TelegramBotEngine
15
15
 
16
16
  def self.log(event_type:, action:, chat_id: nil, username: nil, details: {})
17
17
  return unless TelegramBotEngine.config.event_logging
18
+ return unless table_exists?
18
19
 
19
20
  create!(
20
21
  event_type: event_type,
@@ -10,9 +10,9 @@ module TelegramBotEngine
10
10
 
11
11
  initializer "telegram_bot_engine.middleware" do |app|
12
12
  if app.config.api_only
13
- app.middleware.use ActionDispatch::Cookies
14
- app.middleware.use ActionDispatch::Session::CookieStore
15
- app.middleware.use ActionDispatch::Flash
13
+ app.middleware.insert_before 0, ActionDispatch::Cookies
14
+ app.middleware.insert_after ActionDispatch::Cookies, ActionDispatch::Session::CookieStore
15
+ app.middleware.insert_after ActionDispatch::Session::CookieStore, ActionDispatch::Flash
16
16
  end
17
17
  end
18
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TelegramBotEngine
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegram_bot_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TelegramBotEngine Contributors