Sha256: 1a9d1a570cc938b83888ab31d257c64c76303b89c425421685a800ab558eb65a
Contents?: true
Size: 987 Bytes
Versions: 5
Compression:
Stored size: 987 Bytes
Contents
require 'rubygems' begin require 'test/spec' require 'mocha' require 'active_support' rescue LoadError puts "=> You need the test-spec, mocha, and activesupport gems to run these tests." exit end require 'active_record' begin require 'redgreen'; rescue LoadError; end $:.unshift File.dirname(__FILE__) + '/../lib' require 'ambition' class User extend Ambition def self.reflections return @reflections if @reflections @reflections = {} @reflections[:ideas] = Reflection.new(:has_many, 'user_id', :ideas, 'ideas') @reflections[:invites] = Reflection.new(:has_many, 'referrer_id', :invites, 'invites') @reflections[:profile] = Reflection.new(:has_one, 'user_id', :profile, 'profiles') @reflections[:account] = Reflection.new(:belongs_to, 'account_id', :account, 'accounts') @reflections end def self.table_name 'users' end end class Reflection < Struct.new(:macro, :primary_key_name, :name, :table_name) end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
ambition-0.1.5 | ./test/helper.rb |
ambition-0.1.1 | ./test/helper.rb |
ambition-0.1.2 | ./test/helper.rb |
ambition-0.1.3 | ./test/helper.rb |
ambition-0.1.4 | ./test/helper.rb |