Skip to content

Commit

Permalink
mysql fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-riemer committed Jun 13, 2017
1 parent 2c18d99 commit f8df2be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/effective/attachment.rb
Expand Up @@ -12,7 +12,7 @@ class Attachment < ActiveRecord::Base
# box :string, :default => 'assets' # This is essentially a category
# end

default_scope -> { includes(:asset).order("\"#{EffectiveAssets.attachments_table_name.to_s}\".\"position\" ASC, \"#{EffectiveAssets.attachments_table_name.to_s}\".\"asset_id\" ASC") }
default_scope -> { includes(:asset).order(:position).order(:asset_id) }

validates :asset_id, presence: true
validates :position, presence: true, numericality: true
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/01_create_effective_assets.rb.erb
@@ -1,4 +1,4 @@
class CreateEffectiveAssets < ActiveRecord::Migration
class CreateEffectiveAssets < ActiveRecord::Migration[4.2]
def self.up
create_table <%= @assets_table_name %> do |t|
t.string :title
Expand Down

0 comments on commit f8df2be

Please sign in to comment.