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
class Dcp < Program | |
... | |
def after_initialize | |
ids = Array.new | |
unless (all_subprograms = subprograms.all(:select => 'id')).nil? | |
all_subprograms.each do |subprogram| | |
ids << subprogram.id | |
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
script_console_running = ENV.include?('RAILS_ENV') && IRB.conf[:LOAD_MODULES] && IRB.conf[:LOAD_MODULES].include?('console_with_helpers') | |
rails_running = ENV.include?('RAILS_ENV') && !(IRB.conf[:LOAD_MODULES] && IRB.conf[:LOAD_MODULES].include?('console_with_helpers')) | |
irb_standalone_running = !script_console_running && !rails_running | |
if script_console_running | |
require 'logger' | |
Object.const_set(:RAILS_DEFAULT_LOGGER, Logger.new(STDOUT)) | |
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
class Event < ActiveRecord::Base | |
extend ActiveSupport::Memoizable | |
cattr_accessor :year | |
belongs_to :program | |
has_many :financing_periods, :dependent => :destroy | |
def current_period | |
financing_periods.current(@@year).last(:include => [:plain_financings, { :named_financings => :district }]) |
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
Financing::FINANCINGS.each do |method| | |
define_method method do | |
if current_period && current_period != :nil | |
instance_variable_defined?("@#{method}") ? nil : instance_variable_set("@#{method}", Hash.new) | |
instance_variable_get("@#{method}")[current_period.id] ||= current_period.method("#{method}").call | |
else | |
0.0 | |
end | |
end | |
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
// Здесь представлен пример использования json ответа от контроллера ClassroomsController как источника данных для autocomplete, входящего в набор jQuery UI. | |
$('#classroom_name').change(function () { | |
$(this).autocomplete('disable'); // These two lines fixes bug with simultaneously | |
$(this).autocomplete('enable'); // opening two same auditories at once (on fast clicking) | |
}); | |
$('#classroom_name').autocomplete({ | |
disabled: false, | |
source: function(request, response) { | |
$.getJSON('/editor/classrooms.json', { |
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
script_console_running = ENV.include?('RAILS_ENV') && IRB.conf[:LOAD_MODULES] && IRB.conf[:LOAD_MODULES].include?('console_with_helpers') | |
rails_running = ENV.include?('RAILS_ENV') && !(IRB.conf[:LOAD_MODULES] && IRB.conf[:LOAD_MODULES].include?('console_with_helpers')) | |
irb_standalone_running = !script_console_running && !rails_running | |
if script_console_running | |
require 'logger' | |
Object.const_set(:RAILS_DEFAULT_LOGGER, Logger.new(STDOUT)) | |
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
script_console_running = ENV.include?('RAILS_ENV') && IRB.conf[:LOAD_MODULES] && IRB.conf[:LOAD_MODULES].include?('console_with_helpers') | |
rails_running = ENV.include?('RAILS_ENV') && !(IRB.conf[:LOAD_MODULES] && IRB.conf[:LOAD_MODULES].include?('console_with_helpers')) | |
irb_standalone_running = !script_console_running && !rails_running | |
if script_console_running | |
require 'logger' | |
Object.const_set(:RAILS_DEFAULT_LOGGER, Logger.new(STDOUT)) | |
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
require 'spec_helper' | |
describe "Edit profile process" do | |
before(:each) do | |
@user = Factory.create(:user) | |
@user.confirm! | |
@login_button = I18n.t("devise.sessions.new.submit") | |
@edit_button = I18n.t("devise.registrations.edit.submit") | |
@login_link = I18n.t("devise.menu.login_items.login") | |
@logout_link = I18n.t("devise.menu.login_items.logout") |
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
# Русский перевод для https://github.com/plataformatec/devise/tree/v1.4.7 | |
# Другие переводы на http://github.com/plataformatec/devise/wiki/I18n | |
ru: | |
errors: | |
messages: | |
expired: "устарела. Пожалуйста, запросите новую" | |
not_found: "не найдена" | |
already_confirmed: "уже подтверждена. Пожалуйста, попробуйте войти в систему" | |
not_locked: "не заблокирована" |
OlderNewer