Permalink
Browse files

inital framework commit

  • Loading branch information...
kjg committed Jun 15, 2011
0 parents commit d3755e0cdfc8695f2bb34959c7e4d74bda5e0ae7
Showing with 99 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +1 −0 .rvmrc
  3. +12 −0 Gemfile
  4. +43 −0 Gemfile.lock
  5. 0 README
  6. +21 −0 Rakefile
  7. +1 −0 init.rb
  8. +12 −0 lib/has_normalized_sti.rb
  9. +7 −0 spec/spec_helper.rb
@@ -0,0 +1,2 @@
+pkg/
+.bundle/
1 .rvmrc
@@ -0,0 +1 @@
+rvm 1.9.2@has_normalized_sti
12 Gemfile
@@ -0,0 +1,12 @@
+source :rubygems
+
+group :development do
+ gem 'jeweler'
+ gem 'mocha'
+ gem 'i18n'
+end
+
+group :test do
+ gem 'rspec'
+ gem 'activerecord', '~> 3.0.0'
+end
@@ -0,0 +1,43 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activemodel (3.0.8)
+ activesupport (= 3.0.8)
+ builder (~> 2.1.2)
+ i18n (~> 0.5.0)
+ activerecord (3.0.8)
+ activemodel (= 3.0.8)
+ activesupport (= 3.0.8)
+ arel (~> 2.0.10)
+ tzinfo (~> 0.3.23)
+ activesupport (3.0.8)
+ arel (2.0.10)
+ builder (2.1.2)
+ diff-lcs (1.1.2)
+ git (1.2.5)
+ i18n (0.5.0)
+ jeweler (1.6.2)
+ bundler (~> 1.0)
+ git (>= 1.2.5)
+ rake
+ mocha (0.9.12)
+ rake (0.9.2)
+ rspec (2.6.0)
+ rspec-core (~> 2.6.0)
+ rspec-expectations (~> 2.6.0)
+ rspec-mocks (~> 2.6.0)
+ rspec-core (2.6.4)
+ rspec-expectations (2.6.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.6.0)
+ tzinfo (0.3.28)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ activerecord (~> 3.0.0)
+ i18n
+ jeweler
+ mocha
+ rspec
0 README
No changes.
@@ -0,0 +1,21 @@
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = 'has_normalized_sti'
+ gem.summary = 'allows rails STI to work when the type is normalized out'
+ gem.description = <<-DESC
+ has_normalzied_sti expects the model to have a type_id column
+ referencing a types table containg all the possible types.
+ the types table will be auto populated with new types as new
+ subclasses are saved
+ DESC
+ gem.email = 'kevin@glowacz.info'
+ gem.author = 'Kevin Glowacz'
+ gem.files.exclude '.rvmrc'
+ end
+rescue LoadError
+ puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
+end
+
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new(:spec)
@@ -0,0 +1 @@
+require 'has_normalized_sti'
@@ -0,0 +1,12 @@
+module HasNormalizedSti
+ def self.included(base)
+ base.extend(ClassMethods)
+ end
+
+ module ClassMethods
+ def has_normalized_sti(options = {})
+ end
+ end
+end
+
+ActiveRecord::Base.send :include, HasNormalizedSti
@@ -0,0 +1,7 @@
+require 'rspec'
+
+require 'rubygems'
+require 'active_record'
+
+$:.unshift File.dirname(__FILE__) + '/../lib'
+require File.dirname(__FILE__) + '/../init'

0 comments on commit d3755e0

Please sign in to comment.