Module: Ideasbugs

Defined in:
lib/ideasbugs.rb,
lib/ideasbugs/engine.rb,
lib/ideasbugs/widget.rb,
lib/ideasbugs/version.rb,
lib/ideasbugs/has_feedback.rb,
lib/ideasbugs/configuration.rb,
app/models/ideasbugs/feedback.rb,
app/helpers/ideasbugs/widget_helper.rb,
app/models/ideasbugs/application_record.rb,
app/controllers/ideasbugs/widgets_controller.rb,
app/controllers/ideasbugs/feedbacks_controller.rb,
app/controllers/ideasbugs/application_controller.rb,
app/controllers/ideasbugs/screenshots_controller.rb,
lib/generators/ideasbugs/tenant/tenant_generator.rb,
lib/generators/ideasbugs/install/install_generator.rb

Overview

In-app product feedback collection for Rails. A drop-in widget lets users send bug reports, feature requests, and general feedback (with screenshots) from any page; submissions land in your own database, with a minimal built-in dashboard to browse and triage them.

Defined Under Namespace

Modules: Generators, HasFeedback, Widget, WidgetHelper Classes: ApplicationController, ApplicationRecord, Configuration, Engine, Feedback, FeedbacksController, ScreenshotsController, WidgetsController

Constant Summary collapse

VERSION =
'0.6.0'

Class Method Summary collapse

Class Method Details

.admin?(request) ⇒ Boolean

Can this request browse and triage feedback? Checked by every dashboard action.

Returns:

  • (Boolean)


31
32
33
# File 'lib/ideasbugs.rb', line 31

def admin?(request)
  !!config.authorize_admin.call(request)
end

.configObject



15
16
17
# File 'lib/ideasbugs.rb', line 15

def config
  @config ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields:



19
20
21
# File 'lib/ideasbugs.rb', line 19

def configure
  yield config
end

.enabled?(request) ⇒ Boolean

Can this request send feedback? Checked on the server for the endpoint and by the helper before rendering the widget.

Returns:

  • (Boolean)


25
26
27
# File 'lib/ideasbugs.rb', line 25

def enabled?(request)
  !!config.enabled.call(request)
end

.for(record) ⇒ Object

The feedback belonging to a host record, keyed by its GlobalID — the documented tenant convention. Sugar for Feedback.for_tenant(...); the has_feedback model concern is built on this.



45
46
47
# File 'lib/ideasbugs.rb', line 45

def for(record)
  Feedback.for_tenant(tenant_key_for(record))
end

.tenant(request) ⇒ Object

The tenant key for this request, or nil for the single global board. Normalized to a string so where(tenant:) is consistent whether the resolver returns a GlobalID, an integer id, or a slug; blank becomes nil.



38
39
40
# File 'lib/ideasbugs.rb', line 38

def tenant(request)
  config.tenant.call(request).presence&.to_s
end