New in Rails 5.1.1
Chandan Jhunjhunwal
24-06-2017
https://github.com/indyarocks/
@ChandanJ
Major Changes
- Removal of deprecated functionalities and other notable changes
- Rich Javascript libraries with Yarn
- Removal of default dependency of JQuery
- Webpack for SPA
- Safe secrets
- Direct and Resolve routes
- form_with tag
- System test integration
- Parameterized mailers
Notable Changes
-
PostgreSQL & MySQL: Use big integer as
primary key type for new tables.
-
Add :default option to belongs_to
Use it to specify that an association should be initialized with a particular record before validation. For example:
# Before
belongs_to :account
before_validation -> { self.account ||= Current.account }
# After
belongs_to :account, default: -> { Current.account }
Notable Changes
- Virtual/generated column support for MySQL 5.7.5+ and MariaDB 5.2.0+
create_table :generated_columns do |t|
t.string :name
t.virtual :upper_name, type: :string, as: "UPPER(name)"
t.virtual :name_length, type: :integer, as: "LENGTH(name)", stored: true
t.index :name_length # May be indexed, too!
end
- Following methods have been removed:
#uniq, #uniq!, #unique_value, #insert_sql, #update_sql, and #delete_sql
Notable Changes
- Virtual/generated column support for MySQL 5.7.5+ and MariaDB 5.2.0+
create_table :generated_columns do |t|
t.string :name
t.virtual :upper_name, type: :string, as: "UPPER(name)"
t.virtual :name_length, type: :integer, as: "LENGTH(name)", stored: true
t.index :name_length # May be indexed, too!
end
- Following methods have been removed:
#uniq, #uniq!, #unique_value, #insert_sql, #update_sql, and #delete_sql
W
By Chandan Jhunjhunwal
W
- 428