lib/bobot/configuration.rb in bobot-2.6.0 vs lib/bobot/configuration.rb in bobot-2.6.1
- old
+ new
@@ -12,15 +12,15 @@
raise Bobot::InvalidParameter.new(:domains, "should be a string or an array")
end
end
def find_page_by_id(page_id)
- pages.find { |page| page.page_id == page_id }
+ pages.find { |page| page.page_id.to_s == page_id.to_s }
end
def find_page_by_slug(slug)
- pages.find { |page| page.slug == slug }
+ pages.find { |page| page.slug.to_s == slug.to_s }
end
class Page
attr_accessor :slug, :language, :page_id, :page_access_token, :get_started_payload
@@ -69,11 +69,11 @@
raise Bobot::InvalidParameter.new(:access_token) unless page_access_token.present?
greeting_texts = []
if language.nil?
# Default text
greeting_text = I18n.t("bobot.#{slug}.config.greeting_text", locale: I18n.default_locale, default: nil)
- greeting_texts << { locale: ‘default’, text: greeting_text } if greeting_text.present?
+ greeting_texts << { locale: 'default', text: greeting_text } if greeting_text.present?
# Each languages
I18n.available_locales.each do |locale|
greeting_text = I18n.t("bobot.#{slug}.config.greeting_text", locale: locale, default: nil)
next unless greeting_text.present?
facebook_locales = I18n.t("bobot.#{slug}.config.facebook_locales", locale: locale, default: nil)
@@ -81,11 +81,11 @@
greeting_texts << { locale: locale_long, text: greeting_text }
end
end
else
greeting_text = I18n.t("bobot.#{slug}.config.greeting_text", locale: language, default: nil)
- greeting_texts << { locale: ‘default’, text: greeting_text } if greeting_text.present?
+ greeting_texts << { locale: 'default', text: greeting_text } if greeting_text.present?
end
if greeting_texts.present?
Bobot::Profile.set(
body: { greeting: greeting_texts },
query: { access_token: page_access_token },
@@ -150,11 +150,11 @@
# Default text
if language.nil?
persistent_menu = I18n.t("bobot.#{slug}.config.persistent_menu", locale: I18n.default_locale, default: nil)
if persistent_menu.present?
persistent_menus << {
- locale: ‘default’,
+ locale: 'default',
composer_input_disabled: persistent_menu[:composer_input_disabled],
call_to_actions: persistent_menu[:call_to_actions],
}
end
# Each languages
@@ -172,10 +172,10 @@
end
else
persistent_menu = I18n.t("bobot.#{slug}.config.persistent_menu", locale: language, default: nil)
if persistent_menu.present?
persistent_menus << {
- locale: ‘default’,
+ locale: 'default',
composer_input_disabled: persistent_menu[:composer_input_disabled],
call_to_actions: persistent_menu[:call_to_actions],
}
end
end
\ No newline at end of file