Giter VIP home page Giter VIP logo

activerecord_translatable's People

Contributors

sideshowcoder avatar

Watchers

 avatar  avatar

Forkers

cospired

activerecord_translatable's Issues

handle nil

if there are no translations set for the values marked as translatable in the model the current implementation throws an error (undefined method `each' for nil:NilClass)

Handle empty translate

creating a class which includes translateable but does not actually uses it results in a save failure when saving the class to the db

class Something < ActiveRecord::Base
include ActiveRecordTranslatable
end

s = Something.new
s.save => will fail

cleanup dependecies

currently there is a dependency set for rails, which is not needed as a whole, so it should be cleaned.

create generator

Handle setting up a model for translatable

  • create a migration to add a locales column
  • optional make the locales column a native array
  • add serialize locales to the model if not a native array

remove testunit

the project was created with testunit but is tested via rspec, so testunit should be removed from the called generators.

Currently creating a new model via

$ rails g model MyModel

will create a a test directory with the needed testfiles

Works only for one model

Currently translatable is included in ActiveRecord instead of the model... which is wrong... This means the translatable fields are defined across all models instead of just the one they are for!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.