redhillonrails_core 1.0.3 → 1.0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.0.3.1
@@ -1,8 +1,19 @@
1
1
  module RedHillConsulting::Core::ActiveRecord::ConnectionAdapters
2
2
  module AbstractAdapter
3
3
  def self.included(base)
4
- base.module_eval do
5
- alias_method_chain :drop_table, :redhillonrails_core
4
+ base.alias_method_chain :initialize, :redhillonrails_core
5
+ base.alias_method_chain :drop_table, :redhillonrails_core
6
+ end
7
+
8
+ def initialize_with_redhillonrails_core(*args)
9
+ initialize_without_redhillonrails_core(*args)
10
+ case adapter_name
11
+ when 'MySQL'
12
+ self.class.send(:include, MySQLAdapter) unless self.class.include?(MySQLAdapter)
13
+ when 'PostgreSQL'
14
+ self.class.send(:include, PostgresqlAdapter) unless self.class.include?(PostgresqlAdapter)
15
+ when 'SQLite'
16
+ self.class.send(:include, SqliteAdapter) unless self.class.include?(SqliteAdapter)
6
17
  end
7
18
  end
8
19
 
@@ -3,6 +3,17 @@ module RedHillConsulting::Core::ActiveRecord::ConnectionAdapters
3
3
  def self.included(base)
4
4
  base.class_eval do
5
5
  alias_method_chain :remove_column, :redhillonrails_core
6
+ alias_method_chain :connect, :redhillonrails_core
7
+ end
8
+ end
9
+
10
+ def connect_with_redhillonrails_core(*args)
11
+ returning connect_without_redhillonrails_core(*args) do
12
+ if version[0] < 5
13
+ self.class.send(:include, Mysql4Adapter) unless self.class.included?(Mysql4Adapter)
14
+ else
15
+ self.class.send(:include, Mysql5Adapter) unless self.class.included?(Mysql5Adapter)
16
+ end
6
17
  end
7
18
  end
8
19
 
@@ -34,16 +34,4 @@ ActiveRecord::ConnectionAdapters::Column.send(:include, RedHillConsulting::Core:
34
34
  ActiveRecord::ConnectionAdapters::AbstractAdapter.send(:include, RedHillConsulting::Core::ActiveRecord::ConnectionAdapters::AbstractAdapter)
35
35
  ActiveRecord::ConnectionAdapters::SchemaStatements.send(:include, RedHillConsulting::Core::ActiveRecord::ConnectionAdapters::SchemaStatements)
36
36
 
37
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:include, RedHillConsulting::Core::ActiveRecord::ConnectionAdapters::PostgresqlAdapter)
38
37
 
39
- ActiveRecord::ConnectionAdapters::MysqlColumn.send(:include, RedHillConsulting::Core::ActiveRecord::ConnectionAdapters::MysqlColumn)
40
- ActiveRecord::ConnectionAdapters::MysqlAdapter.send(:include, RedHillConsulting::Core::ActiveRecord::ConnectionAdapters::MysqlAdapter)
41
- if ActiveRecord::Base.connection.send(:version)[0] < 5
42
- #include MySql4Adapter
43
- ActiveRecord::ConnectionAdapters::MysqlAdapter.send(:include, RedHillConsulting::Core::ActiveRecord::ConnectionAdapters::Mysql4Adapter)
44
- else
45
- #include MySql5Adapter
46
- ActiveRecord::ConnectionAdapters::MysqlAdapter.send(:include, RedHillConsulting::Core::ActiveRecord::ConnectionAdapters::Mysql5Adapter)
47
- end
48
-
49
- ActiveRecord::ConnectionAdapters::SQLite3Adapter.send(:include, RedHillConsulting::Core::ActiveRecord::ConnectionAdapters::Sqlite3Adapter)
@@ -5,10 +5,10 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{redhillonrails_core}
8
- s.version = "1.0.3"
8
+ s.version = "1.0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Micha\305\202 \305\201omnicki"]
11
+ s.authors = ["Michał Łomnicki"]
12
12
  s.date = %q{2010-04-05}
13
13
  s.description = %q{RedHill on Rails Core is a plugin that features to support other RedHill on Rails plugins. It creates and drops views and foreign-keys or obtains indexes directly from a model class.}
14
14
  s.email = %q{michal.lomnicki@gmail.com}
metadata CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 1
7
7
  - 0
8
8
  - 3
9
- version: 1.0.3
9
+ - 1
10
+ version: 1.0.3.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - "Micha\xC5\x82 \xC5\x81omnicki"