Displaying 6 results from an estimated 6 matches for "tableize".
Did you mean:
tablesize
2006 May 10
0
tableize and model modules
...to run into a large
number of models and naming conflicts. I found out that I can switch
big_complex_named_model.rb to module/simple_model.rb which changes
BigComplexNamedModel to Module::SimpleModel which cleans things up quite
a bit. However, if I run:
''Module::SimpleModel''.tableize
I get ''module/simple_models'' which is not a valid table name.
If it were ''module_simple_model'', or ''module__simple_model'' (to
differentiate modules from class names) my life would be that much
easier.
Could this be considered a Rails bug, or a...
2006 Jul 26
4
Execute code when an inheritance happens, or disabling STI
...ctiveRecord 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 has to be manually called from each
inheriting class. There must be a better way to execute this code.
Any ideas?
--
Posted via http://www.ruby-forum.com/.
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/.
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
2005 May 22
1
ActiveRecord: can not connect to mysql
.../gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:34:
warning: method redefined; discarding old demodulize
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:38:
warning: method redefined; discarding old tableize
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:42:
warning: method redefined; discarding old classify
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:46:
warning: method redefine...
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