# Model - syntax error

**URL:** <https://www.ruby-forum.com/t/model-syntax-error/133550>\
**Category:** Rails\
**Created:** [April 1, 2008, 4:44pm UTC](https://www.ruby-forum.com/t/model-syntax-error/133550 "2008-04-01T16:44:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shinkaku](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@shinkaku](https://www.ruby-forum.com/u/shinkaku)\
**Post date:** [April 1, 2008, 4:44pm UTC](https://www.ruby-forum.com/t/model-syntax-error/133550/1 "2008-04-01T16:44:50Z")

</div>

I’ve been following the rails 2.0.2 tutorial at  
[http://developer.apple.com/tools/developonrailsleopard.html](http://developer.apple.com/tools/developonrailsleopard.html)

# I get the syntax error below after I put in the relation. I cut and pasted the relation for all three models from the website to be sure that there wasn’t a typo. Any ideas?

/Projects/expenses/app/models/event.rb:2: syntax error, unexpected  
tIDENTIFIER, expecting kEND  
validates\_presence\_of :name  
validates\_numericality\_of :budget, :greater\_than =\> 0.0

has\_many :expenses  
has\_many :vendors, :through =\> :expenses  
^  
/Projects/expenses/app/models/event.rb:2: syntax error, unexpected  
tASSOC, expecting tCOLON2 or ‘[’ or ‘.’  
validates\_presence\_of :name  
validates\_numericality\_of :budget, :greater\_than =\> 0.0

# has\_many :expenses has\_many :vendors, :through =\> :expenses

Here are my relations

class Expense \< ActiveRecord::Base  
belongs\_to :event  
belongs\_to :vendor  
end

class Event \< ActiveRecord::Base  
validates\_presence\_of :name  
validates\_numericality\_of :budget, :greater\_than =\> 0.0

has\_many :expenses  
has\_many :vendors, :through =\> :expenses  
end

class Vendor \< ActiveRecord::Base  
has\_many :expenses  
has\_many :events, :through =\> :expenses  
end

-Anthony
