Skip to content

Instantly share code, notes, and snippets.

@dansteen
Created June 27, 2010 03:17
Show Gist options
  • Save dansteen/454598 to your computer and use it in GitHub Desktop.
Save dansteen/454598 to your computer and use it in GitHub Desktop.
#Here is the TableAcl model:
class TableAcl < ActiveRecord::Base
has_many :column_acls, :dependent => :destroy
....
#Here is the ColumnAcl model:
class ColumnAcl < ActiveRecord::Base
belongs_to :table_acl
...
#Here is the TableAcl Fixture:
...
callsShowAdmin:
role: admin
controller_name: CallsController
action_name: show
...
#Here is the ColumnAcl Fixture:
callsShowAdminTime:
table_acl: callsShowAdmin
column_name: time
#Here is the ColumnAcl test:
test "valid test" do
callsShowAdminTime = column_acls :callsShowAdminTime
assert callsShowAdminTime.save!
end
#Here is the error I am getting:
13) Error:
test_valid_test(ColumnAclTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: column_acls.table_acl: SELECT "column_acls".id FROM "column_acls" WHERE ("column_acls"."column_name" = 'time' AND "column_acls".table_acl = 879745444 AND "column_acls".id <> 203830348) LIMIT 1
/test/unit/column_acl_test.rb:8:in `test_valid_test'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment