| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The Inflector is currently not very supportive of internationalized
websites. If a user wants to singularize and/or pluralize words based on
any locale other than English, they must define each case in locale
files. Rather than create large locale files with mappings between
singular and plural words, why not allow the Inflector to accept a
locale?
This patch makes ActiveSupport::Inflector locale aware and uses `:en`` unless
otherwise specified. Users will still be provided a list of English (:en)
inflections, but they may additionally define inflection rules for other
locales. Each list is kept separately and permanently. There is no reason to
limit users to one list of inflections:
ActiveSupport::Inflector.inflections(:es) do |inflect|
inflect.plural(/$/, 's')
inflect.plural(/([^aeéiou])$/i, '\1es')
inflect.plural(/([aeiou]s)$/i, '\1')
inflect.plural(/z$/i, 'ces')
inflect.plural(/á([sn])$/i, 'a\1es')
inflect.plural(/é([sn])$/i, 'e\1es')
inflect.plural(/í([sn])$/i, 'i\1es')
inflect.plural(/ó([sn])$/i, 'o\1es')
inflect.plural(/ú([sn])$/i, 'u\1es')
inflect.singular(/s$/, '')
inflect.singular(/es$/, '')
inflect.irregular('el', 'los')
end
'ley'.pluralize(:es) # => "leyes"
'ley'.pluralize(:en) # => "leys"
'avión'.pluralize(:es) # => "aviones"
'avión'.pluralize(:en) # => "avións"
A multilingual Inflector should be of use to anybody that is tasked with
internationalizing their Rails application.
Signed-off-by: David Celis <david@davidcelis.com>
|
|\ \
| | |
| | | |
update performance test template to use test method
|
| | | |
|
| | |
| | |
| | |
| | | |
Closes #7110 there's more work to do on rack-cache issue 69
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This allows us to do:
In your configuration:
Rails.queue[:image_queue] = SomeQueue.new
Rails.queue[:mail_queue] = SomeQueue.new
In your app code:
Rails.queue[:mail_queue].push MailJob.new
Both jobs pushed to the same default queue
Rails.queue.push DefaultJob.new
Rails.queue[:default].push DefaultJob.new
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This applies to the following helpers:
`button_to`
`button_tag`
`image_submit_tag`
`link_to`
`submit_tag`
|
|\ \ \
| | | |
| | | | |
Add indexes to create_join_table method
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
For instance, running
rails g migration CreateMediaJoinTable artists musics:uniq
will create a migration with
create_join_table :artists, :musics do |t|
# t.index [:artist_id, :music_id]
t.index [:music_id, :artist_id], unique: true
end
|
| | | | |
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
Add references statements to migration generator
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
AddXXXToYYY/RemoveXXXFromYYY migrations are produced with references
statements, for instance
rails g migration AddReferencesToProducts user:references
supplier:references{polymorphic}
will generate the migration with:
add_reference :products, :user, index: true
add_reference :products, :supplier, polymorphic: true, index: true
|
| | | |
| | | |
| | | |
| | | | |
Follow the consistency defined in dbc43bc.
|
|/ / /
| | |
| | |
| | |
| | | |
Changes introduced in 7404cda9f61e41d52ce244d60abbf598684a96c4.
Fix railties build.
|
| | |
| | |
| | |
| | | |
this is so we can show route output in the development when we get a routing error. Railties can use features of ActionDispatch, but ActionDispatch should not depend on Railties.
|
|\ \ \ |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Engine table name prefix generator fix
|
| | | | | |
|
| | |/ /
| |/| | |
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Last versions of Turn don't monkey patch MiniTest to setup
the natural language option. Here is an
[example](https://github.com/TwP/turn/blob/master/try/test_autorun_minitest.rb#L3).
This patches the following behaviour:
$ rake test:units
`<top (required)>': undefined method `use_natural_language_case_names='
for MiniTest::Unit:Class (NoMethodError)
|
|\ \ \
| | | |
| | | | |
Add few information on the field types
|
| | | | |
|
|/ / /
| | |
| | |
| | | |
test_helper.rb to reflect that
|
| | |
| | |
| | |
| | |
| | | |
Mocha is already required by AS::TestCase, so remove the duplicate
requires.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
This requires all jobs to be instances of named classes, without block
implementations of methods.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Jobs pushed to the queue should not contain a reference to it. As the queue
itself cannot be marshalled, and as a consequence of checking the
marshallability of all jobs in the test environment, we can now guarantee this
to be the case in the test environment when using the default TestQueue
implementation.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
By marshalling and unmarshalling jobs when adding them to the test queue, we
can ensure that jobs created during test runs are valid candidates for
marshalling, and, thus, that they can be used with queueing backends other than
the default simple in-process implementation.
This will also be used in a subsequent commit to ensure that jobs pushed to the
queue do not contain a reference to the queue itself.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Using an anonymous class prevented marshalling: we're not doing that yet, but
the next commit will introduce this. This also provided an opportunity to
improve the expressivity of the tests and to make the assertion failure
messages clearer.
|
| | | |
|
| | |
| | |
| | |
| | | |
Introduced in pull request #6910, merged in 2ee3fa1a48513a2c42833e2e1f60fe03769bc295
|
|\ \ \
| |/ /
|/| | |
Persist glob when replacing a path
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When Rails::Paths::Root's []= is used to replace a path it should persist the previous path's glob. Without passing the glob along we get gnarly bugs when trying to wire up things like engines.
module FooEngine
class Engine < ::Rails::Engine
isolate_namespace FooEngine
config.paths['config/initializers'] = "lib/foo_engine/initializers"
end
end
## Example of behaviour before this commit.
#
# Before the initializer override:
>> FooEngine::Engine.config.paths["config/initializers"].glob
=> "**/*.rb"
# After the initializer override:
>> FooEngine::Engine.config.paths["config/initializers"].glob
=> nil
## Example of behaviour after this commit.
#
# Before the initializer override:
>> FooEngine::Engine.config.paths["config/initializers"].glob
=> "**/*.rb"
# After the initializer override:
>> FooEngine::Engine.config.paths["config/initializers"].glob
=> "**/*.rb"
|
| | |
| | |
| | |
| | | |
Related with 5e7d6bb
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit 6acebb38bc0637bc05c19d87f8767f16ce79189b.
Usage of this feature did not reveal any improvement in existing apps.
Conflicts:
actionpack/lib/action_dispatch/routing/mapper.rb
guides/source/routing.textile
railties/lib/rails/engine.rb
railties/lib/rails/paths.rb
railties/test/paths_test.rb
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
Since plugins were removed, we can clean up a few methods in engines.
We also use this opportunity to move `load_console`, `load_tasks` and
`load_runner` to Rails::Engine. This means that, if someone wants to
improve script/rails for engines to support console or runner commands,
part of the work is already done.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Pull request #6856, merged in 52f6e47682003c83b0466bf5e140ee302498a226.
[ci skip]
|
|\ \
| | |
| | | |
Fix wrong testcase for db:test:prepare, and wrong environment in AR rake task.
|
| | | |
|
|\ \ \
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | | |
Add polymorphic option to model generator
For instance,
$ rails g model Product supplier:references{polymorphic}
generate model with `belongs_to :supplier, polymorphic: true` association and appropriate migration.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
For instance,
$ rails g model Product supplier:references{polymorphic}
generate model with `belongs_to :supplier, polymorphic: true` association and appropriate migration.
Also fix model_generator_test.rb#L196 and #L201
|
|\ \ \
| | | |
| | | | |
Async actionmailer
|
| | | | |
|
| | | | |
|