petehamilton / citier

CITIER (Class Inheritance & Table Inheritance Embeddings for Rails) is a solution for simple Multiple Class Inheritance in Rails.
88 stars 24 forks source link

How to use the latest Citier code? #43

Closed ianpetzer closed 12 years ago

ianpetzer commented 12 years ago

Hi all,

I'd like to get access to the latest Citier code as I need some of the fixes that have already been committed. I'm using Bundler and when I include Citier in my Gemfile I get version 0.1.12 from rubygems (http://rubygems.org/gems/citier) but thats from April 2011.

So I forked citier on GitHub, then ran: 1) gem build citier.gemspec 2) gem install ./citier-0.1.13.gem

I then put a direct dependency on my locally built gem by adding the following the dependency to the Gemfile in my project: gem 'citier', '0.1.13', :path => '../citier/'

After blowing away my old SQLLite3 dev database, I was able to create another using: bundle exec rake db:create

But when I try and run db:migrate, I get the following error as soon as it runs a migration including a citier subtype.

undefined method `create_view' for #ActiveRecord::ConnectionAdapters::SQLite3Adapter:0x00000104300278

My code works fine if I pull in the 0.1.12 citier gem rom RubyGems, but I need the latest code as I'm running into the same problem described in issue 29 except against SQL server db. (https://github.com/PeterHamilton/citier/issues/29)

So, could someone please explain the easiest way to run against the latest code?

petehamilton commented 12 years ago

Hi Ian,

Apologies for the inconsistencies in citier, it's fallen behind slightly and my workloads has me too swamped to give it the good going over it needs.

However, there have been some excellent community contributions and I have now pushed the version to 0.1.13 in rubygems which you should be able to bundle install and have the latest code in the repo.

Hopefully this answers your question?

ianpetzer commented 12 years ago

I just ran 'bundle exec gem uninstall citier' to get rid of the old gem and then pulled down the new version 'bundle install'

But now when I run the db:create task I get the following error:

rake aborted! cannot load such file -- citier/relation_methods

Any idea?

ianpetzer commented 12 years ago

Ps: Thanks for your quick response

petehamilton commented 12 years ago

Apparently I'm an idiot, I didn't check the Manifest and gem spec for the new included files… I have bumped again to .14 and added in the required dependencies, should work fine now.

P

On 22 Dec 2011, at 17:41, ianpetzer wrote:

I just ran 'bundle exec gem uninstall citier' to get rid of the old gem and then pulled down the new version 'bundle install'

But now when I run the db:create task I get the following error:

rake aborted! cannot load such file -- citier/relation_methods

Any idea?


Reply to this email directly or view it on GitHub: https://github.com/PeterHamilton/citier/issues/43#issuecomment-3251934

ianpetzer commented 12 years ago

Hi,

Once again thanks for the rapid response. This is a great Gem but I'm still having the same problem that I outlined in the original post, where the db migration can't create the view for the citier subtype. I reverted to 0.1.12 which works fine, but then I run into issue 29.

So with 0.1.14 I get:

citier -> Root Class citier -> table_name -> gizmos citier -> Non Root Class citier -> table_name -> basic_charting_snippets citier -> tablename (view) -> view_basic_charting_snippets citier -> Resetting column information on BasicChartingSnippet::Writable -- create_view("view_basic_charting_snippets", "SELECT gizmos.id, name,type,created_at,updated_at,client_id,disabled,instrument_code,instrument_title,date_from,date_to,container_height,container_width,line_type,background_color,gradient_values,color1,color2,watermark,default_periodicity,instrument_color,instrument_font_size,instrument_font_weight,grid_line_color,instrument_title_align,title_align,series_type FROM gizmos, basic_charting_snippets WHERE gizmos.id = basic_charting_snippets.id") rake aborted! An error has occurred, this and all later migrations canceled:

undefined method `create_view' for #ActiveRecord::ConnectionAdapters::SQLite3Adapter:0x00000102e345d8

However when I revert to 0.1.12 I get:

-- create_table(:basic_charting_snippets) -> 0.0017s citier -> Root Class citier -> table_name -> gizmos citier -> Non Root Class citier -> table_name -> basic_charting_snippets citier -> tablename (view) -> view_basic_charting_snippets citier -> Creating citier view -> CREATE VIEW view_basic_charting_snippets AS SELECT gizmos.id, name,type,created_at,updated_at,client_id,disabled,instrument_code,instrument_title,date_from,date_to,container_height,container_width,line_type,background_color,gradient_values,color1,color2,watermark,default_periodicity,instrument_color,instrument_font_size,instrument_font_weight,grid_line_color,instrument_title_align,title_align,series_type FROM gizmos, basic_charting_snippets WHERE gizmos.id = basic_charting_snippets.id

ianpetzer commented 12 years ago

This problem is actually referred to in issue 41. The fix is to include the 'rails_sql_views' gem.