Displaying 20 results from an estimated 20000 matches similar to: "Updated today - number of rows"
2008 Nov 13
5
Touch an ActiveRecord - timestamps
When I update an ActiveRecord, i would like to "touch" one of the
related objects, that the updated record belongs_to, in order to update
the timestamps on the parent record, although i don''t want to change any
of the data in the parent. Whats the accepted way to do this?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You
2009 Feb 11
6
Sessions do not update created_at column?
Hi All,
I added a column to the sessions table called "created_at" in order to
allow the created time to be recorded.
However, different from other Models, the column does not update
automatically.
Therefore, what codes should I add to update the sessions."created_at"
value?
It is important for avoiding hacker keeping the sessions alive.
Thanks much!
Arthur
--
Posted via
2009 Oct 13
2
Single Table Inheritance (STI) Broken: NameError
Some how I''m getting NameError: uninitialized constant when accessing a
child models that inherits form the parent model. However, if I access
the parent model first, then the child model is resolved.
What am I doing wrong? My steps are below...
Thanks,
Francis.
> ./script/generate model Blah type:string
class CreateBlahs < ActiveRecord::Migration
def self.up
create_table
2009 Apr 20
3
xxx.valid? still true after xxx.errors.add(...)?
Hi all
I have the following code in my controller:
if @comment.valid?
captcha_url =
"http://captchator.com/captcha/check_answer/#{captcha_code}/#{@comment.captcha}"
result = open(captcha_url)
unless result.read == "1"
@comment.errors.add(:captcha, "Captcha wurde nicht korrekt
eingegeben")
raise "#{@comment.valid?}"
2008 Feb 12
4
Syntax of session's updated_at field ?
What''s the syntax to acquire the updated_at value of a session stored
in a db?
session.updated_at doesn''t work. can''t find any docs on this.
-- gw
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2010 Sep 23
6
Named scope in named scope ??
Hi,
I would like to return a combination of named scopes in a named
scope :
For example, I have a named scope filter and I want to add a named
scope eval_filters like
Product.eval_filters([''x'',''y'',''z'']) is equivalent to
Product.filter(''x'').filter(''y'').filter(''z'')
Anybody know how can I
2010 Jul 20
4
MySQL index question
I am trying to speed up some DB operations and perhaps have gone overboard
with indexes. Does MySQL usually use only one index per query and simply
match keys on the results of the indexed first part? For example:
DELETE FROM tokens WHERE 6813946236211560448 <= fnv AND fnv < 6818449835838930944 AND updated_at<''2010-06-20 14:08:55'' AND occurrences=0;
If I understand
2009 Jun 17
4
Serverside AjaxRequest or AjaxUpdater detections
Hi all,
This question might be a long shot, but I''m going to ask it anyway. In
my application, I''ve created a before_filter that does some magic. It
looks like this:
if request.xhr? then
render :update do |page|
page.redirect_to url_for_thingy
end
else
redirect_to redirect_to url_for_thingy
end
This works perfectly, however, I have one annoyance. On the server side,
2009 Apr 22
4
help with exceptions
Hello,
I was trying to to write a simple ruby program for exceptions.
My code is:
class ABC
begin
alpha = ABC.new
alpha.foo= [1,2,3]
puts foo.inspect.to_s
NonExisting
raise "all other exceptions"
rescue Exception => NoMethodError
puts ''Hello''
puts $ERROR_INFO.inspect
rescue Exception => NameError
puts ''goodbye''
puts $ERROR_INFO.inspect
else
2009 Apr 21
12
still cannot install rails on windows
if i follow the instructions on:
http://agilo.us/2009/03/15/rails-on-windows/
the command
gem install sqlite3-ruby
will give
---------------------------------
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
c:/ruby/bin/ruby.exe extconf.rb
checking for fdatasync() in rt.lib... no
checking for
2008 Jul 02
3
update_all not changing updated_at
Hi everyone-
Model.update_all works and changes the records, but it''s not changing
the updated_at field. Am I doing something wrong or is this by
design?
Thanks,
Dino
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2009 Mar 25
6
Hash with key and value from ActiveRecord?
Heya,
I think I have thinking barrier. I just want a simple hash out of an
ActiveRecord.
@attributes = Attribute.find_all_by_character_id(@character).hash {
|u| [u.name, u.value] }
and I would like to access it like
@attributes[:health]
but it doesn''t work. Anyone can help me out with that?
--
Posted via http://www.ruby-forum.com/.
2009 May 03
13
Ruby or Rails bug?
In irb all works fine:
# irb
irb(main):001:0> require ''rubygems''
=> true
irb(main):002:0> require ''raspell''
=> true
irb(main):003:0> speller = Aspell.new("ru_RU")
=> #<Aspell:0x7f8692c9d158>
irb(main):004:0> speller.suggestion_mode = Aspell::NORMAL
=> "normal"
irb(main):005:0>
2008 Feb 22
7
undefined local variable or method "acts_as_list"?
Hi, I''m getting the error below, and I''m not sure where to find
"acts_as_list" ...
NameError in SpecialsController#printer
undefined local variable or method `acts_as_list'' for #<Class:
0xb7a46994>
RAILS_ROOT: /usr/local/apache2/htdocs/dps
Application Trace | Framework Trace | Full Trace
vendor/plugins/trunk/lib/scope_out.rb:70:in
2010 Jan 06
4
serialized attribute converting to string on reload
Hello,
Anybody help me out? I done googled it good and didn''t find anything
(which should mean that I''ve done something wrong).
Not much code to talk about here, quite simply I have an attribute
that is serialzied and when I update it, irb shows the object and my
methods run on it as it were indeed so. Though when I reload it
changes the data to a string. Not yaml, just one
2009 Jul 23
11
Problem with named_scope
Here are my scopes:
default_scope :order => ''posted_on DESC'', :conditions => { :status =>
''visible'' }
named_scope :positive, :conditions => { :rating => ''positive'', :status
=> ''visible'' }
named_scope :neutral, :conditions => { :rating => ''neutral'', :status
=>
2008 Sep 24
5
Re: save blob to file?
Frederick Cheung wrote:
> On 14 Aug 2008, at 15:11, John Griffiths wrote:
>
>>
>> hope someone can help with this,
>>
>> in my mysql table i''ve got a blob column storing images inside the
>> database, it''s also got the filetype and filesize.
>>
>> now i can work out what the filename will be (e.g. 2002.jpg) but i
>>
2008 Nov 05
4
select in form - best practice?
Q. What resource do readers recommend for referencing regarding best
practices for form construction in Rails?
I have the following situation: location_type of Locations may have one
of five (5) possible codes. Presently I have these codes listed in a
drop-down select constructed thusly:
<p>
<b>Location type</b><br />
<%= f.select :location_type,
2008 Oct 06
4
what is Driver & what is Adapter ?
what is Driver & what is Adapter ?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
2009 Feb 20
6
rails 2.2.2 does not work with ruby 1.9.1
Hi everyone! I''ve installed new Ruby 1.9.1 from sources
(http://www.ruby-lang.org/en/), then "gem install rails", everything was
ok during installation, all tests ("make test") were ok too.
After all, i wanted to create my new RoR project, but I could not start
it.
Plz help me
Here is my terminal:
[renat@localhost rails]$ rails mysite
create
create