Class: ConfigSerializer

Inherits:
ActiveModel::Serializer
  • Object
show all
Defined in:
app/serializers/config_serializer.rb

Instance Method Summary collapse

Instance Method Details

#foodsoftObject


17
18
19
20
21
22
23
# File 'app/serializers/config_serializer.rb', line 17

def foodsoft
  {
    version: Foodsoft::VERSION,
    revision: Foodsoft::REVISION,
    url: object[:foodsoft_url]
  }
end

25
26
27
28
29
30
31
32
33
34
# File 'app/serializers/config_serializer.rb', line 25

def page_footer_html  # also see footer layout

  if FoodsoftConfig[:page_footer].present?
    FoodsoftConfig[:page_footer]
  elsif FoodsoftConfig[:homepage].present?
    ActionController::Base.helpers.link_to(FoodsoftConfig[:name], FoodsoftConfig[:homepage])
  else
    FoodsoftConfig[:name]
  end
end

#webstats_tracking_code_htmlObject


36
37
38
# File 'app/serializers/config_serializer.rb', line 36

def webstats_tracking_code_html
  FoodsoftConfig[:webstats_tracking_code].presence
end