app/models/constructor_pages/field.rb in constructor-pages-0.6.0 vs app/models/constructor_pages/field.rb in constructor-pages-0.6.1
- old
+ new
@@ -10,11 +10,11 @@
# Array of available field types
TYPES = %w{string integer float boolean text date html image}
validates_presence_of :name
- validates_uniqueness_of :code_name, :scope => :template_id
+ validates_uniqueness_of :code_name, scope: :template_id
validate :code_name_uniqueness
after_create :create_page_fields
after_destroy :destroy_all_page_fields
@@ -28,10 +28,10 @@
end
has_many :pages, through: :template
acts_as_list scope: :template_id
- default_scope order: :position
+ default_scope -> { order :position }
# Return constant of model type_value
def type_class; "constructor_pages/types/#{type_value}_type".classify.constantize end
# Return object of type_value by page
\ No newline at end of file