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
>> p = Product.first | |
=> #<Product id=1 type=:product name="X wing 100" description=<not loaded> testers_left=0 created_at=#<DateTime: 23564969261/9600,1/12,2299161> updated_at=#<DateTime: 23564969261/9600,1/12,2299161> deleted_at=<not loaded> owner_id=2> | |
>> p.testers | |
=> [] | |
>> p.testers.count | |
=> 0 | |
>> p.save | |
DataMapper::Associations::ImmutableAssociationError: You can not modify this association | |
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.4/lib/dm-core/associations/one_to_many.rb:247:in `assert_mutable' | |
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.4/lib/dm-core/associations/one_to_many.rb:199:in `save' |
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
[ 14:05:33 teamon ~ ] lsof | grep postgres | |
[ 14:05:56 teamon ~ ] dropdb ps11_test | |
dropdb: database removal failed: ERROR: database "ps11_test" is being accessed by other users | |
[ 14:06:14 teamon ~ ] lsof | |
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | |
loginwind 24 teamon cwd DIR 14,2 1394 2 / | |
loginwind 24 teamon txt REG 14,2 938352 1449540 /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow | |
loginwind 24 teamon txt REG 14,2 600128 1425122 /System/Library/PrivateFrameworks/Admin.framework/Versions/A/Admin | |
loginwind 24 teamon txt REG 14,2 332016 1446819 /System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount | |
loginwind 24 teamon txt REG 14,2 103024 28824 /System/Library/LoginPlugins/FSDisconnect.loginPlugin/Contents/MacOS/FSDisconnect |
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
def full_path_data_with_children | |
(self.ancestors << self).map { |e| | |
pid = e.id == 1 ? 0 : e.id | |
{ :id => pid, :data => e.children.sort.map { |i| { :id => i.id, :name => i.name, :parent_id => pid } } } | |
}.flatten | |
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
Gem.clear_paths | |
Gem.path.unshift(Merb.root / "gems") | |
# Merb.push_path(:lib, Merb.root / "lib") | |
dependency 'dm-aggregates' | |
deps = %w[-slices -auth -assets _helpers -haml | |
-action-args _paginate] | |
dependencies deps.map {|d| "merb#{d}"} | |
require 'merb_has_flash' |
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
~ Loaded DEVELOPMENT Environment... | |
~ loading gem 'dm-aggregates' ... | |
~ loading gem 'merb-slices' ... | |
~ Registered slice 'MerbAuth' located at /opt/local/lib/ruby/gems/1.8/gems/merb-auth-0.1.0 | |
~ loading gem 'merb-auth' ... | |
~ loading gem 'merb-assets' ... | |
~ loading gem 'merb_helpers' ... <<<=== | |
~ loading gem 'merb-haml' ... | |
~ loading gem 'merb-action-args' ... | |
~ loading gem 'merb_paginate' ... |
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
#search_box | |
%h2 Znajdz produkt lub usługę » Sprawdz rekomendację » Wyślij zapytanie | |
- form_tag :action => search_url_from_controller_name(controller_name) do | |
= text_field :name => 'search', :value => params[:search].blank? ? 'Search text'.t : params[:search].gsub('+', ' ') | |
= submit_field :value => 'Search'.t, :class => 'submit' |
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
@list_of_days.each do |i| | |
my_sweet_array = [] | |
i = i.from | |
while i < i.to | |
my_sweet_array << i | |
i += 1.day | |
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
merb : worker (port 4000) ~ Started request handling: Sun Oct 19 19:45:14 +0200 2008 | |
merb : worker (port 4000) ~ Routed to: {"action"=>"destroy", "controller"=>"merb_auth_slice_password/sessions"} | |
merb : worker (port 4000) ~ Params: {"action"=>"destroy", "controller"=>"merb_auth_slice_password/sessions"} | |
~ SELECT "session_id", "data", "created_at" FROM "sessions" WHERE ("session_id" = '5cb55787da7aa5f05eed4fd2a9eacbf7') ORDER BY "session_id" LIMIT 1 | |
merb : worker (port 4000) ~ Could not log in - (Merb::Controller::Unauthenticated) | |
/opt/local/lib/ruby/gems/1.8/gems/merb-auth-core-0.9.9/lib/merb-auth-core/authentication.rb:90:in `authenticate!' | |
/opt/local/lib/ruby/gems/1.8/gems/merb-auth-core-0.9.9/lib/merb-auth-core/session_mixin.rb:35:in `authenticate!' | |
/opt/local/lib/ruby/gems/1.8/gems/merb-auth-core-0.9.9/lib/merb-auth-core/authenticated_helper.rb:32:in `ensure_authenticated' | |
/opt/local/lib/ruby/gems/1.8/gems/merb-core-0.9.9/lib/merb-core/controller/abstract_controller.rb:342:in `send' | |
/opt/local/ |
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
# This file is specifically setup for use with the merb-auth plugin. | |
# This file should be used to setup and configure your authentication stack. | |
# It is not required and may safely be deleted. | |
# | |
# To change the parameter names for the password or login field you may set either of these two options | |
# | |
# Merb::Plugins.config[:"merb-auth"][:login_param] = :email | |
# Merb::Plugins.config[:"merb-auth"][:password_param] = :my_password_field_name | |
begin |
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
merb : worker (port 4000) ~ Unknown property 'abstract?' - (ArgumentError) | |
/opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.7/lib/dm-core/model.rb:452:in `method_missing' | |
/opt/local/lib/ruby/gems/1.8/gems/merb-auth-core-0.9.10/lib/merb-auth-core/authentication.rb:79:in `authenticate!' | |
/opt/local/lib/ruby/gems/1.8/gems/merb-haml-0.9.10/lib/merb-haml/template.rb:52:in `detect' | |
/opt/local/lib/ruby/gems/1.8/gems/merb-auth-core-0.9.10/lib/merb-auth-core/authentication.rb:77:in `each' | |
/opt/local/lib/ruby/gems/1.8/gems/merb-auth-core-0.9.10/lib/merb-auth-core/authentication.rb:77:in `detect' | |
/opt/local/lib/ruby/gems/1.8/gems/merb-auth-core-0.9.10/lib/merb-auth-core/authentication.rb:77:in `authenticate!' | |
/opt/local/lib/ruby/gems/1.8/gems/merb-auth-core-0.9.10/lib/merb-auth-core/session_mixin.rb:25:in `authenticate!' | |
/opt/local/lib/ruby/gems/1.8/gems/merb-auth-core-0.9.10/lib/merb-auth-core/authenticated_helper.rb:32:in `ensure_authenticated' | |
/opt/local/lib/ruby/gems/1.8/gems/merb-core-0.9.10/lib/merb-core/cont |