Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/ruby
- require 'rubygems'
- require 'active_record'
- require 'has_many_polymorphs'
- require 'logger'
- ActiveRecord::Base.establish_connection(
- :adapter => "mysql",
- :database => "TEST",
- :username => "TEST",
- :password => "",
- :socket => "/var/run/mysqld/mysqld.sock"
- )
- class Tag < ActiveRecord::Base
- has_many_polymorphs :taggables,
- :from => [:galleries],
- :through => :taggings
- end
- class Tagging < ActiveRecord::Base
- belongs_to :tag
- belongs_to :taggable, :polymorphic => true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement