Very short description of the application.
Application is written in ruby language, using Ruby on Rails web framework.
1 | |
JavaScript | |
3 | |
howManyYears += 1; | |
Оператор += в js допускает конкатенацию числа со строкой, соответственно нужно убрать кавычки. В оригинале мы получаем 10, а без кавычек - необходимую единицу. | |
2 | |
Ruby | |
2 | |
if (howManyYears != 0) |
"Gistflow.com" |
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> | |
<pre> | |
</pre> |
Very short description of the application.
Application is written in ruby language, using Ruby on Rails web framework.
class CustomSearch < Spree::Core::Search::Base | |
protected | |
def add_search_scopes(base_scope) | |
statement = nil | |
search.each do |property_name, property_values| | |
property = Spree::Property.find_by_name(property_name.gsub("_any", "")) | |
next unless property | |
substatement = product_property[:property_id].eq(property.id).and(product_property[:value].eq(property_values.first)) |
$gl-padding: 17px; | |
$gl-real-height: 70px; | |
$gl-height: $gl-real-height - $gl-padding * 2; | |
$gl-arrow-width: $gl-real-height / 2; | |
$gl-arrow-height: $gl-real-height / sqrt(3); | |
$gl-arrow-degree: -1 * rad-to-deg(atan($gl-arrow-width / $gl-arrow-height)); | |
$gl-margin-vertical: -1 * (($gl-arrow-height - 1) / 2); | |
$gl-margin-horizontal: -1 * (($gl-arrow-width + 1) / 2); | |
@mixin gl-arrow($first-color, $second-color) { |
.b-box { | |
overflow: hidden; | |
margin: 0 0 20px 0; | |
border-radius: 7px; | |
box-shadow: 1px 1px 2px rgba(0, 0, 0, .2); | |
background: #f4f4f4; | |
> header { | |
border-radius: 7px 7px 0 0; | |
padding: 8px 0 8px 0px; |
<table> | |
<tr class='entry_header'> | |
<th>Task</th> | |
<% @timesheet.date_range.each do |week_date| %> | |
<th><%= week_date.to_formatted_s(:short) %></th> | |
<% end %> | |
</tr> | |
<tr class="fields"> | |
<td><%= f.collection_select(:task_id, @tasks, :id, :name, prompt: true) %></td> | |
<%= f.fields_for :time_entries do |builder|%> |
class TariffSchemeFeeRule < ActiveRecord::Base | |
belongs_to :tariff_scheme | |
belongs_to :fee_rule | |
belongs_to :currency | |
validates :currency_id, uniqueness: { scope: [:fee_rule_id, :tariff_scheme_id] }, presence: true | |
end | |
class TariffScheme < ActiveRecord::Base | |
accepts_nested_attributes_for :tariff_scheme_fee_rules, allow_destroy: true |
class BulkValidator | |
attr_accessor :items, :bulk_validations | |
def initialize(items, validations) | |
@items = items | |
@bulk_validations = build_bulk_validations(validations) | |
end | |
def candidates | |
bulk_validations.each do |validation| |