diff options
author | Andrey Deryabin <deriabin@gmail.com> | 2014-11-10 22:55:40 +0300 |
---|---|---|
committer | Andrey Deryabin <deriabin@gmail.com> | 2014-11-10 22:55:40 +0300 |
commit | 5e4a99821dd9a710fe3ab434881cfdae15bd0838 (patch) | |
tree | a65ef33ad57f64ca499990e9fe4e9e562ba2ae76 /activerecord | |
parent | 2a843b3538bbc88286b83562fe1bb517e01576f6 (diff) | |
download | rails-5e4a99821dd9a710fe3ab434881cfdae15bd0838.tar.gz rails-5e4a99821dd9a710fe3ab434881cfdae15bd0838.tar.bz2 rails-5e4a99821dd9a710fe3ab434881cfdae15bd0838.zip |
tiny code improvement in sqlite3 adapter:
- remove unused method `supports_add_column?`
- change additional restriction method to `valid_alter_table_type?`
- fix code style
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb index 1b5e3bdbac..b18cb353f1 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb @@ -179,10 +179,6 @@ module ActiveRecord true end - def supports_add_column? - true - end - def supports_views? true end @@ -451,12 +447,12 @@ module ActiveRecord # See: http://www.sqlite.org/lang_altertable.html # SQLite has an additional restriction on the ALTER TABLE statement - def valid_alter_table_options( type, options) + def valid_alter_table_type?(type) type.to_sym != :primary_key end def add_column(table_name, column_name, type, options = {}) #:nodoc: - if supports_add_column? && valid_alter_table_options( type, options ) + if valid_alter_table_type?(type) super(table_name, column_name, type, options) else alter_table(table_name) do |definition| |