Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Queries must now be select statements
- Loading branch information
Oliver Searle-Barnes
committed
Mar 22, 2010
1 parent
2bd0a16
commit f4264e1
Showing
1 changed file
with
1 addition
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,5 @@ | |||
class Report < ActiveRecord::Base | class Report < ActiveRecord::Base | ||
attr_accessible :name, :query, :database_id | attr_accessible :name, :query, :database_id | ||
belongs_to :database | belongs_to :database | ||
validates_format_of :query, :with => /^select.*/, :message => 'must be a select statement' | |||
end | end |