repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/errors/count_exceeded.rb
lib/ice_cube/errors/count_exceeded.rb
module IceCube # An exception for when a count on a Rule is passed class CountExceeded < StopIteration end end
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/rules/minutely_rule.rb
lib/ice_cube/rules/minutely_rule.rb
module IceCube class MinutelyRule < ValidatedRule include Validations::HourOfDay include Validations::MinuteOfHour include Validations::SecondOfMinute include Validations::DayOfMonth include Validations::DayOfWeek include Validations::Day include Validations::MonthOfYear include Valida...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/rules/secondly_rule.rb
lib/ice_cube/rules/secondly_rule.rb
module IceCube class SecondlyRule < ValidatedRule include Validations::HourOfDay include Validations::MinuteOfHour include Validations::SecondOfMinute include Validations::DayOfMonth include Validations::DayOfWeek include Validations::Day include Validations::MonthOfYear include Valida...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/rules/weekly_rule.rb
lib/ice_cube/rules/weekly_rule.rb
module IceCube class WeeklyRule < ValidatedRule include Validations::HourOfDay include Validations::MinuteOfHour include Validations::SecondOfMinute # include Validations::DayOfMonth # n/a include Validations::DayOfWeek include Validations::Day include Validations::MonthOfYear # incl...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/rules/yearly_rule.rb
lib/ice_cube/rules/yearly_rule.rb
module IceCube class YearlyRule < ValidatedRule include Validations::HourOfDay include Validations::MinuteOfHour include Validations::SecondOfMinute include Validations::DayOfMonth include Validations::DayOfWeek include Validations::Day include Validations::MonthOfYear include Validati...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/rules/hourly_rule.rb
lib/ice_cube/rules/hourly_rule.rb
module IceCube class HourlyRule < ValidatedRule include Validations::HourOfDay include Validations::MinuteOfHour include Validations::SecondOfMinute include Validations::DayOfMonth include Validations::DayOfWeek include Validations::Day include Validations::MonthOfYear include Validati...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/rules/monthly_rule.rb
lib/ice_cube/rules/monthly_rule.rb
module IceCube class MonthlyRule < ValidatedRule include Validations::HourOfDay include Validations::MinuteOfHour include Validations::SecondOfMinute include Validations::DayOfMonth include Validations::DayOfWeek include Validations::Day include Validations::MonthOfYear # include Valid...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/rules/daily_rule.rb
lib/ice_cube/rules/daily_rule.rb
module IceCube class DailyRule < ValidatedRule include Validations::HourOfDay include Validations::MinuteOfHour include Validations::SecondOfMinute include Validations::DayOfMonth include Validations::DayOfWeek include Validations::Day include Validations::MonthOfYear # include Validat...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/builders/hash_builder.rb
lib/ice_cube/builders/hash_builder.rb
module IceCube class HashBuilder def initialize(rule = nil) @hash = {validations: {}, rule_type: rule.class.name} end def validations @hash[:validations] end def []=(key, value) @hash[key] = value end def validations_array(type) validations[type] ||= [] end ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/builders/string_builder.rb
lib/ice_cube/builders/string_builder.rb
module IceCube class StringBuilder attr_writer :base def initialize @types = {} end def piece(type, prefix = nil, suffix = nil) @types[type] ||= [] end def to_s string = @base || "" @types.each do |type, segments| if (f = self.class.formatter(type)) ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/builders/ical_builder.rb
lib/ice_cube/builders/ical_builder.rb
module IceCube class IcalBuilder ICAL_DAYS = ["SU", "MO", "TU", "WE", "TH", "FR", "SA"] def initialize @hash = {} end def self.fixnum_to_ical_day(num) ICAL_DAYS[num] end def [](key) @hash[key] ||= [] end # Build for a single rule entry def to_s arr = [] ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/minute_of_hour.rb
lib/ice_cube/validations/minute_of_hour.rb
module IceCube module Validations::MinuteOfHour def minute_of_hour(*minutes) minutes.flatten.each do |minute| unless minute.is_a?(Integer) raise ArgumentError, "expecting Integer value for minute, got #{minute.inspect}" end verify_alignment(minute, :min, :minute_of_hour) {...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/monthly_interval.rb
lib/ice_cube/validations/monthly_interval.rb
module IceCube module Validations::MonthlyInterval def interval(interval) interval = normalized_interval(interval) verify_alignment(interval, :month, :interval) { |error| raise error } @interval = interval replace_validations_for(:interval, [Validation.new(@interval)]) clobber_base_...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/day_of_year.rb
lib/ice_cube/validations/day_of_year.rb
module IceCube module Validations::DayOfYear def day_of_year(*days) days.flatten.each do |day| unless day.is_a?(Integer) raise ArgumentError, "expecting Integer value for day, got #{day.inspect}" end validations_for(:day_of_year) << Validation.new(day) end clobb...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/count.rb
lib/ice_cube/validations/count.rb
module IceCube module Validations::Count # Value reader for limit def occurrence_count (arr = @validations[:count]) && (val = arr[0]) && val.count end def count(max) unless max.nil? || max.is_a?(Integer) raise ArgumentError, "Expecting Integer or nil value for count, got #{max.ins...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/day_of_week.rb
lib/ice_cube/validations/day_of_week.rb
module IceCube module Validations::DayOfWeek def day_of_week(dows) dows.each do |day, occs| occs.each do |occ| day = TimeUtil.sym_to_wday(day) validations_for(:day_of_week) << Validation.new(day, occ) end end clobber_base_validations :day, :wday self ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/day.rb
lib/ice_cube/validations/day.rb
module IceCube module Validations::Day def day(*days) days = days.flatten return self if days.empty? days.flatten.each do |day| unless day.is_a?(Integer) || day.is_a?(Symbol) raise ArgumentError, "expecting Integer or Symbol value for day, got #{day.inspect}" end ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/secondly_interval.rb
lib/ice_cube/validations/secondly_interval.rb
module IceCube module Validations::SecondlyInterval def interval(interval) verify_alignment(interval, :sec, :interval) { |error| raise error } @interval = normalized_interval(interval) replace_validations_for(:interval, [Validation.new(@interval)]) clobber_base_validations(:sec) sel...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/minutely_interval.rb
lib/ice_cube/validations/minutely_interval.rb
module IceCube module Validations::MinutelyInterval def interval(interval) verify_alignment(interval, :min, :interval) { |error| raise error } @interval = normalized_interval(interval) replace_validations_for(:interval, [Validation.new(@interval)]) clobber_base_validations(:min) sel...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/daily_interval.rb
lib/ice_cube/validations/daily_interval.rb
module IceCube module Validations::DailyInterval # Add a new interval validation def interval(interval) interval = normalized_interval(interval) verify_alignment(interval, :wday, :interval) { |error| raise error } verify_alignment(interval, :day, :interval) { |error| raise error } @in...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/hourly_interval.rb
lib/ice_cube/validations/hourly_interval.rb
module IceCube module Validations::HourlyInterval def interval(interval) verify_alignment(interval, :hour, :interval) { |error| raise error } @interval = normalized_interval(interval) replace_validations_for(:interval, [Validation.new(@interval)]) clobber_base_validations(:hour) sel...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/until.rb
lib/ice_cube/validations/until.rb
module IceCube module Validations::Until extend Deprecated # Value reader for limit def until_time (arr = @validations[:until]) && (val = arr[0]) && val.time end deprecated_alias :until_date, :until_time def until(time) replace_validations_for(:until, time.nil? ? nil : [Validatio...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/hour_of_day.rb
lib/ice_cube/validations/hour_of_day.rb
module IceCube module Validations::HourOfDay # Add hour of day validations def hour_of_day(*hours) hours.flatten.each do |hour| unless hour.is_a?(Integer) raise ArgumentError, "expecting Integer value for hour, got #{hour.inspect}" end verify_alignment(hour, :hour, :ho...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/schedule_lock.rb
lib/ice_cube/validations/schedule_lock.rb
module IceCube module Validations::ScheduleLock # Lock the given time units to the units from schedule's +start_time+ # These locks are all clobberable by other rules of the same #type # using +clobber_base_validation+ # def schedule_lock(*types) types.each do |type| validations_for(...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/month_of_year.rb
lib/ice_cube/validations/month_of_year.rb
module IceCube module Validations::MonthOfYear def month_of_year(*months) months.flatten.each do |month| unless month.is_a?(Integer) || month.is_a?(Symbol) raise ArgumentError, "expecting Integer or Symbol value for month, got #{month.inspect}" end month = TimeUtil.sym_to_m...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/fixed_value.rb
lib/ice_cube/validations/fixed_value.rb
module IceCube # This abstract validation class is used by the various "fixed-time" (e.g. # day, day_of_month, hour_of_day) Validation and ScheduleLock::Validation # modules. It is not a standalone rule validation module like the others. # # Given the including Validation's defined +type+ field, it will lock ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/yearly_interval.rb
lib/ice_cube/validations/yearly_interval.rb
module IceCube module Validations::YearlyInterval def interval(interval) @interval = normalized_interval(interval) replace_validations_for(:interval, [Validation.new(@interval)]) clobber_base_validations(:year) self end class Validation attr_reader :interval def initi...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/day_of_month.rb
lib/ice_cube/validations/day_of_month.rb
module IceCube module Validations::DayOfMonth def day_of_month(*days) days.flatten.each do |day| unless day.is_a?(Integer) raise ArgumentError, "expecting Integer value for day, got #{day.inspect}" end verify_alignment(day, :day, :day_of_month) { |error| raise error } ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/weekly_interval.rb
lib/ice_cube/validations/weekly_interval.rb
module IceCube module Validations::WeeklyInterval def interval(interval, week_start = :sunday) @interval = normalized_interval(interval) @week_start = TimeUtil.wday_to_sym(week_start) replace_validations_for(:interval, [Validation.new(@interval, week_start)]) clobber_base_validations(:day)...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/lock.rb
lib/ice_cube/validations/lock.rb
module IceCube # This validation mixin is used by the various "fixed-time" (e.g. day, # day_of_month, hour_of_day) Validation and ScheduleLock::Validation modules. # It is not a standalone rule validation like the others. # # Given the including Validation's defined +type+ field, it will lock # to the speci...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validations/second_of_minute.rb
lib/ice_cube/validations/second_of_minute.rb
module IceCube module Validations::SecondOfMinute def second_of_minute(*seconds) seconds.flatten.each do |second| unless second.is_a?(Integer) raise ArgumentError, "Expecting Integer value for second, got #{second.inspect}" end verify_alignment(second, :sec, :second_of_min...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/parsers/ical_parser.rb
lib/ice_cube/parsers/ical_parser.rb
module IceCube class IcalParser def self.schedule_from_ical(ical_string, options = {}) data = {} ical_string.each_line do |line| (property, value) = line.split(":") (property, _tzid) = property.split(";") case property when "DTSTART" data[:start_time] = TimeUt...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/parsers/yaml_parser.rb
lib/ice_cube/parsers/yaml_parser.rb
require "yaml" module IceCube class YamlParser < HashParser SERIALIZED_START = /start_(?:time|date): .+(?<tz>(?:-|\+)\d{2}:\d{2})$/ attr_reader :hash def initialize(yaml) @hash = YAML.safe_load(yaml, permitted_classes: [Date, Symbol, Time], aliases: true) yaml.match SERIALIZED_START do |mat...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/parsers/hash_parser.rb
lib/ice_cube/parsers/hash_parser.rb
module IceCube class HashParser attr_reader :hash def initialize(original_hash) @hash = original_hash end def to_schedule data = normalize_keys(hash) schedule = IceCube::Schedule.new parse_time(data[:start_time]) apply_duration schedule, data apply_end_time schedule, da...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/jobs/tracker_job.rb
app/jobs/tracker_job.rb
class TrackerJob < ApplicationJob queue_as :default def perform(category, action, label, value, client_id, ga_id) if ga_id.present? # Initiate the tracker instantiate_tracker(client_id, ga_id) # Send the actual event data to Google @tracker.event(category: category, action: action, lab...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/jobs/application_job.rb
app/jobs/application_job.rb
class ApplicationJob < ActiveJob::Base end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/jobs/empty_trash_job.rb
app/jobs/empty_trash_job.rb
class EmptyTrashJob < ActiveJob::Base queue_as :default def perform topics = Topic.where(current_status: 'deleting').all topics.each do |topic| DeleteTopicJob.perform_later(topic.id) end end end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/jobs/import_job.rb
app/jobs/import_job.rb
class ImportJob < ApplicationJob queue_as :import require 'roo' STATUS = {error: "Error", in_progress: "In Progress", completed: "Completed"} FORMAT_ERROR_MSG = "“The import CSV file was incorrectly formatted.”" SUCCESS_MSG = "Import completed" @@error_objs = [] @@imported_ids = [] @@submited_record_co...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/jobs/backup_job.rb
app/jobs/backup_job.rb
class BackupJob < ApplicationJob queue_as :default def perform(params, user_id) params.select{|k| params[k] == "1"}.keys.each do |model_name| klass = Object.const_get model_name records = klass.all.order(:id) user = User.find(user_id) backup = Backup.new(csv: to_csv(records), user_id: u...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/jobs/delete_user_job.rb
app/jobs/delete_user_job.rb
class DeleteUserJob < ApplicationJob queue_as :default def perform(user_id) user = User.find(user_id) return if user.is_admin? return if user.id == 2 #prevent the system user from being destroyed topic_posts = Post.where(topic_id: Topic.where(user_id: user.id)) # move any authored docs to sy...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/jobs/rebuild_search_job.rb
app/jobs/rebuild_search_job.rb
class RebuildSearchJob < ApplicationJob queue_as :default # Calls a search rebuild, used when categories are updated def perform PgSearch::Multisearch.rebuild(Doc) end end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/jobs/delete_topic_job.rb
app/jobs/delete_topic_job.rb
class DeleteTopicJob < ActiveJob::Base queue_as :default def perform(topic_id) topic = Topic.find(topic_id) topic.destroy unless topic.nil? end end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/uploaders/image_uploader.rb
app/uploaders/image_uploader.rb
class ImageUploader < CarrierWave::Uploader::Base # Include RMagick or MiniMagick support: # include CarrierWave::RMagick include CarrierWave::MiniMagick # Choose what kind of storage to use for this uploader: def self.set_storage if ENV['REMOTE_STORAGE'] == "true" :fog else :file en...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/uploaders/logo_uploader.rb
app/uploaders/logo_uploader.rb
class LogoUploader < CarrierWave::Uploader::Base # Include RMagick or MiniMagick support: # include CarrierWave::RMagick include CarrierWave::MiniMagick # Choose what kind of storage to use for this uploader: def self.set_storage if ENV['REMOTE_STORAGE'] == "true" :fog else :file end...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/uploaders/profile_image_uploader.rb
app/uploaders/profile_image_uploader.rb
class ProfileImageUploader < CarrierWave::Uploader::Base # Include RMagick or MiniMagick support: # include CarrierWave::RMagick include CarrierWave::MiniMagick # Choose what kind of storage to use for this uploader: def self.set_storage if ENV['REMOTE_STORAGE'] == "true" :fog else :file...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/uploaders/attachment_uploader.rb
app/uploaders/attachment_uploader.rb
class AttachmentUploader < CarrierWave::Uploader::Base # Include RMagick or MiniMagick support: # include CarrierWave::RMagick # include CarrierWave::MiniMagick # Choose what kind of storage to use for this uploader: def self.set_storage if ENV['REMOTE_STORAGE'] == "true" :fog else :file...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/errors_helper.rb
app/helpers/errors_helper.rb
module ErrorsHelper end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/docs_helper.rb
app/helpers/docs_helper.rb
# == Schema Information # # Table name: docs # # id :integer not null, primary key # title :string # body :text # keywords :string # title_tag :string # meta_description :string # category_id :integer # user_id :integer # active ...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/emoji_helper.rb
app/helpers/emoji_helper.rb
module EmojiHelper def emojify(content) h(content).to_str.gsub(/:([\w+-]+):/) do |match| if (emoji = Emoji.find_by_alias($1)) %(<img alt="#$1" src="#{image_path("emoji/#{emoji.image_filename}")}" style="vertical-align:middle" width="20" height="20"/>) else match end end.html_...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/comments_helper.rb
app/helpers/comments_helper.rb
module CommentsHelper end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/posts_helper.rb
app/helpers/posts_helper.rb
# == Schema Information # # Table name: posts # # id :integer not null, primary key # topic_id :integer # user_id :integer # body :text # kind :string # active :boolean default(TRUE) # created_at :datetime not null # updated_at :datetime not...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/users_helper.rb
app/helpers/users_helper.rb
# == Schema Information # # Table name: users # # id :integer not null, primary key # login :string # identity_url :string # name :string # admin :boolean default(FALSE) # bio :text # signature ...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/api_keys_helper.rb
app/helpers/api_keys_helper.rb
# == Schema Information # # Table name: api_keys # # id :integer not null, primary key # access_token :string # user_id :integer # name :string # date_expired :datetime # created_at :datetime not null # updated_at :datetime not null # module ApiKeysHelper end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/images_helper.rb
app/helpers/images_helper.rb
# == Schema Information # # Table name: images # # id :integer not null, primary key # key :string # name :string # extension :string # file :text # created_at :datetime not null # updated_at :datetime not null # module ImagesHelper end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/forums_helper.rb
app/helpers/forums_helper.rb
# == Schema Information # # Table name: forums # # id :integer not null, primary key # name :string # description :text # topics_count :integer default(0), not null # last_post_date :datetime # last_post_id :integer # private :bool...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/application_helper.rb
app/helpers/application_helper.rb
module ApplicationHelper include ActsAsTaggableOn::TagsHelper # include TagsHelper # Sets the page title and outputs title if container is passed in. # eg. <%= title('Hello World', :h2) %> will return the following: # <h2>Hello World</h2> as well as setting the page title. # def title(str, container = ni...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/stats_helper.rb
app/helpers/stats_helper.rb
module StatsHelper # See: http://stackoverflow.com/a/14859546/1323144 def median(array) sorted = array.sort len = sorted.length (sorted[(len - 1) / 2] + sorted[len / 2]) / 2.0 end # See: http://stackoverflow.com/a/1341318/1323144 def mean(array) array.inject { |sum, el| sum + el }.to_f / arra...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/categories_helper.rb
app/helpers/categories_helper.rb
# == Schema Information # # Table name: categories # # id :integer not null, primary key # name :string # icon :string # keywords :string # title_tag :string # meta_description :string # rank :integer # front_page :boolean ...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/email_helper.rb
app/helpers/email_helper.rb
module EmailHelper def email_image_tag(image, **options) attachments[image] = File.read(Rails.root.join("app/assets/images/#{image}")) image_tag attachments[image].url, **options end # replace tokens with active content def footer_tokens(text) Hashid::Rails.configuration.salt=AppSettings['settings....
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/locales_helper.rb
app/helpers/locales_helper.rb
module LocalesHelper end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/result_helper.rb
app/helpers/result_helper.rb
module ResultHelper end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/admin_helper.rb
app/helpers/admin_helper.rb
module AdminHelper include StatsHelper def assigned_to(topic) if topic.assigned_user.present? t(:assigned_to, agent: topic.assigned_user.name, default: "assigned to #{topic.assigned_user.name}") else t(:unassigned, default: "Unassigned") end end def admin_title "[Helpy Admin]" en...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/topics_helper.rb
app/helpers/topics_helper.rb
# == Schema Information # # Table name: topics # # id :integer not null, primary key # forum_id :integer # user_id :integer # user_name :string # name :string # posts_count :integer default(0), not null # waiting_on :string ...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/home_helper.rb
app/helpers/home_helper.rb
module HomeHelper end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/admin/reports_helper.rb
app/helpers/admin/reports_helper.rb
module Admin::ReportsHelper def assigned_agent_stats(scoped_stats) User.agents.map { |a| [ a.name, scoped_stats.where(assigned_user_id: a.id).count] } end def tickets_by_status(scoped_stats) scoped_stats.group(:current_status).count end def tickets_by_group(scoped_stats) @teams = @all_teams.sor...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/admin/internal_categories_helper.rb
app/helpers/admin/internal_categories_helper.rb
module Admin::InternalCategoriesHelper end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/admin/docs_helper.rb
app/helpers/admin/docs_helper.rb
module Admin::DocsHelper def categories_collection Category.with_translations(I18n.locale).order(name: :asc).map {|c| [ c.name, c.id ] } end end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/admin/layout_helper.rb
app/helpers/admin/layout_helper.rb
# Helpers for styling the admin layout and views module Admin::LayoutHelper def settings_header(name) content_tag :div, class: 'admin-header' do content_tag :h3 do concat show_responsive_nav concat "#{t(:settings, default: "Settings")}: #{t(name.to_sym, default: name.capitalize)}" en...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/admin/import_helper.rb
app/helpers/admin/import_helper.rb
module Admin::ImportHelper def importable_models_collection [ [t("file_users"),"User"], [t("file_tickets"),"Topic"], [t("file_replies"),"Post"], [t("file_docs"),"Doc"], [t("file_categories"),"Category"], [t("file_forums"), "Forum"] ] end end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/admin/users_helper.rb
app/helpers/admin/users_helper.rb
module Admin::UsersHelper def user_header content_tag :h2, id: 'ticket-page-title' do concat user_name concat user_account_number end end def new_user_ticket_button content_tag :span, class: "hidden-xs pull-right" do link_to t(:open_new_discussion, default: 'Open Discussion'), new_...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/admin/internal_docs_helper.rb
app/helpers/admin/internal_docs_helper.rb
module Admin::InternalDocsHelper end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/helpers/admin/topics_helper.rb
app/helpers/admin/topics_helper.rb
module Admin::TopicsHelper def ticket_page_title concat j ticket_status_label concat j new_ticket_button concat j ticket_nav_dropdown end def user_page_title end def started_by(topic) return "Missing User" if topic.user.nil? user_name = topic.user.name link_to t(:started_by, userna...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/result_controller.rb
app/controllers/result_controller.rb
class ResultController < ApplicationController respond_to :html, :js theme :theme_chosen def index @results = PgSearch.multisearch(params[:q]).page params[:page] @page_title = I18n.translate(:how_can_we_help, default: "How can we help?") add_breadcrumb 'Search' end def search depth = params[...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/posts_controller.rb
app/controllers/posts_controller.rb
# == Schema Information # # Table name: posts # # id :integer not null, primary key # topic_id :integer # user_id :integer # body :text # kind :string # active :boolean default(TRUE) # created_at :datetime not null # updated_at :datetime not...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/docs_controller.rb
app/controllers/docs_controller.rb
# == Schema Information # # Table name: docs # # id :integer not null, primary key # title :string # body :text # keywords :string # title_tag :string # meta_description :string # category_id :integer # user_id :integer # active ...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/forums_controller.rb
app/controllers/forums_controller.rb
# == Schema Information # # Table name: forums # # id :integer not null, primary key # name :string # description :text # topics_count :integer default(0), not null # last_post_date :datetime # last_post_id :integer # private :bool...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/topics_controller.rb
app/controllers/topics_controller.rb
# == Schema Information # # Table name: topics # # id :integer not null, primary key # forum_id :integer # user_id :integer # user_name :string # name :string # posts_count :integer default(0), not null # waiting_on :string ...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/categories_controller.rb
app/controllers/categories_controller.rb
# == Schema Information # # Table name: categories # # id :integer not null, primary key # name :string # icon :string # keywords :string # title_tag :string # meta_description :string # rank :integer # front_page :boolean ...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/home_controller.rb
app/controllers/home_controller.rb
class HomeController < ApplicationController theme :theme_chosen respond_to :html def index redirect_to new_user_session_path if !tickets? && !knowledgebase? @topics = Topic.by_popularity.ispublic.front @rss = Topic.chronologic.active @articles = Doc.all_public_popular.with_translations(I18n.lo...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/omniauth_callbacks_controller.rb
app/controllers/omniauth_callbacks_controller.rb
class OmniauthCallbacksController < Devise::OmniauthCallbacksController skip_before_action :verify_authenticity_token def github handle_redirect('devise.github_uid', 'Github') end def twitter handle_redirect('devise.twitter_uid', 'Twitter') end def google_oauth2 handle_redirect('devise.googl...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/locales_controller.rb
app/controllers/locales_controller.rb
class LocalesController < ApplicationController respond_to :html theme :theme_chosen def select @page_title = t(:select_locale, default: "Change your Locale") add_breadcrumb @page_title end def switch_locale I18n.locale = params[:to] redirect_to root_path end def redirect_on_locale ...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/passwords_controller.rb
app/controllers/passwords_controller.rb
class PasswordsController < Devise::PasswordsController theme :theme_chosen end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/users_controller.rb
app/controllers/users_controller.rb
# == Schema Information # # Table name: users # # id :integer not null, primary key # login :string # identity_url :string # name :string # admin :boolean default(FALSE) # bio :text # signature ...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/invitations_controller.rb
app/controllers/invitations_controller.rb
class InvitationsController < Devise::InvitationsController theme :theme_chosen end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/comments_controller.rb
app/controllers/comments_controller.rb
class CommentsController < ApplicationController before_action :authenticate_user! before_action :get_doc # This method handles the first comment and subsequent replies, storing them # as a Topic with Posts def create if !@doc.topic.present? @topic = Topic.create_comment_thread(@doc.id, current_us...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/errors_controller.rb
app/controllers/errors_controller.rb
class ErrorsController < ApplicationController theme :theme_chosen layout 'errors' def not_found render(:status => 404) end def internal_server_error render(:status => 500) end end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/registrations_controller.rb
app/controllers/registrations_controller.rb
class RegistrationsController < Devise::RegistrationsController theme :theme_chosen # Overwrite update_resource to let users to update their user without giving their password def update_resource(resource, params) unless current_user.provider.nil? params.delete("current_password") resource.update...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/admin_controller.rb
app/controllers/admin_controller.rb
class AdminController < ApplicationController end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
class SessionsController < Devise::SessionsController theme :theme_chosen end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/application_controller.rb
app/controllers/application_controller.rb
class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception helper_method :recaptcha_enabled? before_action :add_root_breadcrumb before_action :set_locale before_action :s...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/omniauth_controller.rb
app/controllers/omniauth_controller.rb
class OmniauthController < ApplicationController def localized # Just save the current locale in the session and redirect to the unscoped path as before session[:omniauth_login_locale] = I18n.locale redirect_to omniauth_authorize_path(:user, params[:provider]) end end
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/flags_controller.rb
app/controllers/flags_controller.rb
# == Schema Information # # Table name: flags # # id :integer not null, primary key # post_id :integer # generated_topic_id :integer # reason :text # created_at :datetime not null # updated_at :datetime not null # class FlagsControll...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/concerns/search_concern.rb
app/controllers/concerns/search_concern.rb
module SearchConcern extend ActiveSupport::Concern protected def search_topics if @start_date.present? && @end_date.present? topics_to_search = Topic.where('created_at >= ?', @start_date).where('created_at <= ?', @end_date) else topics_to_search = Topic.all end if current_user.is_res...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/admin/groups_controller.rb
app/controllers/admin/groups_controller.rb
# == Schema Information # # Table name: tags # # id :integer not null, primary key # name :string # show_on_helpcenter :boolean # show_on_admin :boolean # show_on_dashboard :boolean # class Admin::GroupsController < Admin::BaseController before_a...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/admin/settings_controller.rb
app/controllers/admin/settings_controller.rb
class Admin::SettingsController < Admin::BaseController before_action :verify_admin, except: ['profile'] #before_action :verify_agent, only: ['index'] skip_before_action :verify_authenticity_token def index @settings = AppSettings.get_all render layout: "admin" end def general render layout: ...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/admin/posts_controller.rb
app/controllers/admin/posts_controller.rb
class Admin::PostsController < Admin::BaseController before_action :verify_agent respond_to :js def edit @post = Post.where(id: params[:id]).first end def cancel @post = Post.where(id: params[:id]).first end def create @topic = Topic.find(params[:topic_id]) # @post = Post.new(:body => ...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/admin/docs_controller.rb
app/controllers/admin/docs_controller.rb
class Admin::DocsController < Admin::BaseController before_action :verify_editor before_action :set_categories_and_non_featured respond_to :html, only: ['new','edit','create'] respond_to :js, only: ['destroy'] layout 'admin-content' def new @doc = Doc.new @doc.category_id = params[:category_id] ...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/admin/imports_controller.rb
app/controllers/admin/imports_controller.rb
class Admin::ImportsController < Admin::BaseController before_action :verify_admin before_action :available_file_details, only: [:restore] layout 'admin-settings' def restore if @files_detail.present? row_count = CSV.read(params[:file].path, headers: true, encoding:'iso-8859-1:utf-8').length - 1 ...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/admin/forums_controller.rb
app/controllers/admin/forums_controller.rb
class Admin::ForumsController < Admin::BaseController before_action :verify_agent respond_to :html, only: ['index','show','new','edit','create'] respond_to :js, only: :destroy def index @forums = Forum.where(private: false).order('name ASC') end def new @forum = Forum.new end def edit @f...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false
helpyio/helpy
https://github.com/helpyio/helpy/blob/26aff0e485aee91f41098ee986cfe750746dcfee/app/controllers/admin/topics_controller.rb
app/controllers/admin/topics_controller.rb
# == Schema Information # # Table name: topics # # id :integer not null, primary key # forum_id :integer # user_id :integer # user_name :string # name :string # posts_count :integer default(0), not null # waiting_on :string ...
ruby
MIT
26aff0e485aee91f41098ee986cfe750746dcfee
2026-01-04T15:54:37.819890Z
false