Search Results

Search found 8 results on 1 pages for 'koss'.

Page 1/1 | 1 

  • Pair of blocks in each?

    - by Aleksandr Koss
    As in the standart cycle: - @goods.each do |good| ??? ...to organize this (HAML): .columns-wrapper .column First good .column Second good .column Third good .columns-wrapper .column Fourth good .column Fifth good .column Sixth good

    Read the article

  • pro/con of having single/multiple action per file in symfony?

    - by koss
    been working with symfony for a while. most tutorials describe having multiple actions in a single php file. however, i find having 1 action per php file easier to maintain. what's the pro/con of both? is this purely a developer preference in code organisation? any performance impact on either approach? what's common practice for reasonably large production applications?

    Read the article

  • Automaticaly update ActiveRecord object

    - by Aleksandr Koss
    I have same models: class Father < ActiveRecord::Base has_many :children end class Child < ActiveRecord::Base  belongs_to :father end Then do something like that: $ script/console test Loading test environment (Rails 2.3.5) >> @f1 = Father.create :test => "Father" => #<Father id: 1, test: "Father", created_at: "2010-03-30 08:01:41", updated_at: "2010-03-30 08:01:41"> >> @f2 = Father.find :first => #<Father id: 1, test: "Father", created_at: "2010-03-30 08:01:41", updated_at: "2010-03-30 08:01:41"> >> @f1 == @f2 => true >> @f1.children => [] >> @f2.children => [] >> @f1.children.create :test => "Child1" => #<Child id: 1, test: "Child1", father_id: 1, created_at: "2010-03-30 08:02:15", updated_at: "2010-03-30 08:02:15"> >> @f1.children => [#<Child id: 1, test: "Child1", father_id: 1, created_at: "2010-03-30 08:02:15", updated_at: "2010-03-30 08:02:15">] >> @f2.children => [] >> @f2.reload => #<Father id: 1, test: "Father", created_at: "2010-03-30 08:01:41", updated_at: "2010-03-30 08:01:41"> >> @f2.children => [#<Child id: 1, test: "Child1", father_id: 1, created_at: "2010-03-30 08:02:15", updated_at: "2010-03-30 08:02:15">] As you see rails cache @f2 object. To get actual data we should call reload. There is a way to automatically reload @f2 after children update without calling method "reload"?

    Read the article

  • Auto injecting logger with guice

    - by koss
    With reference to Guice's custom injections article, its TypeListener performs a check for InjectLogger.class annotation - which can be optional. Removing that check will inject to all Logger.class types. class Log4JTypeListener implements TypeListener { public <T> void hear(TypeLiteral<T> typeLiteral, TypeEncounter<T> typeEncounter) { for (Field field : typeLiteral.getRawType().getDeclaredFields()) { if (field.getType() == Logger.class && field.isAnnotationPresent(InjectLogger.class)) { typeEncounter.register(new Log4JMembersInjector<T>(field)); } } } } I'm tempted to remove "&& field.isAnnotationPresent(InjectLogger.class)" from the listener. If we're using Guice to inject all instances of our Logger, is there any reason not to do it automatically (without need to annotate)?

    Read the article

1