Skip to content

Instantly share code, notes, and snippets.

View frcake's full-sized avatar

mpdev frcake

  • Athens, Greece
View GitHub Profile
class UsersController < ApplicationController
def show
@user = User.find(params[:id])
end
before_action :authenticate_user!
def edit
Started PUT "/classifieds/72/favorite?type=favorite" for 127.0.0.1 at 2016-09-08 21:58:36 +0300
Processing by ClassifiedsController#favorite as HTML
Parameters: {"authenticity_token"=>"yynpSeBi2Jsr+GzGZZWbxmBCZSxXfOvG1NU9L3lX3pafRbtka779xUB18MkZUFPxtvQh7O4siIpPe5gl8XGbyQ==", "type"=>"favorite", "id"=>"72"}
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 4], ["LIMIT", 1]]
Classified Load (0.1ms) SELECT "classifieds".* FROM "classifieds" WHERE "classifieds"."id" = ? LIMIT ? [["id", 72], ["LIMIT", 1]]
(0.1ms) begin transaction
SOLR Request (4.4ms) [ path=update parameters={} ]
SQL (0.4ms) INSERT INTO "favorite_classifieds" ("user_id", "classified_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["user_id", 4], ["classified_id", 72], ["created_at", 2016-09-08 18:58:36 UTC], ["updated_at", 2016-09-08 18:58:36 UTC]]
(20.3ms) commit transaction
@frcake
frcake / migration.rb
Last active September 12, 2016 16:18
class CreateFavoriteClassifieds < ActiveRecord::Migration[5.0]
def change
create_table :favorite_classifieds do |t|
t.references :user
t.references :classified
t.timestamps
end
end
end
<div class="center-div">
<div class="messages-box">
<% page_header "Αποστολή μηνύματος" %>
<%= form_tag messages_path, method: :post do %>
<div class="form-group">
<%= label_tag 'message[subject]', 'Αποστολή μηνύματος για την αγγελία : ' %>
<%= label_tag(:classified_id, "#{@classified.title}") %> <!-- integrate this -->
def index
@search = Classified.search do
fulltext params[:search]
with(:created_at).less_than(Time.zone.now)
facet(:date)
with(:date,params[:month]) if params[:month].present?
end
@frcake
frcake / log.txt
Created September 16, 2016 13:20
frcake@frcake-OptiPlex-380:~/workspace/Site/brokerv1/brokr$ rake sunspot:reindex
rake aborted!
NameError: uninitialized constant Sprockets::Helpers
/home/frcake/workspace/Site/brokerv1/brokr/app/uploader/image_uploader.rb:12:in `<class:ImageUploader>'
/home/frcake/workspace/Site/brokerv1/brokr/app/uploader/image_uploader.rb:3:in `<top (required)>'
Tasks: TOP => sunspot:reindex
(See full trace by running task with --trace)
@frcake
frcake / log.txt
Created September 16, 2016 13:57
Started GET "/" for 127.0.0.1 at 2016-09-16 16:54:40 +0300
Processing by ClassifiedsController#index as HTML
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 4], ["LIMIT", 1]]
SOLR Request (7.6ms) [ path=select parameters={fq: ["type:Classified"], start: 0, rows: 30, q: "*:*"} ]
Classified Load (1.2ms) SELECT "classifieds".* FROM "classifieds" WHERE "classifieds"."id" IN (38, 39, 40)
Rendering classifieds/index.html.erb within layouts/application
FavoriteClassified Load (0.3ms) SELECT "favorite_classifieds".* FROM "favorite_classifieds" WHERE "favorite_classifieds"."user_id" = ? [["user_id", 4]]
Photo Load (0.3ms) SELECT "photos".* FROM "photos" WHERE "photos"."classified_id" = ? ORDER BY "photos"."id" ASC LIMIT ? [["classified_id", 38], ["LIMIT", 1]]
CACHE (0.0ms) SELECT "photos".* FROM "photos" WHERE "photos"."classified_id" = ? ORDER BY "photos"."id" ASC LIMIT ? [["classified_id", 38], ["LIMIT", 1]]
Photo Load (0.2
def index
@root_categories = Categories.roots
end
Rendered classifieds/index.html.erb within layouts/application (24.0ms)
Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."parent_id" IS NULL ORDER BY "categories"."lft"
Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE ("categories"."lft" <= 1) AND ("categories"."rgt" >= 12) AND "categories"."parent_id" IS NULL ORDER BY "categories"."lft" LIMIT ? [["LIMIT", 1]]
Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 12) ORDER BY "categories"."lft"
Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE ("categories"."lft" <= 13) AND ("categories"."rgt" >= 62) AND "categories"."parent_id" IS NULL ORDER BY "categories"."lft" LIMIT ? [["LIMIT", 1]]
Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE ("categories"."lft" >= 13) AND ("categories"."lft" < 62) ORDER BY "categories"."lft"
Category Load (0.2ms) SELECT "categories".* FROM "categories" WHER
@frcake
frcake / query.txt
Last active September 19, 2016 16:44
Rendered classifieds/index.html.erb within layouts/application (24.1ms)
Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."parent_id" IS NULL ORDER BY "categories"."lft"
Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."parent_id" IN (205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218) ORDER BY "categories"."lft"
Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."parent_id" IN (244, 245, 246, 247, 248, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 249, 250, 251, 252, 253, 291, 292, 293, 294, 295, 296, 297, 298, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290) ORDER BY "categories"."lft"
Completed 200 OK in 163ms (Views: 150.9ms | ActiveRecord: 3.6ms | Solr: 3.2ms)