module GtfsEngine::Concerns::Controllers::Gtfs::ClassMethods

Public Instance Methods

filters(*attrs) click to toggle source
# File lib/gtfs_engine/concerns/controllers/gtfs.rb, line 38
def filters(*attrs)
  attrs.flatten!
  @filters = attrs unless attrs.empty?
  @filters ||= []
end
gtfs_id(id=nil) click to toggle source

@return [Symbol] the unique key for this GTFS association

# File lib/gtfs_engine/concerns/controllers/gtfs.rb, line 33
def gtfs_id(id=nil)
  @gtfs_id = id unless id.nil?
  @gtfs_id or controller_name.singularize.foreign_key
end
record_class() click to toggle source

@return [Class] the ActiveRecord::Base class associated with this

controller
# File lib/gtfs_engine/concerns/controllers/gtfs.rb, line 46
def record_class
  @record_class ||= begin
    "#{name.deconstantize}::#{controller_name.classify}".constantize
  end
end