similar to: tableize and model modules

Displaying 20 results from an estimated 90 matches similar to: "tableize and model modules"

2009 Sep 07
11
autoincrement for non-id column
There is a table: execute (<<-SQL) CREATE TABLE "tasks" ( "id" serial primary key, "number" serial, "version" integer DEFAULT 0 NOT NULL, "latest_version" boolean DEFAULT ''t'' NOT NULL, "hidden" boolean DEFAULT ''f'' NOT NULL, "type" character varying (1) NOT
2006 Jul 26
4
Execute code when an inheritance happens, or disabling STI
I am trying to inherit from a ActiveRecord class defined in a plugin. The problem is that ActiveRecord thinks I am doing an STI and is looking up a table that doesn''t exist. Currently, I have a method in the parent class that looks like this: def self.fix_table_name class_eval do set_table_name(Inflector.tableize(self.to_s)) end end The problem is that this method
2005 May 22
1
ActiveRecord: can not connect to mysql
Hi I would like to write my first application with Active Record: this is my database table: id PRIMAREY KEY auto_increment german_name varchar(50) english_name varchar(50) | wingspan this is my code: ======================= #!/usr/local/bin/ruby -w require ''rubygems'' require_gem ''activerecord'', ">= 1.10.1"
2002 Feb 21
2
hpa-tftp with xinetd
Good day, Just a quick question- could someone please confirm that this is the correct xinetd configuration (or not) for hpa-tftp? We've noticed that, when under moderate load hpa-tftpd resides in memory, even after there are no connections or even if xinetd is shut down. Under light load the server goes away after each connection, as desired. Thanks in advance! service tftp {
2006 Jan 02
13
Naming Conventions
So, RoR is better at grammer than I. Well so is my nine year old. If I have a table named "people_type" will Rails see this as singular because of the _type or will it consider it the plural of "person_type" ? Is there a link to Rails that lists what words it knows, or what words not to use in table design etc. Kindest regards. -- Posted via http://www.ruby-forum.com/.
2005 Sep 27
5
Am I misunderstanding "require_dependency"?
Hi From what I understand about documentation about require_dependency, this function will work like require but the file will be reloaded on every request to the server when in development mode. I have bootstrapped am minimal RoR project with 0.13.1 Rails. I have created a minimal Controller and hooked up it''s "index" action at the site root. I have also created a
2011 Aug 17
7
autoloading LoadError: Expected known_ip.rb to define KnownIp
Hello, i have a problem with autoloading model classes. I have had similar problems before when a file''s name in Rails'' opinion did not match with the name of the class defined inside, but eventually everything worked, so i didn''t look into details. This time the problem comes from running Unit Tests and does not want to go away. I have a model class KnownIP defined in
2008 Feb 04
1
extracting AIC scores from lmer and other objects
I have a slight conundrum. I'm attempting to write a scrip that will take a number of objects (lm, glm, and lmer) and return AIC scores and weights. I've run into 3 problems, and was wondering if anyone had any pointers. 1) is there any convenient way to extract the name of the objects? Simply, if I have a vector of objects c(my.lm, my.lmer) and I want to get a character
2006 May 05
6
RJS implementation question
Why is RJS so dependant on programatic creation of Javascript? RHTML is a great implementation in that it puts HTML first, and Ruby second. I would have thought RJS would be the same way: a .js with ERb helpers for generating Javascript functions. RJS putting Javascript second means: - I have to learn a whole new set of commands to use Scriptaculous. - Developers have to constantly chase the
2007 Apr 01
7
database.yml: encoding: utf8 does not work
Hi all According to the Agile 2nd Ed book I added the line encoding: utf8 to my database.yml connections. But now when running rake I get plenty of errors: Character set ''utf-8'' is not a compiled character set and is not specified in the ''/usr/local/mysql/share/mysql/charsets/Index'' file What''s wrong here? I checked this Index file, but it seems to
2008 Mar 26
24
[Bug 15206] New: [dualhead, randr12, ppc] Second head displays nothing
http://bugs.freedesktop.org/show_bug.cgi?id=15206 Summary: [dualhead, randr12, ppc] Second head displays nothing Product: xorg Version: unspecified Platform: PowerPC OS/Version: Linux (All) Status: NEW Severity: normal Priority: medium Component: Driver/nouveau AssignedTo: nouveau at
2013 Mar 06
3
CentOS 5 sshd does not log IP address of reverse mapping failure
I'm running a mix of CentOS 5 and 6 servers reachable by ssh from the Internet. Of course I allow only public key authentication and no root login. In addition I'm running fail2ban to block obnoxious brute force attack sources. On CentOS 6 this is working pretty well, but on CentOS 5 there's one class of attacks fail2ban fails to ban. (No pun intended.) This isn't fail2ban's
2013 Jun 13
4
puppet: 3.1.1 -> 3.2.1 load increase
Hi, I recently updated from puppet 3.1.1 to 3.2.1 and noticed quite a bit of increased load on the puppetmaster machine. I''m using the Apache/passenger/rack way of puppetmastering. Main symptom is: higher load on puppetmaster machine (8 cores): - 3.1.1: around 4 - 3.2.1: around 9-10 Any idea why there''s more load on the machine with 3.2.1? -- You received this
2007 Sep 14
0
ProfileFormatter (Top 10 slowest examples)
Hey list, The time it takes for my specs to run is starting to get a little long (~45 seconds), and annoying enough for me to do something about it. I''ve written a simple formatter that prints out the top 10 slowest examples in an attempt to identify any low hanging fruit amongst a spec suite.
2007 Jul 25
5
MockCov: Proof of concept
Hey list, RSpec is great, I''ve been using it at work for a couple of months now. One gripe I have is that I find it hard to know exactly to what extent my code is covered by the specs. I am aware of RCov and Heckle; they''re great, but I''d like to demonstrate another perspective of coverage analysis I''ve hacked up. The perspective is that of what is mocked and
2007 Jun 15
1
Problems with RCov and Rails
Hey list, I''m trying to use the rcov integration that rspec provides in my Rails application. As per the documentation on the website, I''ve created the following rake task: lib/tasks/specs_with_rcov.rake: require ''spec/rake/spectask'' desc "Run all specs with rcov" Spec::Rake::SpecTask.new(''specs_with_rcov'') do |t| t.rcov = true
2007 Jun 18
6
Something like rcov but more explicit?
Hey list, Does anything exist that can show me which lines are explicitly tested? RCov is great, but it doesn''t really give a sense of _actual_ coverage, indeed, there is no guarantee that functions executed were in fact called as the result of a line being tested. I know nothing of the rspec internals, but would a simple list of executed lines be a relatively simple feature to add?
2007 Jun 21
4
should_receive stubs methods?
Hey, I''m using rspec and rails and have a spec that tests if a before_filter is executed, I also have a spec that tests if a method called by the filter is executed. It appears however that when I should_receive something, it is no longer actually called when I fire the http request. I''m not sure how, or where exactly I should manually fire the filter, either before or after the
2007 Jun 27
1
rspec_on_rails: assert_select wrapper doesn''t play nice with XML
Hey, I''m using rspec and rspec_on_rails to test some RSS feed views, the problem is that the specs spew out messy warnings when they run: ignoring attempt to close channel with link opened at byte 61, line 3 closed at byte 141, line 5 attributes at open: {} text around open: "ss version=\"2.0\">\n <channel>\n <title" text around close:
2003 Apr 08
1
hpa-tftp source port selection
Good day, I'd just like a bit of information about the source ports that hpa-tftp uses for its TFTP file transfers. We're using it to transfer files across a network that we have heavily firewalled. So, we'd like to know which ports the TFTP server might use as the source port for its data transfers and/or any ways to configure a range that it can use. I dug through the man page,