Displaying 10 results from an estimated 10 matches for "kukura".
2005 Nov 03
9
[Idea] session-wide persistent variables
I was thinking about having instance variable stored and fetched from
session container automatically before calling an action and after the
action is finished. Using methodology of accessors it would look like:
class MyController < ActionController::Base
persistent_attr :person
def alfa
person = ''John Smith''
# render as usual view alfa.rhtml with anchor
2006 Feb 09
1
migration with PostgreSQL - function nextval does not exist
This might be a problem with postgresql, but I''m not sure. In a
migration I have renamed a table so I wanted to rename a sequencer as
well. It looks like:
execute "ALTER TABLE global_vacations_id_seq RENAME TO vacations_id_seq;"
execute "ALTER TABLE vacations ALTER COLUMN id SET DEFAULT
nextval(''vacations_id_seq''::regclass);"
But the process of
2011 Sep 06
1
Workers getting broken after some time
I have strange error that happens after couple of hours. Some instances
start to respond on any request with status code 500. Log file
unicorn.stderr.log gets populated with this error:
app error: undefined method `each'' for nil:NilClass (NoMethodError)
/usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.2/lib/rack/utils.rb:267:in
`initialize''
2006 Mar 08
2
"humanizing" model attributes presentation
Given a field in database defined as "discount_rate numeric(3,1)" I
found it not very usable for presenting it directly. For example, if
there''s a value 5.00 it will render in
<%= text_field ''model'', ''discount_rate %>
as "0.5E1" which is not very friendly to user. All I do is that I write
kind of proxy accessors (prefixing with
2005 Nov 02
1
getting pagination to work on joined tables
As soon as I use Model.find(:all, :include => [...], :limit => 3) I
loose associations and can''t do :conditions on joined tables. I''m not
able to do pagination in such association.
Only solution I came up with is this beast:
# I set up a paginator:
@reos_pages = Paginator.new self,
Reo.count(conds.join('' AND ''),
2006 Mar 14
3
ActiveRecord row-by-row processing
I want to use ActiveRecord outside of Rails to do processing on large
tables. I want to be able to process the rows as they are retrieved
rather than having to store the results in an intermediate array.
Any suggestions?
Looks like I could hack the adapter to provide an accessor to the
underlying DBI handle. Anything cleaner than that?
2006 May 21
0
problem with "start" in URL
Hi,
I noticed a problem when switched from SCGI to Mongrel. At very first
moment my application goes to url /start/dashboard/overview which in
Mongrel gives me 404 Not Found error. As soon as I changed it to
/appstart/dashboard/overview it fixed the problem.
--
Kamil
2006 Mar 03
1
arrays in model objects
Having a dumb model object like
def MyModel
attr_accessor :property
def initialize
@property = Array.new
end
end
when it is used for for interaction by "@object = MyModel.new" and then
used in view as
<%= text_field ''object'', ''property'' %>
shoudn''t it be rendered as?:
<input type="text"
2006 Mar 09
1
[TIP] Making an intelligent form fields
After searching arround I found a quite smart solution to me for binding
form fields to model in an active way. I use aggregations with single
value objects such as
class Percentage
attr_accessor :value
def initialize(value)
@value = (value.is_a? String) ? value.tr('' %'', '''').to_f : value
end
def to_s
return unless value
2007 Oct 09
0
Fix for using memcache store in mongrel cluster
Hi,
I was having problem with disappearing sessions when storing them in
memcache and when runnning as mongrel cluster in production environment.
I''ve created a patch and it seems it''s now okay. A message to rails-core
including the link to patch <http://dev.rubyonrails.org/ticket/9823> can be
found in the group here: