"index_options": "docs"
, и количество вхождений слова перестанет влиять на релевантность."norms": { "enabled": false }
и общая длина строки перестанет влиять на релевантность.upate table_name set position = position + 1 where position >= 5
<template lang="pug">
form
div you wrote: {{input_data.value != '' ? input_data.value : 'nothing'}}
c_input(
:input_data="input_data"
)
button Отправить
</template>
<script>
import c_input from './test_2'
export default {
components: { c_input },
data() {
return {
input_data: {
name: Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5),
append: '',
value: '',
placeholder: '',
error: 'zz'
}
}
}
}
</script>
<template lang="pug">
.form-group
input(
type="text"
class="form-control"
:class="input_data.append"
v-model="input_data.value"
:placeholder="input_data.placeholder"
:name="input_data.name"
:id="input_data.name"
)
label(
:for="input_data.name"
generated="true"
class="error"
v-if="input_data.error"
) error: {{ input_data.error }}
</div>
</template>
<script>
export default {
props: {
input_data: Object
}
}
</script>
2.3.1 :001 > ->() { false }
=> #<Proc:0x00000001f744e0@(irb):1 (lambda)>
2.3.1 :002 > !(->() { false })
=> false
Model1.includes(:model2).map { |item| item.model2.name }.uniq.each { ... }
Model1.includes(:model2).uniq { |item| item.model2.name }.each { ... }
class Article < ...
# ...
def to_param
"#{created_at.year}/#{created_at.month}/#{created_at.day}/#{transliterated_title}"
end
# ..
end
def to_param
"#{created_at.year}/#{created_at.month}/#{created_at.day}/#{id}-#{transliterated_title}"
end
def to_param
"#{created_at.year}/#{created_at.month}/#{created_at.day}/#{transliterated_title}-#{id}"
end
before_save :update_slug
private
def update_slug
self.slug = to_param
end
def to_param
"#{id}-#{transliterated_title}"
end
@resource = Article.find params[:id].to_i
# подключаете удалённый репозиторий к своему
git remote add baz https://github.com/baz/bar.git
git fetch baz
# переключаетесь на нужную ветку
git checkout baz/fuz
# и дальше ответвляетесь от неё
git checkout -b new_branch_name
scenario "root page" do
visit root_path
puts 'A'
expect(page).to have_link("Login", href: login_path(locale: I18n.locale))
puts 'B'
expect(page).to have_link("Signup", href: signup_path(locale: I18n.locale))
puts 'C'
end
module A1
TEST = 'zz'
end
module A1
class B1
def foo
TEST
end
end
end
module A2
TEST = 'zz'
end
class A2::B2
def foo
TEST
end
end
A1::B1.new.foo #> "zz"
A2::B2.new.foo #> NameError: uninitialized constant A2::B2::TEST
error_page 429 /429.html;
server {
listen 80;
server_name zzzz.org;
root /home/apps/zzzz/production/current/public;
error_page 502 /502.html;
# ...
}
let(:confirm_oauth) { double deliver_now: nil }
before do
allow(ConfirmOauth).to receive(:email_confirmation)
.and_return confirm_oauth
end
subject! { do_something_that_calls_mailer }
it do
expect(ConfirmOauth).to have_received(:email_confirmation).with user
expect(confirm_oauth).to have_received :deliver_now
end
class Manage::SomeController < ...
layout 'manage_application'
end
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_files = false
rescue_from ActionController::RoutingError, with: :routing_error
Post
.where.not(id: @posts_hot.map(&:id))
.where.not(id: Post.where(post_block_id: 2)) # magic number anipattern. лучше заменить на константу
.where.not(id: Post.joins(:post_asset).where.not(post_asset: { quote: nil }))
.order(created_at: :desc)
.limit(15)
Post
.includes(:post_asset)
.where.not(id: @posts_hot.map(&:id))
.order(created_at: :desc)
.limit(15)
.select { |post| post.post_block_id != 2 }
.select { |post| post.post_asset.try :quote }