l12n 1.0.1 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5168656aef5cede55d3daafbbdf71cd6ceb3ee7a
4
- data.tar.gz: 9cd5d20f2fe20b44f19af96c2f8a15c4182f7f89
3
+ metadata.gz: 4c0ef95064ef38a07401c837d519a222ab825946
4
+ data.tar.gz: 2fd065a9ee9aa8dd14211bf6aa79839d9a8041e9
5
5
  SHA512:
6
- metadata.gz: 97a610306d623bdf59f47bfeddb4734d88852a7672be05c8dba9edc54b534789f8f1b81e958198c3c6a9e007ec6072206e17ba87f7c0561f97df49019cab8d11
7
- data.tar.gz: 536c2885485768b9ef20109f5506722c4b14c4380924d70e57df178344023dadb75bcd802052cfa1d6d04bdd9fde4eff1604fee0fe42bcbcbd865b1c5a075eff
6
+ metadata.gz: d305d3cdeeba5ab55b6eada83bd293f5b21cc074629824bdbe6c70f14bd7ca97a4391cf5a54244029fce89c416cd480948a1652c2c7a5cd3fac6e12fa67dcb52
7
+ data.tar.gz: ba4caba3652231c51b620162fe602e23f80b30afd78a4499297578d1eba5e945f35dfaeb1fa9017f9ab888989616e442f6b9ec4a3e3e8f0ac7c4139f9541e27a
@@ -3,7 +3,7 @@ require_dependency 'l12n/application_controller'
3
3
  module L12n
4
4
  class CitiesController < ApplicationController
5
5
  def index
6
- render json: City.select('id, name').order(name: :asc), status: 200, callback: params[:callback]
6
+ render json: City.select('id, name'), status: 200, callback: params[:callback]
7
7
  end
8
8
  end
9
9
  end
@@ -4,7 +4,7 @@ module L12n
4
4
  class DistrictsController < ApplicationController
5
5
  def index
6
6
  city_id = params[:city_id]
7
- districts = District.select('id, name').order(name: :asc).where('city_id = ?', city_id)
7
+ districts = District.select('id, name').where('city_id = ?', city_id)
8
8
  render json: districts, status: 200, callback: params[:callback]
9
9
  end
10
10
  end
data/app/models/city.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  class City < ActiveRecord::Base
2
+ default_scope -> { order_by(name: :asc) }
2
3
  has_many :districts
3
4
  end
@@ -1,3 +1,4 @@
1
1
  class District < ActiveRecord::Base
2
+ default_scope -> { order_by(name: :asc) }
2
3
  belongs_to :city
3
4
  end
data/lib/l12n/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module L12n
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: l12n
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - lab2023
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-03 00:00:00.000000000 Z
11
+ date: 2014-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.0
19
+ version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.0
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sqlite3
29
29
  requirement: !ruby/object:Gem::Requirement