
Problem with singular nouns ending with an “s” as model names
Reported by Wlodek Bzyl | December 28th, 2009 @ 04:20 PM
Hi!
When run the following code:
require 'dm-core'
require 'extlib'
DataMapper.setup :default, 'sqlite3:test.sqlite3'
Extlib::Inflection.plural_word 'xs', 'xse'
class Xs
include DataMapper::Resource
property :id, Serial
property :name, String
belongs_to :film
end
class Film
include DataMapper::Resource
property :id, Serial
property :name, String
has n, :xs
end
DataMapper.auto_migrate!
produces:
/usr/lib64/ruby/gems/1.8/gems/dm-core-0.10.2/
lib/dm-core/associations/relationship.rb:172:
in `target_model': Cannot find the child_model X for Film in xs (NameError)
Replacing 'Xs' with 'Comment' yields the code which works.
Regards
--Włodek Bzyl
No comments found
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »