class Locomotive::Steam::ContentTypeRepository

Public Instance Methods

by_slug(slug_or_content_type) click to toggle source
# File lib/locomotive/steam/repositories/content_type_repository.rb, line 13
def by_slug(slug_or_content_type)
  if slug_or_content_type.is_a?(String)
    query { where(slug: slug_or_content_type) }.first
  else
    slug_or_content_type
  end
end
fields_for(content_type) click to toggle source
# File lib/locomotive/steam/repositories/content_type_repository.rb, line 26
def fields_for(content_type)
  return nil if content_type.nil?
  content_type.fields
end
look_for_unique_fields(content_type) click to toggle source
# File lib/locomotive/steam/repositories/content_type_repository.rb, line 21
def look_for_unique_fields(content_type)
  return nil if content_type.nil?
  content_type.fields.unique
end
select_options(content_type, name) click to toggle source
# File lib/locomotive/steam/repositories/content_type_repository.rb, line 31
def select_options(content_type, name)
  return nil if content_type.nil? || name.nil?
  content_type.fields.select_options(name.to_s)
end