This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
namespace :db do | |
desc 'Also create shared_extensions Schema' | |
task extensions: :environment do | |
# Create Schema | |
ActiveRecord::Base.connection.execute 'CREATE SCHEMA IF NOT EXISTS shared_extensions;' | |
# Enable Hstore | |
ActiveRecord::Base.connection.execute 'CREATE EXTENSION IF NOT EXISTS HSTORE SCHEMA shared_extensions;' | |
# Enable UUID-OSSP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.use-docker: &use-docker | |
image: docker:latest | |
variables: | |
DOCKER_DRIVER: overlay | |
services: | |
- docker:dind | |
before_script: | |
- docker login -u $CI_BUILD_USER -p $CI_BUILD_TOKEN registry.gitlab.com | |
- echo $CI_BUILD_REF >> REVISION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def show | |
topic_ids = if (read = ForumTopicRead.find_by(user_id: current_user.id, forum_topic_id: 0)) | |
ForumTopic.unscoped.joins("LEFT JOIN forum_topic_reads ON forum_topic_reads.forum_topic_id = forum_topics.id AND forum_topic_reads.user_id = #{current_user.id}").where(forum_id: params[:id]).where('forum_topics.last_post_at > ?', read.updated_at).group('forum_topics.id').having('count(forum_topic_reads.id) < 1').pluck(:id) | |
else | |
ForumTopic.unscoped.joins("LEFT JOIN forum_topic_reads ON forum_topic_reads.forum_topic_id = forum_topics.id AND forum_topic_reads.user_id = #{current_user.id}").where(forum_id: params[:id]).group('forum_topics.id').having('count(forum_topic_reads.id) < 1').pluck(:id) | |
end | |
render json: topic_ids | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Arahsi Tiba | |
Cерафима | |
Silvio Silvestri | |
Takashi Fudo | |
Uni | |
Vane | |
Zheng Tong | |
Аанг | |
Абу - Аслан | |
Азула |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.service "ngTableService", ["$filter", "$http", ($filter, $http) -> | |
filterData = (data, filter) -> | |
$filter('filter')(data, filter) | |
orderData = (data, params) -> | |
(if params.sorting() then $filter("orderBy")(data, params.orderBy()) else filteredData) | |
sliceData = (data, params) -> | |
data.slice (params.page() - 1) * params.count(), params.page() * params.count() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Акацуки Мэй | |
Алексис Виталина Блэквич | |
Корра | |
Максим Шпорт | |
Шоно Дава | |
Aleksandr | |
Alennora | |
Arsenic | |
Ayrin | |
Bright Lizavetta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def parse_row(row1='', row2='') | |
map = [] | |
map += [JSON.parse(row1)].flatten | |
map += [JSON.parse(row2)].flatten | |
map | |
resque JSON::ParserError | |
[] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if @topic.links.detect{|l| l.rel_url == rel_url(params)}.state == 'redirect' | |
redirect_to @topic.links.detect{|l| l.state == 'main'}.rel_url, status: :moved_permanently | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1><%= @article.head %></hi> | |
<div class="body"> | |
<%= simple_format @article.body %> | |
</div> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Articles</h1> | |
<ul> | |
<% articles.each do |article| %> | |
<li><%= link_to article.head, article %></li> | |
<% end %> | |
</ul> |